Skip to main content
POST
Take a unit from a person for something

Authorizations

Authorization
string
header
required

A project key (Developers → API keys). Keep it on your server, not in an app.

Headers

traceparent
string

W3C Trace Context; joins your trace to ours

Idempotency-Key
string
required

A retry with the same key and body returns the first response

Required string length: 1 - 255

Body

application/json
user
string
required

The person: a usr_… ID or the brand's own ID

Required string length: 1 - 256
unit
string
required

The unit to take: its key

Pattern: ^[a-z][a-z0-9_-]{0,63}$
amount
integer
required

How much to take

Required range: x <= 1000000
reason
string
required

What it was for, written on the receipt: Free coffee

Required string length: 1 - 280
reference
string

The brand's own redemption or order ID. It can be used once per unit: a second spend with it is refused with reference_used. Matching is exact and case-sensitive (ORD-1 and ord-1 are two), after the text is put in Unicode NFC form

Required string length: 1 - 128

Response

Take a unit from a person for something

id
string
required

The receipt's act_… ID, as the audit log names it

Pattern: ^act_[0-7][0-9a-hjkmnp-tv-z]{25}$
user
object
required

The person it was taken from

unit
string
required

The unit's key

Pattern: ^[a-z][a-z0-9_-]{0,63}$
amount
integer
required

What was taken

balance_after
integer
required

What the person holds now

reference
string | null
required

The reference it was spent under