Shipping rates

A shipping rate contains a filter and a pricing for a specific shipping destination.

Retrieve a list of shipping rates

Retrieve a list of shipping rates.

SecuritySecretApiKey or JWT
Request
query Parameters
limit
integer [ 0 .. 1000 ]

The collection items limit.

offset
integer >= 0

The collection items offset.

filter
string

The collection items filter requires a special format. Use "," for multiple allowed values. Use ";" for multiple fields. See the filter guide for more options and examples about this format.

sort
Array of strings

The collection items sort field and order (prefix with "-" for descending sort).

q
string

The partial search of the text fields.

Responses
200

A list of shipping rates was retrieved successfully.

Response Headers
Pagination-Total
integer

Total items count.

Pagination-Limit
integer

Items per page limit.

Pagination-Offset
integer

Pagination offset.

Response Schema: application/json
Array
name
required
string

The shipping rate name.

price
required
number <double>

The shipping rate price - 0 is a valid value (for free).

currency
required
string 3 characters

ISO 4217 alphabetic currency code.

id
string <= 50 characters

The resource ID. Defaults to UUID v4.

descriptions
string

The shipping rate description.

filter
string
Default: ""

This follows our standard filter format. See the filter guide for more options and examples about this format.

status
string
Default: "active"

If inactive, the shipping rate will not be matched in any case.

Enum: "active" "inactive"
createdTime
string <date-time>

Read-only timestamp, automatically assigned on back-end.

updatedTime
string <date-time>

Read-only timestamp, automatically assigned on back-end.

401

Unauthorized access, invalid credentials were used.

403

Access forbidden.

get/shipping-rates
Request samples
// all parameters are optional
const firstCollection = await api.shippingRates.getAll();

// alternatively you can specify one or more of them
const params = {limit: 20, offset: 100, sort: '-createdTime'};
const secondCollection = await api.shippingRates.getAll(params);

// access the collection items, each item is a ShippingRate
secondCollection.items.forEach(shippingRate => console.log(shippingRate.fields.name));
Response samples
application/json
[
  • {
    }
]

Create a shipping rate

Create a shipping rate.

SecuritySecretApiKey or JWT
Request
Request Body schema: application/json

Shipping rate resource.

name
required
string

The shipping rate name.

price
required
number <double>

The shipping rate price - 0 is a valid value (for free).

currency
required
string 3 characters

ISO 4217 alphabetic currency code.

descriptions
string

The shipping rate description.

filter
string
Default: ""

This follows our standard filter format. See the filter guide for more options and examples about this format.

status
string
Default: "active"

If inactive, the shipping rate will not be matched in any case.

Enum: "active" "inactive"
Responses
201

Shipping rate was created.

Response Schema: application/json
name
required
string

The shipping rate name.

price
required
number <double>

The shipping rate price - 0 is a valid value (for free).

currency
required
string 3 characters

ISO 4217 alphabetic currency code.

id
string <= 50 characters

The resource ID. Defaults to UUID v4.

descriptions
string

The shipping rate description.

filter
string
Default: ""

This follows our standard filter format. See the filter guide for more options and examples about this format.

status
string
Default: "active"

If inactive, the shipping rate will not be matched in any case.

Enum: "active" "inactive"
createdTime
string <date-time>

Read-only timestamp, automatically assigned on back-end.

updatedTime
string <date-time>

Read-only timestamp, automatically assigned on back-end.

401

Unauthorized access, invalid credentials were used.

403

Access forbidden.

422

Invalid data was sent.

post/shipping-rates
Request samples
application/json
{
  • "name": "string",
  • "descriptions": "string",
  • "price": 0,
  • "currency": "USD",
  • "filter": "deliveryAddress.country:US,CA,RU;amount:100..1000",
  • "status": "active"
}
Response samples
application/json
{
  • "id": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
  • "name": "string",
  • "descriptions": "string",
  • "price": 0,
  • "currency": "USD",
  • "filter": "deliveryAddress.country:US,CA,RU;amount:100..1000",
  • "status": "active",
  • "createdTime": "2019-08-24T14:15:22Z",
  • "updatedTime": "2019-08-24T14:15:22Z"
}

Retrieve a shipping rate

Retrieve a shipping rate with specified identifier string.

SecuritySecretApiKey or JWT
Request
path Parameters
id
required
string <= 50 characters ^[@~\-\.\w]+$

The resource identifier string.

Responses
200

Shipping rate was retrieved successfully.

Response Schema: application/json
name
required
string

The shipping rate name.

price
required
number <double>

The shipping rate price - 0 is a valid value (for free).

currency
required
string 3 characters

ISO 4217 alphabetic currency code.

id
string <= 50 characters

The resource ID. Defaults to UUID v4.

descriptions
string

