AbsolutePayDocs

Gift cards

Browse card templates, issue prepaid gift cards from your balance, and track their status.

Issue prepaid gift cards funded from your workspace balance: pick a template (the card design), create a card for an amount, and hand the returned card details to the recipient. Reading templates and cards needs the payments:read scope; issuing needs payments:write and payouts:write, because a card's redemption key is spendable value, like a withdrawal. Only a key with payouts:write sees cardKey when reading cards.

1. Browse templates

const templates = await ap.giftcards.templates();
templates = ap.giftcards.templates()
templates, err := ap.GiftCards.Templates(ctx)
if err != nil {
	log.Fatal(err)
}
fmt.Println(templates)
curl "https://api.absolutepay.io/v1/giftcards/templates" \
  -H "Authorization: Bearer $APP_TOKEN" $(sign GET /v1/giftcards/templates "")
[{ "id": "tmpl-1", "titleEn": "Happy Birthday", "imageUrl": "https://…", "coverType": "birthday" }]

Pass a template's id as templateId when issuing.

2. Issue a card

The face value comes out of your workspace balance, so check balances — and preview the fee with paymentType: "GIFTCARD" — first. An insufficient balance fails the request; so does spending money held for fees not yet collected or for outflows still in progress (409 fees_uncollected — the error says how much can leave right now).

Send an Idempotency-Key header: a retry with the same key and body returns the original card and never issues a second one — retrying with the same key returns the card on record, even after a timeout. Each card is recorded before it is issued, so a request that times out still shows up in your list as UNKNOWN: whether the card exists is not confirmed yet. We check it with the card network and resolve it; don't issue a replacement until it settles.

const card = await ap.giftcards.create({
  title: "Birthday gift",                          // shown on the card
  templateId: "tmpl-1",                            // from templates()
  amount: { amount: "50.00", currency: "USDT" },   // decimal string, ≤ 6 dp
});
console.log(card.cardNum, card.cardKey);
card = ap.giftcards.create(
    title="Birthday gift",                            # shown on the card
    template_id="tmpl-1",                             # from templates()
    amount={"amount": "50.00", "currency": "USDT"},   # decimal string, ≤ 6 dp
)
print(card["cardNum"], card["cardKey"])
card, err := ap.GiftCards.Create(ctx, absolutepay.GiftCardParams{
	Title:      "Birthday gift", // shown on the card
	TemplateID: "tmpl-1",        // from Templates()
	Amount:     absolutepay.Money{Amount: "50.00", Currency: "USDT"}, // decimal string, ≤ 6 dp
})
if err != nil {
	log.Fatal(err)
}
fmt.Println(card["cardNum"], card["cardKey"])
BODY='{"title":"Birthday gift","templateId":"tmpl-1","amount":{"amount":"50.00","currency":"USDT"}}'
curl https://api.absolutepay.io/v1/giftcards \
  -H "Authorization: Bearer $APP_TOKEN" -H "Content-Type: application/json" \
  $(sign POST /v1/giftcards "$BODY") -d "$BODY"
{ "id": "5b0c…", "cardNum": "gc_9f2…", "cardKey": "…", "title": "Birthday gift", "templateId": "tmpl-1", "amount": { "amount": "50.00", "currency": "USDT" }, "status": "PENDING", "createdAt": 1760000000000 }

The cardKey is the redemption secret

Whoever holds cardKey can redeem the card — treat it like cash. Store it securely, deliver it only to the recipient, and never log it. Issued value is crypto: there are no chargebacks.

3. List & look up

const cards = await ap.giftcards.list({ status: "ACTIVE" }); // keyset-paginated
const one = await ap.giftcards.get("gc_9f2…");               // by cardNum
cards = ap.giftcards.list(status="ACTIVE")  # keyset-paginated
one = ap.giftcards.get("gc_9f2…")           # by cardNum
cards, err := ap.GiftCards.List(ctx, absolutepay.PageQuery{Status: "ACTIVE"}) // keyset-paginated
if err != nil {
	log.Fatal(err)
}
one, err := ap.GiftCards.Get(ctx, "gc_9f2…") // by cardNum
if err != nil {
	log.Fatal(err)
}
fmt.Println(cards, one)
curl "https://api.absolutepay.io/v1/giftcards?status=ACTIVE" \
  -H "Authorization: Bearer $APP_TOKEN" $(sign GET "/v1/giftcards?status=ACTIVE" "")
curl "https://api.absolutepay.io/v1/giftcards/gc_9f2…" \
  -H "Authorization: Bearer $APP_TOKEN" $(sign GET "/v1/giftcards/gc_9f2…" "")

Lists are keyset-paginated (limit, before — see Pagination) and read what we have on record. get refreshes one card from the card network first, so it is the call to poll; it accepts the cardNum or the card's id (a card whose issue timed out has no cardNum yet) and only finds cards your account issued (anything else is 404). Cards still settling are also re-checked for you in the background.

Statuses

statusMeaningBalance
PENDINGIssued, payment not yet confirmed.Held, not yet spent
UNKNOWNThe issue request got no answer; no card number yet. We review it.Held
REVIEWUnder manual review.Held
ACTIVEPaid for and not yet redeemed — hand the cardKey to the recipient.Spent (ledger GIFTCARD debit)
REDEEMEDThe recipient redeemed it.Spent
FROZENFrozen; contact support.Spent
FAILEDPayment failed or review rejected (error says why when we know).Returned; a card that had been debited is credited back

Webhook

When a card's payment completes you receive giftcard.paid with orderRef set to the card number and status: "PAID"; the card turns ACTIVE. Polling get reaches the same state, so treat the webhook as a shortcut, not the only signal.

Sandbox

Test-mode cards behave like live ones: they are issued PENDING, turn ACTIVE a moment later, debit the test balance and send giftcard.paid. In the sandbox, a live-mode account may answer 409 unavailable_in_sandbox until gift cards are enabled there — use a test-mode account meanwhile.

Next

  • Fees — preview the issuance cost with paymentType: "GIFTCARD".
  • Balances & reconciliation — the balance the card is funded from.
  • API reference — full parameter and response tables for the gift-card endpoints.

On this page