API docs Endpoints
Cancel a pickup
Cancel the carrier pickup of a shipment. The shipment stays booked.
https://services.parcelparcel.com/partners-api/v1/shipments/{shipmentId}/pickupExample request
Cancel the pickup of a shipment
curl --request DELETE 'https://services.parcelparcel.com/partners-api/v1/shipments/1588448/pickup' \
--header 'X-PP-API: {YourAPIKey}@{YourAPISecret}' \
--header 'Content-Type: application/json'const response = await fetch("https://services.parcelparcel.com/partners-api/v1/shipments/1588448/pickup", {
method: "DELETE",
headers: {
"X-PP-API": "{YourAPIKey}@{YourAPISecret}",
"Content-Type": "application/json",
},
});
const data = await response.json();
console.log(data);import requests
response = requests.delete(
"https://services.parcelparcel.com/partners-api/v1/shipments/1588448/pickup",
headers={
"X-PP-API": "{YourAPIKey}@{YourAPISecret}",
"Content-Type": "application/json",
},
)
print(response.json())Tip: copy the cURL and paste it in Postman under Import, or straight into the URL bar of a new request. Postman fills in the method, headers and body for you. Replace {YourAPIKey}@{YourAPISecret} with your own API key and secret (use your sandbox key while testing), or import the whole Postman Collection.
This endpoint cancels the pickup of a shipment. The shipment itself stays booked: you can drop the parcel off yourself, or schedule a new pickup.
Want to cancel the whole shipment? Use Cancel a (draft) shipment. That also cancels the pickup.
Replace {shipmentId} with the id that you got in the response when you created the shipment.
- This works only while the carrier has not picked up the parcel.
- You can only use shipments of your own account. A shipment of another account gives the same
404as an unknown id.
Header
Add the following headers:
| Name | Value |
|---|---|
Content-Type | application/json |
X-PP-API | {YourAPIKey}@{YourAPISecret} |
Don't have an API Key and API Secret yet? Check our Authentication page to see how to get them in under a minute.
Body
This endpoint does not need a request body.
Response
The response body is a JSON object with the following elements:
| Name | Value | Comments |
|---|---|---|
shipmentId | (int) | The id of the shipment. |
cancelled | (bool) | true if the pickup is cancelled. |
carrierStatus | (string) | How the carrier handled the cancellation: confirmed, requested, not_supported or sandbox. See Carrier status values. |
message | (string) | Tells you the result in plain English. |
Errors have the same format as in Schedule a pickup.
Status codes
| Status code | Meaning |
|---|---|
| 200 OK | The pickup is cancelled. The shipment stays booked. |
| 404 Not Found | We could not find the shipment in your account. Make sure that the shipmentId is correct. |
| 409 Conflict | The shipment has no pickup to cancel, the carrier already has the parcel, or the shipment is cancelled. See message. |
| 422 Unprocessable Entity | The carrier refused the cancellation. Nothing changed. Read message for the reason. |
| 502 Bad Gateway | We could not reach the carrier. Nothing changed: try again later. |
Examples
Don't know how to test these requests? Check our guide.
Request example - Cancel the pickup of a shipment
curl --location --request DELETE 'https://services.parcelparcel.com/partners-api/v1/shipments/1588448/pickup' \
--header 'X-PP-API: {YourAPIKey}@{YourAPISecret}' \
--header 'Content-Type: application/json'DELETE /partners-api/v1/shipments/1588448/pickup HTTP/1.1
Host: services.parcelparcel.com
X-PP-API: {YourAPIKey}@{YourAPISecret}
Content-Type: application/jsonDon't forget to change the X-PP-API element in the header, or this request will not work.
Response example - Pickup cancelled (200)
{
"shipmentId": 1588448,
"cancelled": true,
"carrierStatus": "confirmed",
"message": "The carrier confirmed that the pickup is cancelled. The shipment stays booked: drop it off or schedule a new pickup."
}Response example - No pickup to cancel (409)
{
"error": "conflict",
"message": "The shipment has no pickup to cancel."
}Response example - Carrier not reachable (502)
{
"error": "carrier_unavailable",
"message": "The carrier could not be reached. Nothing was changed; try again later."
}Response example - Shipment not found (404)
"Shipment not found"