Post Purchase Offers

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}

ParameterDescriptionRequiredType
retailer_uuidPath parameter. The retailer whose orders are searchedyesstring
order_idQuery parameter. An id that names the order — see belowone of*string
emailQuery 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 emailone 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:

SpellingResolves
The order's own id, as sent to POST /api/cartsAlways
An id carried by one of the order's line itemsOnly when email is sent
An id a later edit recorded against the order — your own purchase order numberOnly 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, in orders. The customer block 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:

ParameterDescriptionType
line_item_idStable identifier for the line item. Send it back as line_item_id when buying, since position in this response shifts as items sellinteger
warranty_offer_idSet when the line item is pinned to a single offer, null when the customer still chooses from offersstring
offersThe warranty offers still buyable on this line item. Empty when the purchase window has closedarray
productsEvery product this line item covers. More than one for a bundlearray
products_totalThe price the offers were priced against. Already the bundle total for a bundlestring

Covered product fields:

ParameterDescriptionType
product_idYour product id for the covered productstring
product_titleProduct titlestring
product_priceProduct pricestring
product_imageProduct image url, or an empty string when none was sentstring
is_subscription_eligibleWhether the product can be offered on a subscription insteadboolean

Purchased product fields:

ParameterDescriptionType
nameProduct namestring
product_idYour product id. Group on this rather than on namestring
product_imageFirst product image url, or null when the product has nonestring
warranty.duration_monthsTerm of the coverage that was issuedstring
{
  "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"
          }
        }
      ]
    }
  ]
}
StatusDescription
200Offers returned. An order with nothing left to sell returns empty lists
400Neither order_id nor email was given
404No retailer matches the retailer_uuid
500Internal error