Docs

Add a payroll input

Preview· P9
POST
/payroll-runs/{payroll_run_id}/inputs

Adds a one-off amount for one person to a draft or calculated run, by its pay element's key: overtime, a bonus, an allowance or a deduction. Basic pay and Tier 3 come from the person's pay record, not an input. The run goes back to draft and is calculated again before anyone can approve it. Returns invalid_state once the run has been sent for approval.

Scope: payroll:write · Plan: with Agoo Payroll Plus (Enterprise includes it); every plan in test mode.

Authorization

headerAuthorizationBearer <token>

Send Authorization: Bearer <token> on every request. The token is one of:

PrefixWhat it isWhere it may be used
agoo_sk_live_Secret key, live modeYour servers only
agoo_sk_test_Secret key, test modeYour servers only
agoo_pk_live_Publishable key, live modeBrowsers and apps: create pre-registrations and bookings, read public booking types (with their intake questions) and their free slots, read the visit types open for pre-registration with their public forms. Never lists people.
agoo_pk_test_Publishable key, test modeAs above, in test mode
agoo_rk_live_Agoo Reviews key, live mode: a business on Agoo Reviews on its own, on Reviews BusinessYour servers only: the Reviews operations, for that business and the branches the key names
agoo_rk_test_Agoo Reviews key, test modeAs above, on any level: it reads the business's reviews and checks every write without saving it
agoo_ck_live_Check API key, live mode, for a Check API partnerYour servers only: the Checks operations (checks:read), billed per check
agoo_ck_test_Check API key, test modeAs above, answering only the published test values, never billed

Admins create keys in Console → Developers → API keys and choose each key's scopes; a business on Agoo Reviews on its own creates its keys in its business area on agoo.reviews, under Developers; a Check API partner creates its keys in its partner area on agoo.reviews. A key is shown once. Never put a secret key in a URL, a browser or a mobile app.

Scope: payroll:write

Path Parameters

payroll_run_id*string

The payroll run's ID.

Match^prun_[0-7][0-9a-hjkmnp-tv-z]{25}$

Header Parameters

Idempotency-Key*string

A UUID you generate for this operation. If you retry with the same key within 24 hours, Agoo returns the original response instead of acting twice. While the first request is still running, a retry returns conflict. Reusing a key with a different request returns idempotency_key_reused. Responses with rate_limited, internal_error or unavailable aren't stored, so retry those with the same key.

Formatuuid

Request Body

application/json
  1. body
person_id*PersonId

A person ID (TypeID with the person prefix).

Match^person_[0-7][0-9a-hjkmnp-tv-z]{25}$
Example"person_01kjsesxm0e4zbyvkr7bcfxbfg"
element_key*string

The pay element's key in your catalogue.

Length1 <= length <= 60
amount_minor*integer

The amount in pesewas.

Formatint64
Range1 <= value <= 100000000000
note?string
Lengthlength <= 300

Response Body

The input, kept with the run.

application/json
  1. response
object*"payroll_input"
Value in"payroll_input"
id*string
Match^pinp_[0-7][0-9a-hjkmnp-tv-z]{25}$
run_id*PayrollRunId

A payroll run's ID (TypeID with the prun prefix).

Match^prun_[0-7][0-9a-hjkmnp-tv-z]{25}$
person_id*PersonId

A person ID (TypeID with the person prefix).

Match^person_[0-7][0-9a-hjkmnp-tv-z]{25}$
Example"person_01kjsesxm0e4zbyvkr7bcfxbfg"
element_key*string
element_name*string
amount_minor*integer
Formatint64
note*string|null
created_at*string
Formatdate-time
curl -X POST 'https://api.agoohq.com/v1/payroll-runs/string/inputs' \  -H 'Idempotency-Key: 3f6b2a1e-8c4d-4f7a-9b2e-5d1c0a7e9f64' \  -H 'Content-Type: application/json' \  -d '{  "person_id": "person_01kjw4mg80efgb5aqbsqnxhtbh",  "element_key": "overtime",  "amount_minor": 45000,  "note": "Stocktake weekend"}'
{  "object": "payroll_input",  "id": "string",  "run_id": "string",  "person_id": "person_01kjsesxm0e4zbyvkr7bcfxbfg",  "element_key": "string",  "element_name": "string",  "amount_minor": 0,  "note": "string",  "created_at": "2019-08-24T14:15:22Z"}