Last updated: 2026-05-11 14:47:56
**Purpose:** When a merchant imports gift cards (manual import or scheduled import), we need to attach each gift card to the correct **Shopify customer** in that shop.
**Flow:**
1. The merchant uploads a CSV that includes "customer email" (among other columns required for import).
2. Our app calls the Shopify Admin API (GraphQL) using a "customer lookup by email" operation (`getCustomersByEmail` in our codebase) to obtain Shopify’s "customer ID" for that shop.
3. To create/issue the gift card and associate it with that customer, we call the "giftCardCreate" mutation and pass the "customer ID" in the input.
Data handling: We use email "only" to resolve the customer ID for the import operation. We do not retain customer email in our database for this feature (adjust if you also avoid logs/exports; otherwise qualify the statement).
Note: Operation names above refer to our GraphQL queries/mutations; the underlying access is the merchant’s **Shopify Admin API** for their store.