# Void a payment

`POST https://app.shuttleglobal.com/c/api/instances/{instance_key}/payments/{payment_id}/void`

Void (cancel) an authorisation, releasing the hold on the customer's funds.
The void is for the authorised amount less anything already captured, and nothing more can be captured afterwards.

There are no parameters required to void a payment.

## Authentication

- basicAuth: Basic Authentication using secret key
- bearerAuth: OAuth 2.0 Bearer Token Authentication

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `payment_id` | path | string | yes | The authorisation's payment ID (`pay_...`) or transaction ID (`tr_...`), or the `alt_key` you gave it (case-insensitive). The record must be an authorisation, otherwise 404 `Payment not found`. An `alt_key` resolves to the newest authorisation with an amount still open, ignoring failed attempts. |

## Request body (`application/json`)


## Responses

### 200: Void processed

```json
{
  "void": {
    "id": "vo_5139_10151",
    "payment": "pay_5139_10150",
    "amount": "100",
    "status": "SUCCESS",
    "reference": "REF-00010151",
    "created": "2019-10-01T16:25:24.000Z",
    "processed": "2019-10-01T16:25:27.000Z"
  }
}
```

### 400: Bad request - invalid parameters

```json
{
  "code": "string",
  "message": "string"
}
```

### 401: Unauthorized - invalid credentials

```json
{
  "code": "UNAUTHORIZED",
  "message": "Unauthorised"
}
```

### 404: Payment not found

```json
{
  "code": "string",
  "message": "string"
}
```

## Example request

```sh
curl --request POST \
  --url https://app.shuttleglobal.com/c/api/instances/YOUR_INSTANCE_KEY/payments/PAYMENT_ID/void \
  --header 'Authorization: Basic <base64 of SECRET_KEY:>' \
  --header 'Content-Type: application/json' \
  --data '{}'
```

Reference page: https://docs.shuttleglobal.com/platforms/reference/operations/voidpayment/