Skip to main content
POST
TypeScript

Autorisations

Authorization
string
header
requis

An Account API key, an App API key, an account access token, an account-scoped user token, or a user OAuth token. Prepend the key or token with Bearer, for example Bearer ***************************. See Auth & API keys for how to get each one.

Scopes

shipment:create

En-têtes

Idempotency-Key
string

A unique key that makes this request safe to retry. See Idempotent requests.

Maximum string length: 255
Exemple:

"d9105228-4a08-46b1-8b91-42fed586d383"

Api-Version-Date
string

Pins the request to a dated API version.

Exemple:

"2026-11-17"

Corps

application/json
payment_id
string
requis

The payment to attach the shipment to, prefixed pay_.

Exemple:

"pay_xxxxxxxxxxxxxx"

tracking_number
string
requis

The carrier-assigned tracking number.

Exemple:

"1Z999AA10123456784"

account_id
string

The unique identifier of the account, prefixed biz_.

Exemple:

"biz_xxxxxxxxxxxxxx"

Réponse

shipment created

account_id
string
requis

The account that owns this shipment, prefixed biz_.

Exemple:

"biz_xxxxxxxxxxxxxx"

carrier
string | null
requis

The shipping carrier detected for this shipment. Null until a tracking update identifies it.

Exemple:

"ups"

checkpoints
object[]
requis
created_at
string
requis

The datetime the shipment was created (ISO 8601).

Exemple:

"2026-01-01T12:00:00.000Z"

id
string
requis

Shipment ID, prefixed ship_.

Exemple:

"ship_xxxxxxxxxxxxxx"

payment_id
string
requis

The payment this shipment fulfills, prefixed pay_.

Exemple:

"pay_xxxxxxxxxxxxxx"

status
enum<string>
requis

The current delivery status of this shipment.

Options disponibles:
unknown,
pre_transit,
in_transit,
out_for_delivery,
delivered,
available_for_pickup,
return_to_sender,
failure,
cancelled,
error
Exemple:

"in_transit"

tracking_number
string
requis

The carrier-assigned tracking number used to look up shipment progress.

Exemple:

"1Z999AA10123456784"

tracking_url
string
requis

A customer-facing URL to track this shipment's progress.

Exemple:

"https://track.aftership.com/xxxxxxxxxxxxxxxxxx"

updated_at
string
requis

The datetime the shipment was last updated (ISO 8601).

Exemple:

"2026-01-01T12:00:00.000Z"