Download OpenAPI specification:Download
This document refers to the API live after November 2022.
Hakuna's REST APIs use standard HTTP verbs, authentication and response codes.
Hakuna uses JSON-encoded requests and responses. Don't hesitate to reach out with any questions or feedback. You can email Hakuna directly at support@hellohakuna.com.
Hakuna uses API keys to authenticate requests. You can manage API keys in your Merchant Console. Authentication is handled via bearer auth passing API key passed in HTTP Authorization
header.
Authorization: Bearer <API_KEY>
Real-time method to create an Offer for a specific product or products collection in your store. An Offer contains one or more protection plan options, including prices, plus additional details that you can provide to your customers. Every Offer is valid until the expiration date.
The product or products collection you want to create an Offer for
type required | string A type of an Offer |
country | string = 2 characters Default: "de" Two-letter country code (ISO 3166-1 alpha-2 format) in lower case. Germany ("de") by default. |
sales_channel | string Default: "e-commerce" The channel through which the sale will be made. E-commerce ("e-commerce") by default. |
required | object A merchant product data |
Offer has been created for provided product
The request was unacceptable due to invalid parameters or unsupported product.
Access token is missing or invalid
{- "type": "protection_product",
- "product": {
- "id": "prd-iphone14",
- "category": 101,
- "title": "iPhone 14",
- "brand": "Apple",
- "sku": "AP-IPH-14gelb",
- "price": {
- "amount": 112900,
- "currency": "eur"
}
}
}
{- "id": "off-ee589e89-e5a6-4742-9fe8-3d5e119a599f",
- "country": "de",
- "type": "protection_product",
- "created_at": 1645446874158,
- "expired_at": 1648038918163,
- "sales_channel": "e-commerce",
- "product": {
- "id": "prd-iphone14",
- "category": 101,
- "title": "iPhone 14",
- "brand": "Apple",
- "sku": "AP-IPH-14gelb",
- "price": {
- "amount": 112900,
- "currency": "eur"
}
}, - "products_collection": null,
- "plans": [
- {
- "id": "pl-32fad830-139d-47a9-b90a-5b8006096525",
- "sku": "ST-FB-WE-1Y",
- "price": {
- "amount": 1200,
- "currency": "eur"
}, - "term_length": {
- "length": 12,
- "unit": "months"
}, - "title": {
- "en": "1 year of warranty extension",
- "de": "1 Jahr Garantieerweiterung"
}, - "post_purchase_availability_period": null
}, - {
- "id": "pl-d49d0c0d-339a-4acc-8480-a646278da27a",
- "sku": "ST-FB-WE-2Y",
- "price": {
- "amount": 2400,
- "currency": "eur"
}, - "term_length": {
- "length": 24,
- "unit": "months"
}, - "title": {
- "en": "2 years of warranty extension",
- "de": "2 Jahre Garantieerweiterung"
}, - "post_purchase_availability_period": null
}
], - "marketing_content": {
- "recommended_plan_id": "pl-32fad830-139d-47a9-b90a-5b8006096525",
- "hakuna_title": {
- "en": "This is a title you can use",
- "de": "Diesen Titel kannst Du verwenden"
}, - "general_heading": {
- "en": "This is the general heading",
- "de": "Das ist eine allgemeine Überschrift"
}, - "general_description": {
- "en": "This is the description of our service",
- "de": "Das ist die Beschreibung unseres Services"
}, - "coverage_heading": {
- "en": "Great coverage headline",
- "de": "Überschrift zum Schutz"
}, - "coverage_bullets": [
- {
- "en": "Coverage 1",
- "de": "Schutz 1"
}, - {
- "en": "Coverage 2",
- "de": "Schutz 2"
}, - {
- "en": "Coverage 3",
- "de": "Schutz 1"
}
], - "benefit_heading": {
- "en": "Great benefits headline",
- "de": "Überschrift zu den Vorteilen"
}, - "benefit_bullets": [
- {
- "en": "Benefit 1",
- "de": "Vorteil 1"
}, - {
- "en": "Benefit 2",
- "de": "Vorteil 2"
}, - {
- "en": "Benefit 3",
- "de": "Vorteil 3"
}
]
}
}
Retrieve an Offer based on the ID. All fields of an Offer are returned.
An Offer
Access token is missing or invalid
The requested resource doesn't exist.
{- "id": "off-ee589e89-e5a6-4742-9fe8-3d5e119a599f",
- "country": "de",
- "type": "protection_product",
- "created_at": 1645446874158,
- "expired_at": 1648038918163,
- "sales_channel": "e-commerce",
- "product": {
- "id": "prd-iphone14",
- "category": 101,
- "title": "iPhone 14",
- "brand": "Apple",
- "sku": "AP-IPH-14gelb",
- "price": {
- "amount": 112900,
- "currency": "eur"
}
}, - "products_collection": null,
- "plans": [
- {
- "id": "pl-32fad830-139d-47a9-b90a-5b8006096525",
- "sku": "ST-FB-WE-1Y",
- "price": {
- "amount": 1200,
- "currency": "eur"
}, - "term_length": {
- "length": 12,
- "unit": "months"
}, - "title": {
- "en": "1 year of warranty extension",
- "de": "1 Jahr Garantieerweiterung"
}, - "post_purchase_availability_period": null
}, - {
- "id": "pl-d49d0c0d-339a-4acc-8480-a646278da27a",
- "sku": "ST-FB-WE-2Y",
- "price": {
- "amount": 2400,
- "currency": "eur"
}, - "term_length": {
- "length": 24,
- "unit": "months"
}, - "title": {
- "en": "2 years of warranty extension",
- "de": "2 Jahre Garantieerweiterung"
}, - "post_purchase_availability_period": null
}
], - "marketing_content": {
- "recommended_plan_id": "pl-32fad830-139d-47a9-b90a-5b8006096525",
- "hakuna_title": {
- "en": "This is a title you can use",
- "de": "Diesen Titel kannst Du verwenden"
}, - "general_heading": {
- "en": "This is the general heading",
- "de": "Das ist eine allgemeine Überschrift"
}, - "general_description": {
- "en": "This is the description of our service",
- "de": "Das ist die Beschreibung unseres Services"
}, - "coverage_heading": {
- "en": "Great coverage headline",
- "de": "Überschrift zum Schutz"
}, - "coverage_bullets": [
- {
- "en": "Coverage 1",
- "de": "Schutz 1"
}, - {
- "en": "Coverage 2",
- "de": "Schutz 2"
}, - {
- "en": "Coverage 3",
- "de": "Schutz 1"
}
], - "benefit_heading": {
- "en": "Great benefits headline",
- "de": "Überschrift zu den Vorteilen"
}, - "benefit_bullets": [
- {
- "en": "Benefit 1",
- "de": "Vorteil 1"
}, - {
- "en": "Benefit 2",
- "de": "Vorteil 2"
}, - {
- "en": "Benefit 3",
- "de": "Vorteil 3"
}
]
}
}
You can create an Order for your customer by providing us with the selected plans and protected product data as line items, as well as the customer data. Only valid (i.e. unexpired) Offer IDs can be used.
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
{- "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": [
- {
- "offer_id": "off-ee589e89-e5a6-4742-9fe8-3d5e119a599f",
- "plan_id": "pl-32fad830-139d-47a9-b90a-5b8006096525",
- "quantity": 1,
- "protected_product": {
- "id": "prd-iphone14",
- "category": 101,
- "title": "iPhone 14",
- "brand": "Apple",
- "sku": "AP-IPH-14gelb",
- "price": {
- "amount": 112900,
- "currency": "eur"
}
}
}
]
}
A placed Order
{- "id": "ord-797f73eb-22e0-4145-b8af-d6fdac71613d",
- "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": "li-f88c0f27-07cf-4c33-8e27-ea6b2593e673",
- "offer_id": "off-ee589e89-e5a6-4742-9fe8-3d5e119a599f",
- "plan_id": "pl-32fad830-139d-47a9-b90a-5b8006096525",
- "quantity": 1,
- "protection_purchase_date": 1645315200000,
- "protected_product": {
- "id": "prd-iphone14",
- "category": 101,
- "title": "iPhone 14",
- "brand": "Apple",
- "sku": "AP-IPH-14gelb",
- "price": {
- "amount": 112900,
- "currency": "eur"
}
}
}
], - "status": "placed",
- "cancelled_at": null,
- "cancel_reason": null,
- "refunds": [ ],
- "fulfillments": [ ]
}
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
{- "id": "ord-797f73eb-22e0-4145-b8af-d6fdac71613d",
- "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": "li-f88c0f27-07cf-4c33-8e27-ea6b2593e673",
- "offer_id": "off-ee589e89-e5a6-4742-9fe8-3d5e119a599f",
- "plan_id": "pl-32fad830-139d-47a9-b90a-5b8006096525",
- "quantity": 1,
- "protection_purchase_date": 1645315200000,
- "protected_product": {
- "id": "prd-iphone14",
- "category": 101,
- "title": "iPhone 14",
- "brand": "Apple",
- "sku": "AP-IPH-14gelb",
- "price": {
- "amount": 112900,
- "currency": "eur"
}
}
}
], - "status": "placed",
- "cancelled_at": null,
- "cancel_reason": null,
- "refunds": [ ],
- "fulfillments": [ ]
}
Create a fulfillment for a specific Order by specifying the Order ID and the 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": "li-f88c0f27-07cf-4c33-8e27-ea6b2593e673",
- "quantity": 1,
- "fulfilled_at": 1645446874158
}
]
}
The fulfillment resource
{- "id": "ff-0a5eb87d-2d59-4d42-8734-df3593f7d455",
- "fulfillment_line_items": [
- {
- "line_item_id": "li-f88c0f27-07cf-4c33-8e27-ea6b2593e673",
- "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
{- "reason": "customer"
}
A cancelled Order
{- "id": "ord-797f73eb-22e0-4145-b8af-d6fdac71613d",
- "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": "li-f88c0f27-07cf-4c33-8e27-ea6b2593e673",
- "offer_id": "off-ee589e89-e5a6-4742-9fe8-3d5e119a599f",
- "plan_id": "pl-32fad830-139d-47a9-b90a-5b8006096525",
- "quantity": 1,
- "protection_purchase_date": 1645315200000,
- "protected_product": {
- "id": "prd-iphone14",
- "category": 101,
- "title": "iPhone 14",
- "brand": "Apple",
- "sku": "AP-IPH-14gelb",
- "price": {
- "amount": 112900,
- "currency": "eur"
}
}
}
], - "status": "cancelled",
- "cancelled_at": 1645453287866,
- "cancel_reason": "customer",
- "refunds": [ ],
- "fulfillments": [ ]
}
Create a refund for one or all line items of an Order by specifying 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": "li-f88c0f27-07cf-4c33-8e27-ea6b2593e673",
- "quantity": 1
}
]
}
The refund resource
{- "id": "re-f55ca068-1860-4970-82d8-c77388554f9c",
- "refund_line_items": [
- {
- "line_item_id": "li-f88c0f27-07cf-4c33-8e27-ea6b2593e673",
- "quantity": 1
}
]
}
You can manage protection Orders for your customers by providing us with your Order data (ID, status, line item fulfillments and refunds, connection between products and protection) whenever an Order is created or updated.
Required data to add merchant Orders
required | Array of objects A list of Orders in the merchant system |
Accepted orders
The request was unacceptable due to invalid parameters.
A request to add Orders to feed
{- "orders": [
- {
- "id": "order-123",
- "status": "placed",
- "placed_at": 1669377053593,
- "cancelled_at": null,
- "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": "prd-123",
- "quantity": 2,
- "product_data": {
- "id": "prd-123",
- "price": {
- "amount": 12000,
- "currency": "eur"
}, - "brand": "Apple",
- "title": "iPhone 14"
}, - "custom_properties": {
- "protection_line_item_id": "hkn-off-321"
}, - "fulfillments": [ ],
- "refunds": [ ]
}, - {
- "id": "hkn-off-321",
- "quantity": 2,
- "product_data": {
- "id": "hkn-off-321",
- "price": {
- "amount": 2200,
- "currency": "eur"
}, - "brand": "Hakuna",
- "title": "1 year warranty extension"
}, - "custom_properties": {
- "offer_id": "off-12345",
- "plan_id": "pl-54132"
}, - "fulfillments": [ ],
- "refunds": [ ]
}
]
}
]
}
An Order feed response example
{- "request_id": "req-f55ca069-1860-4970-82d8-c77388554f9c"
}
Retrieve the processing status of the request by specifying the ID. The status contains the current processing status and useful information about the processing.
A RequestStatus
Access token is missing or invalid
The requested resource doesn't exist.
Example request status
{- "processing_status": "in_progress",
- "failed_orders": [
- "ord-797f73eb-22e0-4145-b8af-d6fdac711111"
], - "statuses": [
- {
- "order_id": "ord-797f73eb-22e0-4145-b8af-d6fdac711111",
- "status": "failed",
- "errors": [
- "Unsupported region"
]
}, - {
- "order_id": "ord-797f73eb-22e0-4145-b8af-d6fdac712222",
- "status": "in_progress",
- "errors": [ ]
}, - {
- "order_id": "ord-797f73eb-22e0-4145-b8af-d6fdac713333",
- "status": "successful",
- "errors": [ ]
}
]
}