Skip to Content
Docs
Shipping rates

Create a shipping rate

POST/shipping_rates

Headers

AuthorizationstringRequired
HTTP Basic auth: your API key as the password, with an empty username. See Authentication.
idempotency-keystring

A unique key, such as a UUID, that makes a POST safe to retry. Pay.com keeps each key for 24 hours, separately for each workspace. A retry with the same key, endpoint and body gets the first response. Another endpoint or body gets 400 idempotency_error, and a retry while the first is running gets 409.

Parameters

display_namestringRequired
amountintegerRequired
currencystringRequired

Three-letter ISO currency code, in lowercase.

countriesarray of stringsRequired

Where the rate applies (ISO 3166-1 alpha-2).

free_over_amountinteger or null

The order subtotal from which the rate is free.

delivery_estimateobject
Show 2 child parametersHide child parameters
minimumobject
Show 2 child parametersHide child parameters
unitstring

One of business_day, day or week.

valueinteger
maximumobject
Show 2 child parametersHide child parameters
unitstring

One of business_day, day or week.

valueinteger
tax_behaviorstring

exclusive adds tax to the amount, and inclusive includes it.

One of exclusive or inclusive.

tax_codestring
activeboolean

Default: true

metadataobject

Your key-value pairs. Up to 50 keys of 40 characters, with string values of up to 500 characters.

Returns

The shipping rate.

idstring
resourcestring
display_namestring
amountinteger
currencystring

Three-letter ISO currency code, in lowercase.

countriesarray of strings
free_over_amountinteger or null
delivery_estimateobject
Show 2 child attributesHide child attributes
minimumobject
Show 2 child attributesHide child attributes
unitstring

One of business_day, day or week.

valueinteger
maximumobject
Show 2 child attributesHide child attributes
unitstring

One of business_day, day or week.

valueinteger
Show 6 more attributesShow fewer attributes
tax_behaviorstring

exclusive adds tax to the amount, and inclusive includes it.

One of exclusive or inclusive.

tax_codestring or null
activeboolean
metadataobject

Your key-value pairs. Up to 50 keys of 40 characters, with string values of up to 500 characters.

createdstring
test_modeboolean

Errors

400
The request is invalid.
401
The API key is missing or wrong.
403
The key's permissions don't allow this route.
409
A request with this idempotency key is still running.
Was this page helpful?