> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sibipro.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Order Cancellation Requests

## Cancellation Request Created

This event is triggered when an order cancellation request is first created. The event will have a topic of `order.cancellationrequest.created`.

When a cancellation request is created, the status will always be `pending`.

## `orderId`

The unique identifier for the order.

## `poNumber`

Purchase order number associated with this order. Defined by the person that placed the order. Is `null` when not available.

## `status`

The current status of the cancellation request. Will be one of:

* `Pending` - The cancellation request is awaiting review
* `Approved` - The cancellation request was approved and the order has been cancelled
* `Denied` - The cancellation request was denied and the order continues processing

## `reason`

The reason provided for the cancellation request.

## `createdAt`

The timestamp when the cancellation request was created in ISO 8601 format.

## `updatedAt`

The timestamp when the cancellation request was last updated in ISO 8601 format.

### Example payload

```json theme={null}
{
  "topic": "order.cancellationrequest.created",
  "data": {
    "orderId": "ORD-12345XYZ",
    "poNumber": "customer-po-number",
    "status": "Pending",
    "reason": "Customer requested cancellation - wrong item ordered",
    "createdAt": "2025-03-18T15:30:45.123Z",
    "updatedAt": "2025-03-18T15:30:45.123Z"
  }
}
```

## Cancellation Request Updated

This event is triggered when an order cancellation request status changes. The event will have a topic of `order.cancellationrequest.updated`.

This event fires when:

* A pending cancellation request is approved (status changes to `Approved`)
* A pending cancellation request is denied (status changes to `Denied`)
* A cancellation request status changes back to pending (status changes to `Pending`)

Note: This event does NOT fire when the cancellation request is initially created with `pending` status. Use `order.cancellationrequest.created` for that. The `.updated` event only fires for subsequent status changes.

### Fields

All fields are the same as `order.cancellationrequest.created`.

### `status`

For the `.updated` event, status will be one of:

* `Pending` - The cancellation request status changed back to pending
* `Approved` - The cancellation request was approved and the order has been cancelled
* `Denied` - The cancellation request was denied and the order continues processing

### Example payload

```json theme={null}
{
  "topic": "order.cancellationrequest.updated",
  "data": {
    "orderId": "ORD-12345XYZ",
    "poNumber": "customer-po-number",
    "status": "Approved",
    "reason": "Customer requested cancellation - wrong item ordered",
    "createdAt": "2025-03-18T15:30:45.123Z",
    "updatedAt": "2025-03-18T16:45:22.456Z"
  }
}
```
