For the complete documentation index, see llms.txt. This page is also available as Markdown.

Partially update a shipping option

Updates one or more fields of a shipping option. Only the fields included in the request body are changed.

patch
/shipping_options/{id}/
Authorizations
AuthorizationstringRequired

Token credential sent in the Authorization header, in the form: Token <your-token>. Requires a staff (admin) account.

Path parameters
idintegerRequired

The unique identifier of the shipping option.

Body

Fields for creating or updating a shipping option.

namestringRequired

Display name of the shipping option.

slugstringRequired

URL-friendly unique identifier. Must be unique across all shipping options.

Example: free-shipping
is_activebooleanOptional

Whether the shipping option is active.

Default: true
calculatorobjectRequired

Calculator configuration. The object must contain a slug key identifying the calculator. See the Shipping Rules & Calculators guide for available calculators and their parameters.

Example: {"slug":"amount-based-calculator","amounts":[{"min_amount":"0.00","max_amount":"100.00","shipping_amount":"9.99"},{"min_amount":"100.00","max_amount":null,"shipping_amount":"0.00"}]}
ruleobjectRequired

Rule configuration. The object must contain a slug key identifying the rule. Send {} to apply AnyRule (all baskets are eligible). See the Shipping Rules & Calculators guide for available rules and their parameters.

sort_orderintegerOptional

Sort order. Lower values appear first.

Default: 0
descriptionstring · nullableOptional

Optional description of the shipping option.

delivery_typestring · enum · nullableOptional

Delivery type of the shipping option.

Possible values:
Responses
200

The updated shipping option.

application/json

A shipping option returned by the API.

pkintegerRead-onlyRequired

Unique identifier of the shipping option.

namestringRequired

Display name. Returned in the active request language, falling back to the default language.

slugstringRequired

URL-friendly unique identifier.

Example: free-shipping
is_activebooleanRequired

Whether the shipping option is active. Inactive options are hidden from the storefront.

Default: true
calculatorobjectRequired

Calculator configuration. Determines how the shipping cost is computed.

The object must contain at minimum a slug key identifying the calculator. See the Shipping Rules & Calculators guide for available calculators and their parameters.

Example: {"slug":"amount-based-calculator","amounts":[{"min_amount":"0.00","max_amount":"100.00","shipping_amount":"9.99"},{"min_amount":"100.00","max_amount":null,"shipping_amount":"0.00"}]}
ruleobjectRequired

Rule configuration. Determines which baskets are eligible for this shipping option.

The object must contain a slug key identifying the rule. The name key is optional. Send {} to apply AnyRule (all baskets are eligible). See the Shipping Rules & Calculators guide for available rules and their parameters.

Example: {"slug":"any-rule"}
sort_orderintegerRequired

Sort order used when listing options. Lower values appear first.

Default: 0
descriptionstring · nullableOptional

Optional description of the shipping option.

patch/shipping_options/{id}/
PATCH /api/remote/1/shipping_options/{id}/ HTTP/1.1
Host: sandbox.akinon.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 129

{
  "name": "Free Shipping",
  "slug": "free-shipping",
  "is_active": true,
  "calculator": {
    "slug": "free-calculator"
  },
  "rule": {},
  "sort_order": 0
}
{
  "pk": 1,
  "name": "Free Shipping",
  "slug": "free-shipping",
  "is_active": true,
  "calculator": {
    "slug": "free-calculator"
  },
  "rule": {
    "slug": "any-rule"
  },
  "sort_order": 0,
  "description": null,
  "kwargs": {
    "required_fields": []
  },
  "delivery_type": {
    "value": "standard",
    "label": "Standard"
  }
}

Last updated

Was this helpful?