Gift Cards

Mutation

createGiftCard — Returns GiftCard

No scope required

Create an internal gift card

Arguments Type Description

id

String

The client ID of the gift card, you can use this to store your own reference (this is not visible to the user)

outlet

ID!

The Outlet this gift card was purchased at

code

String!

The unique code this gift card has

amount

Float!

The amount of money that the gift card is loaded with

expiry

DateTime!

When the gift card will expire

additional

JSON

Any additional information to include with the gift card, this is not used by Shopfront in any way

Example Mutation
mutation CreateGiftCards($outlet: ID!, $code: String!, $amount: Float!, $expiry: DateTime!) {
    createGiftCard(outlet: $outlet, code: $code, amount: $amount, expiry: $expiry) {
        id,
        clientId,
        originalAmount,
        currentAmount,
        code
    }
}

# Example variables
{
    "outlet": "<OUTLET>",
    "code": "<CODE>",
    "amount": "<AMOUNT>",
    "expiry": "<EXPIRY>"
}

Mutation

updateGiftCard — Returns GiftCard

No scope required

This is currently an experimental mutation, please get in contact with us before using it.

Arguments Type Description

id

ID!

The ID scalar type represents a unique identifier.

The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. The ID is mathematically universally unique across all types and Vendors and can be used as such.

amount

Float!

The Float scalar type represents signed double-precision fractional values as specified by IEEE 754.

expiry

DateTime!

The DateTime scalar type represents dates and time values as specified by ISO 8601.

Example Mutation
mutation UpdateGiftCards {
    updateGiftCard {
        id,
        clientId,
        originalAmount,
        currentAmount,
        code
    }
}