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
Name | Type | Description |
---|---|---|
Shopify Token | Credentials | A token with permissions to create gift cards (e.g., shpat_… ). |
Shopify Domain | String | The store’s myshopify.com subdomain (e.g., your-store ). |
Card Value | Optional Number | Absolute amount for the gift card. Overrides order totals when provided. |
Include Shipping? | Boolean | Whether to include the order’s shipping cost in the gift card value (ignored if Card Value is set). |
Order Data | Object | The Shopify order object; used to derive totals (current_total_price or current_subtotal_price ). |
Gift Card Note | Optional String | A note attached to the gift card (visible to agents in Shopify). |
Number of Days Valid | Optional Number | Days until expiration; use 0 for no expiry. Defaults to 365 days if omitted. |
Outputs
Name | Type | Description |
---|---|---|
Gift Card Created? | Boolean | true if the gift card was successfully generated. |
Gift Card Code | String | The alphanumeric code for the new gift card. |
Gift Card Amount | Number | The numerical value of the gift card (in store currency). |
Gift Card Amount String | String | The amount plus currency (e.g., 50.00 USD ). |
Expires On | String | ISO 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.
Updated about 6 hours ago