Testing in sandbox
Get sandbox credentials
Section titled “Get sandbox credentials”- Go to the sandbox portal and generate a Client ID and secret. The sandbox portal offers client credentials clients.
- Send token requests to
https://sandbox.parcel2go.com/auth/connect/token. - Send API calls to
https://sandbox.parcel2go.com/api.
Sandbox credentials don’t work on live, and live credentials don’t work on sandbox.
How sandbox differs from live
Section titled “How sandbox differs from live”Parcel2Go says the sandbox may not fully replicate live:
- Features: some live features may not be fully available in sandbox, and sandbox may have some that live doesn’t.
- Data: sandbox uses sample or simulated data, so results can differ from live.
- External integrations: anything that depends on outside services may behave differently.
Parcel2Go recommends testing in both environments and checking for differences. Read the full note on their environments page.
Test plan
Section titled “Test plan”Work through these in sandbox. Each one maps to a step in the checklist.
| # | Test | Pass when |
|---|---|---|
| 1 | Request a token with public-api payment |
200 with access_token and expires_in |
| 2 | Call GET /api/countries with the token |
200. Your connectivity check works. |
| 3 | Let the token expire, or send a bad one | Your client gets 401, requests a new token and retries once |
| 4 | Quote a domestic parcel | Your code picks a service by its attributes and keeps the Service.Slug |
| 5 | Quote an international parcel with ExportReason and VatStatus |
You read RequiresCustoms and the requirement fields |
| 6 | Verify an international order with the customs details left out | 400 with Errors, each with your item Id, and your code shows them |
| 7 | Verify and create a complete order with two items | OrderId, Hash, and two OrderlineIdMap entries stored against your records |
| 8 | Check customs line values | Contents[].EstimatedValue is unit value × quantity |
| 9 | Pay with PrePay | 200 with Links. Handle a 400 (for example, not enough balance) without crashing. |
| 10 | Get labels as PDF and PNG, A4 and 4×6, per order and per order line | Files decode and print. FailedLabels is 0. |
| 11 | Track an order line | Your code reads Stage, IsInError and Results |
| 12 | Receive a webhook on your sandbox client | Signature check passes, replays are rejected, endpoint returns 200 |
| 13 | Search your code for api.parcelmonkey.co.uk, apiversion, userid and Parcel Monkey service codes |
Nothing left in the new code path |
Tracking depends on courier events, so a new sandbox order may have little or no tracking data. Test your tracking and webhook parsing with the examples in this guide as well.