Cancel an order
POSThttps://api.playbox.grow.curacel.co/api/v1/orders/:id/cancel
This is to allow developers to trigger and test the 'order.cancelled' webhook event in test environments. This operation will return a 403 response in production.
Request
Path Parameters
id integerrequired
The ID of the order to cancel
- application/json
Body
Context of the cancellation
reason string
Why are you cancelling this order?
Responses
- 200
- 400
- 403
- 404
OK
- application/json
- Schema
- Example (from schema)
Schema
order object
{
"order": {
"id": 2,
"status": "paid",
"amount_due": 1470,
"policy_start_date": "2022-04-06T00:00:00.000000Z",
"asset_ref": "T2354354",
"currency": "GHS",
"channel": "API",
"created_at": "2022-04-06T10:34:20.000000Z",
"payment_made_at": "2022-04-06T10:34:20.000000Z",
"payment_method": "wallet",
"product": {
"title": "Comprehensive Car Plan XYZ",
"code": "auto-com-xyz",
"id": 1,
"insurer": {
"code": "AXA",
"name": "Axa Mansard",
"logo_url": null,
"terms_conditions": null
},
"product type": {
"name": "Goods in Transit",
"slug": "GIT"
},
"cover-benefits": {},
"created-at": "string",
"price": 0,
"premium-type": "string",
"premium-rate-unit": 0,
"premium-rate": 0,
"premium": 0,
"partner-commision-rate": 0,
"min-premium": "string",
"premium-rules": "string",
"premium_frequency": "annually"
},
"customer": {
"ref": "string",
"email": "string",
"phone": "408-867-5309",
"first_name": "Jane",
"last_name": "Doe"
},
"policy": null
}
}
Bad Request
- application/json
- Schema
Schema
string
Unauthorized
- application/json
- Schema
Schema
string
Not Found
- application/json
- Schema
- Example (from schema)
Schema
message string
{
"message": "Order not found"
}
Authorization: http
name: bearerAuthtype: httpscheme: bearerbearerFormat: API KEY from your account dashboard
- curl
- python
- go
- nodejs
- ruby
- csharp
- php
- java
- powershell
- CURL
curl -L -X POST 'https://api.playbox.grow.curacel.co/api/v1/orders/:id/cancel' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
--data-raw '{
"reason": "string"
}'
ResponseClear