Before you activate a cancellation option in your UI, check that the relevant items[] in the fulfillment order are either pending or backordered . Customers shouldn't be allowed to cancel shipped items. However, your integration can provide customers the option to return shipped items.
Defining and submitting a fulfillment cancellation request
An upstreamId represents the identifier of the order. We recommend setting this value for tracking purposes and maintaining data consistency.
Order
POST/fulfillment-cancellations
id
➔
upstreamId
Item data
For each item a customer wants to cancel, provide its fulfillment order line item identifier assigned to it. You must also specify the quantity of that line item.
In a fulfillment cancellation, each items[] provides the quantity you specified in the POST/fulfillment-cancellations as well as the quantityAccepted by the fulfiller. If quantityAccepted is less than quantity, then the fulfiller didn't approve all the items for cancellation.
The fulfillment cancellation life cycle
A fulfillment cancellation, as well as its items[], have a defined lifecycle, each stage of which is represented by a state.
A fulfillment cancellation contains a state. It indicates where the resource is in its lifecycle. The values for a successful fulfillment cancellation (i.e., the happy path) are pending > accepted.
(1) When the fulfillment cancellation...
(2) its state transitions to...
is created but not yet approved for cancellation by the fulfiller
pending
is approved for cancellation by the fulfiller
accepted
is rejected for cancellation by the fulfiller
rejected
Line item states
Eachitems[] in a fulfillment cancellation also contains a state. The state values of a successfully cancelled line item (i.e., the happy path) are pending > accepted.
(1) When the line item...
(2) its state transitions to...
is not yet approved for cancellation by the fulfiller
pending
is approved for cancellation by the fulfiller
accepted
is rejected for cancellation by the fulfiller
rejected
Handling fulfillment cancellation state change events
When a POST /fulfillment-cancellations request is successfully submitted, we create a fulfillment_cancellation.createdevent. This event indicates that your cancellation request has been received by Digital River but has not yet been approved or rejected by the fulfiller.
If you're using the orchestrated model, we listen for fulfillment cancellation-approved events and submit the appropriate payment cancellation request.
A fulfillment_cancellation.rejected event indicates that the fulfiller has declined the cancellation request.
We recommend you respond to these events by notifying customers (typically through email and their order management page) that the cancellation request has been rejected. In the notification, you can provide customers instructions on returning physical products and requesting refunds.