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

Create a shipping option

Creates a new shipping option.

The slug must be unique across all shipping options. If it already exists, the request fails.

To make the option eligible for all baskets, send rule as an empty object ({}); the server will apply AnyRule automatically.

post
/shipping_options/
Authorizations
AuthorizationstringRequired

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

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
201

The created 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.

post/shipping_options/
POST /api/remote/1/shipping_options/ 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?