# Cancel a Pay-In Instruction

> Coming soon, upon request — this feature is turned on for your tenant by the Aurea team. [Contact us](https://www.aureahub.com/contact)

Withdraw an open instruction the user no longer needs.

## Overview

- Only an `open` instruction: otherwise `409` `BANK_RAMP_INSTRUCTION_CLOSED`.
- A payment of its amount that arrives later is not credited automatically: it waits for your tenant's review.

Called with the user's access token, in one environment (`isTestnet`). See [Bank Ramp: Local Rails](https://docs.aureahub.com/docs/guide-bank-local.md).

## Endpoint

### `POST /v1/ramp/bank/customer/instructions/{id}/cancel`

Authentication: bearer token required.

Withdraws an open pay-in instruction.

**Path parameters**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string (uuid) | yes | The record's `id` |

**Query parameters**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `isTestnet` | boolean | no | `true` for the sandbox; `false` or omitted for production |

**Responses**

`200` Cancelled

```json
{
  "id": "6b1f2d9e-3c4a-4e8b-9f21-7a5d0c3e8b14",
  "environment": "production",
  "asset": "KES",
  "requestedAmount": "15000.00",
  "amountToPay": "15000.37",
  "expectedCredit": "14775.36",
  "status": "cancelled",
  "delivery": {
    "kind": "balance"
  },
  "payTo": null,
  "payBy": "2026-10-24T09:00:00.000Z",
  "matchedAt": null,
  "createdAt": "2026-10-23T09:00:00.000Z"
}
```

`409` Not open

```json
{
  "statusCode": 409,
  "error": "BankRampOperationError",
  "message": "The instruction is matched.",
  "details": {
    "code": "BANK_RAMP_INSTRUCTION_CLOSED"
  }
}
```

---

Web version: https://docs.aureahub.com/#local-instruction-cancel
