CancelShipment
What’s different
Section titled “What’s different”Cancellation is not available through the Parcel2Go API. There’s no equivalent of CancelShipment.
What to change in your code
Section titled “What to change in your code”- Remove calls to
CancelShipment, and any UI or jobs that depend on it. - Parcel2Go orders are created unpaid, and nothing is booked until you pay. Build your flow so you only pay for an order once you’re sure it should ship. See GetPaymentLink.
Compare with the Parcel Monkey CancelShipment call
curl -X POST "https://api.parcelmonkey.co.uk/CancelShipment" \ -H "Content-Type: application/json" \ -H "apiversion: 3.3" \ -H "userid: $PM_USER_ID" \ -H "token: $PM_API_KEY" \ -d '{ "ShipmentId": "4749253"}'<?php$ch = curl_init('https://api.parcelmonkey.co.uk/CancelShipment');curl_setopt_array($ch, [ CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => ['Content-Type: application/json', 'apiversion: 3.3', 'userid: ' . $pmUserId, 'token: ' . $pmApiKey], CURLOPT_POSTFIELDS => json_encode([ 'ShipmentId' => '4749253', ]),]);$response = json_decode(curl_exec($ch), true);{ "ShipmentId": "4749253", "ShipmentCancelled": "Y"}Field mapping
Section titled “Field mapping”| Parcel Monkey | Parcel2Go | Required | Notes |
|---|---|---|---|
ShipmentId | No equivalent | Not offered. Parcel2Go does not provide cancellation through the API. | |
ShipmentCancelled | No equivalent | No equivalent. |