---
title: "Cancel Payment"
method: POST
path: "/api/v1/payments/{paymentId}/cancel"
tags: ["Payments"]
---

# Cancel Payment

`POST /api/v1/payments/{paymentId}/cancel`

## Request

- Base URL: `https://merchant-api.accruesavings.com`
- URL: `https://merchant-api.accruesavings.com/api/v1/payments/{paymentId}/cancel`
- Auth: none declared. Required headers: `Client-ID`, `Authorization`
- TypeScript: <https://skmtc.dev/byaccrue/apis/accrue-merchant-api/docs/api/v1/payments/:paymentId/cancel/post.ts> (a function with typed inputs; its response is checked against the schema)

The cancel endpoint can be called on a `Payment` that is in the `Created` or `Waiting` status, otherwise it will return an error.

  A Payment will be in the `Waiting` status if you the capture endpoint has been called but the capture is in the waiting period before
  it is actually committed. Cancelling is always the full amount so there’s no support for partial amounts with cancel.
 The status of the
  payment will transition to `Canceled` **ONLY** after successfully calling the cancel endpoint.

  **For Card Rails (Virtual Debit Cards)**, this endpoint should only be called if the manual capture on your payment processor fails.

  Refer to [Merchant API](/docs/payments/merchant-api/#payment-authorization-and-capture-via-card-rails-virtual-debit-cards) Guide for more information.

## Path parameters

- `paymentId` string, uuid, required: Payment ID

## Query parameters

- `include` string: Comma-separated list of resources to include. Supported resources: `paymentIntent`

## Headers

- `Client-ID` string, uuid, required: The unique identifier of the client making the request. This header is required to retrieve the client-specific configuration and ensure that the response is tailored to the client's settings and permissions.
- `Authorization` string, uuid, required: Secure secret to access privileged endpoints.

## Response `200`

OK

- CancelPaymentResponse
  - `data` object, required: A payment
    - `id` string, uuid, required: Unique identifier for the object.
    - `type` 'Payment', required
    - `attributes` object, required
      - `id` string, uuid
      - `status` 'Canceled' | 'Created' | 'Failed' | 'Processing' | 'Returned' | 'Sent': The current status of the payment. Each status indicates a specific phase in the payment process, such as waiting for authorization, being processed, or having been successfully completed or canceled.
      - `amount` integer: The total amount of the payment processed, represented in the smallest currency unit (e.g., cents for USD). To obtain the value in dollars, divide by 100. This amount may differ from the initially intended amount due to adjustments, fees, or additional charges.
      - `channel` string, nullable: External system identifier used to identify the payment channel. E.g. App Name, Activity ID, Checkout Interface, etc.
      - `reference` string, nullable: Reference to the data inside an external system.
      - `disbursement` object[]: Array of disbursements associated with this payment, including counterparty IDs, amounts, and fees.
        - `counterpartyId` string, uuid, required: The ID of the counterparty to whom the funds are being disbursed.
        - `amount` integer, required: The total amount charged with a particular payment method, represented in the smallest currency unit (e.g., cents for USD). To obtain the value in dollars, divide by 100.
        - `fee` integer, required: The fee assigned to this particular disbursement based on the whole payment fee, represented in the smallest currency unit (e.g., cents for USD). To obtain the value in dollars, divide by 100.
        - `remit` boolean, required: Deprecated. Always returns `true`. All disbursements are remitted directly. Will be removed in a future version.
      - `charges` object: Charges applied to this payment.
        - `fee` object: Processing fee details
          - `amount` integer, required: Fee amount in cents
          - `type` string, required: Fee type identifier
        - `rewards` integer: Rewards amount spent from wallet balance, in cents
      - `deductions` object: Legacy charges breakdown. Use `charges` instead.
        - `rewards` integer, required: Rewards amount spent from wallet balance, in cents
        - `fees` integer, required: Processing fees charged, in cents
      - `expiresAt` string, date-time: The field indicates the date and time until which the payment is valid. After this date, the payment will either be automatically cancelled or completed.
      - `updatedAt` string, date-time, required
      - `createdAt` string, date-time, required
    - `relationships` object, required
      - `paymentIntent` object, required
        - `data` object, required
          - `id` string, uuid, required
          - `type` 'PaymentIntent', required
        - `links` object, required
          - `self` string, uri, required
    - `links` object, required
      - `virtualDebitCard` string, required
    - `meta` object: Optional metadata on the Payment resource. Omitted when no processor payload is attached to the response.
      - `processor` unknown
  - `links` object, required
    - `self` string, required
  - `included` object[], required
    - `id` string, uuid, required: Unique identifier for the object.
    - `type` 'PaymentIntent', required
    - `attributes` object, required
      - `balance` object: Optional wallet balance information
        - `available` integer, required: Available wallet balance in cents
        - `eligibleReward` integer, required: Eligible reward amount for this transaction in cents
        - `upperLimit` integer, required: Maximum checkout amount supported for this purchase, in cents
      - `billingAddress` object, nullable
        - `street` string, nullable, required
        - `street2` string, nullable, required
        - `city` string, nullable, required
        - `state` string, nullable, required
        - `postalCode` string, nullable, required
        - `country` string, nullable, required
      - `email` string, email, nullable
      - `error` 'LinkedAccountUnverified' | 'LinkedAccountDisconnected' | 'LinkedAccountMissing' | 'InsufficientBalance' | 'MissingFullName' | 'WrongEmail' | 'InvalidKycStatus', nullable: Specific error associated with the current invalid status.
      - `expiresAt` string, date-time, nullable: The datetime at which the payment intent is set to expire. After this time, the intent cannot be promoted to a payment and is considered expired.
      - `fullName` string, nullable
      - `phoneNumber` string, nullable
      - `amount` integer: Total purchase amount in cents.
      - `reference` string, nullable: Reference to the data inside an external system.
      - `status` 'Promotable' | 'PromotedToPayment' | 'Invalid' | 'Expired' | 'Canceled': The current status of the payment intent. Each status represents a different stage in the payment intent lifecycle, from creation to completion or cancellation.
      - `userId` string, nullable
      - `walletId` string, nullable: The ID of the wallet for which the payment intent is created.
      - `updatedAt` string, date-time, required
      - `createdAt` string, date-time, required

## Other responses

- `400`: Bad Request
- `404`: Not Found

---

[API](https://skmtc.dev/byaccrue/apis/accrue-merchant-api.md) - [All operations](https://skmtc.dev/byaccrue/apis/accrue-merchant-api/llms.txt) - [OpenAPI document](https://skmtc.dev/byaccrue/apis/accrue-merchant-api/revisions/3e2d97ef2e6e?raw)
