Pigee Shipping Partner API
Plug live multi-carrier global shipping, automated customs, real-time tracking and payment collection into your own systems, with a single REST API. Works for shipping agents, 3PLs, e-commerce platforms and custom fulfilment integrations.
Live multi-carrier rates
DHL, FedEx, UPS, Aramex, Parcelforce and 200+ local couriers, all in a single POST. Returns sorted rates with transit time and landed cost.
AI customs automation
Auto-classifies HS codes from your product catalogue. Commercial invoices, customs declarations and duties calculated per destination.
Pigee Pay collection
Share a payment link or embed checkout. Collect from end-customers in 135+ currencies and settle to your bank in your local currency.
Real-time webhooks
Receive shipment.created, payment.received, parcel.delivered and more events pushed to your endpoint instantly.
Labels & invoices
PDF labels and commercial invoices generated automatically on order creation. No carrier portals required.
Custom service fees
Add your own percentage or fixed-fee margin on top of Pigee base rates per carrier, per lane or globally.
Quickstart
From account creation to your first live shipment in under an hour. Follow these five steps:
- Create a free Pigee account at account.pigeepost.com and select Shipping Partner as your account type.
- Go to Dashboard → Developer → API Keys and generate a live key and a test key.
- Choose your payment mode: Pigee Pay or Pigee Account Balance.
- Configure your service fee in Dashboard → Fees.
- Import the Postman collection for staging development.
Authentication
Every request must include your API key in the Authorization header as a Bearer token. Keys are scoped to your partner account and carry your fee configuration and payment mode.
Authorization: Bearer pgk_live_YOUR_API_KEY_HERE
Key types
| Prefix | Environment | Description |
|---|---|---|
| pgk_live_… | LIVE | Real shipments and real charges. |
| pgk_test_… | TEST | Sandbox only. No charges, synthetic carrier responses, safe for CI/CD. |
Environments & Base URLs
The sandbox is a full 1:1 mirror of production. Switch environments by swapping your key prefix, or use the explicit sandbox URL for clarity.
v1. Version is part of the path: /api/v1/….SDKs & Libraries
Official SDKs wrap the REST API with typed models, automatic retries and sandbox helpers.
Validate API Key
Call this endpoint to confirm your API key is active and correctly configured before going live.
POST /api/v1/store/valid Authorization: Bearer pgk_live_… Content-Type: application/json { "store_type": 2, "api_key": "pgk_live_YOUR_KEY" }
{
"valid": true,
"account": {
"id": "acc_7H4K",
"type": "shipping_partner",
"payment_mode": "pigee_pay",
"service_fee_pct": 8.5,
"balance_gbp": 240.00
}
}
Get Shipping Rates
Fetch live carrier rates for a shipment. Returns all available services sorted by price, including transit time, insured value support and landed cost.
carrier_request_id to use when creating the order.{
"shop_url": "https://your-store.com",
"currency": "GBP",
"parcel": {
"type": "Box",
"boxsize": 4
},
"weight": { "value": 4, "units": "kg" },
"dimension": {
"length": 40,
"width": 30,
"height": 20,
"units": "cms"
},
"address": {
"pickup": {
"address_line1": "10 High Street",
"town": "London",
"post_code": "SW1A 1AA",
"country": "United Kingdom"
},
"destination": {
"address_line1": "123 Ocean Drive",
"town": "Miami",
"post_code": "33101",
"country": "United States"
}
}
}
{
"rates": [
{
"carrier_request_id": "cr_abc123",
"carrier_id": "dhl",
"pigee_carrier_id": "DHL_EXPRESS_WORLDWIDE",
"method_title": "DHL Express Worldwide",
"price": 125.50,
"currency": "GBP",
"transit_days": 2,
"insurance_available": true,
"customs_included": true
}
],
"currency": "GBP",
"request_id": "req_7H4K2026"
}
Request parameters
| Field | Type | Required | Description |
|---|---|---|---|
| shop_url | string | required | Your store or platform URL. |
| currency | string | required | ISO 4217 currency code. |
| parcel.type | string | required | Box | Bag | Tube | Pallet |
| parcel.boxsize | integer | required | Size tier 1 to 6. |
| weight.value | number | required | Actual weight of the parcel. |
| weight.units | string | required | kg | lbs |
| dimension | object | optional | Length, width, height and units. |
| address.pickup | object | required | Sender address. |
| address.destination | object | required | Recipient address. |
Create Order
Create a Pigee order using a carrier_request_id from the rates endpoint. Pigee generates the label, commercial invoice and, if using Pigee Pay, a hosted payment link.
{
"order_from": "api",
"shop_url": "https://your-store.com",
"order_id": "ORDER-10001",
"currency": "GBP",
"items": [
{
"name": "Vintage leather jacket",
"quantity": 1,
"value": 600.00,
"currency": "GBP",
"hs_code": "4203100090"
}
],
"shippingData": {
"method_title": "DHL Express Worldwide",
"cost": 125.50,
"currency": "GBP",
"meta_data": {
"carrier_request_id": "cr_abc123",
"carrier_id": "dhl",
"pigee_carrier_id": "DHL_EXPRESS_WORLDWIDE"
}
}
}
{
"order_id": "po_78910",
"pigee_order_id": "PGE-7H4K-2026-0042",
"status": "pending_payment",
"payment_url": "https://pay.pigee.com/c/abc123",
"label_url": null,
"tracking_number": null
}
Fulfil Order
Send final fulfilment details once payment is confirmed. Pigee generates the shipping label, books the carrier and returns a tracking number.
{
"order_id": "po_78910",
"status": "processing",
"shop_id": "https://your-store.com",
"currency": "GBP",
"total": 725.50,
"shipping_total": 125.50
}
{
"order_id": "po_78910",
"pigee_order_id": "PGE-7H4K-2026-0042",
"status": "booked",
"label_url": "https://labels.pigeepost.com/PGE-7H4K-2026-0042.pdf",
"tracking_number": "1234567890",
"carrier": "DHL",
"estimated_delivery": "2026-05-08"
}
Tracking
Retrieve live tracking events for any shipment created via the API.
{
"pigee_order_id": "PGE-7H4K-2026-0042",
"tracking_number": "1234567890",
"carrier": "DHL",
"status": "in_transit",
"estimated_delivery": "2026-05-08",
"events": [
{
"timestamp": "2026-05-06T08:14:00Z",
"status": "in_transit",
"location": "DHL Hub, Leipzig",
"description": "Shipment in transit"
}
]
}
Payment Modes
Pigee supports two payment modes. The active mode is set in your partner dashboard and applies to all orders.
| Mode | How it works | Best for |
|---|---|---|
| Pigee Pay | Pigee hosts a checkout page. Order creation returns a payment_url. | E-commerce and marketplace integrations. |
| Account Balance | Shipment cost is deducted from your pre-funded Pigee balance. | Shipping agents, 3PLs and high-volume partners. |
Service Fees
As a Shipping Partner you can add your own fee on top of Pigee’s base carrier rates. Fees are configured in your dashboard and applied automatically before rates are returned.
- Percentage fee: Applied as a percentage of the base carrier cost.
- Fixed fee: A flat amount added per shipment.
- Per-lane overrides: Override the global fee for specific origin/destination pairs.
Settlements & FX
Pigee Pay collects from end-customers in 135+ currencies and settles to your bank account in your local currency.
- Settlement cycle is typically T+2 business days after shipment delivery confirmation.
- Withdraw from your Pigee balance via the dashboard.
- Detailed transaction logs are available under Finance → Settlements.
- Invoices for settled transactions are auto-generated and available as PDF.
Webhooks
Pigee pushes real-time events to your HTTPS endpoint as JSON POST requests. Configure your webhook URL in Dashboard → Developer → Webhooks.
{
"event": "parcel.delivered",
"created_at": "2026-05-08T14:22:07Z",
"api_version": "v1",
"data": {
"pigee_order_id": "PGE-7H4K-2026-0042",
"order_id": "ORDER-10001",
"carrier": "DHL",
"tracking_number": "1234567890",
"delivered_at": "2026-05-08T14:18:00Z"
}
}
Webhook Event Reference
Webhook Signatures
Every webhook request includes a X-Pigee-Signature header, an HMAC-SHA256 digest of the raw request body. Always verify this before processing.
// Node.js const crypto = require('crypto'); function verifyPigeeWebhook(rawBody, signature, secret) { const expected = crypto .createHmac('sha256', secret) .update(rawBody) .digest('hex'); return crypto.timingSafeEqual( Buffer.from(expected, 'hex'), Buffer.from(signature, 'hex') ); }
Errors
All errors return JSON with an error object containing a machine-readable code and a human-readable message.
{
"error": {
"code": "INSUFFICIENT_BALANCE",
"message": "Your Pigee partner balance is not sufficient to create this shipment.",
"request_id": "req_7H4K2026"
}
}
| HTTP | Error code | Meaning & resolution |
|---|---|---|
| 400 | INVALID_REQUEST | Missing or malformed field. |
| 401 | INVALID_API_KEY | Key is missing, malformed or revoked. |
| 402 | INSUFFICIENT_BALANCE | Account balance too low. |
| 403 | FORBIDDEN | Account type does not have access to this endpoint. |
| 404 | ORDER_NOT_FOUND | No order found for the given ID. |
| 409 | ORDER_ALREADY_FULFILLED | Order already fulfilled. |
| 422 | INVALID_ADDRESS | Address could not be validated. |
| 422 | CARRIER_UNAVAILABLE | No carrier services available for this route. |
| 422 | RATE_EXPIRED | carrier_request_id expired. Fetch rates again. |
| 429 | RATE_LIMITED | Too many requests. Back off and retry. |
| 500 | INTERNAL_ERROR | Pigee-side error. Retry with back-off. |
| 503 | CARRIER_TIMEOUT | Downstream carrier API timed out. |
Rate Limits
Rate limits are applied per API key and scale with your account tier.
| Account tier | Requests / minute | Requests / day |
|---|---|---|
| Free test | 60 | 1,000 |
| Shipping Partner live | 300 | 50,000 |
| Enterprise | Custom | Custom |
When a rate limit is hit, the API returns HTTP 429 with a Retry-After header.
Data Types & Conventions
- Dates & times - ISO 8601 UTC, e.g.
2026-05-06T14:22:07Z - Currencies - ISO 4217 three-letter codes, e.g.
GBP,USD,NGN - Monetary values -
numberwith two decimal places, always paired with acurrencyfield - Country names - English full names, e.g.
"United Kingdom","United States" - Phone numbers - E.164 format recommended, e.g.
+447700900123 - Weights -
kgorlbsspecified per request - IDs - Pigee-generated IDs use prefix format, e.g.
po_78910,cr_abc123
Carrier IDs Reference
Use pigee_carrier_id values from the rates response when creating orders.
| carrier_id | Example pigee_carrier_id | Region |
|---|---|---|
| dhl | DHL_EXPRESS_WORLDWIDE, DHL_EXPRESS_12 | Global |
| fedex | FEDEX_INTERNATIONAL_PRIORITY, FEDEX_INTERNATIONAL_ECONOMY | Global |
| ups | UPS_WORLDWIDE_EXPRESS, UPS_WORLDWIDE_EXPEDITED | Global |
| aramex | ARAMEX_EXPRESS, ARAMEX_ECONOMY | MENA, Africa, Asia |
| parcelforce | PARCELFORCE_EXPRESS24, PARCELFORCE_GLOBAL_EXPRESS | UK & International |
| teleport | TELEPORT_STANDARD | Southeast Asia |
| local_* | local_5b3, local_8ac | Regional, returned dynamically |
Changelog
v1.3 - May 2026
- Added
insurance_availableandcustoms_includedflags to rates response. - Webhook signature verification now uses HMAC-SHA256.
- New error code
RATE_EXPIRED. - Tracking endpoint added:
GET /api/v1/tracking/{pigee_order_id}.
v1.2 - February 2026
- Added per-lane service fee overrides in dashboard.
- Pigee Pay payment links now include an
expires_atfield. - New webhook events added for customs and settlements.
v1.1 - October 2025
- Initial Postman collection published.
- Sandbox environment launched.
- Account Balance payment mode released.
v1.0 - June 2025
- Initial public release: Validate, Get Rates, Create Order, Fulfil Order.