How is an Order Relayed?

Written By Ops UrbanPiper (Collaborator)

Updated at December 5th, 2019

Each aggregator has a different order payload for the orders they relay to us.

This article shows the payloads relayed to UrbanPiper from the aggregators: Swiggy, Zomato and UberEats and explains the different parameters sent by each of them.


Order Relay for Swiggy

Here's a sample payload that Swiggy relays to our system:

{
    "callback_url": "https://rms.swiggy.com/external/order/confirm", 
    "cart_cgst": 10.25, 
    "cart_cgst_percent": 2.5, 
    "cart_gst": 20.5, 
    "cart_gst_percent": 5.0, 
    "cart_igst": 0.0, 
    "cart_igst_percent": 0.0, 
    "cart_sgst": 10.25, 
    "cart_sgst_percent": 2.5, 
    "customer_name": "SWIGGY", 
    "delivery_type": "PICKUP", 
    "instructions": "", 
    "is_thirty_mof": false, 
    "items": [
        {
            "addons": [], 
            "cgst": 10.25, 
            "cgst_percent": 2.5, 
            "discount": 0.0, 
            "gst_inclusive": false, 
            "id": "130653", 
            "igst": 0.0, 
            "igst_percent": 0.0, 
            "name": "Kaju Burfi", 
            "packing_charges": 0.0, 
            "price": 410.0, 
            "quantity": 1, 
            "reward_type": null, 
            "sgst": 10.25, 
            "sgst_percent": 2.5, 
            "subtotal": 410.0, 
            "variants": [
                {
                    "cgst": 0.0, 
                    "cgst_percent": 0.0, 
                    "id": "13134", 
                    "igst": 0.0, 
                    "igst_percent": 0.0, 
                    "name": "500 Gms", 
                    "price": 0.0, 
                    "sgst": 0.0, 
                    "sgst_percent": 0.0
                }
            ]
        }
    ], 
    "meals": [], 
    "order_cess_charges": {}, 
    "order_cess_expressions": {}, 
    "order_date_time": "2019-10-23 08:44:56", 
    "order_edit": false, 
    "order_edit_reason": null, 
    "order_id": "54875696540", 
    "order_packing_charges": 0.0, 
    "order_packing_charges_cgst": 0.0, 
    "order_packing_charges_cgst_percent": 2.5, 
    "order_packing_charges_gst": 0.0, 
    "order_packing_charges_igst": 0.0, 
    "order_packing_charges_igst_percent": 0.0, 
    "order_packing_charges_sgst": 0.0, 
    "order_packing_charges_sgst_percent": 2.5, 
    "order_type": "regular", 
    "outlet_id": "1951", 
    "payment_type": "Online", 
    "restaurant_discount": 0.0, 
    "restaurant_gross_bill": 431.0, 
    "restaurant_name": "Bikanervala", 
    "restaurant_service_charges": 0.0
}

Taxes: The payload consists of tax on the order split into SGST(2.5%) and CGST(2.5%) as standard along with the exact amount calculated on the order. 

Customer info: Customer details are masked by swiggy because they do not share customer info with the business. Every order from Swiggy would have the same customer name (Swiggy), email (NA) phone number(1234567890) and address (Bangalore, Bangalore, Bangalore) displayed in our dashboard under user details.

Item details: The item array consists of  item name, external id (Swiggy ID) of the item, price of the item, tax applicable on the item, charges applicable on the item, quantity and and the subtotal of the items after computing the quantity and price of each item.

Option details: The options added to any item are relayed as a subset of the items array. The array consists of option ID, price and title of the option.

Note: The tax field is always 0 because the tax is calculated on the item level after adding the option's price to the item.

Order details: The Swiggy order ID of the item, UrbanPiper outlet ID at which the order was placed, time, date, and mode of payment.

Charges: The charges applicable on the order level, along with the the tax on the charges.


Order Relay for Zomato

Here's a sample payload that Zomato relays to our system:

