Order Cancel
Summary of Changes: (The purpose of this table is to keep traceability and Product team to highlight the things that were changed into the scope, based on comments or discussions)
Version | Date | Created / Updated | Notes |
---|---|---|---|
v1.0 | 04.04.23 | Bogomil Pavlov | First publish |
v1.1 | 02.08.23 | Bogomil Pavlov | Cancellation works only for Ready for Shipping orders |
The purpose of this document is to describe how we cancel orders on Very.
Very do support full and partial cancellations on orders but their partial cancellations are per product which means if we have an order with 2 products we can cancel either one full or two full products. Also if we have an order with 1 product we cannot make partial cancellations even on orders with 1 product multiple quantity we always cancel the whole product. The shipping cost is refunded when the order is fully cancelled.<v1.1>For them the cancellation work for all type of orders “Ready for Shipping” (pre shipment)</v1.1> We want all triggers, status, error handling, etc. to be as per the Refunds send general logic
API Call: POST https://api-sl-2-3.kornitx.net/order/{orderId}/cancellation
API Docs: TBA
Sample Request: POST https://api-sl-2-3.kornitx.net/order/48079310/cancellation
{
"status": 9000,
"items": [
{
"id": 87328092,
"quantity": 1
},
{
"id": 87328093,
"quantity": 1
}
]
}
Mapping:
Very Field | Required | Hemi Field | Comment | |
---|---|---|---|---|
status |
Yes | Hardcoded as “9000“ | ||
items |
||||
id |
Yes | Product In Order > Item Order Line ID | ||
quantity |
Yes | Need to be calculated based on the price |
Sample Error Response #1:
{
"error": {
"message": "Permission denied (api-sl-2-3.order-cancellation.create)",
"code": 0
}
}
Sample Error Response #2:
{
"error": {
"message": "Invalid order status",
"code": 0
}
}
Sample Error Response #3:
{
"error": {
"message": "Invalid item specified, index 0",
"code": 0
}
}
Sample Success Response:
[
{
"id": 252858,
"items": [
{
"id": 87328092,
"order_id": 49399710,
"quantity": 1
}
]
}
]
KornitX field | Hemi Field | Comment | |
---|---|---|---|
id | Order Payment > Transaction Id | We want to store the id as a transaction id of the refund row | |
Items | |||
id | N/A | ||
order_id |
N/A | ||
quantity |
N/A |
Based on the response we need to mark the order as “Cancelled” if all the lines and shipping cost is refunded else it remains on the actual status. Also we want to update the product statuses as per abstraction If any errors are returned we want to store them in Order Errors table.
We want to include additional validation and do not allow to make partial cancellation on a single product or partial quantity cancellations on a single product. All other validations are as per the Refunds send general logic