Gift Card line_item_id will become read-only in REST Admin API version 2027-01
- Announced
- Tags
- Admin-REST-API
- Severity
- breaking, set by
reef/rss-rule-v1 - Source
- https://shopify.dev/changelog/rest-gift-card-line_item_id-will-become-read-only-in-api-version-2027-01
In REST Admin API version 2027-01 and later, the line_item_id property on the Gift Card resource is read-only. Shopify ignores the property in create and update requests. Remove it from those requests before you upgrade.
What changed
In REST Admin API version 2027-01 and later, apps can't add, replace, or clear a gift card's line-item association through Gift Card create or update requests. Shopify ignores any line_item_id value in those requests.
Gift Card responses still include existing line-item and order associations. Earlier API versions keep their current behavior.
Who's affected
This change affects you if all of the following are true:
- Your app uses the REST Admin API Gift Card resource.
- Your app includes
line_item_idwhen it creates or updates gift cards. - You plan to upgrade your app to API version 2027-01 or later.
If your app only reads line_item_id from Gift Card responses, or stays on an API version earlier than 2027-01, then this change doesn't affect you.
Why this matters
A gift card's line-item association records the order line item that created the gift card. Making line_item_id read-only stops apps from changing the link between a gift card and its order.
Breaking changes and migrations
In REST Admin API version 2027-01 and later, Shopify accepts create and update requests that include line_item_id and ignores the property. The gift card keeps its existing line-item association.
Before you upgrade to API version 2027-01:
- Find the REST Gift Card create and update calls that send
line_item_id. - Remove
line_item_idfrom those request payloads. - If your app needs the existing association, then keep reading
line_item_idfrom Gift Card responses.
There isn't a replacement API for adding, replacing, or clearing a gift card's line-item association from outside Shopify.
To confirm the migration:
- Send a create or update request without
line_item_id. - Read the same gift card, and check that its
line_item_idvalue didn't change.
Action required
Before you move production traffic to REST Admin API version 2027-01 or later, stop sending line_item_id in Gift Card create and update requests. Otherwise, your app's records might not match Shopify's, because Shopify keeps the original association.
Related docs
The text above is the source's. reef added the severity, the dates it could read from the text, and the endpoints and scopes named in code.