Baraka Pay DOCS

← Back to docs

Vouchers

A shared registry of codes one merchant issues and any of its applications can spend.

Redeeming moves no money

This is the part worth reading twice. Redeeming a voucher posts nothing to the ledger and moves no balance. It authorises the CALLING application to credit its own account, exactly once, for a stated amount — the crediting is yours to do.

Every route is scoped to the merchant behind the API key and to that key's environment, so a sandbox code is worth nothing in Live and no merchant can read or spend another's codes.

The code is a bearer instrument

The plaintext codes are returned when the batch is issued and never again. Baraka Pay stores them hashed; there is no endpoint that reads a code back. Treat the issue response the way you would treat a one-time password.

Redemption is single-use under concurrency: two simultaneous redemptions of one code produce exactly one success and one refusal, not two credits.

Endpoints

Issue a batch, list them, validate a code without spending it, redeem it, request delivery of a batch to a recipient, or void one that has not been spent.

POST /v1/vouchers issue a batch GET /v1/vouchers list, by status or batch POST /v1/vouchers/validate check without spending POST /v1/vouchers/redeem spend, once POST /v1/vouchers/{id}/void withdraw an unspent code