> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tender.cash/llms.txt
> Use this file to discover all available pages before exploring further.

# Cancel Payment

> Cancel a pending payment request

> [!NOTE]
>
> **Auth method: Basic (Access ID)** — this endpoint only requires your
> `x-access-id` header. No request signing is needed. See
> [Authentication](/api-reference/authentication.md#basic-access-id-authentication).

Cancels a payment request that is still `pending`, for example when the customer abandons
checkout. Once cancelled, Tender stops checking the deposit address for this payment, and its
`reference` can be used for a new payment.

* Only `pending` payments can be cancelled. A payment that has received funds, or has already
  completed, can't be cancelled.
* The call is idempotent: cancelling a payment that is already cancelled returns success again.
* A successful cancellation sends the `transaction_cancelled` [webhook event](/get-started/webhook-events.md).
  Repeating the call doesn't send it again.

You can only cancel payments that belong to your merchant account. Payment endpoints share a limit
of 120 requests per minute. See [Rate limits](/api-reference/rate-limits.md).

## Path Parameters

**id** `string` *required*

The `txId` returned when the payment was initiated

**Example:** `"66aec7de809b7f45c42a49f9"`

## Headers

**x-access-id** `string` *required*

Your API access ID provided by Tender

**Example:** `"your-access-id-here"`

## Response

**status** `string` *required*

Status of the API request

**Example:** `"success"`

**message** `string` *required*

Human-readable message describing the result

**Example:** `"success"`

**data** `object` *required*

The cancelled payment

**data properties**

**txId** `string`

The payment's transaction ID

**Example:** `"66aec7de809b7f45c42a49f9"`

**status** `string`

Always `cancelled`

**Example:** `"cancelled"`

**referenceId** `string`

Your `reference`, or an empty string

**Example:** `"ORDER-9821"`

**cancelledAt** `string`

ISO 8601 timestamp of the cancellation. Omitted when the payment was already cancelled.

**Example:** `"2026-10-15T09:12:00.000Z"`

## Errors

| HTTP | Message | Cause |
| - | - | - |
| 400 | `Invalid tx id` | The ID is unknown or doesn't belong to your merchant account |
| 400 | `Invalid resource ID format` | The ID isn't a valid transaction ID |
| 400 | `Transaction with status '<status>' can no longer be cancelled` | The payment isn't `pending` (for example, it is `completed` or `partial-payment`) |

Error responses use the standard envelope with `data: null`. See [Errors](/api-reference/errors.md).

## Example request

```bash theme={null}
curl -X POST https://sandbox-api.tender.cash/v1/api/payment/cancel/66aec7de809b7f45c42a49f9 \
  -H "x-access-id: your-access-id-here"
```

## Example response

```json theme={null}
{
  "status": "success",
  "message": "success",
  "data": {
    "txId": "66aec7de809b7f45c42a49f9",
    "status": "cancelled",
    "referenceId": "ORDER-9821",
    "cancelledAt": "2026-10-15T09:12:00.000Z"
  }
}
```


## OpenAPI

````yaml POST /v1/api/payment/cancel/{id}
openapi: 3.1.0
info:
  title: Tender API
  description: Tender Developer API for cryptocurrency payments and agent management
  version: 2.0.0
  contact:
    name: Tender Support
    url: https://tender.cash
servers:
  - url: https://secureapi.tender.cash
    description: Production Server
  - url: https://sandbox-api.tender.cash
    description: Sandbox Server
security:
  - SignedAuth: []
tags:
  - name: Agents
    description: Manage agents and sub-businesses
  - name: Transactions
    description: Payment and transaction operations
  - name: System
    description: System information and configuration
  - name: Webhooks
    description: Webhook management and logs
  - name: On-ramp
    description: Fiat-to-crypto on-ramp operations
  - name: Payouts
    description: Send crypto from merchant balance to a wallet address or payout account
  - name: Subwallets
    description: Provision and manage crypto wallet infrastructure for your end-users
  - name: Conversions
    description: Swap crypto between coins and chains, or convert to a payout account
paths:
  /v1/api/payment/cancel/{id}:
    post:
      tags:
        - Transactions
      summary: Cancel Payment
      description: >-
        Cancel a pending payment. Idempotent. Sends the `transaction_cancelled`
        webhook on the first successful cancellation.
      operationId: cancelPayment
      parameters:
        - name: id
          in: path
          required: true
          description: The payment's txId
          schema:
            type: string
          example: 66aec7de809b7f45c42a49f9
        - name: x-access-id
          in: header
          required: true
          description: Your API access ID provided by Tender
          schema:
            type: string
          example: your-access-id-here
      responses:
        '200':
          description: Payment cancelled
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentsCancelResponse'
        '400':
          description: Unknown ID, or the payment is no longer pending
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentsErrorResponse'
              example:
                status: error
                message: Transaction with status 'completed' can no longer be cancelled
                data: null
        '401':
          description: Missing or unknown access ID
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentsErrorResponse'
              example:
                status: error
                message: INVALID_REQUEST_SIGNATURE
                data: {}
        '429':
          description: Too many requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentsErrorResponse'
              example:
                status: error
                message: Too many requests. Max 120 per 60s.
                data: null
      security:
        - AccessIdAuth: []
components:
  schemas:
    PaymentsCancelResponse:
      type: object
      properties:
        status:
          type: string
          example: success
        message:
          type: string
          example: success
        data:
          type: object
          properties:
            txId:
              type: string
              example: 66aec7de809b7f45c42a49f9
            status:
              type: string
              enum:
                - cancelled
            referenceId:
              type: string
              example: ORDER-9821
            cancelledAt:
              type: string
              format: date-time
              description: Omitted when the payment was already cancelled
    PaymentsErrorResponse:
      type: object
      required:
        - status
        - message
      properties:
        status:
          type: string
          enum:
            - error
        message:
          type: string
        data:
          nullable: true
          description: Usually `null` or `{}`
  securitySchemes:
    SignedAuth:
      type: apiKey
      in: header
      name: authorization
      description: >-
        Signed (HMAC) authentication. Required headers: x-access-id,
        x-request-id (UUID v4), x-timestamp (ISO 8601, must be within 5 minutes
        of server time), and authorization: the Base64 HMAC-SHA256 of the JSON
        string
        {"timeStamp":"<x-timestamp>","requestId":"<x-request-id>","accessId":"<x-access-id>"}
        (keys in that order, no whitespace) using your access secret. The
        request body, method and path are not signed. The API key must be linked
        to an outlet.
    AccessIdAuth:
      type: apiKey
      in: header
      name: x-access-id
      description: >-
        Basic (Access ID) authentication. Only the x-access-id header is
        required; no request signing.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.