# Submit a payment cancel request

Send a cancel request if you don't want to proceed with a payment.
**Note:** You can only cancel a payment which is authorized. If the payment is settled, you must create a refund.

Endpoint: POST /api/payments/{linkData}/cancellations
Version: 2024-06-01
Security: BasicAuth

## Security:

  - `BasicAuth` (unknown)
    http basic

## Path parameters:

  - `linkData` (string, required)

## Header parameters:

  - `WP-Api-Version` (string, required)
    The API version

## Request fields (application/json):

  - `reference` (string)
    A reference generated by you to identify a payment throughout its lifecycle.
    Example: full-cancellation-reference

## Response 202:

  - `202` (unknown)
    Accepted

## Response 202 fields (application/json):

  - `outcome` (string)
    Enum: "sentForCancellation"

  - `_links` (object)
    Return details about the status of the payment.

  - `_links.self` (object)

  - `_links.self.href` (string)

## Response 401:

  - `401` (unknown)
    Unauthorized

## Response 401 fields (application/json):

  - `errorName` (string)

  - `message` (string)

## Response 404:

  - `404` (unknown)
    Not found

## Response 404 fields (application/json):

  - `errorName` (string)

  - `message` (string)

## Response 406:

  - `406` (unknown)
    Not acceptable

## Response 406 fields (application/json):

  - `errorName` (string)

  - `message` (string)

  - `headerName` (string)

## Response 415:

  - `415` (unknown)
    Unsupported media type

## Response 415 fields (application/json):

  - `errorName` (string)

  - `message` (string)

## Response 500:

  - `500` (unknown)
    Internal server error

## Response 500 fields (application/json):

  - `errorName` (string)

  - `message` (string)

## Response 202 examples:

  - `sentForCancellation` (unknown)

## Response 401 examples:

  - `Unauthorized` (unknown)

## Response 404 examples:

  - `Not found` (unknown)

## Response 406 examples:

  - `Not acceptable` (unknown)

## Response 415 examples:

  - `Unsupported media type` (unknown)

## Response 500 examples:

  - `Internal server error` (unknown)

