Mark Transaction for Erasure

The Mark Transaction for Erasure API facilitates transaction deletion. Users can request to delete one or more completed or incomplete transactions, and specify the time of deletion.

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

Headers

Request headers

The following headers are included in the request:

Status codes

Status codes lists the 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. Occurs if X-Tenant is not matching the token, grace_period is a negative number, none of the transaction_ids were accepted, or if 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.