- 07 Oct 2024
- 1 Minute à lire
- SombreLumière
- PDF
Mark Transaction for Erasure
- Mis à jour le 07 Oct 2024
- 1 Minute à lire
- SombreLumière
- PDF
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.
Syntax
POST /api/transactions/mark-for-erasure
Examples
Example request
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
{
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: The OAuth/JWT token to authenticate
Content-Type: application/json
X-Tenant: The tenant ID (optional)
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:
|
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. |