POST
Create a shipping rate

Authorizations

Authorization
string
header
required

A secret API key. Publishable keys cannot reach this API. A key may carry an expiry, and an expired key is refused exactly like an unknown one, with a 401 that names no reason; check the key's expires_at in the dashboard rather than inferring it from a response. When a merchant rolls a key's secret they choose a grace window of up to 3 days, and for its duration BOTH the new secret and the one it replaced authenticate, so an integration moves over on its own deploy schedule instead of at the instant the button is pressed. Move before the window closes: after it, the old secret is refused. Nothing else about this contract moves with a roll. The key keeps its id and its scopes, so the only thing an integration updates is the credential itself.

Headers

Idempotency-Key
string
required

A unique key per logical write. Replaying a request with the same key returns the first response byte for byte instead of applying the write twice.

Body

application/json

amount_minor is an INTEGER in the store's default currency's minor units, and it is required rather than defaulted: a missing amount treated as 0 would mint a free shipping rate indistinguishable from a deliberate one. Send 0 for genuinely free shipping. There is no currency_code: a shipping option carries no currency of its own, and the amount is converted into the shopper's currency at cart time by the same code checkout charges through, so naming one here would mislabel the number rather than change it.

name
string
required

What the shopper sees beside the rate at checkout. Required and non-blank.

amount_minor
integer
required

The flat rate, in the store default currency's minor units. The upper bound sits well below the integer maximum so an order total built from it cannot overflow.

Required range: 0 <= x <= 1000000000000
is_active
boolean

Defaults to true. Setting it false stages a rate the merchant can switch on later, and it is also the REVERSIBLE way to retire one.

region_id
string | null

The destination region this rate applies to. Absent or null means GLOBAL, offered everywhere, which is the only spelling for "any destination". A region-bound rate is refused at every other destination, including an unknown one.

Response

Created

data
object