Skip to content

Spend value now

POST /redemptions

Only the card itself (serial or card_id), or an external_id linked with the card, may spend. A phone, an email, or an id linked from a phone or email alone answers card_required.

Scope: redemptions:write. The key’s connection must hold it; see the reference’s introduction.

Replace the CAPITALS, and set PASSKAAR_KEY to a key from the portal.

Terminal window
curl -X POST "https://api.passkaar.com/integrations/v1/redemptions" \
-H "Authorization: Bearer $PASSKAAR_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"card": {
"card_id": "CARD_ID"
},
"reference": "ORDER-1002",
"spend": {
"type": "reward"
}
}'
Name In Type Required What it is
Idempotency-Key header string Any 1–255 visible ASCII characters, a UUID by preference. A retry with the same key within 24 hours answers the first result. reference is what guards a resend after that.
Field Type Required What it is
card object yes Exactly one of serial, card_id, phone, email or external_id. A phone or email that matches several customers answers 409 ambiguous. Spending accepts only serial, card_id, or an external_id linked with the card.
reference string yes The caller’s invoice, order or refund number, 1–64 visible ASCII characters. Unique per connection for ever within its kind (awards, redemptions, reversals, holds): the same reference again, at any age, answers the first result with replayed: true.
spend object (SpendReward) or object (SpendPoints) or object (SpendDeduction) or object (SpendCoupon) or object (SpendSession) yes What is spent. The card’s type decides which it may be.
bill object (Bill) The sale, where the card asks for one (a coupon’s minimum spend).
bill.total integer yes The whole bill in whole rupees, tax and delivery in it.
bill.tax integer Whole rupees of tax inside total.
bill.delivery integer Whole rupees of delivery inside total.
bill.currency "PKR" yes
occurred_at string (date-time) Defaults to now. Not in the future.
branch string (uuid) A branch’s id from GET /branches. Omitted, the connection’s branch if it has one, otherwise none.
note string Words for the row in the card’s history, at most 500 characters.

A replay of a reference already used.

Field Type Required What it is
id string (uuid) yes
reference string yes The caller’s invoice, order or refund number, 1–64 visible ASCII characters. Unique per connection for ever within its kind (awards, redemptions, reversals, holds): the same reference again, at any age, answers the first result with replayed: true.
card object (CardIds) yes The card’s id and, where shown, its printed card ID.
card.id string (uuid) yes
card.card_id string or null yes The printed card ID, only when the call named the card by serial or card_id, the call made the card (a created sign-up), or this connection’s external_id was linked with the card. Null when the card was found by phone, email or an unproven link.
type stamps, points, coupon, prepaid, membership, tiers yes tiers is the VIP card; prepaid the prepaid card.
spent object (Value) yes An amount in the card’s own units. Only the keys its type counts in are present; a check-in is {}.
spent.stamps integer
spent.rewards integer Stamp-card rewards.
spent.points integer
spent.rupees number A prepaid card’s own rupees.
spent.bonus_rupees number A prepaid top-up’s bonus, on top of rupees.
spent.value_rupees number What points spent on a cash-back points card are worth off the bill, for the caller’s discount line.
spent.sessions integer
spent.deals integer Coupon deals.
spent.qualifying integer Towards a VIP card’s tier, in the card’s measure: visits, or whole rupees of spend.
spent.paid_through string (date) A membership renewed to this day.
balance object yes The card’s standing after the call, by its type.
occurred_at string (date-time) yes RFC 3339. Answers are in UTC; requests may carry any offset.
recorded_at string (date-time) yes RFC 3339. Answers are in UTC; requests may carry any offset.
replayed boolean yes True when this answers a reference or idempotency key already used.

Spent.

Field Type Required What it is
id string (uuid) yes
reference string yes The caller’s invoice, order or refund number, 1–64 visible ASCII characters. Unique per connection for ever within its kind (awards, redemptions, reversals, holds): the same reference again, at any age, answers the first result with replayed: true.
card object (CardIds) yes The card’s id and, where shown, its printed card ID.
card.id string (uuid) yes
card.card_id string or null yes The printed card ID, only when the call named the card by serial or card_id, the call made the card (a created sign-up), or this connection’s external_id was linked with the card. Null when the card was found by phone, email or an unproven link.
type stamps, points, coupon, prepaid, membership, tiers yes tiers is the VIP card; prepaid the prepaid card.
spent object (Value) yes An amount in the card’s own units. Only the keys its type counts in are present; a check-in is {}.
spent.stamps integer
spent.rewards integer Stamp-card rewards.
spent.points integer
spent.rupees number A prepaid card’s own rupees.
spent.bonus_rupees number A prepaid top-up’s bonus, on top of rupees.
spent.value_rupees number What points spent on a cash-back points card are worth off the bill, for the caller’s discount line.
spent.sessions integer
spent.deals integer Coupon deals.
spent.qualifying integer Towards a VIP card’s tier, in the card’s measure: visits, or whole rupees of spend.
spent.paid_through string (date) A membership renewed to this day.
balance object yes The card’s standing after the call, by its type.
occurred_at string (date-time) yes RFC 3339. Answers are in UTC; requests may carry any offset.
recorded_at string (date-time) yes RFC 3339. Answers are in UTC; requests may carry any offset.
replayed boolean yes True when this answers a reference or idempotency key already used.

Every error is a Problem Details answer with a stable code.

Status Code
400 invalid_request
401 unauthorized
404 not_found
409 request_in_progress
409 ambiguous
422 idempotency_key_reused
422 reference_reused
422 card_required
422 card_not_active
422 operation_not_allowed
422 insufficient_balance
422 daily_cap_reached
422 invalid_occurred_at
429 rate_limited
500 internal_error
503 unavailable