Gift Cards
Query
giftCard — Returns GiftCard
Scopes Required: manage_gift_cards
| Arguments | Type | Description |
|---|---|---|
|
id |
The ID of the gift card to retrieve |
Example Query
query GetGiftCard($id: ID!) {
giftCard(id: $id) {
id,
clientId,
originalAmount,
currentAmount,
code
}
}
# Example variables
{
"id": "<ID>"
}Query
giftCardMovements — Returns ConnectionType of GiftCardMovement
Scopes Required: manage_gift_cards
Retrieve the gift card movements that occurred between two dates, this will only included movements that occurred because of sales, not gift card imported or directly created through the API.
Sortable Fields
Fields from GiftCardMovement that can be used to sort the connection items
- timestamp
| Arguments | Type | Description |
|---|---|---|
|
sold |
Boolean |
Show the sold gift card movements (defaults to |
|
redeemed |
Boolean |
Show the redeemed gift card movements (defaults to |
|
outlets |
The Outlets where the gift card had movement (defaults to all Outlets) |
|
|
registers |
The Registers where the gift card had movement (defaults to all Registers) |
|
|
startDate |
The date and time to get the movements from (inclusive) (defaults to today) |
|
|
endDate |
The date and time to get movements to (inclusive) |
Example Query
query GetGiftCardMovements($outlets: [ID!]) {
giftCardMovements(outlets: $outlets) {
edges {
node {
amount,
action,
timestamp
}
},
pageInfo {
hasNextPage,
endCursor
}
}
}
# Example variables
{
"outlets": [
"<OUTLETS>"
]
}Query
giftCards — Returns ConnectionType of GiftCard
Scopes Required: manage_gift_cards
Sortable Fields
Fields from GiftCard that can be used to sort the connection items
- originalAmount
- currentAmount
- code
- expiry
| Arguments | Type | Description |
|---|---|---|
|
redeemed |
Boolean |
Whether the list should include redeemed gift cards or not (defaults to |
|
expired |
Boolean |
Whether the list should include expired gift cards or not (defaults to |
|
ids |
The specific gift cards to return |
Example Query
query GetGiftCards($redeemed: Boolean) {
giftCards(redeemed: $redeemed) {
edges {
node {
id,
clientId,
originalAmount,
currentAmount,
code
}
},
pageInfo {
hasNextPage,
endCursor
}
}
}
# Example variables
{
"redeemed": "<REDEEMED>"
}