Cancel an Order

Before you get started with this section, you should have created an Order with Hakuna.
When something goes wrong in your store (e.g., payment doesn't go through, fraud detected, inventory issues, etc.), you will also need to cancel the Hakuna Order.
This is only possible before fulfillment.

Cancel a Hakuna Order

To do so, just call our endpoint to cancel an Order
with an optional reason:
curl -X POST
-H "X-API-KEY: sk_test_4eC39HqLyjWDarjtT1zdp7dc" \
-H "Content-Type: application/json" \
-d '{ "reason": "customer" }'
As a response, you will receive the Hakuna Order with the status cancelled :
"id": "797f73eb-22e0-4145-b8af-d6fdac71613d",
"payment_handler": "merchant",
"customer": {
"first_name": "Max",
"last_name": "Mustermann",
"email": "[email protected]",
"phone": "+491601234567"
"customer_billing_address": {
"address_line_1": "Musterstrasse",
"address_line_2": 1,
"city": "Musterstadt",
"country": "de",
"zip": "123456"
"line_items": [
"id": "f88c0f27-07cf-4c33-8e27-ea6b2593e673",
"offer_id": "ee589e89-e5a6-4742-9fe8-3d5e119a599f",
"plan_id": "32fad830-139d-47a9-b90a-5b8006096525",
"quantity": 1,
"protected_product": {
"id": "prd-1234",
"category": 101,
"title": "Banana",
"brand": "Frutta",
"sku": "BNN-YE-01",
"price": {
"amount": 10000,
"currency": "eur"
"status": "cancelled",
"cancelled_at": 1645453287866,
"cancel_reason": "customer",
"refunds": [],
"fulfillments": []


You have cancelled a Hakuna Order. Protection products from this Order can no longer be fulfilled.