---
title: "Cancel Transaction"
slug: "cancel-transaction"
updated: 2025-06-27T19:57:23Z
published: 2025-06-27T19:57:23Z
canonical: "docs.onespan.com/cancel-transaction"
---

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

# Cancel Transaction

The Cancel Transaction API prevents a transaction from progressing. Once the API is invoked, the transaction status becomes cancelled. The transaction information is returned, and when the session is resumed, the transaction canceled page is displayed.

Depending on the geographical region, data retention policies applied to canceled transactions may be different from the policies that are applied to active transactions.

## Syntax

```http
PUT /api/transaction/uuid: transaction_id/event
```

## Examples

### Example request

```http
PUT /api/transaction/968c1ceb-7508-4a92-aef7-3661b01ffcab/event
Host: onespan.com
Accept: application/json, text/javascript
{
  "trigger": "transaction_cancelled"
}
```

### Example response

```json
{
  "id": "968c1ceb-7508-4a92-aef7-3661b01ffcab",
  "status": "cancelled",
  "request_ids": [],
  "tenant_id": "dealflo",
  "brand_id": "onespan",
  "workflow_id": "00000000-0000-0000-0000-200000000001",
  "language": "english",
  "opaque_id": "WorkflowExternalMitAtPwd=1234",
  "created": "2019-07-23T15:38:33.299Z",
  "last_session_event": "2012-04-23T18:25:43.511Z",
  "completed": "2012-04-23T18:25:43.511Z",
  "last_api_request": "2019-07-23T15:38:33.299Z",
  "users": [...],
  "tokens": [],
  "documents": [...],
  "expiry_period": 90,
  "expiry_timestamp": "2019-10-21T15:38:33.167Z",
  "disable_notifications": false,
  "disable_recording": false,
  "verifications": [],
  "version": 5
}
```

### Headers

The following headers are included in the request and the response:

#### Request headers

- [Accept](https://tools.ietf.org/html/rfc7231#section-5.3.2): The response content type depends on the Accept header.
- [Authorization](https://tools.ietf.org/html/rfc7235#section-4.2): The OAuth/JWT token to authenticate.

#### Response headers

- [Content-Type](https://tools.ietf.org/html/rfc7231#section-3.1.1.5): application/json

### Status codes

<editor360-custom-block data-preprocessing="true" data-sanitizationtags="a"><div data-type="table-content"> <table width="100%" class=" fr-alternate-rows editor360-table" borderstyle="Solid"> <colgroup style="display:none;"> <col style="width:250px;"> <col style="width:250px;"> <col style="width:250px;"> </colgroup> <tbody> <tr> <td colspan="3" rowspan="1" style="vertical-align:middle;text-align:left;"> <p data-block-id="830f7745-850c-4256-9a0d-97ccf644f49e"><a name="Tab_Status_codes" display="false"></a><strong>Status codes</strong></p> </td> </tr> <tr> <th colspan="1" rowspan="1" class="TableStyle-Global-HeadE-Column-MainHeader" style="vertical-align:middle;text-align:left;"> <p data-block-id="f0c2da7a-a7ad-4bce-b832-1055dd917365">Status code</p> </th> <th colspan="1" rowspan="1" class="TableStyle-Global-HeadE-Column-MainHeader" style="vertical-align:middle;text-align:left;"> <p data-block-id="3270cf8f-4712-43ee-abdb-3eac5e5f7567">Name</p> </th> <th colspan="1" rowspan="1" class="TableStyle-Global-HeadD-Column-MainHeader" style="vertical-align:middle;text-align:left;"> <p data-block-id="ef97cbd8-30b6-48db-ad8c-9df84fc30801">Description</p> </th> </tr> <tr> <td colspan="1" rowspan="1" style="vertical-align:middle;text-align:left;"> <p data-block-id="4f6feace-8da6-436a-9556-95b35e626fac"><span class="vdsCodeBasic" type="spanMark">200</span></p> </td> <td colspan="1" rowspan="1" style="vertical-align:middle;text-align:left;"> <p data-block-id="da9047e9-c974-4add-b99c-c9dbce8e7d4a"><span class="vdsCodeBasic" type="spanMark">OK</span></p> </td> <td colspan="1" rowspan="1" style="vertical-align:middle;text-align:left;"> <p data-block-id="5ac5e466-a8ad-4d6a-9e95-82ed2d1e5a80">No error.</p> </td> </tr> <tr> <td colspan="1" rowspan="1" style="vertical-align:middle;text-align:left;"> <p data-block-id="ce12a418-0c86-4586-9d09-3999e45b39da"><span class="vdsCodeBasic" type="spanMark">400</span></p> </td> <td colspan="1" rowspan="1" style="vertical-align:middle;text-align:left;"> <p data-block-id="f36df37b-c9ac-4f26-bf8a-6f6971de2b92"><span class="vdsCodeBasic" type="spanMark">Bad Request</span></p> </td> <td colspan="1" rowspan="1" style="vertical-align:middle;text-align:left;"> <p data-block-id="867d5883-ecdc-438b-8f09-989111e0e1d6">The transaction data is invalid.</p> </td> </tr> <tr> <td colspan="1" rowspan="1" style="vertical-align:middle;text-align:left;"> <p data-block-id="9b9e85a3-f3c3-4adf-9d17-707ba74c1eb4"><span class="vdsCodeBasic" type="spanMark">401</span></p> </td> <td colspan="1" rowspan="1" style="vertical-align:middle;text-align:left;"> <p data-block-id="6c3e22e1-f071-4ae0-9134-3fefba7354b8"><span class="vdsCodeBasic" type="spanMark">Unauthorized</span></p> </td> <td colspan="1" rowspan="1" style="vertical-align:middle;text-align:left;"> <p data-block-id="174dc106-8e82-44b1-9bfc-a420e2aa9e35">Invalid token.</p> </td> </tr> <tr> <td colspan="1" rowspan="1" style="vertical-align:middle;text-align:left;"> <p data-block-id="44a409e0-ed56-4b7c-b9e1-82cd2b3fb8ab"><span class="vdsCodeBasic" type="spanMark">403</span></p> </td> <td colspan="1" rowspan="1" style="vertical-align:middle;text-align:left;"> <p data-block-id="88f66199-4161-4259-af92-9a1d67002afd"><span class="vdsCodeBasic" type="spanMark">Forbidden</span></p> </td> <td colspan="1" rowspan="1" style="vertical-align:middle;text-align:left;"> <p data-block-id="e8a1a00d-f0d8-4b8e-8e26-722ab58d2fe4">The token does not grant transaction creation rights.</p> </td> </tr> <tr> <td colspan="1" rowspan="1" style="vertical-align:middle;text-align:left;"> <p data-block-id="ef79e15e-e970-4f70-9c78-3839af47580d"><span class="vdsCodeBasic" type="spanMark">500</span></p> </td> <td colspan="1" rowspan="1" style="vertical-align:middle;text-align:left;"> <p data-block-id="7e8aa53a-86d9-48b7-bd9f-7604793dd0b8"><span class="vdsCodeBasic" type="spanMark">Internal Server Error</span></p> </td> <td colspan="1" rowspan="1" style="vertical-align:middle;text-align:left;"> <p data-block-id="14c831b8-9f37-4f36-a61a-3181f03c07e3">Server or application error.</p> </td> </tr> </tbody> </table></div></editor360-custom-block>
