POST Cancel Txn
Cancel/Abandon a specified transaction.
This operation returns a 400 Bad Request HTTP status code if the transaction does not meet the following requirements:
- The form status is not 
"completed"or"abandoned". - Accessible by the user calling the API.
 
Request
HTTP request
POST https://<JM_SERVER>/workspaces/secure/api/v1/txn/cancel
Request body
The POST request must contain a JSON structure describing the txn query. To support multiple parameters, this API uses HTTP Content Type: application/json.
The available query attributes are listed below. All attributes are optional except where otherwise indicated.
caution
If you specify an invalid request attribute, a 400 Bad Request HTTP status code is returned.
| Attribute | Description | 
|---|---|
params | MapRequired. A map containing the cancel attributes.  | 
Supported cancel attributes
The supported cancel attributes are listed below.
caution
If you specify an invalid cancel attribute, a 400 Bad Request HTTP status code is returned.
| Attribute | Description | 
|---|---|
milestones | StringA submission milestone value to add to the transaction.  | 
reason | StringThe abandonment reason.  | 
submitKey | StringRequired. The submit key property of the submission/transaction record to cancel.  | 
Response
If successful (that is, the transaction abandonment is successful and no errors occurred during the execution of the API), this operation returns a response with a HTTP 200 OK status code.
Error messages
| Error key | Error | HTTP status code | 
|---|---|---|
internalError | Please see Error Log ID {number} | 500 Internal Server Error | 
submitKeyNotSpecified | submitKey not specified | 400 Bad Request | 
txnAlreadyFinished | The transaction has already been finished (Completed or Abandoned). | 400 Bad Request | 
txnNotFound | The transaction specified by the submitKey was not found. | 400 Bad Request | 
Error responses
| HTTP status code | Description | 
|---|---|
400 Bad Request | Bad request or request parameter. Check error message for details. | 
404 Not Found | Ensure the URL endpoint is entered correctly. | 
500 Internal Server Error | Exception occurred in txn cancel. Contact administrator. | 
Example
Ensure you specify Content-Type: application/json.
POST <b>/workspaces/secure/api/v1/txn/cancel</b> HTTP/1.1
Host: https://transact.workspaces.com
Content-Type: application/json
{
    "params": {
        "milestones": "Application Status: Staff Cancelled",
        "reason": "Job application will be completed in branch",
        "submitKey": "15d071280b92c867f86975b9cd2e8765"
    }
}