Skip to main content
POST
/
shipments
JavaScript
import Whopsdk from 'whopsdk';

const client = new Whopsdk({
  apiKey: 'My API Key',
});

const shipment = await client.shipments.create({
  company_id: 'biz_xxxxxxxxxxxxxx',
  payment_id: 'pay_xxxxxxxxxxxxxx',
  tracking_code: 'tracking_code',
});

console.log(shipment.id);
{
  "id": "ship_xxxxxxxxxxxxx",
  "created_at": 1701406800,
  "status": "unknown",
  "substatus": "address_correction",
  "tracking_code": "<string>",
  "updated_at": 1701406800,
  "carrier": "accurate",
  "service": "<string>",
  "delivery_estimate": 1701406800,
  "payment": {
    "id": "pay_xxxxxxxxxxxxxx"
  }
}

Authorizations

Authorization
string
header
required

The app API key from an app from the /dashboard/developer page

Body

application/json

Parameters for CreateShipment

company_id
string
required

The ID of the bot to create the shipment for

Example:

"biz_xxxxxxxxxxxxxx"

payment_id
string
required

The ID of the payment to create the shipment for

Example:

"pay_xxxxxxxxxxxxxx"

tracking_code
string
required

The tracking code for the shipment

Response

A successful response

A shipment

id
string
required

The ID of the shipment

Example:

"ship_xxxxxxxxxxxxx"

created_at
integer
required

The date and time the shipment was created

Example:

1701406800

status
enum<string>
required

The status of the shipment

Available options:
unknown,
pre_transit,
in_transit,
out_for_delivery,
delivered,
available_for_pickup,
return_to_sender,
failure,
cancelled,
error
substatus
enum<string> | null
required

The substatus of the shipment The substatus of a shipment

Available options:
address_correction,
arrived_at_destination,
arrived_at_facility,
arrived_at_pickup_location,
awaiting_information,
substatus_cancelled,
damaged,
delayed,
delivery_exception,
departed_facility,
departed_origin_facility,
expired,
substatus_failure,
held,
substatus_in_transit,
label_created,
lost,
missorted,
substatus_out_for_delivery,
received_at_destination_facility,
received_at_origin_facility,
refused,
return,
status_update,
transferred_to_destination_carrier,
transit_exception,
substatus_unknown,
weather_delay
tracking_code
string
required

The tracking code of the shipment

updated_at
integer
required

The date and time the shipment was last updated

Example:

1701406800

carrier
enum<string>
required

The carrier of the shipment

Available options:
accurate,
amazon_mws,
amazon_shipping,
apc,
asendia_usa,
australia_post,
axlehire_v3,
better_trucks,
canada_post,
canpar,
columbus_last_mile,
chronopost,
cloud_sort,
courier_express,
couriers_please,
cs_logistics,
dai_post,
deutsche_post_uk,
deutsche_post,
dhl_ecommerce_asia,
dhl_ecs,
dhl_express,
dhl_paket,
door_dash,
dpd_nl,
dpd_uk,
dpd,
epost_global,
estafeta,
evri,
fastway,
fedex_cross_border,
fedex_default,
fedex_mailview,
fedex_smartpost,
fedex,
first_choice,
first_mile,
flexport,
gio,
gio_express,
gso,
hailify,
henry,
interlink_express,
jet,
kuroneko_yamato,
la_post,
lasership_v2,
loomis_express,
lso,
ontrac,
optima,
osm_worldwide,
parcelforce,
parcll,
passport_global,
post_nl,
purolator,
quick,
royal_mail,
omni_parcel,
sendle,
sf_express,
smart_kargo,
sonic,
spee_dee,
swyft,
tforce,
uds,
ups_iparcel,
ups_mail_innovations,
ups,
usps,
veho,
yanwen
service
string | null
required

The service of the shipment

delivery_estimate
integer | null
required

The delivery estimate of the shipment

Example:

1701406800

payment
object
required

The payment of the shipment

I