The shipping rate description.

filter
string
Default: ""

This follows our standard filter format. See the filter guide for more options and examples about this format.

status
string
Default: "active"

If inactive, the shipping rate will not be matched in any case.

Enum: "active" "inactive"
createdTime
string <date-time>

Read-only timestamp, automatically assigned on back-end.

updatedTime
string <date-time>

Read-only timestamp, automatically assigned on back-end.

401

Unauthorized access, invalid credentials were used.

403

Access forbidden.

404

Resource was not found.

get/shipping-rates/{id}
Request samples
const shippingRate = await api.shippingRates.get({id: 'foobar-001'});
console.log(shippingRate.fields.name);
Response samples
application/json
{
  • "id": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
  • "name": "string",
  • "descriptions": "string",
  • "price": 0,
  • "currency": "USD",
  • "filter": "deliveryAddress.country:US,CA,RU;amount:100..1000",
  • "status": "active",
  • "createdTime": "2019-08-24T14:15:22Z",
  • "updatedTime": "2019-08-24T14:15:22Z"
}

Create a shipping rate with predefined ID

Create a shipping rate with predefined identifier string.

SecuritySecretApiKey or JWT
Request
path Parameters
id
required
string <= 50 characters ^[@~\-\.\w]+$

The resource identifier string.

Request Body schema: application/json

Shipping rate resource.

name
required
string

The shipping rate name.

price
required
number <double>

The shipping rate price - 0 is a valid value (for free).

currency
required
string 3 characters

ISO 4217 alphabetic currency code.

descriptions
string

The shipping rate description.

filter
string
Default: ""

This follows our standard filter format. See the filter guide for more options and examples about this format.

status
string
Default: "active"

If inactive, the shipping rate will not be matched in any case.

Enum: "active" "inactive"
Responses
200

Shipping rate was updated.

Response Schema: application/json
name
required
string

The shipping rate name.

price
required
number <double>

The shipping rate price - 0 is a valid value (for free).

currency
required
string 3 characters

ISO 4217 alphabetic currency code.

id
string <= 50 characters

The resource ID. Defaults to UUID v4.

descriptions
string

The shipping rate description.

filter
string
Default: ""

This follows our standard filter format. See the filter guide for more options and examples about this format.

status
string
Default: "active"

If inactive, the shipping rate will not be matched in any case.

Enum: "active" "inactive"
createdTime
string <date-time>

Read-only timestamp, automatically assigned on back-end.

updatedTime
string <date-time>

Read-only timestamp, automatically assigned on back-end.

201

Shipping rate was created.

Response Schema: application/json
name
required
string

The shipping rate name.

price
required
number <double>

The shipping rate price - 0 is a valid value (for free).

currency
required
string 3 characters

ISO 4217 alphabetic currency code.

id
string <= 50 characters

The resource ID. Defaults to UUID v4.

descriptions
string

The shipping rate description.

filter
string
Default: ""

This follows our standard filter format. See the filter guide for more options and examples about this format.

status
string
Default: "active"

If inactive, the shipping rate will not be matched in any case.

Enum: "active" "inactive"
createdTime
string <date-time>

Read-only timestamp, automatically assigned on back-end.

updatedTime
string <date-time>

Read-only timestamp, automatically assigned on back-end.

401

Unauthorized access, invalid credentials were used.

403

Access forbidden.

422

Invalid data was sent.

put/shipping-rates/{id}
Request samples
application/json
{
  • "name": "string",
  • "descriptions": "string",
  • "price": 0,
  • "currency": "USD",
  • "filter": "deliveryAddress.country:US,CA,RU;amount:100..1000",
  • "status": "active"
}
Response samples
application/json
{
  • "id": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
  • "name": "string",
  • "descriptions": "string",
  • "price": 0,
  • "currency": "USD",
  • "filter": "deliveryAddress.country:US,CA,RU;amount:100..1000",
  • "status": "active",
  • "createdTime": "2019-08-24T14:15:22Z",
  • "updatedTime": "2019-08-24T14:15:22Z"
}

Delete a shipping rate

Delete a shipping rate with predefined identifier string.

SecuritySecretApiKey or JWT
Request
path Parameters
id
required
string <= 50 characters ^[@~\-\.\w]+$

The resource identifier string.

Responses
204

Shipping rate was deleted.

401

Unauthorized access, invalid credentials were used.

403

Access forbidden.

404

Resource was not found.

delete/shipping-rates/{id}
Request samples
const request = await api.shippingRates.delete({id: 'my-second-key'});

// the request does not return any fields but
// you can confirm the success using the status code
console.log(request.response.status); // 204
Response samples
application/json
{
  • "status": 401,
  • "title": "string",
  • "detail": "string",
  • "instance": "string"
}