Fetch the warranty offers still available on an order after the sale
Returns the warranty offers still available on an order after the original sale, together with the coverage that order already carries. It backs Mulberry's hosted post purchase experience, which reads it to render the landing page a customer lands on from a remarketing email.
Offers exist on an order because it was submitted to POST /api/carts without a warranty. Look one order up by an id that names it, or look up every order for a customer by email. Send both to look one order up by an id that is not the one it was created with. Either way only orders belonging to the retailer in the path are returned.
What is returned here is bought either by the customer, on the Mulberry landing page the order's link leads to, or by you, through Post Purchase Checkout once you have collected the payment yourself.
Post Purchase Offers Endpoint
HTTP method: GET
Authentication: None. This endpoint backs Mulberry's hosted post purchase experience and is not part of the partner integration surface.
Staging Endpoint: https://partner-staging.getmulberry.com/api/purchase-warranties/{retailer_uuid}
Production Endpoint: https://partner.getmulberry.com/api/purchase-warranties/{retailer_uuid}
| Parameter | Description | Required | Type |
|---|---|---|---|
| retailer_uuid | Path parameter. The retailer whose orders are searched | yes | string |
| order_id | Query parameter. An id that names the order — see below | one of* | string |
Query parameter. On its own, returns every order for this customer under the retailer. Alongside order_id, says who is asking — a phone number works here too, for a customer who has no email | one of* | string |
* At least one of order_id or email is required; sending neither is a 400. Sending both looks up the one order order_id names — it does not also list the customer's other orders.
Which ids resolve
The id a customer or a retailer quotes is often not the one the order was created with, so order_id is matched against three spellings:
| Spelling | Resolves |
|---|---|
The order's own id, as sent to POST /api/carts | Always |
| An id carried by one of the order's line items | Only when email is sent |
| An id a later edit recorded against the order — your own purchase order number | Only when email is sent |
A customer who has no email address sends their phone number as email. Mulberry records one for them when you submit the order without an address, so their phone is the thing they can corroborate with.
The order's own id needs nothing to corroborate it: it is the id every post purchase link already carries, and the address a customer types on the landing page is not always the one you recorded. The other two are looser — one purchase order number can name several orders, and a line item can carry an id its own order does not — so on an endpoint with no authentication they resolve only when email matches the address recorded on the order — or, for a customer who has none, their phone number.
An id that names several of that customer's orders returns all of them, inorders. Thecustomerblock describes the first.
Response
Each order carries two lists, and they answer different questions.
line_items is what is still purchasable. One entry per line item, carrying the offers the customer can choose between and every product that line item covers — more than one when the line item covers a bundle. An empty offers list means the purchase window has closed, which the landing page renders as protection expired; that is not the same as the order having no line item.
products is what is already protected and out of the checkout flow. There is one entry per coverage issued, so a product covered twice appears twice, and product_id is what to group on for display.
customer.tax_rate is only present for orders billed to New York. customer.has_subscription is only present when the customer has an active subscription with Mulberry.
Line item fields:
| Parameter | Description | Type |
|---|---|---|
| line_item_id | Stable identifier for the line item. Send it back as line_item_id when buying, since position in this response shifts as items sell | integer |
| warranty_offer_id | Set when the line item is pinned to a single offer, null when the customer still chooses from offers | string |
| offers | The warranty offers still buyable on this line item. Empty when the purchase window has closed | array |
| products | Every product this line item covers. More than one for a bundle | array |
| products_total | The price the offers were priced against. Already the bundle total for a bundle | string |
Covered product fields:
| Parameter | Description | Type |
|---|---|---|
| product_id | Your product id for the covered product | string |
| product_title | Product title | string |
| product_price | Product price | string |
| product_image | Product image url, or an empty string when none was sent | string |
| is_subscription_eligible | Whether the product can be offered on a subscription instead | boolean |
Purchased product fields:
| Parameter | Description | Type |
|---|---|---|
| name | Product name | string |
| product_id | Your product id. Group on this rather than on name | string |
| product_image | First product image url, or null when the product has none | string |
| warranty.duration_months | Term of the coverage that was issued | string |
{
"customer": {
"email": "[email protected]",
"first_name": "John",
"tax_rate": 0
},
"orders": [
{
"id": "testing1234567-33",
"merchant": null,
"merchant_logo": "",
"line_items": [
{
"line_item_id": 91827,
"warranty_offer_id": null,
"offers": [
{
"cost": "100.00",
"customer_cost": "100.00",
"currency": "USD",
"duration_months": "36",
"expiration_date": "2022-05-01",
"mb_category": "indoor_furniture",
"policy_terms_url": "https://terms.getmulberry.com/20210305_fortegra_furniture_plus",
"service_type": "Replacement",
"warranty_offer_id": "0e2ac3d8-5965-45fd-9e8a-9aa6860829dc",
"warranty_type": "regular"
}
],
"products": [
{
"product_id": "9393939",
"product_title": "deluxe couch",
"product_price": "179.99",
"product_image": "",
"is_subscription_eligible": false
}
],
"products_total": "179.99"
}
],
"products": [
{
"name": "deluxe couch",
"product_id": "9393939",
"product_image": null,
"warranty": {
"duration_months": "36"
}
}
]
}
]
}| Status | Description |
|---|---|
| 200 | Offers returned. An order with nothing left to sell returns empty lists |
| 400 | Neither order_id nor email was given |
| 404 | No retailer matches the retailer_uuid |
| 500 | Internal error |
