07 - Respond to cancellation initiated by Seller App - ACK to /on_cancel
Developing
POST
/on_cancel
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST '/on_cancel' \
--header 'Content-Type: application/json' \
--data-raw '{
"context": {
"domain": "ONDC:RET11",
"country": "IND",
"city": "std:0124",
"core_version": "1.2.5",
"action": "on_cancel",
"transaction_id": "{{transaction_id}}",
"message_id": "{{message_id}}",
"timestamp": "{{timestamp}}",
"bap_uri": "{{bap_uri}}",
"bap_id": "{{bap_id}}",
"ttl": "PT30S"
},
"message": {
"order": {
"id": "SS1745833620254",
"state": "Cancelled",
"provider": {
"id": "pramaan_provider_1",
"locations": [
{
"id": "SSL1"
}
]
},
"items": [
{
"id": "id_ancc5_0_0",
"quantity": {
"count": 0
},
"tags": [
{
"code": "np_fees",
"list": [
{
"code": "id"
}
]
}
],
"fulfillment_id": "ed0d1e5e-2a3e-4312-83b2-1f5b2e65bd4d"
},
{
"quantity": {
"count": 2
},
"id": "id_ancc5_0_0",
"fulfillment_id": "60acffc9-292d-4075-86d1-bd6b164bd687"
}
],
"billing": {
"address": {
"name": "Nirdosh Chauhan",
"building": "221 B",
"locality": "Baker Steeet",
"city": "Gurgaon",
"state": "Haryana",
"country": "India",
"area_code": "122007"
},
"tax_number": "00ABCDE1234F1Z5",
"name": "Nirdosh Chauhan",
"email": "nirdosh.chauhan@sequelstring.com",
"phone": "9876543210",
"created_at": "2025-04-28T09:46:57.777Z",
"updated_at": "2025-04-28T09:46:57.777Z"
},
"payment": {
"type": "ON-ORDER",
"@ondc/org/settlement_basis": "delivery",
"@ondc/org/settlement_window": "P1D",
"@ondc/org/withholding_amount": "10.00",
"tags": [
{
"code": "bpp_collect",
"list": [
{
"code": "success",
"value": "Y"
},
{
"code": "error",
"value": ".."
}
]
}
],
"collected_by": "BPP",
"status": "NOT-PAID",
"uri": "http://localhost:5006/seller/toPaymentUtility?amount=\"2715\"&transaction_id=0e5d2340-cf92-426b-95f5-7ab6db2fd9f2&label=RETAIL_PRE_PAID_PAYMENT",
"params": {
"amount": "2715.00",
"currency": "INR"
},
"@ondc/org/settlement_details": [
{
"settlement_counterparty": "buyer-app",
"settlement_type": "upi",
"beneficiary_name": "Nirdosh Chauhan",
"upi_address": "gft@oksbi",
"settlement_bank_account_no": "987654321012",
"settlement_ifsc_code": "SBI00000001"
}
]
},
"fulfillments": [
{
"id": "ed0d1e5e-2a3e-4312-83b2-1f5b2e65bd4d",
"@ondc/org/provider_name": "Pramaan Store 1",
"@ondc/org/category": "Standard Delivery",
"@ondc/org/TAT": "PT24H",
"state": {
"descriptor": {
"code": "Cancelled"
}
},
"type": "Delivery",
"tracking": true,
"start": {
"location": {
"id": "SSL1",
"gps": "28.527300,77.182100",
"descriptor": {
"name": "Pramaan Store 1",
"images": [
"https://ondc.org/assets/theme/images/ondc_registered_logo.svg?v=399788fda7"
]
},
"address": {
"locality": "N. Caldwell",
"city": "New Delhi",
"area_code": "110030",
"state": "New Delhi"
}
},
"time": {
"range": {
"start": "2025-04-28T09:47:00.282Z",
"end": "2025-04-28T23:00:00.000Z"
},
"timestamp": "2025-04-28T09:47:17.658Z"
},
"contact": {
"phone": "9876543210",
"email": "ss_seller_1@ss.com"
}
},
"end": {
"location": {
"gps": "28.4554726,77.0219019",
"address": {
"name": "Nirdosh Chauhan",
"building": "221 B",
"locality": "Baker Steeet",
"city": "Gurgaon",
"state": "Haryana",
"country": "India",
"area_code": "122007"
}
},
"contact": {
"phone": "9876543210",
"email": "nirdosh.chauhan@sequelstring.com"
},
"person": {
"name": "Nirdosh Chauhan"
},
"time": {
"range": {
"start": "2025-04-29T09:30:00.000Z",
"end": "2025-04-29T19:00:00.000Z"
},
"timestamp": "2025-04-28T09:47:25.825Z"
}
},
"tags": [
{
"code": "cancel_request",
"list": [
{
"code": "reason_id",
"value": "001"
},
{
"code": "initiated_by",
"value": "ondc.sequelstring.com/buyer/protocol"
}
]
},
{
"code": "precancel_state",
"list": [
{
"code": "fulfillment_state",
"value": "Order-delivered"
},
{
"code": "updated_at",
"value": "2025-04-28T09:47:36.019Z"
}
]
}
]
},
{
"@ondc/org/provider_name": "Pramaan Store 1",
"type": "Return",
"state": {
"descriptor": {
"code": "Cancelled"
}
},
"tags": [
{
"code": "cancel_request",
"list": [
{
"code": "id",
"value": "60acffc9-292d-4075-86d1-bd6b164bd687"
},
{
"code": "reason_id",
"value": "001"
},
{
"code": "initiated_by",
"value": "ondc.sequelstring.com/buyer/protocol"
}
]
},
{
"code": "precancel_state",
"list": [
{
"code": "fulfillment_state",
"value": "Return_Initiated"
},
{
"code": "updated_at",
"value": "2025-04-28T09:47:36.019Z"
}
]
}
],
"id": "f452402c-902b-4909-8ad9-fbf92436a5d4"
},
{
"id": "60acffc9-292d-4075-86d1-bd6b164bd687",
"type": "Cancel",
"state": {
"descriptor": {
"code": "Cancelled"
}
},
"tags": [
{
"code": "quote_trail",
"list": [
{
"code": "type",
"value": "item"
},
{
"code": "id",
"value": "id_ancc5_0_0"
},
{
"code": "currency",
"value": "INR"
},
{
"code": "value",
"value": "-2400.00"
}
]
},
{
"code": "quote_trail",
"list": [
{
"code": "type",
"value": "delivery"
},
{
"code": "id",
"value": "ed0d1e5e-2a3e-4312-83b2-1f5b2e65bd4d"
},
{
"code": "currency",
"value": "INR"
},
{
"code": "value",
"value": "-40"
}
]
},
{
"code": "quote_trail",
"list": [
{
"code": "type",
"value": "tax"
},
{
"code": "id",
"value": "ed0d1e5e-2a3e-4312-83b2-1f5b2e65bd4d"
},
{
"code": "currency",
"value": "INR"
},
{
"code": "value",
"value": "-5"
}
]
}
]
}
],
"cancellation": {
"cancelled_by": "ondc.sequelstring.com/buyer/protocol",
"reason": {
"id": "001"
}
},
"quote": {
"price": {
"currency": "INR",
"value": "0.00"
},
"breakup": [
{
"@ondc/org/item_id": "id_ancc5_0_0",
"title": "Adidas Track Suit",
"@ondc/org/item_quantity": {
"count": 0
},
"@ondc/org/title_type": "item",
"price": {
"currency": "INR",
"value": "0"
},
"item": {
"price": {
"currency": "INR",
"value": "1200.00"
}
}
},
{
"@ondc/org/item_id": "ed0d1e5e-2a3e-4312-83b2-1f5b2e65bd4d",
"title": "Delivery charges",
"@ondc/org/title_type": "delivery",
"price": {
"currency": "INR",
"value": "0"
}
},
{
"@ondc/org/item_id": "ed0d1e5e-2a3e-4312-83b2-1f5b2e65bd4d",
"title": "Tax",
"@ondc/org/title_type": "tax",
"price": {
"currency": "INR",
"value": "0"
},
"item": {
"tags": [
{
"code": "quote",
"list": [
{
"code": "type",
"value": "fulfillment"
},
{
"code": "subtype",
"value": "delivery"
}
]
}
]
}
}
]
},
"created_at": "2025-04-28T09:47:00.254Z",
"updated_at": "2025-04-28T09:47:43.105Z"
}
}
}'
Response Response Example
{}
Request
Body Params application/json