# POST /api/billing-runs/{id}/cancel

Billing Runs: Cancels a pending or running billing run.

The optional cancellation reason is supplied in the request body (not the query string) so
the free-text note is not captured by ingress/access logs, proxies, or APM. The body is
optional: an empty body cancels the run with no attributed reason.

**Operation ID:** `POST_api_billing-runs_id_cancel`

## Authorization

Requires: MerchantBilling.BillingRuns, MerchantBilling.BillingRuns.Create, merchant scope.

Required permissions:
- `MerchantBilling.BillingRuns`
- `MerchantBilling.BillingRuns.Create`

## Parameters

| Name | In | Required | Type | Description |
| --- | --- | --- | --- | --- |
| id | path | yes | string(uuid) | The billing run identifier. |
| suppressNulls | query | no | boolean | If true, omit properties with null values. |

## Request Body

The cancellation input carrying the optional reason; may be omitted.

**Content type:** `application/json`

Schema: `PhoeniXGateMerchantBillingBillingRunsCancelBillingRunInput`

**Content type:** `text/json`

Schema: `PhoeniXGateMerchantBillingBillingRunsCancelBillingRunInput`

**Content type:** `application/*+json`

Schema: `PhoeniXGateMerchantBillingBillingRunsCancelBillingRunInput`

## Responses

### 204

The billing run was cancelled.

### 400

The run is not in a pending or running state, or the reason is too long.

### 404

No billing run exists with the specified id.

### 403

Forbidden

**Content type:** `text/plain`

Schema: `WinkPGHttpRemoteServiceErrorResponse`

**Content type:** `application/json`

Schema: `WinkPGHttpRemoteServiceErrorResponse`

**Content type:** `text/json`

Schema: `WinkPGHttpRemoteServiceErrorResponse`

### 401

Unauthorized

**Content type:** `text/plain`

Schema: `WinkPGHttpRemoteServiceErrorResponse`

**Content type:** `application/json`

Schema: `WinkPGHttpRemoteServiceErrorResponse`

**Content type:** `text/json`

Schema: `WinkPGHttpRemoteServiceErrorResponse`

### 501

Not Implemented

**Content type:** `text/plain`

Schema: `WinkPGHttpRemoteServiceErrorResponse`

**Content type:** `application/json`

Schema: `WinkPGHttpRemoteServiceErrorResponse`

**Content type:** `text/json`

Schema: `WinkPGHttpRemoteServiceErrorResponse`

### 500

Internal Server Error

**Content type:** `text/plain`

Schema: `WinkPGHttpRemoteServiceErrorResponse`

**Content type:** `application/json`

Schema: `WinkPGHttpRemoteServiceErrorResponse`

**Content type:** `text/json`

Schema: `WinkPGHttpRemoteServiceErrorResponse`

### default

The request failed. The body carries the standard error envelope: a machine-readable `error.code`, a human-readable `error.message`, and `error.validationErrors` when the failure was a validation rejection. See the error-code reference in this document's description for the values `error.code` can take.

**Content type:** `application/json`

Schema: `WinkPGHttpRemoteServiceErrorResponse`

## See also

- [All documentation](https://docs.winkpg.io/llms.txt): the machine-readable index of every public page on this site.
