---
agentTools:
  projectIndex: https://ordatic.readme.io/llms.txt
---

# Orders

Currently the webhook system for Orders handles two types of events. The Order and the Rider types events:

Order type events:

* `order-accepted`
* `order-in-kitchen`
* `order-ready-to-pick-up`
* `order-picked-up`
* `order-served`
* `order-canceled`

Rider type events:

* `rider-created`
* `rider-picking`
* `rider-delivering`
* `rider-completed`
* `rider-error`
* `rider-proof-delivery`
* `rider-refund`

# Event `order-accepted`

***

Sent to know that an order has been created.

##### APP SCOPE

| Channel | Pos | Riders | Loyalty |
| :------ | :-- | :----- | :------ |
| ✖️      | ✔️  | ✖️     | ✖️      |

##### WEBHOOK FORMAT

```json
{
  "eventType": "order-accepted",
  "storeId": "string",
  "data": {
    "orderId": "string"
  }
}
```

##### FIELDS SPECIFICATION

| Field          | Description                                   |
| :------------- | :-------------------------------------------- |
| `eventType`    | The type of event                             |
| `storeId`      | The `storeId` where the event occurred        |
| `data.orderId` | The `orderId` in which the status was updated |

# Event `order-in-kitchen`

***

Sent to know that an order has been received by the POS and will be prepared.

##### APP SCOPE

| Channel | Pos | Riders | Loyalty |
| :------ | :-- | :----- | :------ |
| ✔️      | ✖️  | ✔️     | ✔️      |

##### WEBHOOK FORMAT

```json
{
  "eventType": "order-in-kitchen",
  "storeId": "string",
  "data": {
    "orderId": "string"
  }
}
```

##### FIELDS SPECIFICATION

| Field          | Description                                   |
| :------------- | :-------------------------------------------- |
| `eventType`    | The type of event                             |
| `storeId`      | The `storeId` where the event occurred        |
| `data.orderId` | The `orderId` in which the status was updated |

# Event `order-ready-to-pick-up`

***

Sent to know that an order which the `fulfillment.type` is `delivery-by-location` is ready to be picked up.

##### APP SCOPE

| Channel | Pos | Rider | Loyalty |
| :------ | :-- | :---- | :------ |
| ✔️      | ✖️  | ✔️    | ✖️      |

##### WEBHOOK FORMAT

```json
{
  "eventType": "order-ready-to-pick-up",
  "storeId": "string",
  "data": {
    "orderId": "string"
  }
}
```

##### FIELDS SPECIFICATION

| Field          | Description                                   |
| :------------- | :-------------------------------------------- |
| `eventType`    | The type of event                             |
| `storeId`      | The `storeId` where the event occurred        |
| `data.orderId` | The `orderId` in which the status was updated |

# Event `order-picked-up`

***

Sent to know that an order which the `fulfillment.type` is `takeaway` has been picked up by the customer.

##### APP SCOPE

| Channel | Pos | Rider | Loyalty |
| :------ | :-- | :---- | :------ |
| ✔️      | ✖️  | ✖️    | ✖️      |

##### WEBHOOK FORMAT

```json
{
  "eventType": "order-picked-up",
  "storeId": "string",
  "data": {
    "orderId": "string"
  }
}
```

##### FIELDS SPECIFICATION

| Field          | Description                                   |
| :------------- | :-------------------------------------------- |
| `eventType`    | The type of event                             |
| `storeId`      | The `storeId` where the event occurred        |
| `data.orderId` | The `orderId` in which the status was updated |

# Event `order-served`

***

Sent to know that an order which the `fulfillment.type` is `order-at-table` has been served to the customer.

##### APP SCOPE

| Channel | Pos | Rider | Loyalty |
| :------ | :-- | :---- | :------ |
| ✔️      | ✖️  | ✖️    | ✖️      |

##### WEBHOOK FORMAT

```json
{
  "eventType": "order-served",
  "storeId": "string",
  "data": {
    "orderId": "string"
  }
}
```

##### FIELDS SPECIFICATION

| Field          | Description                                   |
| :------------- | :-------------------------------------------- |
| `eventType`    | The type of event                             |
| `storeId`      | The `storeId` where the event occurred        |
| `data.orderId` | The `orderId` in which the status was updated |

