Overview
When Loop issues a Shopify gift card for a return, it can append structured gift card details to the original Shopify order. Integrations read this metafield from Shopify’s order API — there is no Loop API endpoint for this data. Scope: Shopify-native gift card issuance only (Loop creates the gift card in Shopify). This does not apply to third-party store credit or gift card platforms (for example Rise.ai) or other credit providers. Use the Gift card webhook for those flows.Metafield location
Each successful issuance adds one map entry keyed by that gift card. If Loop
writes the same gift card again, the existing entry for that key is replaced
with the same payload — integrators should treat entries as idempotent by map
key.
When Loop writes
Loop writes when all of the following are true:- The shop has this feature enabled.
- Gift card credit is successfully issued (action
issued). - The provider is Shopify gift card API or Shopify gift card order (Loop-created Shopify gift cards).
Standard vs out-of-stock exchange
Both paths write the same metafield when Loop issues a Shopify gift card. The entry shape differs. When Loop issues a Shopify gift card for an out-of-stock exchange (including auto out-of-stock gift cards), Loop writes this metafield when enabled and does not send thegiftcard.requested webhook. That webhook still applies for
third-party providers such as Rise.
Out-of-stock edge case: If Loop cannot obtain a Shopify gift card ID or a
non-zero issuance amount, no metafield entry is written for that event.
Entry schema
Each map value uses the same fields as the Gift card webhook payload (minustopic and trigger), plus issuance identifiers. Amount fields are formatted
strings in shop currency.
Examples
Standard issuance
Out-of-stock exchange (second entry on the same order)
Reading from Shopify
Query the order metafield with the Shopify Admin API:value as JSON. Multiple issuances on the same order accumulate as
separate map keys.
Related documentation
- Gift card webhook — push-based alternative
- Retrieving Return Data — Loop API polling options