Create Gift Card

Creates a new gift card for a specific customer or store, including details such as initial value, expiration date, and custom templates.

🔒

Requires write_gift_cards access scope. More access scope

Creates a new gift card for a specific customer or store, including details such as initial value, expiration date, and custom templates.

This API is especially useful for:

  1. Generating new gift cards for customers
  2. Setting up promotional gift cards for marketing campaigns
  3. Creating gift cards with specific values and expiration dates

Request Parameters

Public Request Parameters

📘

Body Parameters

📘

Body Parameters

ParameterTypeRequiredDescriptionExample
gift_card.codestringYesThe gift card code, which is a string of alphanumeric characters. Must be between 8 and 20 characters."GIFT123456"
gift_card.initial_valuestringYesThe initial value of the gift card when it was created. e.g. 200.00"100.00"
gift_card.expires_onstringNoThe expiration date of the gift card in ISO-8601 format. e.g. 2022-11-01T00:00:00Z"2025-12-31T23:59:59Z"
gift_card.notestringNoAn optional note that a merchant can attach to the gift card that isn't visible to customers."Birthday gift for John"
gift_card.customer_idstringNoThe ID of the customer associated with this gift card."cust_12345"
gift_card.template_suffixstringNoThe suffix of the Liquid template that's used to render the gift card online."birthday"
gift_card.send_emailbooleanNoSend notification email to customer, true is default.true

Response Explanation

Public Response Parameters

📘

Successful Response

ParameterTypeExampleDescription
codestring"200"The status code of the response
messagestring"success"The message describing the response status
data.gift_card.idstring"gc_123456"Unique identifier for the gift card
data.gift_card.last_charactersstring"456"Last characters of the gift card code
data.gift_card.balancestring"100.00"Current balance of the gift card
data.gift_card.initial_valuestring"100.00"The initial value of the gift card
data.gift_card.notestring"Birthday gift for John"Note attached to the gift card
data.gift_card.expires_onstring"2025-12-31T23:59:59Z"Expiration date of the gift card in ISO-8601 format
data.gift_card.disabled_atstringnullTimestamp when the gift card was disabled (null if active)
data.gift_card.enabledbooleantrueWhether the gift card is currently enabled
data.gift_card.created_atstring"2025-06-01T10:00:00Z"Timestamp of when the gift card was created
data.gift_card.updated_atstring"2025-06-01T10:00:00Z"Timestamp of when the gift card was last updated
data.gift_card.statusstring"enabled"Status of the gift card (enable or disable)
data.gift_card.currencystring"USD"Currency in which the gift card is denominated
data.gift_card.line_item_idstring"li_123"ID of the line item associated with the gift card
data.gift_card.order_idstring"order_456"ID of the order associated with the gift card
data.gift_card.user_idstring"user_789"User ID of the creator or owner of the gift card
data.gift_card.template_suffixstring"birthday"Suffix of the template used to render the gift card online
data.gift_card.customer_idstring"cust_12345"Customer ID associated with the gift card
data.gift_card.codestring"GIFT123456"The gift card code, consisting of alphanumeric characters

Error Response

FieldTypeExampleDescription
codestringInvalidParameterError http message
messagestring``Error message
Language
Credentials
Header
URL
Click Try It! to start a request and see the response here!