# Event `order-canceled`

***

Sent to know that an order has been canceled.

##### APP SCOPE

| Channel | Pos | Rider | Loyalty |
| :------ | :-- | :---- | :------ |
| ✖️      | ✔️  | ✔️    | ✔️      |

##### WEBHOOK FORMAT

```json
{
  "eventType": "order-canceled",
  "storeId": "string",
  "data": {
    "orderId": "string"
  }
}
```

##### FIELDS SPECIFICATION

| Field          | Description                                   |
| :------------- | :-------------------------------------------- |
| `eventType`    | The type of event                             |
| `storeId`      | The `storeId` where the event occurred        |
| `data.orderId` | The `orderId` in which the status was updated |

# Event `rider-created`

***

Sent to know that an order has been take in charge for the delivery by a rider.

##### APP SCOPE

| Channel | Pos | Rider | Loyalty |
| :------ | :-- | :---- | :------ |
| ✔️      | ✔️  | ✖️    | ✖️      |

##### WEBHOOK FORMAT

```json
{
  "eventType": "rider-created",
  "storeId": "string",
  "data": {
    "orderId": "string"
  }
}
```

##### FIELDS SPECIFICATION

| Field          | Description                                   |
| :------------- | :-------------------------------------------- |
| `eventType`    | The type of event                             |
| `storeId`      | The `storeId` where the event occurred        |
| `data.orderId` | The `orderId` in which the status was updated |

# Event `rider-picking`

***

Sent to know that a rider is on his way to the restaurant in order to pick the order.

##### APP SCOPE

| Channel | Pos | Rider | Loyalty |
| :------ | :-- | :---- | :------ |
| ✔️      | ✔️  | ✖️    | ✖️      |

##### WEBHOOK FORMAT

```json
{
  "eventType": "rider-picking",
  "storeId": "string",
  "data": {
    "orderId": "string"
  }
}
```

##### FIELDS SPECIFICATION

| Field          | Description                                   |
| :------------- | :-------------------------------------------- |
| `eventType`    | The type of event                             |
| `storeId`      | The `storeId` where the event occurred        |
| `data.orderId` | The `orderId` in which the status was updated |

# Event `rider-delivering`

***

Sent to know that a rider is on his way to the customer in order to deliver the order.

##### APP SCOPE

| Channel | Pos | Rider | Loyalty |
| :------ | :-- | :---- | :------ |
| ✔️      | ✔️  | ✖️    | ✖️      |

##### WEBHOOK FORMAT

```json
{
  "eventType": "rider-delivering",
  "storeId": "string",
  "data": {
    "orderId": "string"
  }
}
```

##### FIELDS SPECIFICATION

| Field          | Description                                   |
| :------------- | :-------------------------------------------- |
| `eventType`    | The type of event                             |
| `storeId`      | The `storeId` where the event occurred        |
| `data.orderId` | The `orderId` in which the status was updated |

# Event `rider-completed`

***

Sent to know that the delivery process of an order has been completed correctly.

##### APP SCOPE

| Channel | Pos | Rider | Loyalty |
| :------ | :-- | :---- | :------ |
| ✔️      | ✔️  | ✖️    | ✖️      |

##### WEBHOOK FORMAT

```json
{
  "eventType": "rider-completed",
  "storeId": "string",
  "data": {
    "orderId": "string"
  }
}
```

##### FIELDS SPECIFICATION

| Field          | Description                                   |
| :------------- | :-------------------------------------------- |
| `eventType`    | The type of event                             |
| `storeId`      | The `storeId` where the event occurred        |
| `data.orderId` | The `orderId` in which the status was updated |

# Event `rider-error`

***

Sent to know that an error occurred during the process of delivery of an order.

##### APP SCOPE

| Channel | Pos | Rider | Loyalty |
| :------ | :-- | :---- | :------ |
| ✔️      | ✔️  | ✖️    | ✖️      |

##### WEBHOOK FORMAT

```json
{
  "eventType": "rider-error",
  "storeId": "string",
  "data": {
    "orderId": "string"
  }
}
```

##### FIELDS SPECIFICATION

