Skip to content

GetPaymentLink

Pay with POST /api/orders/{orderId}/paywithprepay. There’s no separate call to get a payment link.

GetPaymentLink took a list of shipment IDs and returned a signed link to the Parcel Monkey checkout. On Parcel2Go:

  • Payment is per order. To pay for several shipments together, create them as Items in one order.
  • The create-order response already has the PrePay payment link in Links.PayWithPrePay.
  • You pay with PrePay. It’s a single API call, and the order is paid from your Parcel2Go PrePay balance.
  1. Make sure your token has the payment scope. See Request a token.
  2. Keep your PrePay balance topped up. Check it with GET /api/prepay. You can create top-up links with POST /api/prepay/create-topup-links.
  3. After creating the order, call POST /api/orders/{orderId}/paywithprepay. The simplest way is to use Links.PayWithPrePay from the create-order response, which is the same URL with the hash already added.
  4. Then get your labels. See Labels.

If payment fails, the response is 400 with a list of Errors, each with a Name and Description.

curl -X POST "https://sandbox.parcel2go.com/api/orders/76423942/paywithprepay" \
-H "Authorization: Bearer $P2G_TOKEN" \
-H "Accept: application/json" \
-H "Content-Length: 0"
Response
{
"Links": [
{
"Name": "<link name>",
"Link": "https://www.parcel2go.com/..."
}
]
}

Shape only. Swagger says these links include labels and a picking list; read them by Name from the response.

Compare with the Parcel Monkey GetPaymentLink call
curl -X POST "https://api.parcelmonkey.co.uk/GetPaymentLink" \
-H "Content-Type: application/json" \
-H "apiversion: 3.3" \
-H "userid: $PM_USER_ID" \
-H "token: $PM_API_KEY" \
-d '[
"4749253",
"4749254"
]'
Response
{
"OrderId": 1234567,
"Shipments": [
"4749253",
"4749254"
],
"url": "https://www.parcelmonkey.co.uk/2falogin.php?UserId=12345&hash=...&return=%2Fcheckout.php%3Fsub%3Dresume%26OrderId%3D1234567"
}
GetPaymentLink request field mapping
Parcel MonkeyParcel2GoRequiredNotes
[ShipmentId, ...]
Items[]
YesNo separate call. To pay for several shipments together, create them as Items in one order.
GetPaymentLink response field mapping
Parcel MonkeyParcel2GoRequiredNotes
OrderId
OrderId
No
Shipments
OrderlineIdMap[].OrderLineId
No
urlNo link needed. Pay from your PrePay balance with POST /api/orders/{orderId}/paywithprepay (the PayWithPrePay link in the create-order response). The token needs the payment scope.
New in Parcel2GoCheck PrePay balance; create top-up links (GBP, minimum stated in Swagger).