Merchant API: testing cancelations in your sandbox
About this article
This article describes the tests to run before you go live with the cancelation endpoints of the Merchant API, and the checklist to confirm with your ChannelEngine implementation contact. For background on how cancelations work, refer to Merchant API: cancelations.
Table of contents
Introduction
Run these tests to confirm that your cancelation integration works end to end. Work through the tests in order, log the results, and share them with your ChannelEngine implementation contact before sign-off.
Requirements
- Staging or sandbox environment: a ChannelEngine staging environment or dedicated sandbox.
- Merchant API key: the key of your sandbox environment.
- Test orders: at least two acknowledged test orders without a shipment.
Test 1: retrieve cancelations
Goal: confirm that your integration retrieves cancelation records from ChannelEngine and correctly distinguishes merchant cancelations from channel cancelations.
Create a merchant cancelation and a test channel cancelation. To simulate a channel cancelation, create a test cancelation on ChannelEngine via the web interface. Create a cancelation on a test order, select Channel (Test) in the Created by field, and the cancelation is created with IsMerchantCreator set to false.
- Open a test order on ChannelEngine and click Create cancelation. Select Merchant in Created by and save the cancelation.
- Open a second test order, click Create cancelation, select Channel (Test) in Created by, and save the cancelation.
- Call
GET /v2/cancellations/merchantwithout filters. Expected: HTTP 200 and both cancelations in the response. - Call the endpoint again with
UpdatedSinceset to a recent timestamp. Expected: only cancelations updated since that timestamp are returned. - Check the
IsMerchantCreatorfield of each record. Expected: your integration routes the record withIsMerchantCreatorset tofalseto your stop-fulfillment workflow, and treats the record withtrueas your own cancelation.
Record your results: HTTP status, polling by UpdatedSince works (yes or no), and IsMerchantCreator correctly identified (yes or no).
Test 2: submit a cancelation
Goal: confirm that your integration submits a merchant cancelation correctly.
- Retrieve an acknowledged test order that has no shipment and note its
MerchantOrderNo. - Call
POST /v2/cancellationswithIsMerchantCreatorset totrue, aReasonCode, and all order lines at their full quantities. Expected: a successful response, and the cancelation is queued for export to the marketplace. - Call
GET /v2/cancellations/merchantfiltered by yourMerchantCancellationNo. Expected: the cancelation appears with the matching order reference, lines, and reason code.
Record your results: HTTP status, cancelation visible in the GET response (yes or no), and partial cancelation tested (yes, no, or not applicable).
Sign-off checklist
Before you go live, confirm all of the following with your ChannelEngine implementation contact:
- A unique
MerchantCancellationNois generated and stored for every cancelation, and never reused. - Your integration polls
GET /v2/cancellations/merchantregularly and usesUpdatedSinceto avoid retrieving the full history on every call. - Your integration checks
IsMerchantCreatorin the response and routes channel cancelations to your stop-fulfillment workflow. - Your integration detects cancelation requests through
GET /v2/ordersand confirms them withPOST /v2/cancellationsafter fulfillment is stopped. - Merchant cancelations are submitted only for orders that have no shipment on ChannelEngine.
- The marketplace guide of each channel is checked for merchant cancelation support, and
ChannelOrderSupportis checked before you submit a partial cancelation. - If you sell on marketplaces with enforced cancelations, shipments are recorded on ChannelEngine at the moment of carrier handover and not in a delayed batch.
- Every cancelation uses the most accurate
ReasonCode, andOTHERis not used as a default. - (If applicable) Partial cancelation support is verified against the cancelation model of each channel before creating partial cancelations.
Next steps
- Merchant API: cancelations (endpoints, fields, and cancelation flows).
- ChannelEngine: cancelations (handle cancelations via the ChannelEngine web interface).
Comments
0 comments
Article is closed for comments.