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

Register an easy return shipping company

Registers a carrier for return collection.

Send every field of the request body, including is_active, start_date_gap and duration. Those three carry defaults on the stored record, but the create operation reads all of them from the request: if any one is left out, the record is not created and the request fails.

The combination of shipping_company and rules must not already exist. If it does, the request is rejected with Easy return shipping company already exists.

post
/easy_return_shipping_companies/
Authorizations
AuthorizationstringRequired

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

Body

Request body for registering or fully updating an easy return shipping company. Every field is read from the request on both operations; leaving any one out fails the request.

The length limits on prefix and name are applied when the record is stored rather than during request validation, so a longer value prevents the record from being saved.

shipping_companystringRequired

Carrier code, sent in lower case (for example ups). Codes are case-sensitive. See the Supported Carriers section for the carriers that have a return-collection integration.

Example: ups
prefixstring · max: 6Required

Prefix added to the return codes issued for this carrier. Send an empty string for no prefix.

Example: RET
namestring · max: 128Required

Name used to tell records of the same carrier apart. Send an empty string to leave it blank.

Example: UPS — Oversized Items
is_activebooleanRequired

Whether the carrier is offered for return collection.

Default: true
start_date_gapintegerRequired

Number of days after a return code is issued before its collection window opens.

Default: 0Example: 0
durationintegerRequired

Number of days the collection window stays open.

Default: 14Example: 14
Responses
201

The registered easy return shipping company.

application/json

An easy return shipping company returned by the API.

pkintegerRead-onlyRequired

Unique identifier of the easy return shipping company.

is_activebooleanRequired

Whether the carrier is offered for return collection. Deactivated records are retained and still listed.

Default: true
start_date_gapintegerRequired

Number of days after a return code is issued before its collection window opens. 0 means the code is valid immediately.

Default: 0Example: 0
durationintegerRequired

Number of days the collection window stays open, counted from its start.

Default: 14Example: 14
prefixstring · max: 6Required

Prefix added to the return codes issued for this carrier. May be an empty string.

Example: RET
namestring · max: 128 · nullableRequired

Name used to tell records of the same carrier apart. May be an empty string.

Example: UPS — Oversized Items
post/easy_return_shipping_companies/
POST /api/v1/remote/1/easy_return_shipping_companies/ HTTP/1.1
Host: sandbox.akinon.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 362

{
  "shipping_company": "ups",
  "auth": {
    "url": "https://carrier.example.com/service",
    "customer_code": "123456",
    "username": "akinon",
    "password": "secret"
  },
  "prefix": "RET",
  "rules": {
    "package_rule": "product",
    "product": {
      "field_key": "attributes__size",
      "field_values": [
        [
          "XL",
          "L"
        ]
      ]
    },
    "max_count": 5
  },
  "name": "UPS — Oversized Items",
  "is_active": true,
  "start_date_gap": 0,
  "duration": 14
}
{
  "pk": 1,
  "shipping_company": {
    "value": "ups",
    "label": "UPS"
  },
  "auth": {
    "url": "https://carrier.example.com/service",
    "customer_code": "123456",
    "username": "akinon",
    "password": "secret"
  },
  "is_active": true,
  "start_date_gap": 0,
  "duration": 14,
  "prefix": "RET",
  "rules": {
    "package_rule": "product",
    "product": {
      "field_key": "attributes__size",
      "field_values": [
        [
          "XL",
          "L"
        ]
      ]
    },
    "max_count": 5
  },
  "name": "UPS — Oversized Items"
}

Last updated

Was this helpful?