{
    "openapi": "3.0.0",
    "info": {
        "title": "Reporting",
        "description": {
            "$ref": "./content/reportingEndpoints"
        },
        "version": "",
        "x-feedbackLink": {}
    },
    "x-externalLinks": [
        {
            "label": "Homepage",
            "url": "https://deliverectdevportal.lovable.app/"
        },
        {
            "label": "API Status",
            "url": "https://status.deliverect.com/"
        }
    ],
    "servers": [],
    "tags": [
        {
            "name": "Partner Webhooks",
            "description": "Partner Webhooks"
        }
    ],
    "x-topics": [
        {
            "title": "Get Started",
            "content": {
                "$ref": "./content/getStarted"
            }
        },
            {
      "title": "Certification",
      "content": {
        "$ref": "./content/certificationProcess"
      }
    },
        {
            "title": "IP Whitelisting",
            "content": {
                "$ref": "./content/ipWhitelisting"
            }
        },
        {
            "title": "HMAC Authentication",
            "content": {
                "$ref": "./content/hmacAuthentication"
            }
        }
    ],
    "paths": {
        "/new_order": {
            "post": {
                "summary": "New Order",
                "responses": {
                    "200": {
                        "description": "Order received successfully"
                    }
                },
                "tags": [
                    "Partner Webhooks"
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object"
                            },
                            "example": {
                                "_created": "YYYY-MM-DDTHH:mm:ss.SSSSSSZ",
                                "_updated": "YYYY-MM-DDTHH:mm:ss.SSSSSSZ",
                                "_id": "63********************a7",
                                "account": "65********************e9",
                                "channelOrderId": "T5*****17e",
                                "channelOrderDisplayId": "**17E",
                                "posId": "",
                                "posReceiptId": "",
                                "posLocationId": "",
                                "location": "65********************a4",
                                "channelLink": "65********************e2",
                                "status": 2,
                                "statusHistory": [
                                    {
                                        "timeStamp": "YYYY-MM-DDTHH:mm:ss.SSSSSSZ",
                                        "status": 4,
                                        "response": "",
                                        "source": 2
                                    },
                                    {
                                        "timeStamp": "YYYY-MM-DDTHH:mm:ss.SSSSSSZ",
                                        "status": 1,
                                        "response": "",
                                        "source": 5
                                    },
                                    {
                                        "timeStamp": "YYYY-MM-DDTHH:mm:ss.SSSSSSZ",
                                        "status": 2,
                                        "response": "",
                                        "source": 1
                                    }
                                ],
                                "packaging": {
                                    "includeCutlery": false
                                },
                                "by": "",
                                "orderType": 2,
                                "channel": 7,
                                "pos": 10000,
                                "rating": [],
                                "pickupTime": "YYYY-MM-DDTHH:mm:ss.SSSSSSZ",
                                "deliveryTime": "YYYY-MM-DDTHH:mm:ss.SSSSSSZ",
                                "deliveryIsAsap": true,
                                "courier": {
                                    "deliveryBy": ""
                                },
                                "courierUpdateHistory": [
                                    {
                                        "status": 81,
                                        "received": "YYYY-MM-DDTHH:mm:ss.SSSSSSZ",
                                        "courier": {},
                                        "arrivalTime": "YYYY-MM-DDTHH:mm:ss.SSSSSSZ",
                                        "deliveryTime": "YYYY-MM-DDTHH:mm:ss.SSSSSSZ",
                                        "source": 5
                                    }
                                ],
                                "customer": {
                                    "name": "",
                                    "phoneNumber": "",
                                    "phoneAccessCode": "",
                                    "email": ""
                                },
                                "deliveryAddress": {
                                    "street": "1 Greenwich Street, New York, NY 10013, US",
                                    "postalCode": "10013",
                                    "area": "Manhattan",
                                    "city": "New York",
                                    "country": "US",
                                    "source": "1 Greenwich Street, New York, NY 10013, US, 10013, Manhattan, New York, US",
                                    "extraAddressInfo": "Front door has bell"
                                },
                                "orderIsAlreadyPaid": true,
                                "taxes": [],
                                "payment": {
                                    "amount": 11580,
                                    "type": 3,
                                    "due": 0,
                                    "rebate": 0
                                },
                                "note": "",
                                "items": [
                                    {
                                        "plu": "658",
                                        "name": "7UP",
                                        "sortOrder": 0,
                                        "price": 300,
                                        "quantity": 2,
                                        "productType": 1,
                                        "remark": "",
                                        "categoryInfo": {},
                                        "subItems": [],
                                        "packaging": {
                                            "count": 1,
                                            "reusable": false,
                                            "packedItems": 0
                                        },
                                        "productTags": [],
                                        "discountReferenceId": 1,
                                        "discountReferenceIds": [
                                            1
                                        ]
                                    },
                                    {
                                        "plu": "492",
                                        "name": "Burger + Drink",
                                        "sortOrder": 0,
                                        "price": 1290,
                                        "quantity": 1,
                                        "productType": 1,
                                        "remark": "",
                                        "categoryInfo": {},
                                        "subItems": [
                                            {
                                                "plu": "742",
                                                "name": "Big Burger",
                                                "sortOrder": 0,
                                                "price": 0,
                                                "quantity": 1,
                                                "productType": 1,
                                                "categoryInfo": {},
                                                "subItems": [],
                                                "packaging": {
                                                    "count": 1,
                                                    "reusable": false,
                                                    "packedItems": 0
                                                },
                                                "productTags": []
                                            },
                                            {
                                                "plu": "656",
                                                "name": "Cola",
                                                "sortOrder": 0,
                                                "price": 0,
                                                "quantity": 1,
                                                "productType": 1,
                                                "categoryInfo": {},
                                                "subItems": [],
                                                "packaging": {
                                                    "count": 1,
                                                    "reusable": false,
                                                    "packedItems": 0
                                                },
                                                "productTags": []
                                            }
                                        ],
                                        "packaging": {
                                            "count": 1,
                                            "reusable": false,
                                            "packedItems": 0
                                        },
                                        "productTags": []
                                    }
                                ],
                                "decimalDigits": 2,
                                "numberOfCustomers": 0,
                                "channelOrderRawId": "65********************27",
                                "channelOrderHistoryRawIds": [
                                    "64********************37",
                                    "63********************27"
                                ],
                                "serviceCharge": 0,
                                "deliveryCost": 0,
                                "bagFee": 0,
                                "tip": 0,
                                "driverTip": 0,
                                "discountTotal": -936,
                                "discounts": [
                                    {
                                        "type": "item_bogof",
                                        "provider": "restaurant",
                                        "name": "BOGO",
                                        "channelDiscountCode": "",
                                        "referenceId": 1,
                                        "value": 300,
                                        "amount": 300,
                                        "amountRestaurant": 300,
                                        "amountChannel": 0
                                    },
                                    {
                                        "type": "order_percent_off",
                                        "provider": "restaurant",
                                        "name": "PERCENTOFF",
                                        "channelDiscountCode": "",
                                        "referenceId": 2,
                                        "value": 4000,
                                        "amount": 636,
                                        "amountRestaurant": 636,
                                        "amountChannel": 0
                                    }
                                ],
                                "capacityUsages": [],
                                "resolvedBy": "",
                                "brandId": "65********************e8",
                                "timezone": "Europe/Madrid",
                                "date": 20260417
                            }
                        }
                    }
                }
            }
        },
        "/orderStatus": {
            "post": {
                "summary": "Order Status Update",
                "responses": {
                    "200": {
                        "description": "Ok",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "examples": {
                                    "Success": {
                                        "summary": "Success",
                                        "value": {
                                            "message": "Order status update received successfully"
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                "tags": [
                    "Partner Webhooks"
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "orderId": {
                                        "type": "string"
                                    },
                                    "status": {
                                        "type": "integer"
                                    },
                                    "timeStamp": {
                                        "type": "string",
                                        "format": "uri"
                                    },
                                    "reason": {
                                        "type": "string"
                                    },
                                    "channelOrderId": {
                                        "type": "string"
                                    },
                                    "location": {
                                        "type": "string"
                                    },
                                    "isIgnoredPOSStatus": {
                                        "type": "boolean"
                                    }
                                }
                            },
                            "example": {
                                "orderId": "62********************e4",
                                "status": 20,
                                "timeStamp": "YYYY-MM-DDTHH:mm:ss.SSSSSSZ",
                                "reason": "",
                                "channelOrderId": "T5*****17e",
                                "location": "61********************r2",
                                "isIgnoredPOSStatus": false
                            }
                        }
                    }
                }
            }
        },
        "/courierUpdateStatus": {
            "post": {
                "tags": [
                    "Partner Webhooks"
                ],
                "summary": "Courier Update Status",
                "description": {
                    "$ref": "./content/courierUpdateStatus"
                },
                "responses": {
                    "200": {
                        "description": "Ok",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "examples": {
                                    "Success": {
                                        "summary": "Success",
                                        "value": {
                                            "message": "Courier update status received successfully"
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object"
                            },
                            "example": {
                                "received": "YYYY-MM-DDTHH:mm:ss.SSSSSSZ",
                                "orderId": "61********************b4",
                                "rawDriverUpdate": "{}",
                                "updatedOrigin": 6,
                                "pickupTime": "YYYY-MM-DDTHH:mm:ss.SSSSSSZ",
                                "courier": {
                                    "deliveryBy": "",
                                    "status": 83,
                                    "firstName": "",
                                    "lastName": "",
                                    "phoneNumber": ""
                                },
                                "deliveryTime": "YYYY-MM-DDTHH:mm:ss.SSSSSSZ",
                                "location": "63********************d2"
                            }
                        }
                    }
                }
            },
            "components": {
                "securitySchemes": {
                    "BearerAuth": {
                        "type": "http",
                        "scheme": "bearer"
                    }
                }
            }
        }
    }
}
