Shopify Generate Gift Card

This action creates a new Shopify gift card via the Admin GraphQL API, using either a specified card value or an order’s totals. It supports optional expiration and custom notes.


Inputs

NameTypeDescription
Shopify TokenCredentialsA token with permissions to create gift cards (e.g., shpat_…).
Shopify DomainStringThe store’s myshopify.com subdomain (e.g., your-store).
Card ValueOptional NumberAbsolute amount for the gift card. Overrides order totals when provided.
Include Shipping?BooleanWhether to include the order’s shipping cost in the gift card value (ignored if Card Value is set).
Order DataObjectThe Shopify order object; used to derive totals (current_total_price or current_subtotal_price).
Gift Card NoteOptional StringA note attached to the gift card (visible to agents in Shopify).
Number of Days ValidOptional NumberDays until expiration; use 0 for no expiry. Defaults to 365 days if omitted.

Outputs

NameTypeDescription
Gift Card Created?Booleantrue if the gift card was successfully generated.
Gift Card CodeStringThe alphanumeric code for the new gift card.
Gift Card AmountNumberThe numerical value of the gift card (in store currency).
Gift Card Amount StringStringThe amount plus currency (e.g., 50.00 USD).
Expires OnStringISO date when the gift card expires, or null if open-ended.

Notes

  • The action uses the 2025-04 GraphQL endpoint /admin/api/2025-04/graphql.json.
  • If Card Value is omitted, the gift card amount is taken from the order’s subtotal or total, based on Include Shipping?.
  • Number of Days Valid of 0 creates a non-expiring gift card.