On_Cancel

Send cancellation request_id with reasons list in case of cancellation request. Else send cancelled order object

Overview

The BPP will send the cancelled order object to the BAP.

Request

URL

/on_cancel

Method

POST

Request Body Schema

Field Type
context* ContextForOn_cancel
message MessageForOn_cancel
error Error

Request Body Example

{
    "context": {
        "domain": "nic2004:55204",
        "country": "IND",
        "city": "std:080",
        "action": "on_cancel",
        "core_version": "0.9.1",
        "bap_id": "https://mock_bap.com/",
        "bap_uri": "https://mock_bap.com/beckn/",
        "bpp_id": "https://mock_bpp.com/",
        "bpp_uri": "https://mock_bpp.com/beckn/",
        "transaction_id": "1209849124",
        "message_id": "12341242345",
        "timestamp": "2021-03-23T10:00:40.065Z"
    },
    "message": {
        "order": {
            "id":"order_1",
            "state":"CANCELLED",
            "items":[
                {
                    "id": "normal-documents",
                    "quantity": {
                        "count": 1
                    }
                }
            ],
            "billing": {
                "name": "John Doe",
                "address": {
                    "door": "21A",
                    "name": "ABC Appartments",
                    "locality": "HSR Layout",
                    "city": "Bengaluru",
                    "state": "Karnataka",
                    "country": "India",
                    "area_code": "560102"
                },
                "email": "[email protected]",
                "phone": "+919876543210"
            },
            "fulfillment": {
                "tracking": true,
                "start": {
                    "location": {
                        "id": "user-location",
                        "descriptor": {
                            "name": "Current user location"
                        },
                        "gps": "12.9349377,77.6055586"
                    },
                    "instructions": {
                        "name": "pick up instructions",
                        "short_desc": "Ask doorman to ring 21A"
                    },
                    "time": {
                        "range": {
                            "start": "2021-06-15T07:11:36.212Z",
                            "end": "2021-06-15T07:12:36.212Z"
                        }
                    },
                    "contact": {
                        "phone": "+919999999999",
                        "email": "[email protected]"
                    }
                },
                "end": {
                    "location": {
                        "gps": "12.914028, 77.638698",
                        "address": {
                            "door": "2A",
                            "name": "XYZ Appartments",
                            "locality": "Electronic City",
                            "city": "Bengaluru",
                            "state": "Karnataka",
                            "country": "India",
                            "area_code": "560100"
                        }
                    },
                    "time": {
                        "range": {
                            "start": "2021-06-15T07:11:56.212Z",
                            "end": "2021-06-15T07:12:56.212Z"
                        }
                    },
                    "instructions": {
                        "name": "drop off instructions",
                        "short_desc": "Drop at front desk"
                    },
                }
            },
            "quote": {
                "price": {
                    "currency": "INR",
                    "value": "180"
                },
                "breakup": [
                    {
                        "title": "Documents normal delivery",
                        "price": {
                            "currency": "INR",
                            "value": "170"
                        }
                    },
                    {
                        "title": "Service Charge",
                        "price": {
                            "currency": "INR",
                            "value": "10"
                        }
                    }
                ]
            },
            "payment": {
                "uri": "https://api.bpp.com/pay?amt=$180&mode=upi&vpa=bpp@upi",
                "tl_method": "http/get",
                "params": {
                    "amount": "180",
                    "mode": "upi",
                    "vpa": "bpp@upi"
                },
                "type": "ON-FULFILMENT",
                "status": "NOT-PAID"
            }
        }
    }
}

The cancelled order object is returned

Response

Response Body Schema

Field Type
message* { Ack }
error Error

Response Body Example

{
  "message": {
    "ack": {
      "status": "ACK"
    }
  }
}

Acknowldegement response

Response Codes

Code Description
200 Acknowledgement of message received
On this page