Merchant API: testing shipments in your sandbox
About this article
This article provides a step-by-step test script for verifying your Merchant API shipments integration end-to-end before going live. It covers creating a shipment, retrieving a shipping label, adding tracking, and submitting delivery state.
Table of contents
Test 1: create a basic shipment
Test 2: retrieve a shipping label
Test 3: add tracking to an existing shipment
Introduction
Run through these tests before going live to confirm that your shipment integration works end-to-end. Work through them in order. Log your results and share them with your ChannelEngine implementation contact before sign-off.
Requirements
- A ChannelEngine test environment (e.g.: account-name-dev.channelengine.net). Request one from your implementation contact if you do not have one yet.
- At least one test order visible on ChannelEngine. Create one yourself, or your implementation contact can create these for you if needed.
- Your Merchant API key, available at Settings, Merchant API keys on ChannelEngine.
- A tool for making HTTP requests, such as Postman, curl, or your integration code.
Test 1: create a basic shipment
This test confirms that a shipment is successfully created for an acknowledged order, with tracking details included.
Retrieve a test order using GET /v2/orders/new and note its MerchantOrderNo. If you have not already done so, acknowledge it using POST /v2/orders/acknowledge. ChannelEngine requires orders to be acknowledged before a shipment can be created for them.
- Generate a unique
MerchantShipmentNoin your system and store it alongside theMerchantOrderNo. - Call
POST /v2/shipmentswith the required fields plus aTrackTraceNoandMethod. Expect HTTP 201. The shipment is created on ChannelEngine. - Verify the shipment using
GET /v2/shipments/merchant. Filter by yourMerchantShipmentNoand confirm the returned data matches what you submitted. Expect your shipment to appear with the correct order reference, lines, carrier, and tracking number.
Record your results:
- HTTP status of the shipment call
- Shipment visible in the GET response (yes or no)
- Tracking number correct (yes or no)
Test 2: retrieve a shipping label
This test confirms that your integration can retrieve a marketplace-generated label and handle its format. It is only required for channels that provide shipping labels via API. This test covers POST /v2/shipments but not POST /v2/shipments/channelmethod.
POST /v2/shipments/channelmethod cannot be tested on a test connection, because requesting the channel's available carrier options only works on live channel connections. Test POST /v2/shipments/channelmethod together with your ChannelEngine implementation contact once the first live channel is connected. The steps below cover retrieving labels from channels that generate them with a POST /v2/shipments request.
- Create the shipment by calling
POST /v2/shipmentswith the required fields andMethodset to the shipment method name. Do not send tracking details. Expect HTTP 201. - Generate a test label for the shipment by calling
POST /v2/testshippinglabelwith your shipment number in the request. Expect a test label to become available for the shipment. - Poll
GET /v2/orders/{merchantShipmentNo}/shippinglabelat a short interval until the label is available. A404means it is not ready yet, so keep retrying. Do not treat404as a permanent failure. Expect HTTP 200 with a PDF, PNG, or ZPL file. - Confirm the label can be printed or downloaded from your warehouse UI or WMS. Expect the label to open correctly and to be scannable.
Record your results:
- HTTP status on label retrieval
- Label format received (PDF, PNG, or ZPL)
- Label printable (yes or no)
Test 3: add tracking to an existing shipment
This test confirms that tracking details can be added or updated after shipment creation.
- Using the shipment from Test 1 (or a new one without tracking), call
PUT /v2/shipments/{merchantShipmentNo}with aMethodandTrackTraceNo. Expect HTTP 200. The tracking information is updated on the shipment. - Verify the update using
GET /v2/shipments/merchant. Filter by yourMerchantShipmentNoand confirm the tracking fields reflect your update. ExpectTrackTraceNoandMethodto match what you submitted.
Record your results:
- HTTP status
-
TrackTraceNoupdated correctly (yes or no) -
Methodupdated correctly (yes or no)
Test 4: submit delivery state
This test confirms that your integration can report the final delivery outcome. It is only required for channels that explicitly request delivery confirmation.
- Call
PUT /v2/shipments/{merchantShipmentNo}/delivery-statewithStatusset toDELIVEREDand aDeliveredAttimestamp. Expect HTTP 201. The delivery status is recorded against the shipment. - If your channel requires it, upload a proof of delivery PDF via
POST /v2/shipments/{merchantShipmentNo}/proof-of-delivery. Expect HTTP 201. - Verify on ChannelEngine: navigate to the shipment and confirm the delivery status is displayed correctly. Expect the status to show as delivered with the correct timestamp.
Record your results:
- HTTP status of the delivery state call
- HTTP status of the proof of delivery call, if applicable
- Status visible on ChannelEngine (yes or no)
Sign-off checklist
Before going live, confirm all of the following with your ChannelEngine implementation contact.
- A unique
MerchantShipmentNois generated and stored per shipment and is never reused. - The
MerchantOrderNois stored alongside each shipment and correctly matches the acknowledged order. - A basic shipment is created and verified via
GET /v2/shipments/merchant. - Tracking number and carrier are submitted at creation time or added via
PUTafter handover to the carrier. - (If applicable) The correct label flow (
POST /v2/shipments/channelmethodorPOST /v2/shipments/) is confirmed for each channel in scope. The Air Waybill number is retrieved for channels where ChannelEngine generates this. - (If applicable) Label retrieval uses polling or a user-triggered retry, and the integration does not treat a
404as a permanent failure. - (If applicable) Your warehouse or WMS can handle the label format (PDF, PNG, or ZPL) of each channel in scope.
- (If applicable) Partial shipment support is verified against the
ChannelOrderSupportfield for each channel before splitting orders. - (If applicable) Delivery state is submitted via
PUT /v2/shipments/{merchantShipmentNo}/delivery-statefor channels that require explicit confirmation. - (If applicable) Proof of delivery is uploaded to channels or processes that require it.
Common issues
| Issue | Cause | Solution |
| Shipment cannot be created | The order has not been acknowledged yet, or the MerchantShipmentNo was already used. |
Acknowledge the order first and use a unique MerchantShipmentNo. |
Label request returns 404
|
The label is not ready yet. | Keep polling at a short interval. Do not treat it as a failure. |
| Pattern A carrier options call fails | Carrier options are only available on live channel connections. | Test the Pattern A flow with your implementation contact on a live connection. |
Next steps
- Merchant API: shipments - the full reference for creating, updating, and tracking shipments.
- Merchant API: testing flow - the ChannelEngine standard testing flow per resource.
Comments
0 comments
Article is closed for comments.