Add and remove shipping lines with new mutations on the order editing API
API
Effective February 29, 2024
As of GraphQL Admin API version 2024-04
, you can add new shipping lines or remove existing shipping lines when editing an order. You can also continue to query removed shipping lines.
The mutation orderEditAddShippingLine
allows you to add a new, custom shipping line to an existing order.
The mutation orderEditRemoveShippingLine
allows you to remove existing shipping lines from an order.
The mutation orderEditUpdateShippingLine
allows you to update the attributes of a newly added shipping line before committing the order edit.
The new field shippingLine.isRemoved
allows you to determine whether a shipping line has been removed.
The new parameter includeRemovals
on the connection order.shippingLines
allows you to query removed shipping lines. The default value for this parameter is false, so removed shipping lines will not be returned by default.
For REST API users, removed shipping lines will continue to be returned in the payload of the Order resource. As of API version 2024-04
, you can determine whether a shipping line has been removed by checking the value of the new attribute is_removed
.
For consumers of Order webhooks, removed shipping lines will also continue to be returned in the payload. As of API version 2024-04
, the payload for shipping lines will have a new key is_removed
. You can consume the order/edit
webhook to be notified when shipping lines have been added or removed from an order.
For more information about editing shipping lines, visit the tutorial on editing an existing order with the Admin API.