{
    "amount_balance": 0, 
    "amount_paid": 320, 
    "cash_to_be_collected": 0, 
    "customer_details": {
        "address": "P-1/16 budh vihar phase-1, Budh Vihar Phase I, Budh Vihar, Delhi, NCT of Delhi, India", 
        "address_instructions": "", 
        "address_type": "Home", 
        "city": "Delhi NCR", 
        "country": "India", 
        "delivery_area": "Budh Vihar Phase I, Budh Vihar, Delhi, India", 
        "delivery_area_latitude": "28.70969381860760", 
        "delivery_area_longitude": "77.08666227757931", 
        "delivery_coordinates_type": "user", 
        "email": "2248902902@example.com", 
        "name": "CA Sunil Aggarwal", 
        "order_instructions": "", 
        "phone_number": "02248902902", 
        "pincode": ""
    }, 
    "enable_delivery": 0, 
    "gross_amount": 320, 
    "is_special_combo_order": 0, 
    "net_amount": 320, 
    "order_date_time": 1571800538, 
    "order_discounts": [], 
    "order_id": 1038825694, 
    "order_instructions": "", 
    "order_items": [
        {
            "item_charges": [], 
            "item_discounts": [], 
            "item_final_price": 152.25, 
            "item_id": "160595", 
            "item_name": "Paneer Pakoda", 
            "item_quantity": 5, 
            "item_taxes": [
                {
                    "tax_amount": 7.25, 
                    "tax_applied_on": "DELIVERY", 
                    "tax_id": "138", 
                    "tax_is_active": true, 
                    "tax_name": "GST", 
                    "tax_type": "PERCENTAGE", 
                    "tax_value": 5
                }
            ], 
            "item_unit_price": 29, 
            "order_item_id": 1, 
            "zomato_item_id": 1074326694
        }, 
        {
            "item_charges": [], 
            "item_discounts": [], 
            "item_final_price": 78.75, 
            "item_id": "160618", 
            "item_name": "Samosa", 
            "item_quantity": 5, 
            "item_taxes": [
                {
                    "tax_amount": 3.75, 
                    "tax_applied_on": "DELIVERY", 
                    "tax_id": "138", 
                    "tax_is_active": true, 
                    "tax_name": "GST", 
                    "tax_type": "PERCENTAGE", 
                    "tax_value": 5
                }
            ], 
            "item_unit_price": 15, 
            "order_item_id": 2, 
            "zomato_item_id": 1074326710
        }, 
        {
            "item_charges": [], 
            "item_discounts": [], 
            "item_final_price": 88.998, 
            "item_id": "1199552", 
            "item_name": "Grilled Sandwich with chips", 
            "item_quantity": 1, 
            "item_taxes": [
                {
                    "tax_amount": 4.238, 
                    "tax_applied_on": "DELIVERY", 
                    "tax_id": "138", 
                    "tax_is_active": true, 
                    "tax_name": "GST", 
                    "tax_type": "PERCENTAGE", 
                    "tax_value": 5
                }
            ], 
            "item_unit_price": 84.76, 
            "order_item_id": 3, 
            "zomato_item_id": 1074326553
        }
    ], 
    "order_status": "placed", 
    "order_type": "DELIVERY", 
    "outlet_id": "1951", 
    "payment_mode": "ONLINE", 
    "payment_status": "PAID", 
    "restaurant_id": 18435918, 
    "restaurant_name": "Bikanervala", 
    "total_merchant": 320
}

Customer details: Address and name of the customer are relayed. However the phone number and email ID are masked.

Bill details: Consists of the total bill, any amount due from the same user from any previous orders(can include due amount because of previous cancellations), Zomato order ID, Zomato outlet ID and UrbanPiper ID, payment mode (online or cash), order instructions, any charges applicable (name, type and value) on the order sub-total level along with the Zomato charge ID and delivery type (either Zomato delivery or self delivery by restaurant).

Item details: Item name, Zomato item ID, item price, quantity added for the item, and the tax applied on the item and any charges applicable at the item level.

Discount details: Discount amount, discount category, the price on which the tax is applicable, whether the discount is taxable, the discount type (fixed or percentage), and whether the discount is sponsored by Zomato (1 in case it is sponsored by Zomato).


Order Relay for Ubereats

{
    "charges": [
        {
            "charge_type": "subtotal", 
            "formatted_price": "\u20b9\u00a01,680.00", 
            "price": "168000"
        }, 
        {
            "charge_type": "tax", 
            "formatted_price": "\u20b9\u00a084.00", 
            "price": "8400"
        }, 
        {
            "charge_type": "delivery_fee", 
            "formatted_price": "\u20b9\u00a020.00", 
            "price": "2000"
        }
    ], 
    "created_time": 1571800412505, 
    "currency_code": "INR", 
    "current_state": "created", 
    "eater_info": {
        "first_name": "deepak"
    }, 
    "order_items": [
        {
            "external_data": "1157284", 
            "item_id": "1aae5c7c-49a7-48e1-ab46-52bc071485b1", 
            "price": "0", 
            "quantity": 1, 
            "selected_options": [
                {
                    "external_data": "1157284-13143", 
                    "option_id": "70b61162-fbb0-4b72-866c-6ade9e41044f", 
                    "price": "56000", 
                    "quantity": 1
                }
            ]
        }, 
        {
            "external_data": "1157284", 
            "item_id": "1aae5c7c-49a7-48e1-ab46-52bc071485b1", 
            "price": "0", 
            "quantity": 1, 
            "selected_options": [
                {
                    "external_data": "1157284-13143", 
                    "option_id": "70b61162-fbb0-4b72-866c-6ade9e41044f", 
                    "price": "56000", 
                    "quantity": 1
                }
            ]
        }, 
        {
            "external_data": "1157284", 
            "item_id": "1aae5c7c-49a7-48e1-ab46-52bc071485b1", 
            "price": "0", 
            "quantity": 1, 
            "selected_options": [
                {
                    "external_data": "1157284-13143", 
                    "option_id": "70b61162-fbb0-4b72-866c-6ade9e41044f", 
                    "price": "56000", 
                    "quantity": 1
                }
            ]
        }
    ], 
    "order_num": "B7AAA", 
    "store_id": "6bc0d97e-3e43-49f6-a835-a03f6a5e72a8"
}



Was this article helpful?