v1

latestOpenAPI 3.0.1Apache 2.02026-07-26193304444.4 KB
Gift Cards

Create a gift card transaction

Creates a new gift card transaction on the specified gift card. The request body requires the type, amount, and client_id fields. The type determines what sort of transaction it is.

  • "REDEEMING" - Use this type when you want to redeem a certain amount from the gift card balance. The amount MUST be negative. If you want to add an amount to the balance use the "RELOADING" type.
  • "RELOADING" - Use this type when you load a new amount onto a gift card.

If the gift card does not have enough credit to honour the transaction a 422 HTTP status code will be returned.

Idempotency

Please populate the client_id field with a unique transaction identifier, to ensure that the transaction is safe from double-submit problems. See the tutorial for more information.

🔒 Requires: gift_cards:write:redeem scope

post/gift_cards/{card_number}/transactions

Path parameters

card_numberstring required

The number of the gift card to add the transaction to.

Request body

amountstring required

The transaction amount. Must be negative for REDEEMING transactions and positive for RELOADING transactions.

client_idstring required

A unique transaction identifier for idempotency. The client must provide this and is normally the transaction id from the client system.

expires_atstring

Optional new expiry date for the gift card in YYYY-MM-DD format. Can be used to extend the gift card's expiry when reloading.

time_zonestring

The timezone to use when interpreting the expires_at date (e.g. "Pacific/Auckland"). See the list of tz database time zones for valid values.

type'REDEEMING' | 'RELOADING' required

The type of the transaction.

user_idstring

The ID of the user creating the transaction. If omitted, the authenticated user will be used.

Response

Gift card transaction successfully created.