Download OpenAPI specification:Download
This document refers to v1.3 of the API, live after June 2023. The Hakuna API v1.3 is built on top of the previous version v1.2 and significantly simplifies your interactions with the Hakuna Platform. So far, this version is only accessible to selected patners: This reference is for Globetrotter / Fenix Outdoor.
Hakuna's REST APIs use standard HTTP verbs, authentication and response codes as well as JSON-encoded requests and responses.
Don't hesitate to contact us with any questions or feedback. You can email Hakuna directly at support@hellohakuna.com.
This version allows you to create Protection Items in your (ERP) system beforehand, and without needing to manage any Hakuna related data. Once you sell a protection item, you can use the Order API to place and manage it, again, without managing any Hakuna related data.
Hakuna uses API keys to authenticate requests. You can manage API keys in your Merchant Dashboard. Authentication is handled via bearer auth passign API key passed in HTTP Authorization
header.
Authorization: Bearer <API_KEY>
You can create an Order for your customer by providing us with the selected protection and protected product data as line items, as well as the customer data.
Required data to create an Order
Order has been placed
The request was unacceptable due to invalid parameters or unsupported customer location.
Access token is missing or invalid
A sample Order placement request
{- "order_id": "order-364587",
- "placed_at": 1645315200000,
- "sales_channel": "e-commerce",
- "customer": {
- "first_name": "Max",
- "last_name": "Mustermann",
- "email": "max.mustermann@example.com",
- "phone": "+491601234567"
}, - "customer_billing_address": {
- "address_line_1": "Musterstrasse",
- "address_line_2": "1",
- "city": "Musterstadt",
- "country": "de",
- "zip": "123456"
}, - "line_items": [
- {
- "id": "line-item-id-3311",
- "quantity": 1,
- "protection_item_id": "protection-item-id-323",
- "price": {
- "amount": 20299,
- "currency": "eur"
}, - "protected_product": {
- "id": "prd-iphone14",
- "title": "iPhone 14",
- "brand": "Apple",
- "sku": "AP-IPH-14gelb",
- "price": {
- "amount": 112900,
- "currency": "eur"
}
}
}
]
}
A placed Order
{- "order_id": "order-364587",
- "placed_at": 1645315200000,
- "sales_channel": "e-commerce",
- "customer": {
- "first_name": "Max",
- "last_name": "Mustermann",
- "email": "max.mustermann@example.com",
- "phone": "+491601234567"
}, - "customer_billing_address": {
- "address_line_1": "Musterstrasse",
- "address_line_2": "1",
- "city": "Musterstadt",
- "country": "de",
- "zip": "123456"
}, - "line_items": [
- {
- "id": "line-item-id-3311",
- "quantity": 1,
- "protection_item_id": "protection-item-id-323",
- "price": {
- "amount": 20299,
- "currency": "eur"
}, - "protected_product": {
- "id": "prd-iphone14",
- "title": "iPhone 14",
- "brand": "Apple",
- "sku": "AP-IPH-14gelb",
- "price": {
- "amount": 112900,
- "currency": "eur"
}
}
}
], - "status": "placed",
- "cancelled_at": null,
- "cancel_reason": null,
- "refunds": [ ],
- "fulfillments": [ ],
- "cancellations": [ ]
}
Retrieve an Order by specifying the ID. All fields of an Order are returned.
An Order
Access token is missing or invalid
The requested resource doesn't exist.
A placed Order
{- "order_id": "order-364587",
- "placed_at": 1645315200000,
- "sales_channel": "e-commerce",
- "customer": {
- "first_name": "Max",
- "last_name": "Mustermann",
- "email": "max.mustermann@example.com",
- "phone": "+491601234567"
}, - "customer_billing_address": {
- "address_line_1": "Musterstrasse",
- "address_line_2": "1",
- "city": "Musterstadt",
- "country": "de",
- "zip": "123456"
}, - "line_items": [
- {
- "id": "line-item-id-3311",
- "quantity": 1,
- "protection_item_id": "protection-item-id-323",
- "price": {
- "amount": 20299,
- "currency": "eur"
}, - "protected_product": {
- "id": "prd-iphone14",
- "title": "iPhone 14",
- "brand": "Apple",
- "sku": "AP-IPH-14gelb",
- "price": {
- "amount": 112900,
- "currency": "eur"
}
}
}
], - "status": "placed",
- "cancelled_at": null,
- "cancel_reason": null,
- "refunds": [ ],
- "fulfillments": [ ],
- "cancellations": [ ]
}
Create a cancellation for a specific Order by specifying the Order ID and cancelled items so that we can manage the protection status accordingly.
Created cancellation
The request was unacceptable due to invalid parameters.
Access token is missing or invalid
The requested resource doesn't exist.
A request to create a cancellation
{- "cancellation_line_items": [
- {
- "line_item_id": "line-item-id-3311",
- "quantity": 1,
- "cancelled_at": 1645446874158
}
]
}
The cancellation resource
{- "id": "ff-0a5eb87d-2d59-4d42-8734-df3593f7d455",
- "cancellation_line_items": [
- {
- "line_item_id": "line-item-id-3311",
- "quantity": 1,
- "cancelled_at": 1645446874158
}
]
}
Create a fulfillment for a specific Order by specifying the Order ID and fulfilled items so that we can manage the protection status accordingly. Generally, fulfillment means that the product was shipped.
Created fulfillment
The request was unacceptable due to invalid parameters.
Access token is missing or invalid
The requested resource doesn't exist.
A request to create a fulfillment
{- "fulfillment_line_items": [
- {
- "line_item_id": "line-item-id-3311",
- "quantity": 1,
- "fulfilled_at": 1645446874158
}
]
}
The fulfillment resource
{- "id": "ff-0a5eb87d-2d59-4d42-8734-df3593f7d455",
- "fulfillment_line_items": [
- {
- "line_item_id": "line-item-id-3311",
- "quantity": 1,
- "fulfilled_at": 1645446874158
}
]
}
Cancel an Order by specifying the ID. We will cancel the whole Order and the cancellation will be only accepted, if the Order has not been fulfilled yet.
Required data to cancel an Order
An Order
The request was unacceptable due to the Order cancel decline.
Access token is missing or invalid
The requested resource doesn't exist.
A request to cancel an Order
{- "cancel_reason": "customer",
- "cancelled_at": 1645453287866
}
A cancelled Order
{- "order_id": "order-364587",
- "placed_at": 1645315200000,
- "sales_channel": "e-commerce",
- "customer": {
- "first_name": "Max",
- "last_name": "Mustermann",
- "email": "max.mustermann@example.com",
- "phone": "+491601234567"
}, - "customer_billing_address": {
- "address_line_1": "Musterstrasse",
- "address_line_2": "1",
- "city": "Musterstadt",
- "country": "de",
- "zip": "123456"
}, - "line_items": [
- {
- "id": "line-item-id-3311",
- "quantity": 1,
- "protection_item_id": "protection-item-id-323",
- "price": {
- "amount": 20299,
- "currency": "eur"
}, - "protected_product": {
- "id": "prd-iphone14",
- "title": "iPhone 14",
- "brand": "Apple",
- "sku": "AP-IPH-14gelb",
- "price": {
- "amount": 112900,
- "currency": "eur"
}
}
}
], - "status": "cancelled",
- "cancelled_at": 1645453287866,
- "cancel_reason": "customer",
- "refunds": [ ],
- "fulfillments": [ ],
- "cancellations": [ ]
}
Create a refund for one or all items of an Order by specific the Order ID and line_items_ids. This can be necessary if a customer revokes one or multiple items from their purchase in your store. Refunds are only possible for fulfilled line items, up to 30 days after fulfillment.
Created refund
The request was unacceptable due to invalid parameters.
Access token is missing or invalid
The requested resource doesn't exist.
A request to create a refund
{- "refund_line_items": [
- {
- "line_item_id": "line-item-id-3311",
- "quantity": 1,
- "refunded_at": 1645447874158
}
]
}
The refund resource
{- "id": "re-f55ca068-1860-4970-82d8-c77388554f9c",
- "refund_line_items": [
- {
- "line_item_id": "line-item-id-3311",
- "quantity": 1,
- "refunded_at": 1645447874158
}
]
}