---
title: "Mark Transaction for Erasure"
slug: "mark-transaction-for-erasure"
updated: 2025-06-27T19:58:32Z
published: 2025-06-27T19:58:32Z
canonical: "docs.onespan.com/mark-transaction-for-erasure"
---

> ## 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.

# Mark Transaction for Erasure

The Mark Transaction for Erasure API facilitates the deletion of a transaction. Users can request to delete one or more completed or incomplete transactions. They can also specify the time when the transaction should be deleted.

Within the grace period, i.e. the time between the marking of a transaction for erasure and the actual deletion, transactions can be recovered by unmarking them for erasure. For more information, see [Unmark transaction for erasure](/v1/docs/unmark-transaction-for-erasure).

## Syntax

```http
POST /api/transactions/mark-for-erasure
```

## Examples

### Example request

```http
POST /api/transactions/mark-for-erasure
Authorization: Bearer token
Content-Type: application/json
X-Tenant: dealflo
{
  "grace_period": 25,
  "transaction_ids": [
    "6cca2f64-2781-49fc-85de-f80361581968",
    "6cca2f64-2781-49fc-85de-f80361581969",
    "6cca2f64-2781-49fc-85de-f80361581970"
  ]
}
```

### Example response

```http
{
message: "Some of the transactions could be marked for erasure others couldn't."
 
transactions: [
  {
    transaction_id: "xxxx-xxxxxx-xxxxxxx-xxxxxx",
    marking_event: "Transaction Erase Request - Accepted"
    message: "The transaction has been accepted to be marked for erasure, there could be a short period where the transaction is recoverable, it depends on the data retention policy (grace period)."
  },
 
  {
    transaction_id: "xxxx-xxxxxx-xxxxxxx-xxxxxx",
    marking_event: "Transaction Erase Request - ID field error"
    message: "This transaction doesn't exist, therefore cannot be marked for erasure."
  },
 
  {
    transaction_id: "xxxx-xxxxxx-xxxxxxx-xxxxxx",
    marking_event: "Transaction Erase Request - Transaction Not Found"
    message: "This transaction doesn't exist, therefore cannot be marked for erasure."
  },
 
  {
    transaction_id: "xxxx-xxxxxx-xxxxxxx-xxxxxx",
    marking_event: "Transaction Erase Request - Transaction currently active"
    message: "Failed to mark for erasure, the transaction was active (New or In Post Processing),  if it needs to be mark for erasure, it must first be cancelled."
  },
 
  {
    transaction_id: "xxxx-xxxxxx-xxxxxxx-xxxxxx",
    marking_event: "Transaction Erase Request - Fail" # Note that if this generic use case doesn't exist, don't create it.
    message: "Failed to mark for erasure. {descriptive_error_message}"
    message: "Failed to mark for erasure, the transaction was locked, please try again later."
  }
 
]
}
```

### Headers

#### Request headers

The following headers are included in the request:

- [Authorization](https://tools.ietf.org/html/rfc7235#section-4.2): The OAuth/JWT token to authenticate
- [Content-Type](https://tools.ietf.org/html/rfc7231#section-3.1.1.5): application/json
- X-Tenant: The tenant ID (optional)

### Status codes

| **Status codes** |
| --- |
| Status code | Name | Description |
| 202 | Accepted | All transactions were marked for deletion and will be deleted when the timestamp has been reached. |
| 207 |  | Some transactions were marked for deletion, others were not. See each transaction operation status in the response body. |
| 400 | Bad Request | Validation error. Empty list of transaction_ids. Can occur if one of the following applies: - X-Tenant is not matching the token. - grace_period is a negative number. - None of the transaction_ids were accepted. - There are too few or too many transactions. |
| 401 | Unauthorized | Invalid token. |
| 404 | Not Found | Wrong URL. Transactions provided in the list were not found. |
| 500 | Internal Server Error | Server or application error. |
