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

# Cancel order

# Cancel Order

Use the Order Cancel API to cancel an unpaid or pending payment order created using the Elite Neo Bank Payment Gateway.

This API allows merchants to:

* Cancel abandoned payment sessions
* Expire unpaid payment links
* Prevent duplicate payment attempts
* Manage order lifecycle securely

Only eligible orders can be cancelled successfully.

***

## Endpoint

```http theme={null}
POST /api/v3/pg/order/cancel
```

#### To view all available base URLs and environments, refer to:

➡️ [API Resources](https://docs.eliteneobank.com/guide/quick-start/api-resources.md)

***

## Authentication required.

Refer to:\
➡️ [Headers](https://docs.eliteneobank.com/guide/authentication/headers.md)\
➡️ [Signature Generation](https://docs.eliteneobank.com/guide/authentication/signature.md)\
➡️ [Timestamp Validation](https://docs.eliteneobank.com/guide/authentication/timestamp.md)

***

## Request Parameters

| Parameter | Type | Required | Description |
| - | - | - | - |
| `order_id` | Integer/String | Yes | Merchant order ID |

***

## Example Request Body

```json theme={null}
{
  "order_id": 6116229263036
}
```

***

## Example cURL Request

```http theme={null}
curl --request POST \
--url https://sandbox.Elite Neo Bank.com/api/v3/pg/order/cancel \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "X-API-KEY: pk_test_xxxxxxxxx" \
--header "X-SIGNATURE: GENERATED_SIGNATURE" \
--header "X-TIMESTAMP: GENERATED_TIMESTAMP" \
--data '{
  "order_id": 6116229263036
}'
```

***

## Example Success Response

```json theme={null}
{
  "code": "200",
  "status": "success",
  "message": "Order cancelled successfully.",
  "return_data": {
    "order_id": 6116229263036,
    "order_status": "CANCELLED",
    "cancelled_at": "13-05-2026 09:14 AM"
  }
}
```

***

## Response Parameters

| Parameter | Description |
| - | - |
| `order_id` | Merchant order ID |
| `order_status` | Updated order status |
| `cancelled_at` | Order cancellation timestamp |

***

## Cancel Eligible Statuses

Orders can typically be cancelled when they are in:

| Status | Description |
| - | - |
| `UN_PAID` | Payment not completed |
| `PROCESSING` | Payment under processing |

Orders that are already:

* `PAID`
* `FAILED`
* `EXPIRED`
* `CANCELLED`

may not be cancellable.

***

## Recommended Use Cases

Use Order Cancel API when:

* Customer abandons checkout
* Payment session expires
* Merchant wants to stop pending payment attempts
* Duplicate orders need cancellation

***

## Important Notes

* `order_id` must belong to your merchant account
* Cancellation may fail for completed payments
* Always verify final order status using Order Status API
* Cancelled payment links should not be reused

***

## Recommended Workflow

1. Create Order
2. Redirect customer to payment page
3. Customer abandons payment or session expires
4. Call Order Cancel API
5. Verify updated order status

***

## Common Errors

### 400 Bad Request

Possible reasons:

* Missing `order_id`
* Invalid request payload
* Incorrect request structure

***

### 401 Unauthorized

Possible reasons:

* Invalid API key
* Incorrect signature
* Expired timestamp

***

### Order Cannot Be Cancelled

Possible reasons:

* Payment already completed
* Order already cancelled
* Invalid order state

***

## Security Recommendations

* Generate signatures server-side only
* Use HTTPS for all API requests
* Never expose secret keys publicly
* Verify order ownership before cancellation
* Validate timestamps for every request

***

## Best Practices

* Cancel abandoned payment sessions regularly
* Verify order status before cancellation attempts
* Avoid duplicate payment links
* Store cancellation logs for reconciliation


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.