Mailhub Shipping API for Ecommerce

One integration for USPS, FedEx and DHL. Create an order and get every carrier’s rate back in the same response, with the discounted price and a delivery estimate where the carrier provides one.

cURL
curl -X POST https://api.mailhub.com/api/v2/orders \
  -H "Authorization: Bearer <accessToken>" \
  -H "Content-Type: application/json" \
  -d '{ "order": { "toAddress": { ... }, "shipments": [ ... ] } }'
An application connected to carrier networks
An API call to Mailhub returns USPS, FedEx and DHL rates, each with your discounted price, and a delivery estimate where the carrier provides one.
Your application sends
Every carrier’s rate comes back
One Call, Every Carrier

What a shipping API does

A shipping API connects your application straight to carrier networks, pulling live rates, buying labels and returning tracking numbers in code rather than through a dashboard. Mailhub returns every carrier in one response with the same shape, so adding a carrier never means writing another integration.

Shipping run for several clients from one system
Built for Platforms and 3PLs

Run shipping for every business you serve

If you ship on behalf of other businesses, every call can carry a sub-account ID, so each client’s orders and labels sit under their own sub-account. You write the code once, not once per client.

The Mailhub Shipping API in four numbers

1

Connection to build, not three

3

Carriers in one response

3

Calls to your first label

$0

To call the API

Every carrier and platform you can reach through one API

Three calls to your first label

01.

Authenticate

Exchange your API key for an access token that authorises every call after it.

02.

Create the order and get rates

One request creates the order and returns every carrier’s rate, with a delivery estimate where there is one.

03.

Buy the label

Pick a rate, then get back a tracking code and a label file ready to print.

Get every carrier in one call

cURL
curl -X POST https://api.mailhub.com/api/v2/orders \
  -H "Authorization: Bearer $MAILHUB_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "order": {
      "toAddress": { "name": "John Doe", "street1": "123 Main St",
                     "city": "Springfield", "state": "IL",
                     "zip": "62701", "country": "US" },
      "shipments": [ { "parcel": { "weight": 2.5 } } ]
    }
  }'

One response, every carrier

JSON
{
  "success": true,
  "data": {
    "status": "created",
    "order": { ... },
    "shipmentRates": [
      {
        "shipmentId": "8f2c...",
        "rates": [
          {
            "id": "a1b2c3d4-0000-0000-0000-000000000001",
            "carrier": "USPS",
            "serviceName": "USPS Priority Mail",
            "rate": 7.35,
            "currency": "USD",
            "deliveryDays": 2,
            "estimatedDeliveryDate": "2026-04-04T23:59:59Z",
            "deliveryDateGuaranteed": false
          },
          {
            "id": "b2c3d4e5-0000-0000-0000-000000000002",
            "carrier": "FedEx",
            "serviceName": "FedEx Ground",
            "rate": 9.12,
            "currency": "USD"
          }
        ]
      }
    ],
    "errors": []
  },
  "errors": null
}
rate
Your price for that service, with the discount already applied. Nothing is added on top.
deliveryDays and estimatedDeliveryDate
Present only when the carrier returns a delivery estimate, as on the USPS rate here. Check for them before ranking on speed.
deliveryDateGuaranteed
Whether the carrier will stand behind that date.

Core endpoints

MethodEndpointDescription
POST /v1/auth/tokenExchange an API key for an access token
POST /v1/auth/token/refreshGet a new token pair
POST /v2/ordersCreate an order and return carrier rates
POST /v1/ordersCreate an order
GET /v1/ordersList orders, paginated and filterable
POST /v1/shipments/{shipmentId}/ratesGet carrier rate quotes
POST /v1/shipments/{shipmentId}/labelsBuy a shipping label
GET /v1/labels/{labelId}/downloadDownload the label as a PDF or ZPL file
DELETE /v1/labels/{labelId}Void a label

Mailhub Shipping API compared to going direct

Comparison criteriaMailhub Shipping APICarrier APIs direct
Integrations to buildOneOne per carrier
Response formatSame shape for every carrierDifferent for each carrier
Adding a carrierNothing to buildA new integration to write and maintain
Carrier accounts neededNoneOne contract per carrier
Discounted ratesReturned on every quote, from your first callOnly once you qualify and negotiate
Delivery estimatesIncluded when the carrier returns oneVaries by carrier, sometimes a separate call
CostFree to call, pay per labelFree to call, at your contracted rates

Mailhub Shipping API FAQs

Three calls gets you a label. Authenticate, create the order, buy the label, and rates come back with the order rather than needing a separate request. Because every carrier returns in the same shape, adding one later costs you nothing in code.

Calls are free. You pay per label at the discounted carrier rate, with no monthly platform fee and no minimum volume, so you can build and test the whole integration before any commercial conversation.

No. Mailhub’s negotiated rates with USPS, FedEx and DHL are available from your first call. There is nothing to sign with the carriers.

Yes. Order, rate and label calls all take an X-SubAccount-Id header, so each client’s orders and labels sit under their own sub-account through a single integration.

Ready to ship

Get your API key and make your first call

Free to sign up, free to call, and you only pay when you buy a label. No contract and no minimum volume.