Retrieve a list of shipping rates.
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. |
A list of shipping rates was retrieved successfully.
Pagination-Total | integer Total items count. |
Pagination-Limit | integer Items per page limit. |
Pagination-Offset | integer Pagination offset. |
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 |
createdTime | string <date-time> Read-only timestamp, automatically assigned on back-end. |
updatedTime | string <date-time> Read-only timestamp, automatically assigned on back-end. |
Unauthorized access, invalid credentials were used.
Access forbidden.
// 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));
[- {
- "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.
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 |
Shipping rate was created.
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 |
createdTime | string <date-time> Read-only timestamp, automatically assigned on back-end. |
updatedTime | string <date-time> Read-only timestamp, automatically assigned on back-end. |
Unauthorized access, invalid credentials were used.
Access forbidden.
Invalid data was sent.
{- "name": "string",
- "descriptions": "string",
- "price": 0,
- "currency": "USD",
- "filter": "deliveryAddress.country:US,CA,RU;amount:100..1000",
- "status": "active"
}
{- "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 with specified identifier string.
Shipping rate was retrieved successfully.
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 |
createdTime | string <date-time> Read-only timestamp, automatically assigned on back-end. |
updatedTime | string <date-time> Read-only timestamp, automatically assigned on back-end. |
Unauthorized access, invalid credentials were used.
Access forbidden.
Resource was not found.
const shippingRate = await api.shippingRates.get({id: 'foobar-001'}); console.log(shippingRate.fields.name);
{- "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 identifier string.
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 |
Shipping rate was updated.
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 |
createdTime | string <date-time> Read-only timestamp, automatically assigned on back-end. |
updatedTime | string <date-time> Read-only timestamp, automatically assigned on back-end. |
Shipping rate was created.
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 |
createdTime | string <date-time> Read-only timestamp, automatically assigned on back-end. |
updatedTime | string <date-time> Read-only timestamp, automatically assigned on back-end. |
Unauthorized access, invalid credentials were used.
Access forbidden.
Invalid data was sent.
{- "name": "string",
- "descriptions": "string",
- "price": 0,
- "currency": "USD",
- "filter": "deliveryAddress.country:US,CA,RU;amount:100..1000",
- "status": "active"
}
{- "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 with predefined identifier string.
Shipping rate was deleted.
Unauthorized access, invalid credentials were used.
Access forbidden.
Resource was not found.
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
{- "status": 401,
- "title": "string",
- "detail": "string",
- "instance": "string"
}