Skip to main content
POST
Registrar un movimiento de puntos o sellos
Records a movement against a membership. This is the endpoint your point of sale calls: it moves the balance, writes the audit entry, and pushes the new number to the card in the customer’s wallet. Whether the movement touches points or stamps is decided by the program, not by this call. You never pass a metric.

Endpoint

Required scope

loyalty:write

Headers

Path parameters

Body

How kind maps to the balance

Example request

Response

201 Created

400 Bad Request

kind outside the allowed set, a non-numeric amount, a field over its length limit, or a property the endpoint does not accept.

401 Unauthorized

Missing, invalid, revoked, or expired token.

403 Forbidden

The token does not have the loyalty:write scope.

404 Not Found

No membership with that id in your company.

502 Bad Gateway

The loyalty service is unreachable.

Operational notes

Do not fire concurrent movements against the same membership. The balance is read, modified, and written back rather than incremented atomically, so two simultaneous accruals can lose one of them. Serialise per membership — one call per transaction, not one per line item — or put them through a queue keyed by membership_id.
  • This call is not idempotent. There is no deduplication on ref. A retry after a network timeout may double-count, so record the returned entry _id and check the ledger before retrying.
  • The balance never goes below zero. Redeeming more than the customer has clamps to 0 and succeeds — it does not fail. If you need to reject an unaffordable redemption, check the balance first and decide on your side.
  • Nothing validates a redemption against a reward. Loyalty has no reward catalogue: redeem just subtracts. What the customer receives is your business logic.
  • The wallet card updates on its own. After the movement, the pass in Apple or Google Wallet is refreshed with the new balance. You do not need to call the notify endpoint for that — notify is for sending a message, not for syncing a number.
  • On a stamps program, amount is a stamp count. Sending amount: 1 adds one stamp. Sending 120 adds 120 stamps, which is almost certainly not what you meant — the program type is what you should branch on.
  • Tiers are recomputed on every movement, against the point balance and the program’s thresholds.

Authorizations

Authorization
string
header
required

Personal Access Token con prefijo kbai_pk_. Generar desde el portal con permiso developer.manage_tokens.

Path Parameters

id
string
required

Body

application/json
kind
enum<string>
required

earn suma, redeem resta, adjust respeta el signo de amount para correcciones

Available options:
earn,
redeem,
adjust
amount
number
required

Magnitud del movimiento. En earn y redeem se toma el valor absoluto; en adjust se respeta el signo

Example:

120

source
string

De dónde vino el movimiento. Por defecto manual

Example:

"pos-sucursal-centro"

ref
string

Referencia externa, por ejemplo el número de boleta

Example:

"boleta-99120"

note
string
Example:

"Compra de 12.000 en tienda"

Response

201 - application/json
entry
object
required