# Remove order: Cancel an order created with your secret API key

If an order hasn't been confirmed then you can cancel it.

If the order is successfully cancelled then cancelled_at parameter will display the time the order was cancelled at. If the order cannot be cancelled and error will be returned.

WARNING

THE BANK SHOULD NOT REMOVE FUND HOLD ON A CUSTOMER’S ACCOUNT UNTIL IT HAS RECEIVED THIS CONFIRMATION!

If you have followed the tutorial to this point, you have no orders to remove. So go create an order, then come back here with the Order ID.

TIP

In the curl command below, replace $orderId with your Order ID. The Order ID should look like this: tx-vq5ej63d0p

curl --location --request PUT 'https://localhost/api/v1/order/$orderId/remove' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer secret-api-token'
1
2
3

The response will be an order object with the cancelled_at value set to the current time.

{
    "id": "tx-vq5ej63d0p",
    "parent_id": null,
    "user_id": "ld87yg",
    "poster_currency": "NGN",
    "matcher_currency": "USD",
    "poster_payment_method_type": "nigerian_bank_payment",
    "matcher_payment_method_type": "zelle_payment",
    "matcher_amount": 500,
    "poster_amount": 180750,
    "exchange_rate": 361.5,
    "posted_at": "2020-01-26T07:46:48.000Z",
    "updated_at": "2020-01-26T07:47:27.654Z",
    "is_matched": false,
    "is_confirmed": false,
    "is_cancelled": true,
    "is_completed": 0,
    "confirmed_at": null,
    "expires_at": "2020-01-27T00:00:00.000Z",
    "matched_at": null,
    "completed_at": null,
    "cancelled_at": "2020-01-26T07:47:27.654Z",
    "is_accepted": false,
    "external_order": {
        "id": 15,
        "created_by": "mdzqmd",
        "order_id": "tx-vq5ej63d0p",
        "current_account_balance": 123123.12,
        "transaction_fee": 123.12,
        "transaction_fee_currency": "NGN",
        "created_at": "2020-01-26T07:46:48.000Z",
        "updated_at": "2020-01-26T07:46:48.000Z"
    },
    "is_processing": 0,
    "can_cancel_order": false
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36