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.

Syntax

POST /api/transactions/mark-for-erasure

Examples

Example request

  1. POST /api/transactions/mark-for-erasure
  2. Authorization: Bearer token
  3. Content-Type: application/json
  4. X-Tenant: dealflo
  5. {
  6.   "grace_period": 25,
  7.   "transaction_ids": [
  8.     "6cca2f64-2781-49fc-85de-f80361581968",
  9.     "6cca2f64-2781-49fc-85de-f80361581969",
  10.     "6cca2f64-2781-49fc-85de-f80361581970"
  11.   ]
  12. }

Example response

  1. {
  2. message: "Some of the transactions could be marked for erasure others couldn't."
  3.  
  4. transactions: [
  5.   {
  6.     transaction_id: "xxxx-xxxxxx-xxxxxxx-xxxxxx",
  7.     marking_event: "Transaction Erase Request - Accepted"
  8.     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)."
  9.   },
  10.  
  11.   {
  12.     transaction_id: "xxxx-xxxxxx-xxxxxxx-xxxxxx",
  13.     marking_event: "Transaction Erase Request - ID field error"
  14.     message: "This transaction doesn't exist, therefore cannot be marked for erasure."
  15.   },
  16.  
  17.   {
  18.     transaction_id: "xxxx-xxxxxx-xxxxxxx-xxxxxx",
  19.     marking_event: "Transaction Erase Request - Transaction Not Found"
  20.     message: "This transaction doesn't exist, therefore cannot be marked for erasure."
  21.   },
  22.  
  23.   {
  24.     transaction_id: "xxxx-xxxxxx-xxxxxxx-xxxxxx",
  25.     marking_event: "Transaction Erase Request - Transaction currently active"
  26.     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."
  27.   },
  28.  
  29.   {
  30.     transaction_id: "xxxx-xxxxxx-xxxxxxx-xxxxxx",
  31.     marking_event: "Transaction Erase Request - Fail" # Note that if this generic use case doesn't exist, don't create it.
  32.     message: "Failed to mark for erasure. {descriptive_error_message}"
  33.     message: "Failed to mark for erasure, the transaction was locked, please try again later."
  34.   }
  35.  
  36. ]
  37. }

Headers

Request headers

The following headers are included in the request:

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.