Checkout Carts

Create a build-to-order cart

Changed on

Creates a checkout cart for the account bound to the token and returns it with a checkout_url the buyer can be sent to. The account that owns the cart is resolved server-side from the token, so the request carries no owner identifiers. Buyer prefill is optional. Name the vehicle with manufacturer_id, model_id, variant_id, and style_id, the same four that address a vehicle on the catalog endpoint. A cart holds one vehicle. Pass accessories for anything sold with it, and is_preorder to create the cart as an ante-preorder. To sell a specific dealer unit that already exists, use POST /carts/inventory.

post/carts/build-to-order

Request

  • Base URL: https://api.ekho.com
  • URL: https://api.ekho.com/carts/build-to-order
  • Auth: HTTP bearer

Request body

manufacturer_idstring required

The manufacturer of the vehicle.

model_idstring required

The model being built.

variant_idstring required

The trim of that model.

style_idstring required

The colour of that trim.

accessoriesstring[]

Accessories sold with the vehicle. A part is fitted to the vehicle and financed with it; gear and accessory items are sold alongside it and priced as separate cart items. Which one an id is comes from the catalog, not from this request.

is_preorderboolean

When true, the cart is created as an ante-preorder.

cancel_redirect_urlstring

URL the buyer is redirected to if they cancel checkout.

metadataobject

Free-form metadata carried through to the cart, and on to the order and its vehicles. Stored as written, so a nested object or an array needs no JSON encoding and reads back in the shape it was sent. At most 100 object keys and 2 levels of object nesting, and no array may hold another array.

promo_codesstring[]

Promotion codes, matched against the promotions published for your account. A code matching none is skipped rather than failing the request. At most 10. Matching runs after the cart is written, so a validate_only request reports nothing about them.

validate_onlyboolean

When true, the request is checked as a real one would be, then stops: no cart is created. A request that would have succeeded answers 200 with {"validate_only": true}; one that would have failed answers the same error. Reserves nothing, so a unit can still sell between a passing check and the create.

Example request

{
  "manufacturer_id": "oem_apex",
  "model_id": "trail-350-2026",
  "variant_id": "trail-350-2026-base",
  "style_id": "fireball-red",
  "promo_codes": [
    "SPRING500"
  ]
}

Response

A validate_only request passed. No cart was created.

Example response

{
  "data": {
    "dropped_accessories": [
      {
        "id": "acc_rear_rack_black"
      }
    ]
  }
}

Changes

    • info

      added the required property / to the response with the status

    • info

      added the required property / to the response with the status

    • info

      added the new optional request property