Skip to main content
POST
Create a gift card transaction

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

id
string<uuid>
required

Body

application/json
amount
string<monetary>
required

Amount to be added or removed from the gift card

Pattern: ^-?[0-9]+(\.[0-9]+)?$
Example:

"199.99"

idempotency_key
string
required

Idempotency key to avoid duplicate transactions. Only one transaction may exist with a given idempotency key. Subsequent requests with the same idempotency key will return the data persisted in the database.

type
enum<string>
required

The kind of transaction. An API client may send manual_adjustment to correct a balance, or order_payment to spend the card on an order; the remaining types are recorded at the point of sale.

Available options:
book_transfer,
funding_from_payment,
manual_adjustment,
order_payment
description
string

Description to write alongside the transaction

employee_id
string

ID of the employee responsible. Only a register sends one, and it is required there; a back-office session records the signed-in user, and an API credential records itself.

order_id
string<uuid>

ID of the order this transaction is tied to, from the transactions resource. Required when spending the card on an order, and rejected on an adjustment. The order does not have to be recorded yet: send the ID you will record it under.

store_id
string

ID of the store the transaction belongs to. Optional: name a store to attribute the adjustment to it, or omit it for one that is not tied to a store.

Pattern: ^[0-9]+$

Response

Gift card transaction created successfully.

One credit or debit on a gift card. The ledger is append-only, so a transaction is never edited or removed once recorded; a correction is another transaction.

id
string
required

Unique identifier for the record.

amount
string<monetary>
required

Money the transaction moved on the card. A positive amount adds funds; a negative amount spends them.

Pattern: ^-?[0-9]+(\.[0-9]+)?$
Example:

"199.99"

api_client_id
string | null
required

ID of the API credential that recorded the transaction. Null when a person did.

created_at
string<date-time>
required

When the record was created.

description
string | null
required

Note written alongside the transaction, such as why an adjustment was made.

effective_at
string<date-time>
required

When the transaction took effect. A sale carries the time it was completed at the register, so this can be earlier than created_at, which is when the transaction was recorded on the ledger.

employee_id
string | null
required

ID of the employee who took the transaction at a register, or null when it was made in the back office or by an API credential.

Pattern: ^[0-9]+$
idempotency_key
string
required

Key supplied when the transaction was created, unique within the banner. Sending the same key again returns the transaction already recorded rather than moving the balance twice.

order_id
string<uuid> | null
required

ID of the order this transaction is tied to, from the transactions resource. Null when the transaction is not tied to an order.

store_id
string | null
required

ID of the store where the transaction took place. Null for a transaction not tied to a store, such as a back-office adjustment.

Pattern: ^[0-9]+$
type
enum<string>
required

What produced the transaction: funds loaded onto the card, the card spent on a sale or restored by a refund, or a back-office adjustment.

Available options:
book_transfer,
funding_from_payment,
manual_adjustment,
order_payment
updated_at
string<date-time>
required

When the record was last changed.

user_id
string | null
required

ID of the back-office user who made the transaction. Null for a transaction taken at a register or by an API credential.

Pattern: ^[0-9]+$