Shipping Options API Routes
A shipping option is a way of shipping an item to or from the customer.
Shipping options are associated with the fulfillment provider used to handle their fulfillment.
Shipping options can be restricted geographically by service zones, and by custom rules, such as an item's weight or the customer's group.
These API routes allow admins to manage shipping options.
GET /admin/shipping-options#
List Shipping Options
Retrieve a list of shipping options. The shipping options can be filtered by fields such as id. The shipping options can also be sorted or paginated.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Query parameters
fieldsstringOptional+ it will be added to the default fields, using - will remove it from the default fields. without prefix it will replace the entire default fields.offsetnumberOptionallimitnumberOptionalorderstringOptional-.idstring | string[]OptionalqstringOptionalservice_zone_idstring | string[]Optionalshipping_profile_idstring | string[]Optionalprovider_idstring | string[]Optionalshipping_option_type_idstring | string[]Optionalcreated_atobjectOptionalupdated_atobjectOptionaldeleted_atobjectOptionalstock_location_idstring | string[]Optionalis_returnbooleanOptionaladmin_onlybooleanOptionalwith_deletedbooleanOptionalRequest examples
Responses
200 OK
limitnumberoffsetnumbercountnumbershipping_optionsobject[]400, 401, 404, 409, 422, 500: an error response is returned.
POST /admin/shipping-options#
Create Shipping Option
Create a shipping option.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Query parameters
fieldsstringOptional+ it will be added to the default fields, using - will remove it from the default fields. without prefix it will replace the entire default fields.Request body (application/json)
namestringservice_zone_idstringshipping_profile_idstringdataobjectOptionalprice_type"flat" | "calculated"flat, the shipping option has a fixed price set in prices. Otherwise, the shipping option's price is calculated by the fulfillment provider.provider_idstringtypeobjectOptionalThe shipping option type's details.
typeobjectOptionalpricesobject[]OptionalThe shipping option's prices.
pricesobject[]Optionaltype_idstringOptionalrulesobject[]OptionalThe shipping option's rules.
rulesobject[]OptionalmetadataobjectOptionalRequest examples
Responses
200 OK
shipping_optionobjectThe shipping option's details.
shipping_optionobject400, 401, 404, 409, 422, 500: an error response is returned.
Emitted events
shipping-option.created: Emitted when shipping options are created.
GET /admin/shipping-options/{id}#
Get a Shipping Option
Retrieve a shipping option by its ID. You can expand the shipping option's relations or select the fields that should be returned.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Path parameters
idstringQuery parameters
fieldsstringOptional+ it will be added to the default fields, using - will remove it from the default fields.
without prefix it will replace the entire default fields.Request examples
Responses
200 OK
shipping_optionobjectThe shipping option's details.
shipping_optionobject400, 401, 404, 409, 422, 500: an error response is returned.
POST /admin/shipping-options/{id}#
Update a Shipping Option
Update a shipping option's details.
When you provide the prices array, it replaces the shipping option's existing flat-rate prices:
- A price with a matching
idis updated. - A price without an
idis created - Any existing price whose
idisn't included in the array is deleted.
The rules you provide for a price similarly replace that price's existing rules, so omit a rule to remove it.
Omitting the prices property entirely leaves the existing prices unchanged, whereas setting price_type to calculated removes all flat-rate prices.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Path parameters
idstringQuery parameters
fieldsstringOptional+ it will be added to the default fields, using - will remove it from the default fields. Without prefix it will replace the entire default fields.Request body (application/json)
namestringOptionaldataobjectOptionalprice_type"flat" | "calculated"Optionalprovider_idstringOptionalshipping_profile_idstringOptionaltypeobjectOptionalThe shipping option type's details.
typeobjectOptionaltype_idstringOptionalpricesobject[]OptionalThe shipping option's prices. This array replaces the shipping option's existing prices - a price with a matching id is updated, a price without an id is created, and any existing price whose id isn't included is deleted. Omit this property to leave the existing prices unchanged.
pricesobject[]Optionalrulesobject[]OptionalThe shipping option's rules.
rulesobject[]OptionalmetadataobjectOptionalRequest examples
Responses
200 OK
shipping_optionobjectThe shipping option's details.
shipping_optionobject400, 401, 404, 409, 422, 500: an error response is returned.
Emitted events
shipping-option.updated: Emitted when shipping options are updated.
DELETE /admin/shipping-options/{id}#
Delete a Shipping Option
Delete a shipping option.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Path parameters
idstringRequest examples
Responses
200 OK
idstringobjectstringDefault: "shipping_option"
deletedboolean400, 401, 404, 409, 422, 500: an error response is returned.
Emitted events
shipping-option.deleted: Emitted when shipping options are deleted.
POST /admin/shipping-options/{id}/rules/batch#
Manage the Rules of a Shipping Option
Manage the rules of a shipping option to create, update, or delete them.
Authentication: secret API key (HTTP Basic authorization), cookie session, JWT bearer token.
Path parameters
idstringQuery parameters
fieldsstringOptional+ it will be added to the default fields, using - will remove it from the default fields. without prefix it will replace the entire default fields.Request body (application/json)
createobject[]OptionalThe shipping option rules to create.
createobject[]Optionalupdateobject[]OptionalThe shipping option rules to update.
updateobject[]Optionaldeletestring[]OptionalRequest examples
Responses
200 OK
createdobject[]The created shipping option rules.
createdobject[]updatedobject[]The updated shipping option rules.
updatedobject[]deletedobjectThe details of the deleted shipping option rules.
deletedobject400, 401, 404, 409, 422, 500: an error response is returned.