ERP + E-commerce integration
Context
This integration path requires both ERP and e-commerce integration. You will still be responsible for the UI components on the PDP and in the cart that present protection plans as an opt-in next to the corresponding products.
Preparation
Create items
Using the list provided to you by your Hakuna Account Manager, add the required products/items representing protection plans to your inventory.
Share item IDs with Hakuna
Once you have manually created the items, please share the product/item IDs from your system with your Hakuna Account Manager.
As an example, let's pretend that you added an item representing a 1-year warranty extension to your ERP system and shared the ID "pl-prd-hakuna"
with Hakuna.
E-commerce integration
Present protection plans
On the product detail page
On your product detail pages, your e-commerce system needs to present protection plans as an opt-in next to the corresponding protectable products. To find out what protection plan and information to display for a particular product, pass us the product information and the user session ID in an HTTP GET request.
As a response, you'll get the matching protection plan.
When a product is added to the cart with the associated protection plan selected, you must also add the selected plan as a line item to the cart, with a reference to the protected product as a custom property.
In the cart
In the cart, your e-commerce system needs to:
display the relationship between associated protection plans and products
present protection plans as an opt-in next to the corresponding unprotected products
To identify connected plans and products as well as unprotected products in the cart, pass us the cart ID and the user session ID in an HTTP GET request.
As a response, you'll get a list of all product and protection plan line item connections:
For all unprotected products in the cart, find and display the matching protection plans as an opt-in.
When a protection plan is selected from the cart, you must add an item to the cart that represents that plan, with a reference to the protected product as a custom property.
Manage your cart
Whenever your cart is updated, your e-commerce system needs to notify Hakuna of the cart updates and then perform any cart management actions returned by Hakuna.
In the response, you'll get a list of necessary cart management actions that you need to take to reconcile your cart. Once you have completed these actions, you will need to notify Hakuna of these additional cart updates, then perform any additional cart management actions and notify Hakuna again, continuing this process until no further cart management actions are required.
Notify Hakuna of a successful checkout
When an order is successfully placed, your e-commerce system needs to notify Hakuna. This information allows our platform to connect the cart and order data with the order events you share through your ERP and the Hakuna API.
As a response, you'll get the accepted cart checkout data.
ERP integration
Your ERP system must notify Hakuna whenever any of the following order events occur so that our platform can create and manage the protection for your customers accordingly:
Order placement event: When an order is placed in your system
Line item fulfillment event: When one or more line items are fulfilled in your system (e.g., after shipping)
Line item refund event: When one or more line items are refunded in your system (e.g., after a product return)
Order cancellation event: When an entire order is cancelled (e.g., because of a failed payment)
Publish order placement events
Let's pretend that a customer named Max Mustermann buys an iPhone 14 with a 1-year extended warranty and a phone case from you. You will need to publish an order placement event by calling our events endpoint and passing us order, customer, and product information. You can skip the custom property product_reference
since it is only required in ERP-only integration.
As a response, you'll receive the generated event ID:
Publish line item fulfillment events
Once you ship Max's iPhone and the phone case, you'll need to publish the line item fulfillment events for the two products.
Hakuna does not require you to fulfill protection plan line items, but it may make sense to have your ERP system automatically fulfill them when the associated product is fulfilled. You can use the Hakuna API to check for connections between products and plans so you know which plans to fulfill when.
Publish line item refund events
Let's pretend that Max decides to return the iPhone and the phone case. Whenever a protected product is refunded, you must also refund the protection plan associated with that product. You can use the Hakuna API to check for connections between products and plans so you know which plan to refund.
Once you've refunded all of the products and associated protection plans, you will need to publish the line item refund events:
Publish order cancellation events
Let's rewind and pretend that Max changed his mind about the iPhone and the phone case, so he cancels his order before you can fulfill it. Whenever an entire order is cancelled for any reason, you will need to publish an order cancellation event:
That's all you need to do!
Last updated