Shipping Rates

Retrieve a list of shipping rates

Retrieve a list of shipping rates.

Request
Security:
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.

header Parameters
Organization-Id
string (ResourceId) <= 50 characters
Deprecated

Organization identifier in scope of which need to perform request (if not specified, the default organization will be used).

It is deprecated. Use servers with /organizations/{organizationId} base path instead.

Example: 4f6cf35x-2c4y-483z-a0a9-158621f77a21
Responses
200

A list of shipping rates was retrieved successfully.

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.

Request
Security:
header Parameters
Organization-Id
string (ResourceId) <= 50 characters
Deprecated

Organization identifier in scope of which need to perform request (if not specified, the default organization will be used).

It is deprecated. Use servers with /organizations/{organizationId} base path instead.

Example: 4f6cf35x-2c4y-483z-a0a9-158621f77a21
Request Body schema: application/json

Shipping rate resource.

name
required
string

The shipping rate name.

descriptions
string

The shipping rate description.

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.

filter
string
Default: ""

A filter based on the invoice's properties which is used to determine when the rate is applicable. Empty filter will match any case.

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.

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.

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

The resource identifier string.

header Parameters
Organization-Id
string (ResourceId) <= 50 characters
Deprecated

Organization identifier in scope of which need to perform request (if not specified, the default organization will be used).

It is deprecated. Use servers with /organizations/{organizationId} base path instead.

Example: 4f6cf35x-2c4y-483z-a0a9-158621f77a21
Responses
200

Shipping rate was retrieved successfully.

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.

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

The resource identifier string.

header Parameters
Organization-Id
string (ResourceId) <= 50 characters
Deprecated

Organization identifier in scope of which need to perform request (if not specified, the default organization will be used).

It is deprecated. Use servers with /organizations/{organizationId} base path instead.

Example: 4f6cf35x-2c4y-483z-a0a9-158621f77a21
Request Body schema: application/json

Shipping rate resource.

name
required
string

The shipping rate name.

descriptions
string

The shipping rate description.

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.

filter
string
Default: ""

A filter based on the invoice's properties which is used to determine when the rate is applicable. Empty filter will match any case.

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.

201

Shipping rate was created.

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.

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

The resource identifier string.

header Parameters
Organization-Id
string (ResourceId) <= 50 characters
Deprecated

Organization identifier in scope of which need to perform request (if not specified, the default organization will be used).

It is deprecated. Use servers with /organizations/{organizationId} base path instead.

Example: 4f6cf35x-2c4y-483z-a0a9-158621f77a21
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": 400,
  • "title": "string",
  • "detail": "string",
  • "error": "string"
}