POST https://partner.getmulberry.com/api/post-purchase-checkout
Converts a post-purchase eligible order into a full warranty order, attaching one or
more warranties to line items after the original sale. The retailer collects
payment for the warranty themselves and calls this endpoint to complete the
issuance.
HTTP method: POST
Authentication: Private Bearer Token
Staging endpoint: https://partner-staging.getmulberry.com/api/post-purchase-checkout
Production endpoint: https://partner.getmulberry.com/api/post-purchase-checkout
Prerequisites
Before calling this endpoint, the order must have been submitted to
POST /api/carts without a warranty. That submission creates a order
and automatically generates warranty offers for each line item.
No offer ID requiredYou do not need to capture or store the internal
warranty_offer_id. Pass the
sameproduct_id(orvariant_id) that you used inPOST /api/cartsand
Mulberry resolves the offer server-side. Passingwarranty_offer_iddirectly
is still supported for backward compatibility.
Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | required | The external order ID — the same value used as order_id in POST /api/carts. |
line_items | array | required | One or more line items to attach a warranty to. Must not be empty. |
line_items object
line_items objectEach entry in line_items must include either product_id / variant_id
or warranty_offer_id.
| Field | Type | Required | Description |
|---|---|---|---|
product_id | string | conditional | The product SKU — the same value used in the original cart request. Provide this or warranty_offer_id. |
variant_id | string | conditional | Product variant ID. Alternative to product_id. |
warranty_offer_id | string | conditional | UUID of a specific warranty offer. Use when you already have the offer ID (e.g. from a previous API call). Overrides product-based resolution. |
quantity | integer | optional | Quantity of warranties to attach. Defaults to 1. |
Headers
| Header | Value |
|---|---|
Authorization | Bearer <token> |
Content-Type | application/json |
Request Examples
Attach by product_id (recommended)
product_id (recommended){
"id": "ORDER-12345",
"line_items": [
{ "product_id": "SOFA-001" }
]
}Attach by warranty_offer_id
warranty_offer_id {
"id": "ORDER-12345",
"line_items": [
{ "warranty_offer_id": "d177c5c3-e549-416f-b048-db0e7ac46758" }
]
}Multiple line items
{
"id": "ORDER-12345",
"line_items": [
{ "product_id": "SOFA-001" },
{ "product_id": "CHAIR-002" }
]
}cURL
curl --request POST \
--url https://partner-staging.getmulberry.com/api/post-purchase-checkout \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"id": "ORDER-12345",
"line_items": [
{ "product_id": "SOFA-001" }
]
}'Responses
200 — Success
200 — SuccessA warranty order was created. The response contains the internal Mulberry order ID.
{
"id": "3af6dd3b-1234-5678-abcd-ef0123456789"
}400 — Bad Request
400 — Bad RequestReturned when:
- A
product_idis provided but no warranty offer exists for that product on
the order.{ "error": "No warranty offer found for product SOFA-001 on order ORDER-12345." } - A line item contains neither
warranty_offer_idnorproduct_id/variant_id.{ "error": "Each line item must include either a warranty_offer_id or a product_id/variant_id to identify the warranty offer." } line_itemsis empty or the payload fails schema validation.
404 — Not Found
404 — Not FoundNo order exists for the given id and authenticated retailer.
{ "error": "Existing vagrant order not found." }500 — Internal Server Error
500 — Internal Server ErrorThe order could not be created. Contact support if this persists.
{ "error": "Failed post purchase checkout. No order was created." }Relationship to /api/carts
/api/carts| Step | Endpoint | Purpose |
|---|---|---|
| 1 | POST /api/carts | Create the original order (without warranty). Mulberry stores it as a order and auto-generates offers. |
| 2 | POST /api/post-purchase-checkout | Attach the warranty and convert the order into a full warranty order. |
Order must exist firstCalling
POST /api/post-purchase-checkoutwith anidthat was never sent to
POST /api/cartsreturns404.
