← Developer home

Doeh POS — Loyalty API (1.0.0)

Download OpenAPI specification:

Public loyalty API, served by the edge gateway. Bearer-token auth. Balances are SHOP-scoped: a member's points are shared across all branches of a shop and isolated across shops. Points are integers; the ledger is append-only; redeem cannot exceed balance.

Loyalty

Accrue points for a member

Idempotent when an Idempotency-Key is supplied.

Authorizations:
MerchantAuth
path Parameters
id
required
string^[A-Za-z0-9_]+$

Member id.

header Parameters
Idempotency-Key
string <= 200 characters
Trace-Id
string
Request Body schema: application/json
required
points
required
integer >= 1

Whole points (never a decimal).

reason
string

Responses

Request samples

Content type
application/json
{
  • "points": 1,
  • "reason": "string"
}

Response samples

Content type
application/json
{
  • "ok": true,
  • "idempotent": true,
  • "account": {
    }
}

Redeem points for a member

Idempotent when an Idempotency-Key is supplied — a retried redeem never double-spends. Redeeming more than the balance is rejected; no ledger entry is written.

Authorizations:
MerchantAuth
path Parameters
id
required
string^[A-Za-z0-9_]+$

Member id.

header Parameters
Idempotency-Key
string <= 200 characters
Trace-Id
string
Request Body schema: application/json
required
points
required
integer >= 1

Whole points (never a decimal).

reason
string

Responses

Request samples

Content type
application/json
{
  • "points": 1,
  • "reason": "string"
}

Response samples

Content type
application/json
{
  • "ok": true,
  • "idempotent": true,
  • "account": {
    }
}

Read a member's balance and recent ledger

Authorizations:
MerchantAuth
path Parameters
id
required
string^[A-Za-z0-9_]+$

Member id.

header Parameters
Trace-Id
string

Responses

Response samples

Content type
application/json
{
  • "ok": true,
  • "account": {
    }
}