# Queries / Gift Cards

# Gift Cards

**Query**
## giftCard — Returns [GiftCard](/documentation/Objects/Gift-Cards#GiftCard)

**Scopes required:** manage_gift_cards

| Arguments | Type | Description |
| --- | --- | --- |
| id | [ID!](/documentation/Types/UUID#UUID) | The ID of the gift card to retrieve |

**Example Query**

```graphql
query GetGiftCard($id: ID!) {
    giftCard(id: $id) {
        id,
        clientId,
        originalAmount,
        currentAmount,
        code
    }
}

# Example variables
{
    "id": "<ID>"
}
```

**Query**
## giftCardMovements — Returns [ConnectionType](/documentation/General/Connections) of [GiftCardMovement](/documentation/Objects/Gift-Cards#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](/documentation/Objects/Gift-Cards#GiftCardMovement) that can be used to sort the connection items*

- timestamp

| Arguments | Type | Description |
| --- | --- | --- |
| sold | *Boolean* | Show the sold gift card movements (defaults to `true`) |
| redeemed | *Boolean* | Show the redeemed gift card movements (defaults to `true`) |
| outlets | [[ID!]](/documentation/Types/UUID#UUID) | The Outlets where the gift card had movement (defaults to all Outlets) |
| registers | [[ID!]](/documentation/Types/UUID#UUID) | The Registers where the gift card had movement (defaults to all Registers) |
| startDate | [DateTime](/documentation/Types/Date-Time#DateTime) | The date and time to get the movements from (inclusive) (defaults to today) |
| endDate | [DateTime](/documentation/Types/Date-Time#DateTime) | The date and time to get movements to (inclusive) |

**Example Query**

```graphql
query GetGiftCardMovements($outlets: [ID!]) {
    giftCardMovements(outlets: $outlets) {
        edges {
            node {
                amount,
                action,
                timestamp
            }
        },
        pageInfo {
            hasNextPage,
            endCursor
        }
    }
}

# Example variables
{
    "outlets": [
        "<OUTLETS>"
    ]
}
```

**Query**
## giftCards — Returns [ConnectionType](/documentation/General/Connections) of [GiftCard](/documentation/Objects/Gift-Cards#GiftCard)

**Scopes required:** manage_gift_cards

### Sortable Fields
*Fields from [GiftCard](/documentation/Objects/Gift-Cards#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 `false`) |
| expired | *Boolean* | Whether the list should include expired gift cards or not (defaults to `false`) |
| ids | [[ID!]](/documentation/Types/UUID#UUID) | The specific gift cards to return |

**Example Query**

```graphql
query GetGiftCards($redeemed: Boolean) {
    giftCards(redeemed: $redeemed) {
        edges {
            node {
                id,
                clientId,
                originalAmount,
                currentAmount,
                code
            }
        },
        pageInfo {
            hasNextPage,
            endCursor
        }
    }
}

# Example variables
{
    "redeemed": "<REDEEMED>"
}
```