# Order Cancellation

This endpoint allows merchants to request order cancellation through the Keeta platform when they are unable to fulfill a customer's order.
**Notes:**
1. The developers should only invoke this API when the merchant is **unable to fulfill the order.**
2. Upon successful cancellation, the order status will be updated to **"CANCELLED"** in Keeta's system and Keeta will **automatically initiate a full refund** to the customer.
3. This API **does not support duplicate calls**. If the order is already in a **"CANCELLED"** state, the system will return an error response.
4. Merchants should **confirm the necessity of cancellation** before proceeding to avoid unnecessary losses.

Endpoint: POST /order/cancel
Version: v.1.0.0

## Request fields (application/json):

  - `orderViewId` (integer, required)
    Unique identifier for orders on Keeta platform
    Example: 756823555555859

  - `shopId` (integer, required)
    Unique identifier of the Keeta store
    Example: 466663

  - `cancelCode` (integer, required)
    This field represents the code value for the reason an order was canceled. Please send the corresponding cancellation reason code for the merchant's order cancellation in this field.
    Enum: "500000", "500001", "500002", "500003"

  - `cancelReason` (string)
    This text field provides a detailed explanation for the cancellation when using the generic reason code (500000).
    Example: too expensive

## Response 200:

  - `200` (unknown)
    Request executed successfully

## Response 200 fields (application/json):

  - `code` (integer, required)
    A numeric status identifier indicating the result of the interface call, used to determine whether the operation executed successfully.
    Example: 0

  - `message` (string, required)
    Text description corresponding to the status code, explaining the operation result or error cause to users.
    Example: Success

