Introduction
You can cancel an order if the order is cancelable and if the order does not have an active appointment or the appointment currently available is not within 26 hours of the current date/time. Before cancelling an order you must have created one.
Request Lifecycle
To cancel the order, you must send a POST request to /api/connect/orders/cancel
with the body of
the request containing the order id.
Request Specifications
Version | Header | Changes |
---|---|---|
1 (Deprecated) |
X-API-VERSION=1 |
Initial Version |
2 (Deprecated) |
X-API-VERSION=2 |
No Change |
3 |
X-API-VERSION=3 |
No Change |
4 |
X-API-VERSION=4 |
No Change |
5 |
X-API-VERSION=5 |
No Change |
6 |
X-API-VERSION=6 |
No Change |
7 |
X-API-VERSION=7 |
No Change |
API Version 1, 2 3, 4, 5, 6 and 7 - POST
POST Request
Verb |
POST |
URI |
/api/connect/orders/cancel |
Name | Description |
---|---|
|
The OAuth bearer access token |
|
The version of the endpoint you are accessing |
Path | Type | Description | Required |
---|---|---|---|
|
|
The id of the order to cancel |
Required |
POST Response
Status Code | Meaning |
---|---|
200 |
The request is complete. |
401 |
Bearer Token missing or invalid |
404 |
You are not authorised or The id (of the order) provided does not exist |
500 |
There was an unexpected error processing the request |
API Version 1, 2 3, 4, 5, 6 and 7 - Examples
Order Cancelled
A request to cancel an order is created by sending a request JSON object as a POST request to
/api/connect/orders/cancel
.
POST /api/connect/orders/cancel HTTP/1.1
Content-Type: application/json;charset=UTF-8
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJ1X25vaWhzY21YU2Jja1hBeHVvcEM0U2VENWxGNjhOb1dxTnMwWlVUV2RBIn0.eyJleHAiOjE3NDE3MzQ5MjEsImlhdCI6MTc0MTczMTkyMSwiYXV0aF90aW1lIjowLCJqdGkiOiI1YjA3NGVhMi03ODIwLTQ0NDAtYmM3Mi0yMDlkMmJlODM5MTciLCJpc3MiOiJodHRwOi8vbG9jYWxob3N0OjEwMzQyL2F1dGgvcmVhbG1zL3N1cGVybG9vcCIsInN1YiI6ImNhMGNlNjZhLTQwOGMtNGIzYS1hYTczLTExOWI0OTIzNDZiYyIsInR5cCI6IkJlYXJlciIsImF6cCI6InBvcnRhbC1hcGkiLCJzZXNzaW9uX3N0YXRlIjoiNTEwMTJhZDEtZmUzOS00MjY5LWIyNTAtOTIxYmIxYzljODlhIiwiYWNyIjoiMSIsInNjb3BlIjoiIiwic2lkIjoiNTEwMTJhZDEtZmUzOS00MjY5LWIyNTAtOTIxYmIxYzljODlhIiwiY2xpZW50SWQiOiJwb3J0YWwtYXBpIiwiY2xpZW50SG9zdCI6ImxvY2FsaG9zdCIsInVzZXJJZCI6IjExMDAxIiwiY2xpZW50QWRkcmVzcyI6IjEyNy4wLjAuMSIsImFwcHMiOiJwb3J0YWwtYXBpIn0.hJRhS_kJpQndxJE_r4Kxpya9VpUjhIQmjsHlYNRYS3F8WIz56LuM-ySBzv-b1iz8S2D2zBjniAik1_4eVpBQmWPeKAPrClxpYD8tkllaL5ZWujwvlkfcuXCfaBbjWOxoDz0HxFSwR_bd--XHkcEnGBLgwF3P_lB7YhXCSMyWGnIrZLjCea8Oq80-NKuAEpWPrpZHteXdN0gCuNo0bOQld8VbU_mvi0qVDko0g4q5yXF_Zllg7manvFZK9CYSU6yeKjhuELW9Vd58LJQ7M7zsn5iHnPyput0U7-h413TSKRGGJpaNUP5T3dLpongRHyikopqjXHU4xEaFQazCmBbbDg
X-API-VERSION: 7
Content-Length: 13
Host: localhost:8080
{"orderId":1}
If all required fields were given, then the response to the request will have:
-
a http status of 200
HTTP/1.1 200 OK
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY