---
title: "Cancel a payment"
method: POST
path: "/merchant/workflows/{workflowCode}/executions/{executionId}/cancel"
tags: ["Actions"]
---

# Cancel a payment

`POST /merchant/workflows/{workflowCode}/executions/{executionId}/cancel`

Request a payment cancelation during a workflow execution.

## Path parameters

- `workflowCode` string, required — Machine-friendly code of Workflow.
- `executionId` string, uuid, required

## Headers

- `x-idempotency-key` string, uuid, required

## Request body

- object
  - `reason` 'BetterPrice' | 'CustomerDontNeed' | 'DamagedProduct' | 'Duplicate' | 'FraudulentProduct' | 'LateDelivery' | 'NoReason' | 'ProductMismatchDescription' | 'WrongProduct' | 'WrongProductSpecification' — Reason for invoking the operation or action.
  - `reasonDescription` string — An optional field to include any necessary information for the capture action.

## Response `202`

The payment cancelation was requested.

- object
  - `name` 'cancel', required — Performed action name.
  - `actionId` string, uuid, required — Unique identifier for this action execution. If its processing is done asynchronously, you will receive a notification with the same `actionId`.
  - `workspaceId` string, uuid — Unique identifier of a workspace in Payrails.
  - `executedAt` string, date-time, required — Date and time when execution of the Action was started.
  - `links` object, required — Links to the next possible actions that can be taken.
    - `execution` union, required — URL to fetch the current execution state.
      - string
      - object — Link related information.
        - `href` string, required
        - `method` 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' — HTTP method that should be used to call the `href`.
  - `reason` 'BetterPrice' | 'CustomerDontNeed' | 'DamagedProduct' | 'Duplicate' | 'FraudulentProduct' | 'LateDelivery' | 'NoReason' | 'ProductMismatchDescription' | 'WrongProduct' | 'WrongProductSpecification' — Reason for invoking the operation or action.
  - `reasonDescription` string — An optional field to include any necessary information for the cancel action.

## Other responses

- `400` — Bad Request.
- `401` — Unauthorized.
- `403` — Insufficient Scope.
- `404` — Not Found.
- `429` — Too Many Requests.

---

[API](https://skmtc.dev/payrails/apis/payrails-api-reference.md) · [All operations](https://skmtc.dev/payrails/apis/payrails-api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/payrails/payrails-api-reference/revisions/9dd2f0158582/schema)