| Field          | Description                                   |
| :------------- | :-------------------------------------------- |
| `eventType`    | The type of event                             |
| `storeId`      | The `storeId` where the event occurred        |
| `data.orderId` | The `orderId` in which the status was updated |

# Event `rider-proof-delivery`

***

Sent by some riders as proof that the order has been delivered.

##### APP SCOPE

| Channel | Pos | Rider | Loyalty |
| :------ | :-- | :---- | :------ |
| ✔️      | ✖️  | ✖️    | ✖️      |

##### WEBHOOK FORMAT

```json
{
  "eventType": "rider-proof-delivery",
  "storeId": "string",
  "data": {
    "orderId": "string",
    "proofDelivery": "string"
  }
}
```

##### FIELDS SPECIFICATION

[block:parameters]
{
  "data": {
    "h-0": "Field",
    "h-1": "Description",
    "0-0": "`eventType`",
    "0-1": "The type of event",
    "1-0": "`storeId`",
    "1-1": "The `storeId` where the event occurred",
    "2-0": "`data.orderId`",
    "2-1": "The `orderId` in which the status was updated",
    "3-0": "`data.proofDelivery`",
    "3-1": "The  `proofDelivery`string.  \n**UberDirect** case: Long Base64 string that can be converted to a PNG image ([Web Converter](https://codebeautify.org/base64-to-image-converter) (External)) "
  },
  "cols": 2,
  "rows": 4,
  "align": [
    "left",
    "left"
  ]
}
[/block]

# Event `rider-refund`

***

Sent by some riders, when for some reason the order is not delivered.

##### APP SCOPE

| Channel | Pos | Rider | Loyalty |
| :------ | :-- | :---- | :------ |
| ✔️      | ✖️  | ✖️    | ✖️      |

##### WEBHOOK FORMAT

```json
{
  "eventType": "rider-refund",
  "storeId": "string",
  "data": {
    "orderId": "string",
    "refund": {
      id: "string",
      date: "string",
      totalRiderRefund: "number",
      totalPartnerRefund: "number",
      reason: "string",
      refundItems:[
        {
          reason: "string",
          riderAmount: "number",
          partnerAmount: "number",
          partyAtFault: "string",
          items: [
            {
              name: "string",
              qty: "number"
          	},
          ]
      	},
      ],
      refundFees: [
        {
          name: "string",
          amount: "value",
          code: "string"
      	},
      ]
    }
  }
}
```

##### FIELDS SPECIFICATION

| Field                                   | Description                                                                                      |
| :-------------------------------------- | :----------------------------------------------------------------------------------------------- |
| `eventType`                             | The type of event.                                                                               |
| `storeId`                               | The `storeId` where the event occurred.                                                          |
| `data.orderId`                          | The `orderId` in which the status was updated.                                                   |
| `data.refund`                           | The refund Data `Object`                                                                         |
| `data.refund.id`                        | The refund identifier.                                                                           |
| `data.refund.date`                      | Refund creation date.                                                                            |
| `data.refund.totalRiderRefund`          | Total monetary amount that Rider will adjust on the billing details report and invoice in cents. |
| `data.refund.totalPartnerRefund`        | Total monetary amount that the partner is liable to their customers in cents.                    |
| `data.refund.reason`                    | Refund reason.                                                                                   |
| `data.refund.refundItems`               | Array of refund items data `Object`                                                              |
| `data.refund.refundItems.reason`        | Refund item reason.                                                                              |
| `data.refund.refundItems.riderAmount`   | The monetary value of items that Rider will adjust on the invoice in cents.                      |
| `data.refund.refundItems.partnerAmount` | The monetary value of items that the partner is liable towards their customers in cents.         |
| `data.refund.refundItems.partyAtFault`  | Party at fault.                                                                                  |
| `data.refund.refundItems.items`         | Array of items `Object`                                                                          |
| `data.refund.refundItems.items.name`    | Refund Item name.                                                                                |
| `data.refund.refundItems.items.qty`     | Quantity of the item.                                                                            |
| `data.refund.refundFees`                | Array of refund Fees data `Object`                                                               |
| `data.refund.refundFees.name`           | Refund fee name.                                                                                 |
| `data.refund.refundFees.amount`         | Refund fee amount.                                                                               |
| `data.refund.refundFees.code`           | Refund fee Code.                                                                                 |