Refund or void an award, in full or in part
POST /awards/{reference}/reverse
Full and unspent: the award is undone. Partial: its proportional share. Already spent: what is there is taken, never below zero, and refund.unresolved is sent.
Scope: awards:reverse. The key’s connection must hold it; see the reference’s introduction.
Example
Section titled “Example”Replace the CAPITALS, and set PASSKAAR_KEY to a key from the portal.
curl -X POST "https://api.passkaar.com/integrations/v1/awards/ORDER-1001/reverse" \ -H "Authorization: Bearer $PASSKAAR_KEY" \ -H "Idempotency-Key: $(uuidgen)" \ -H "Content-Type: application/json" \ -d '{}'Parameters
Section titled “Parameters”| Name | In | Type | Required | What it is |
|---|---|---|---|---|
reference |
path | string | yes | The award’s reference, percent-encoded as one path segment (encodeURIComponent): INV/24-25/001 is sent as INV%2F24-25%2F001, and %, ? and # are encoded the same way. |
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. |
Request body
Section titled “Request body”| Field | Type | Required | What it is |
|---|---|---|---|
refund |
object | A partial refund: the award’s proportional share of it is taken back. Omitted, the whole award is reversed. | |
refund.total |
integer | yes | Whole rupees refunded of the bill the award had. |
refund.currency |
"PKR" |
yes | |
refund_reference |
string | The refund or credit note number. Required with refund, so each partial refund is its own and a resend replays it. |
|
occurred_at |
string (date-time) | RFC 3339. Answers are in UTC; requests may carry any offset. | |
note |
string | Words for the row in the card’s history, at most 500 characters. |
Answers
Section titled “Answers”A replay.
| Field | Type | Required | What it is |
|---|---|---|---|
id |
string (uuid) | yes | |
award |
object | yes | |
award.id |
string (uuid) | yes | |
award.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. |
kind |
full, partial |
yes | |
reversed |
object (Value) | yes | What was taken back. |
reversed.stamps |
integer | ||
reversed.rewards |
integer | Stamp-card rewards. | |
reversed.points |
integer | ||
reversed.rupees |
number | A prepaid card’s own rupees. | |
reversed.bonus_rupees |
number | A prepaid top-up’s bonus, on top of rupees. |
|
reversed.value_rupees |
number | What points spent on a cash-back points card are worth off the bill, for the caller’s discount line. | |
reversed.sessions |
integer | ||
reversed.deals |
integer | Coupon deals. | |
reversed.qualifying |
integer | Towards a VIP card’s tier, in the card’s measure: visits, or whole rupees of spend. | |
reversed.paid_through |
string (date) | A membership renewed to this day. | |
shortfall |
object (Value) or null | yes | What could not be taken back because it was already spent. Never below zero; refund.unresolved is sent for it. |
shortfall.stamps |
integer | ||
shortfall.rewards |
integer | Stamp-card rewards. | |
shortfall.points |
integer | ||
shortfall.rupees |
number | A prepaid card’s own rupees. | |
shortfall.bonus_rupees |
number | A prepaid top-up’s bonus, on top of rupees. |
|
shortfall.value_rupees |
number | What points spent on a cash-back points card are worth off the bill, for the caller’s discount line. | |
shortfall.sessions |
integer | ||
shortfall.deals |
integer | Coupon deals. | |
shortfall.qualifying |
integer | Towards a VIP card’s tier, in the card’s measure: visits, or whole rupees of spend. | |
shortfall.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. |
Reversed.
| Field | Type | Required | What it is |
|---|---|---|---|
id |
string (uuid) | yes | |
award |
object | yes | |
award.id |
string (uuid) | yes | |
award.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. |
kind |
full, partial |
yes | |
reversed |
object (Value) | yes | What was taken back. |
reversed.stamps |
integer | ||
reversed.rewards |
integer | Stamp-card rewards. | |
reversed.points |
integer | ||
reversed.rupees |
number | A prepaid card’s own rupees. | |
reversed.bonus_rupees |
number | A prepaid top-up’s bonus, on top of rupees. |
|
reversed.value_rupees |
number | What points spent on a cash-back points card are worth off the bill, for the caller’s discount line. | |
reversed.sessions |
integer | ||
reversed.deals |
integer | Coupon deals. | |
reversed.qualifying |
integer | Towards a VIP card’s tier, in the card’s measure: visits, or whole rupees of spend. | |
reversed.paid_through |
string (date) | A membership renewed to this day. | |
shortfall |
object (Value) or null | yes | What could not be taken back because it was already spent. Never below zero; refund.unresolved is sent for it. |
shortfall.stamps |
integer | ||
shortfall.rewards |
integer | Stamp-card rewards. | |
shortfall.points |
integer | ||
shortfall.rupees |
number | A prepaid card’s own rupees. | |
shortfall.bonus_rupees |
number | A prepaid top-up’s bonus, on top of rupees. |
|
shortfall.value_rupees |
number | What points spent on a cash-back points card are worth off the bill, for the caller’s discount line. | |
shortfall.sessions |
integer | ||
shortfall.deals |
integer | Coupon deals. | |
shortfall.qualifying |
integer | Towards a VIP card’s tier, in the card’s measure: visits, or whole rupees of spend. | |
shortfall.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. |
Errors
Section titled “Errors”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 | already_reversed |
| 422 | idempotency_key_reused |
| 422 | reversal_exceeds_award |
| 422 | reference_reused |
| 422 | operation_not_allowed |
| 422 | invalid_occurred_at |
| 429 | rate_limited |
| 500 | internal_error |
| 503 | unavailable |