Stop transaction
POST
{{server}}/api/v1/counter/transaction/stopThis endpoint stops a transaction on the ticket. The next step depends on the status value in the response.
Request
-
ticket(string, required): The called ticketkey -
task(string, required): Thekeyof the task under transaction. -
wasRealTransaction(boolean): Is it was a real transaction? -
closingCodes(string|string[]): Optional one or more closing code keys. -
afterwork(boolean): If the afterwork is enabled for the service, the clerk can decide whether want to afterwork on the ticket or not.
There is no response if it was successful.
Request
Authorization
| Header | Value |
|---|---|
Authorization | Bearer {{counterToken}} |
Headers
| Key | Value |
|---|---|
Accept | application/json |
X-WSID | {{counterWsID}} |
Body (json)
{
"ticket": "{{ticketKey}}",
"task": "{{ticketTaskKey}}",
"wasRealTransaction": true,
"closingCodes": null,
"afterwork": true
}
Code snippets
- cURL
- JavaScript
- Python
curl -X POST '{{server}}/api/v1/counter/transaction/stop' \
-H 'Accept: application/json' \
-H 'X-WSID: {{counterWsID}}' \
-H 'Authorization: Bearer {{counterToken}}' \
-H 'Content-Type: application/json' \
-d '{
"ticket": "{{ticketKey}}",
"task": "{{ticketTaskKey}}",
"wasRealTransaction": true,
"closingCodes": null,
"afterwork": true
}'
const response = await fetch("{{server}}/api/v1/counter/transaction/stop", {
method: "POST",
headers: {
"Accept": "application/json",
"X-WSID": "{{counterWsID}}",
"Authorization": "Bearer {{counterToken}}",
"Content-Type": "application/json"
},
body: JSON.stringify({
"ticket": "{{ticketKey}}",
"task": "{{ticketTaskKey}}",
"wasRealTransaction": true,
"closingCodes": null,
"afterwork": true
}),
});
const data = await response.json();
console.log(data);
import requests
url = "{{server}}/api/v1/counter/transaction/stop"
headers = {
"Accept": "application/json",
"X-WSID": "{{counterWsID}}",
"Authorization": "Bearer {{counterToken}}",
"Content-Type": "application/json"
}
payload = {
"ticket": "{{ticketKey}}",
"task": "{{ticketTaskKey}}",
"wasRealTransaction": True,
"closingCodes": None,
"afterwork": True
}
response = requests.post(url, headers=headers, json=payload)
print(response.status_code)
print(response.json())
Example
Example request
POST
{{server}}/api/v1/counter/transaction/stopHeaders (2)
| Key | Value |
|---|---|
Accept | application/json |
X-WSID | {{counterWsID}} |
Body
{
"ticket": "1905ee5f-dbe2-4dfc-dd29-9ad2056f437f",
"task": "1905ee5f-dbc7-4ac8-61a9-c9f961034f1b",
"wasRealTransaction": true,
"closingCodes": null,
"afterwork": true
}
Example response 200 Ok
Response headers (9)
| Key | Value |
|---|---|
Access-Control-Expose-Headers | * |
Cache-Control | no-store, no-cache, must-revalidate |
Access-Control-Allow-Origin | * |
Access-Control-Allow-Methods | POST, PUT, GET, OPTIONS, DELETE |
Access-Control-Allow-Credentials | true |
Content-Length | 12 |
Access-Control-Max-Age | 86400 |
Access-Control-Allow-Headers | Content-Type, Authorization, X-Requested-With |
Content-Type | application/json;charset=utf-8 |
Body
{
"status": 1
}