Skip to main content
POST
/
shipments
Create shipment
curl --request POST \
  --url https://api.whop.com/api/v1/shipments \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "company_id": "biz_xxxxxxxxxxxxxx",
  "payment_id": "pay_xxxxxxxxxxxxxx",
  "tracking_code": "<string>"
}
'
import requests

url = "https://api.whop.com/api/v1/shipments"

payload = {
"company_id": "biz_xxxxxxxxxxxxxx",
"payment_id": "pay_xxxxxxxxxxxxxx",
"tracking_code": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
company_id: 'biz_xxxxxxxxxxxxxx',
payment_id: 'pay_xxxxxxxxxxxxxx',
tracking_code: '<string>'
})
};

fetch('https://api.whop.com/api/v1/shipments', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.whop.com/api/v1/shipments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'company_id' => 'biz_xxxxxxxxxxxxxx',
'payment_id' => 'pay_xxxxxxxxxxxxxx',
'tracking_code' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.whop.com/api/v1/shipments"

payload := strings.NewReader("{\n \"company_id\": \"biz_xxxxxxxxxxxxxx\",\n \"payment_id\": \"pay_xxxxxxxxxxxxxx\",\n \"tracking_code\": \"<string>\"\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.whop.com/api/v1/shipments")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"company_id\": \"biz_xxxxxxxxxxxxxx\",\n \"payment_id\": \"pay_xxxxxxxxxxxxxx\",\n \"tracking_code\": \"<string>\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.whop.com/api/v1/shipments")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"company_id\": \"biz_xxxxxxxxxxxxxx\",\n \"payment_id\": \"pay_xxxxxxxxxxxxxx\",\n \"tracking_code\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body
{
  "created_at": "2023-12-01T05:00:00.401Z",
  "delivery_estimate": "2023-12-01T05:00:00.401Z",
  "id": "ship_xxxxxxxxxxxxx",
  "payment": {
    "id": "pay_xxxxxxxxxxxxxx"
  },
  "service": "Priority",
  "tracking_code": "9400111899223456789012",
  "updated_at": "2023-12-01T05:00:00.401Z"
}
{
"error": {
"code": "parameter_missing",
"message": "Missing required parameter: amount.",
"param": "amount",
"type": "invalid_request_error"
}
}
{
"error": {
"message": "Invalid or missing API key",
"type": "unauthorized"
}
}
{
"error": {
"message": "You do not have permission to access this resource",
"type": "forbidden"
}
}
{
"error": {
"message": "Resource not found",
"type": "not_found"
}
}
{
"error": null
}
{
"error": null
}
{
"error": {
"message": "An unexpected error occurred",
"type": "internal_server_error"
}
}

Authorizations

Authorization
string
header
required

A company API key, company scoped JWT, app API key, or user OAuth token. You must prepend your key/token with the word 'Bearer', which will look like Bearer ***************************

Body

application/json

Parameters for CreateShipment

company_id
string
required

The unique identifier of the company to create the shipment for, starting with 'biz_'.

Example:

"biz_xxxxxxxxxxxxxx"

payment_id
string
required

The unique identifier of the payment to associate the shipment with.

Example:

"pay_xxxxxxxxxxxxxx"

tracking_code
string
required

The carrier tracking code for the shipment, such as a USPS, UPS, or FedEx tracking number.

Response

A successful response

A physical shipment associated with a payment, including carrier details and tracking information.

carrier
enum<string>
required

The shipping carrier responsible for delivering this 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
created_at
string<date-time>
required

The datetime the shipment was created.

Example:

"2023-12-01T05:00:00.401Z"

delivery_estimate
string<date-time> | null
required

The estimated delivery date for this shipment. Null if the carrier has not provided an estimate.

Example:

"2023-12-01T05:00:00.401Z"

id
string
required

The unique identifier for the shipment.

Example:

"ship_xxxxxxxxxxxxx"

payment
object | null
required

The payment associated with this shipment. Null if the payment has been deleted or is inaccessible.

service
string | null
required

The shipping service level used for this shipment. Null if the carrier does not specify a service tier.

Example:

"Priority"

status
enum<string>
required

The current delivery status of this 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

A more granular status providing additional detail about the shipment's current state. Null if no substatus applies.

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 carrier-assigned tracking number used to look up shipment progress.

Example:

"9400111899223456789012"

updated_at
string<date-time>
required

The datetime the shipment was last updated.

Example:

"2023-12-01T05:00:00.401Z"