giftCardCreate mutation

Version unstable

Creates a gift card.

Required access

write_gift_cards access scope. Also: The API client must be a private or custom app installed on a Shopify Plus store.

Interactive example

This is an example mutation query. Use the embedded interactive tool below to edit the query.

Hint: use Ctrl + Space for autocompleting fields.


Arguments

Argument Description
input ( GiftCardCreateInput! ) required

The properties for the gift card to be created.

GiftCardCreateInput fields

  • code (String)

    An optional custom code of the gift card. It must be 8-20 characters long and contain only letters(a-z) and numbers(0-9). A random code will be generated if the code is not provided.

  • customerId (ID)

    The ID of the customer for the gift card.

  • expiresOn (Date)

    The expiry date of the gift card. If unspecified, then the gift card will never expire.

  • initialValue (Decimal!) Required

    The initial value of the gift card in the shop's currency.

  • note (String)

    An optional note associated with the gift card. The note isn't visible to customers.

  • templateSuffix (String)

    The suffix of the Liquid template that's used to render the gift card online. For example, if the value is birthday, then the gift card is rendered using the template gift_card.birthday.liquid. When the argument is not supplied, the default gift_card.liquid template is used.

Return fields

  • giftCard (GiftCard)

    The gift card that is created.

  • giftCardCode (String)

    The gift card code which is used to make payments.

  • userErrors ([GiftCardUserError!]!)

    List of errors that occurred from executing the mutation.

Version 2021-10 (Release candidate)

Creates a gift card.

Required access

write_gift_cards access scope. Also: The API client must be a private or custom app installed on a Shopify Plus store.

Interactive example

This is an example mutation query. Use the embedded interactive tool below to edit the query.

Hint: use Ctrl + Space for autocompleting fields.