# Manage Orders

### Summary Export

Export order summaries as PDF reports. Useful for daily/weekly operational reporting.

### `GET /orders/summary/{exportType}` - Export Order Summary PDF

Generates and downloads a PDF report for orders within the specified date range. The response is a binary PDF file.

#### Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| exportType | string | Yes | Report type: production, delivery, clickAndCollect, or sitIn. |
| startDate | ISO date | Yes | Start date (ISO 8601). |
| endDate | ISO date | Yes | End date (ISO 8601). |
| deliveryAreaID | integer | No | Optional delivery area ID filter. |

#### Response

```json
Binary PDF file (Content-Type: application/pdf)
```

### Cancel Order

Cancel a validated or paid order and generate a contra entry (credit note) for accounting purposes. Requires the `CAN_CANCEL_ORDER_WITH_CONTRA_ENTRY` access flag.

### `POST /v1/orders/{orderPosId}/cancel-with-contra-entry` - Cancel Order with Contra Entry

Cancels an order and generates a contra entry. The cancellation reason is mandatory. If the reason is OTHER, a description must be provided.

#### Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| orderPosId | string | Yes | The POS order ID of the order to cancel. |

#### Request Body

```json
{
  "cancellationReason": "ORDERING_MISTAKE",
  "cancellationReasonDescription": "",
  "manualPaymentMethodCode": "Cash"
}
```

##### Request Body Properties

Every field in the example is listed below. Explicit requiredness is shown when the endpoint contract defines it.

| Property | Type | Example | Description |
| --- | --- | --- | --- |
| cancellationReason | string | "ORDERING\_MISTAKE" | The cancellation reason value. |
| cancellationReasonDescription | string | "" | The cancellation reason description value. |
| manualPaymentMethodCode | string | "Cash" | The manual payment method code value. |

#### Response

```json
{
  "status": 200,
  "code": "order_cancelled_with_contra_entry",
  "message": "Your order has been cancelled with contra entry.",
  "data": {
    "reportOrderContraEntryId": 456,
    "orderPosId": "1927055",
    "cancellationReason": "ORDERING_MISTAKE",
    "contraEntryOrderId": 1927099
  }
}
```

##### Response Properties

Every field in the example is listed below. Explicit requiredness is shown when the endpoint contract defines it.

| Property | Type | Example | Description |
| --- | --- | --- | --- |
| status | integer | 200 | HTTP status code returned by the API. |
| code | string | "order\_cancelled\_with\_contra\_entry" | Machine-readable application code for the result. |
| message | string | "Your order has been cancelled with contra entry." | Human-readable result message. Do not use this value for program logic. |
| data | object | {…} | Endpoint-specific response payload. |
| data.reportOrderContraEntryId | integer | 456 | Identifier of the associated report order contra entry. |
| data.orderPosId | string | "1927055" | Identifier of the associated order pos. |
| data.cancellationReason | string | "ORDERING\_MISTAKE" | The cancellation reason value. |
| data.contraEntryOrderId | integer | 1927099 | Identifier of the associated contra entry order. |

### Cancellation Reasons

CANNOT\_FULFILL\_ORDER

ORDERING\_MISTAKE

UNSATISFIED\_CUSTOMER

CUSTOMER\_NO\_SHOW

CUSTOMER\_LEAVES

LEARNING\_MODE

TECHNICAL

OTHER

### Manual Payment Options

Retrieve the list of available manual payment method codes for order cancellation with contra entry. Requires the `CAN_CANCEL_ORDER_WITH_CONTRA_ENTRY` access flag.

### `GET /v1/orders/payment-methods/manual-options` - Get Manual Payment Method Options

Returns available payment method codes that can be used when cancelling an order with a contra entry.

#### Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| restaurantId | integer | Yes | The restaurant ID. |
| channelId | integer | Yes | The channel ID. |
| consumptionModeId | integer | Yes | The consumption mode ID. |

#### Response

```json
{
  "status": 200,
  "code": "manual_payment_method_code_options_succeed",
  "data": [
    {
      "code": "Cash",
      "label": "Cash"
    },
    {
      "code": "CreditCard",
      "label": "Credit Card"
    },
    {
      "code": "LuncheonVoucher",
      "label": "Luncheon Voucher"
    }
  ]
}
```

##### Response Properties

Every field in the example is listed below. Explicit requiredness is shown when the endpoint contract defines it.

| Property | Type | Example | Description |
| --- | --- | --- | --- |
| status | integer | 200 | HTTP status code returned by the API. |
| code | string | "manual\_payment\_method\_code\_options\_succeed" | Machine-readable application code for the result. |
| data | array | \[…\] | Endpoint-specific response payload. |
| data\[\] | object | {…} | Endpoint-specific response payload. |
| data\[\].code | string | "Cash" | Machine-readable application code for the result. |
| data\[\].label | string | "Cash" | The label value. |
