Post-Purchase Checkout

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 required

You do not need to capture or store the internal warranty_offer_id. Pass the
same product_id (or variant_id) that you used in POST /api/carts and
Mulberry resolves the offer server-side. Passing warranty_offer_id directly
is still supported for backward compatibility.


Body Parameters

ParameterTypeRequiredDescription
idstringrequiredThe external order ID — the same value used as order_id in POST /api/carts.
line_itemsarrayrequiredOne or more line items to attach a warranty to. Must not be empty.

line_items object

Each entry in line_items must include either product_id / variant_id
or warranty_offer_id.

FieldTypeRequiredDescription
product_idstringconditionalThe product SKU — the same value used in the original cart request. Provide this or warranty_offer_id.
variant_idstringconditionalProduct variant ID. Alternative to product_id.
warranty_offer_idstringconditionalUUID of a specific warranty offer. Use when you already have the offer ID (e.g. from a previous API call). Overrides product-based resolution.
quantityintegeroptionalQuantity of warranties to attach. Defaults to 1.

Headers

HeaderValue
AuthorizationBearer <token>
Content-Typeapplication/json

Request Examples

Attach by product_id (recommended)

{
  "id": "ORDER-12345",
  "line_items": [
    { "product_id": "SOFA-001" }
  ]
}

Attach by 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

A warranty order was created. The response contains the internal Mulberry order ID.

{
  "id": "3af6dd3b-1234-5678-abcd-ef0123456789"
}

400 — Bad Request

Returned when:

  • A product_id is 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_id nor product_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_items is empty or the payload fails schema validation.

404 — Not Found

No order exists for the given id and authenticated retailer.

{ "error": "Existing vagrant order not found." }

500 — Internal Server Error

The order could not be created. Contact support if this persists.

{ "error": "Failed post purchase checkout. No order was created." }

Relationship to /api/carts

StepEndpointPurpose
1POST /api/cartsCreate the original order (without warranty). Mulberry stores it as a order and auto-generates offers.
2POST /api/post-purchase-checkoutAttach the warranty and convert the order into a full warranty order.
🚧

Order must exist first

Calling POST /api/post-purchase-checkout with an id that was never sent to
POST /api/carts returns 404.