---
updatedAt: 2025-09-09T21:10:29.000Z
agentTools:
  projectIndex: https://developer.paylink.sa/llms.txt
---

# Cancel Invoice

This endpoint enables the cancellation of an existing invoice. It requires the invoice transaction number to cancel it, preventing further payment processing.

## Endpoint

```http
POST /api/cancelInvoice
```

## Request Headers

| Header        | Required | Description                                                                                          |
| :------------ | :------- | :--------------------------------------------------------------------------------------------------- |
| Authorization | Yes      | Bearer token provided by [Authentication Endpoint](https://developer.paylink.sa/docs/authentication) |
| Accept        | Yes      | It must be set to **application/JSON**.                                                              |
| Content-Type  | Yes      | It must be set to **application/JSON**.                                                              |

```json JSON
{
  "Authorization": "Bearer [id_token]",
  "Accept": "application/json",
  "Content-Type": "application/json"
}
```

## Request Body Parameters

| Parameter     | Type   | Required | Description                                      |
| ------------- | ------ | -------- | ------------------------------------------------ |
| transactionNo | string | Yes      | The unique transaction number is to be canceled. |

An example of the request is as follows:

```json JSON
{
  "transactionNo": "1707943132122"
}
```

## Response Body

The API endpoint will return a JSON response with the following parameters:

| Parameter | Type    | Description                                                                |
| :-------- | :------ | :------------------------------------------------------------------------- |
| success   | Boolean | This field indicates whether this endpoint operation is successful or not. |

Example of the response:

```json JSON
{
  "success": true
}
```