Buy a label
POST
/shipments/{id}/buy
const url = 'https://shipjay.com/api/v1/shipments/example/buy';const options = { method: 'POST', headers: { 'Idempotency-Key': 'example', Authorization: 'Bearer <token>', 'Content-Type': 'application/json' }, body: '{"rate_id":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://shipjay.com/api/v1/shipments/example/buy \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --header 'Idempotency-Key: example' \ --data '{ "rate_id": "example" }'Spends wallet money on the chosen rate. Requires an Idempotency-Key header: repeating the request with the same key never buys twice. Subject to the key’s per purchase and daily spending limits, the organization’s daily limit and its wallet balance.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
string
Header Parameters
Section titled “Header Parameters”Idempotency-Key
required
string
A unique value (8 to 200 characters) for this operation. Repeating the request with the same key returns the first result.
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
rate_id
required
string
Example generated
{ "rate_id": "example"}Responses
Section titled “Responses”Success.
Media typeapplication/json
object
shipment_id
required
string
status
required
string
tracking_code
required
string | null
balance_after_cents
required
number | null
duplicate
required
boolean
Example
{ "status": "purchased"}Missing or invalid API key.
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details
object
key
additional properties
any
request_id
required
string
Example
{ "error": { "code": "validation" }}The key lacks the required permission, or the account is suspended.
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details
object
key
additional properties
any
request_id
required
string
Example
{ "error": { "code": "validation" }}The resource does not exist.
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details
object
key
additional properties
any
request_id
required
string
Example
{ "error": { "code": "validation" }}The request is not valid. error.details.issues lists the problems.
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details
object
key
additional properties
any
request_id
required
string
Example
{ "error": { "code": "validation" }}Too many requests. Wait Retry-After seconds.
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details
object
key
additional properties
any
request_id
required
string
Example
{ "error": { "code": "validation" }}© 2026 Ship Jay. All rights reserved. Created & Developed by WCWS Internet
