# ParcelParcel API

> Compare shipping options, book shipments, get labels and track parcels from your own software.

With the ParcelParcel API you connect your own software (webshop, ERP or WMS) to your ParcelParcel account. You get the prices of your own account, and every shipment you create shows up in MyParcelParcel. The API works the same for accounts of ParcelParcel Netherlands B.V. and ParcelParcel Belgium BV.

## Base URL

All endpoints start with:

```text
https://services.parcelparcel.com/partners-api/v1
```

Every request needs two headers: `X-PP-API` with your API key and secret, and `Content-Type: application/json`. Every response is JSON with the same three elements: `errors`, `message` and `data` (see [General information](https://www.parcelparcel.com/api-docs/general-information/)).

## Quickstart

> [!tip] Start with your sandbox key
> On the same page you can generate a sandbox key (it starts with `sbx_`). Every call works with live rates and tracking, but bookings never go to the carrier and nothing is charged. [More about the sandbox](https://www.parcelparcel.com/api-docs/authentication/#test-with-your-sandbox-key).

1. **Get your API key and API secret.** Log in to MyParcelParcel and go to **Settings** → **Developers** → **API keys**. See [Authentication](https://www.parcelparcel.com/api-docs/authentication/). No account yet? [Create an account](https://my.parcelparcel.com/register).
2. **Compare shipping options.** Send the parcels, origin and destination to [Compare shipping options](https://www.parcelparcel.com/api-docs/compare-shipping-options/). You get the price and transit time per carrier, each with a `productId`.
3. **Create a shipment.** Send the addresses, parcels and content items to [Create a (draft) shipment](https://www.parcelparcel.com/api-docs/create-shipment/). Add the `productId` as `preferredShippingOption`, or leave it out and we pick the cheapest option. With `bookShipment: true` we book it directly and return the labels.
4. **Get the labels and track.** Fetch the labels with [Get the shipping documents](https://www.parcelparcel.com/api-docs/shipping-documents/) and follow the parcel with [Track a shipment](https://www.parcelparcel.com/api-docs/track-shipment/).

```bash cURL
curl --request POST 'https://services.parcelparcel.com/partners-api/v1/rates' \
--header 'X-PP-API: {YourAPIKey}@{YourAPISecret}' \
--header 'Content-Type: application/json' \
--data-raw '{
  "parcels": [
    {
      "type": "NONDOC",
      "weight": "8.3",
      "height": "21",
      "width": "25",
      "length": "65",
      "count": "1"
    }
  ],
  "fromCountry": "NL",
  "toCountry": "US",
  "recipientType": "business"
}'
```

## Endpoints

- `GET /me` [Check your API key](https://www.parcelparcel.com/api-docs/me/): See which ParcelParcel account your API key belongs to.
- `POST /rates` [Compare shipping options](https://www.parcelparcel.com/api-docs/compare-shipping-options/): Get shipping rates from ParcelParcel
- `POST /shipments` [Create a (draft) shipment](https://www.parcelparcel.com/api-docs/create-shipment/): Create a draft shipment or book your shipment directly in ParcelParcel.
- `POST /shipments/{shipmentId}/cancel` [Cancel a (draft) shipment](https://www.parcelparcel.com/api-docs/cancel-shipment/): Cancel a (draft) shipment directly in ParcelParcel.
- `GET /track/{trackingNumber}` [Track a shipment](https://www.parcelparcel.com/api-docs/track-shipment/): Track shipments that are booked through MyParcelParcel.
- `GET /shipments` [List your shipments](https://www.parcelparcel.com/api-docs/list-shipments/): Retrieve and filter all shipments linked to your ParcelParcel account.
- `GET /shipments/{shipmentId}/labels` [Get the shipping documents (labels)](https://www.parcelparcel.com/api-docs/shipping-documents/): Receive the shipping documentation in a base64 string.
- `POST /duties-taxes-estimate` [Estimate duties/taxes](https://www.parcelparcel.com/api-docs/estimate-duties-taxes/): Estimate the import duties and taxes of a shipment.
- `GET /dutiable-route/{countryFrom}/{countryTo}/{parcelType}` [Check if a shipment goes through customs](https://www.parcelparcel.com/api-docs/dutiable-route/): Find out if a shipment between two countries is dutiable, before you create it.
- `POST /hooks/subscribe` [Webhooks](https://www.parcelparcel.com/api-docs/webhooks/): Get a message on your own URL as soon as a shipment is booked.

## For AI agents and code generators

- **[OpenAPI spec](/api-docs/openapi.json)** (also as [YAML](/api-docs/openapi.yaml)): every endpoint, field, required value and example in OpenAPI 3.1. Use it to generate a client, to give an AI agent the API as tools, or to import it in Postman or Insomnia.
- **[llms.txt](/api-docs/llms.txt)** and **[llms-full.txt](/api-docs/llms-full.txt)**: these docs for language models, as an index or all pages in one file. Every page is also available as markdown with the **Markdown** button.
- **[MCP server](https://www.parcelparcel.com/api-docs/mcp/)**: let Claude or ChatGPT compare rates and book shipments for you, without writing code.

## Other ways to connect

- **[MCP for Claude or ChatGPT](https://www.parcelparcel.com/api-docs/mcp/)**: compare rates, book, get labels and track from the chat.
- **[Postman Collection](https://www.parcelparcel.com/api-docs/postman-collection/)**: every request ready to try, without writing code.
- **[Webhooks](https://www.parcelparcel.com/api-docs/webhooks/)**: get a message when a shipment is created or booked.

Questions about the API? See [Support](https://www.parcelparcel.com/api-docs/support/).
