November 23, 2026 · 4 min read

Gift Card line_item_id in 2027-01: What Breaks and What Replaces It?

Shopify's gift card line_item_id becomes read-only in REST 2027-01. See which integrations break, what GraphQL can do, and how to test the change.

Gift Card line_item_id in 2027-01: What Breaks and What Replaces It?

In Shopify REST Admin API version 2027-01, GiftCard.line_item_id becomes read-only: Shopify will accept the field in create and update requests but ignore it. GraphQL replaces the supported gift card creation, update, and reading workflows, not the ability to attach a gift card to an arbitrary order line item. If your integration relies on that attachment, you need to redesign the workflow rather than swap endpoints.

Key takeaways

  • A successful REST response will not mean that a submitted line_item_id was applied.
  • Purchased gift cards can still expose their Shopify-created line-item association.
  • giftCardCreate and giftCardUpdate support issuance and ordinary edits, but neither accepts a line-item ID.
  • Test the actual association after every migration, not just the HTTP status or GraphQL errors.

What changes on the wire?

Shopify announced the change on October 30, 2026. As of November 23, 2026, 2027-01 is a release candidate, not the latest stable API version. Shopify's version schedule lists January 1, 2027 as its stable release date. Use the release candidate for development testing, not as a reason to move production traffic early.

The failure mode is unusually quiet. In 2027-01 and later, a REST create or update request containing line_item_id is accepted, but Shopify ignores that property. An existing association stays as it was; sending null does not clear it. Responses can still include line_item_id and order_id. Earlier versions retain their existing behavior, but pinning an old version is not a durable migration plan: Shopify eventually falls forward when a requested version becomes inaccessible. Check the response's X-Shopify-API-Version header to see which version actually handled a request.

Here is the decision boundary:

Existing patternImpact in REST 2027-01Replacement
Read line_item_id for a purchased cardStill worksKeep the REST read, or query GraphQL GiftCard.lineItem and order
Issue a standalone card and set line_item_idSubmitted association is ignoredIssue the card without a Shopify line-item association; record your own external reference separately
Reassign or clear an existing associationSubmitted change is ignoredNo API replacement for changing Shopify's association
Edit a card's note, expiry, or recipient detailsUnrelated edits remain possibleUse giftCardUpdate where it fits your integration
Treat line_item_id as a fulfillment instructionIncorrect workflowUse fulfillment orders and fulfillmentCreate for eligible items

Shopify's 2027-01 REST Gift Card reference still shows line_item_id in responses. That makes request and response models especially easy to confuse.

Which integrations need an audit?

Search serialized requests, not just handwritten API calls. A shared model may read a gift card, modify its note, then serialize every field back to REST. In that case, line_item_id is being sent even though the feature owner thinks the integration only edits notes.

  • Search REST Gift Card POST and PUT payload builders for line_item_id, including generic object spread and JSON serialization.
  • Find code that assumes a successful write proves an order-to-card association. That assumption becomes false without a request error.
  • Inspect reconciliation jobs that copy a submitted line-item ID into a local database before reading Shopify's response.
  • Separate fulfillment logic from gift card issuance. Shopify's REST reference says passing line_item_id no longer creates a fulfillment; GraphQL fulfillmentCreate operates on fulfillment orders and their line items instead.

For a large catalog, I prefer a small, explicit request type over serializing an entire fetched resource. It makes this kind of read-only transition visible in code review. That is an implementation choice, not a Shopify requirement.

The GraphQL path, with its hard limit

For cards your app issues independently, use GraphQL giftCardCreate. Its GiftCardCreateInput accepts fields such as initialAmount, customerId, note, and recipientAttributes, but not lineItemId. The mutation requires write_gift_cards; assigning a customerId also requires write_customers. initialAmount takes a decimal amount and currency code; the older initialValue input is deprecated.

mutation IssueGiftCard($input: GiftCardCreateInput!) {
  giftCardCreate(input: $input) {
    giftCard { id lineItem { id } order { id } }
    userErrors { field code message }
  }
}

For example, pass {"input":{"initialAmount":{"amount":"25.00","currencyCode":"USD"},"note":"External reference: reward-123"}} as variables. The note is only an internal label. It does not create a Shopify order association, and an app-owned database is a better place for a durable, unique external mapping. Treat retries carefully so a transient failure does not issue two cards. If you need the code for distribution, request giftCardCode from the creation payload and handle it securely at issuance time.

For an existing card, GraphQL giftCardUpdate can change supported details such as its note or expiry. For verification, the GraphQL giftCard query exposes lineItem { id } and order { id }; a manually issued card has neither association. Neither mutation offers a hidden way to add, replace, or clear lineItem. Shopify explicitly says there is no replacement API for doing that from outside Shopify.

Verify the migration before switching versions

Build two fixtures: a card Shopify associated with a purchased gift card line item, and a manually issued card with no order. Then test both the write path and the read-back path against the release candidate.

  1. Send create and update requests without line_item_id; confirm the fields you intended to change were applied.
  2. Read the affected card again. Confirm the purchased card retains its original line item and the manual card remains unassociated.
  3. In a disposable test, submit a different line_item_id or null using REST 2027-01. Confirm the association does not change despite the accepted request.
  4. Compare Shopify's returned association with your local record. Flag mismatches instead of copying the requested ID into the record as if it were confirmed.
  5. Log the requested API version and X-Shopify-API-Version response header. For GraphQL mutations, inspect userErrors as well as transport errors.

The important migration is a change in ownership: Shopify controls which order line item originated a gift card. Remove line_item_id from REST writes, use GraphQL for supported gift card operations, and keep any separate business correlation explicitly labeled as app-owned data.

Teams without in-house Shopify developers can bring this to Lintel, my Shopify engineering studio, for Shopify API and ERP integrations.

shopifyadmin-apigift-cardsgraphqlapi-migration

Frequently asked questions

Will REST 2027-01 reject a gift card request containing line_item_id?

No. Shopify accepts the create or update request but ignores line_item_id, so a successful response does not prove that the association changed.

Can giftCardCreate or giftCardUpdate attach a card to an existing order line item?

No. Neither GraphQL mutation accepts a line-item ID, and Shopify provides no replacement API for adding, replacing, or clearing that association from outside Shopify.

Can an app still read the line item associated with a purchased gift card?

Yes. REST gift card responses can still contain line_item_id, and GraphQL exposes the GiftCard lineItem and order fields. A manually issued card has no Shopify-created order association.

Seven years of Shopify, on one page.

Roles, projects, stack and certifications are on the resume.

Resume Download PDF LinkedIn