Cancel Order
The API is used to cancel the orders created by the “Create Order API“. Merchant partners must call this API to cancel the orders created by the Create Order API in the previous step.
Path Parameters
- merchant_id string required
Header Parameters
- X-Access-Key string
Default value:
1mg_client_access_key
- application/json
Request Body
- object
Responses
- 400
Bad Request
Response Headers
- application/json
- Schema
- Example (from schema)
- example-0
- example-1
Schema
- object
{}
Cancel Order
{
"is_success": false,
"status_code": 400,
"error": {
"message": "Invalid request",
"errors": [
{
"message": "Invalid request"
}
]
}
}
Invalid Status for Cancelation
{
"is_success": false,
"status_code": 400,
"error": {
"message": "Invalid order status for this operation",
"errors": null
}
}
POST /api/v4/:merchant_id/order/cancel
Authorization
name: bearerAuthtype: httpscheme: bearer
Request
Request
curl / cURL
curl -L -X POST 'https://jupiterapi.1mg.com/api/v4/:merchant_id/order/cancel' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
--data-raw '{
"order_id": "PO29523381380005",
"reason": "CANCELLED REASON",
"agent_id": "",
"merchant": ""
}'
python / requests
curl -L -X POST 'https://jupiterapi.1mg.com/api/v4/:merchant_id/order/cancel' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
--data-raw '{
"order_id": "PO29523381380005",
"reason": "CANCELLED REASON",
"agent_id": "",
"merchant": ""
}'
go / native
curl -L -X POST 'https://jupiterapi.1mg.com/api/v4/:merchant_id/order/cancel' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
--data-raw '{
"order_id": "PO29523381380005",
"reason": "CANCELLED REASON",
"agent_id": "",
"merchant": ""
}'
nodejs / axios
curl -L -X POST 'https://jupiterapi.1mg.com/api/v4/:merchant_id/order/cancel' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
--data-raw '{
"order_id": "PO29523381380005",
"reason": "CANCELLED REASON",
"agent_id": "",
"merchant": ""
}'
ruby / Net::HTTP
curl -L -X POST 'https://jupiterapi.1mg.com/api/v4/:merchant_id/order/cancel' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
--data-raw '{
"order_id": "PO29523381380005",
"reason": "CANCELLED REASON",
"agent_id": "",
"merchant": ""
}'
csharp / RestSharp
curl -L -X POST 'https://jupiterapi.1mg.com/api/v4/:merchant_id/order/cancel' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
--data-raw '{
"order_id": "PO29523381380005",
"reason": "CANCELLED REASON",
"agent_id": "",
"merchant": ""
}'
php / cURL
curl -L -X POST 'https://jupiterapi.1mg.com/api/v4/:merchant_id/order/cancel' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
--data-raw '{
"order_id": "PO29523381380005",
"reason": "CANCELLED REASON",
"agent_id": "",
"merchant": ""
}'
java / OkHttp
curl -L -X POST 'https://jupiterapi.1mg.com/api/v4/:merchant_id/order/cancel' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
--data-raw '{
"order_id": "PO29523381380005",
"reason": "CANCELLED REASON",
"agent_id": "",
"merchant": ""
}'
powershell / RestMethod
curl -L -X POST 'https://jupiterapi.1mg.com/api/v4/:merchant_id/order/cancel' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
--data-raw '{
"order_id": "PO29523381380005",
"reason": "CANCELLED REASON",
"agent_id": "",
"merchant": ""
}'