Skip to content
Elara One docs
Cart

Create a cart

POST
/v1/cart

Authorization

tenantKey
headerX-Tenant-Key<token>

The public store key (pk_live_…). Required on every call.

Header Parameters

X-Client-IP?string

Optional. IP address of the shopper (one IPv4/IPv6, no port, no list). Honoured only together with a valid X-Tenant-Secret; ignored otherwise. Used for rate limits and recorded with form submissions.

X-Tenant-Secret?string

Optional here. Server secret of the store: server-to-server only, never from a browser. Enables X-Client-IP.

Response Body

Success.

application/json
  1. response
data*
Example Request
curl -X POST 'https://api.elaraone.app/api/v1/cart' \  -H 'X-Tenant-Key: pk_live_…' \  -H 'X-Tenant-Secret: your-server-secret'
Example Response
{  "data": {    "cart_token": "string",    "cart": {      "id": 0,      "currency": "string",      "coupon_code": "string",      "coupon": {        "code": "string",        "status": "string",        "reason": "string",        "reason_code": "string",        "remaining": {          "amount": 0,          "currency": "string",          "formatted": "string"        }      },      "lines": [        {          "id": 0,          "quantity": 0,          "variant": {            "id": 0,            "sku": "string",            "name": "string"          },          "unit_price": {            "amount": 0,            "currency": "string",            "formatted": "string"          },          "sub_total": {            "amount": 0,            "currency": "string",            "formatted": "string"          },          "discount_total": {            "amount": 0,            "currency": "string",            "formatted": "string"          },          "sub_total_discounted": {            "amount": 0,            "currency": "string",            "formatted": "string"          },          "discounts": [            {              "id": 0,              "amount": {                "amount": 0,                "currency": "string",                "formatted": "string"              }            }          ],          "gift": true,          "gift_promotion_id": 0,          "tax_amount": {            "amount": 0,            "currency": "string",            "formatted": "string"          },          "total": {            "amount": 0,            "currency": "string",            "formatted": "string"          }        }      ],      "shippable": true,      "addresses": {        "shipping": {          "title": "string",          "first_name": "string",          "last_name": "string",          "company_name": "string",          "line_one": "string",          "line_two": "string",          "line_three": "string",          "city": "string",          "state": "string",          "postcode": "string",          "country_id": 0,          "delivery_instructions": "string",          "contact_email": "string",          "contact_phone": "string",          "shipping_option": "string",          "collection_location_id": 0,          "address_id": 0,          "save_to_account": true        },        "billing": {          "title": "string",          "first_name": "string",          "last_name": "string",          "company_name": "string",          "line_one": "string",          "line_two": "string",          "line_three": "string",          "city": "string",          "state": "string",          "postcode": "string",          "country_id": 0,          "delivery_instructions": "string",          "contact_email": "string",          "contact_phone": "string",          "shipping_option": "string",          "collection_location_id": 0,          "address_id": 0,          "save_to_account": true        }      },      "shipping": {        "option": "string",        "sub_total": {          "amount": 0,          "currency": "string",          "formatted": "string"        },        "tax_total": {          "amount": 0,          "currency": "string",          "formatted": "string"        },        "total": {          "amount": 0,          "currency": "string",          "formatted": "string"        },        "breakdown": [          {            "identifier": "string",            "name": "string",            "price": {              "amount": 0,              "currency": "string",              "formatted": "string"            }          }        ]      },      "discounts": [        {          "id": 0,          "name": "string",          "label": "string",          "kind": "string",          "coupon": "string",          "amount": {            "amount": 0,            "currency": "string",            "formatted": "string"          },          "items_amount": {            "amount": 0,            "currency": "string",            "formatted": "string"          },          "shipping_amount": {            "amount": 0,            "currency": "string",            "formatted": "string"          }        }      ],      "tax_breakdown": [        {          "identifier": "string",          "description": "string",          "percentage": "string",          "price": {            "amount": 0,            "currency": "string",            "formatted": "string"          }        }      ],      "sub_total": {        "amount": 0,        "currency": "string",        "formatted": "string"      },      "discount_total": {        "amount": 0,        "currency": "string",        "formatted": "string"      },      "shipping_discount": {        "amount": 0,        "currency": "string",        "formatted": "string"      },      "savings": {        "amount": 0,        "currency": "string",        "formatted": "string"      },      "nudges": [        {          "promotion_id": 0,          "message": "string",          "remaining": {            "amount": 0,            "currency": "string",            "formatted": "string"          }        }      ],      "rewards": [        {          "promotion_id": 0,          "label": "string",          "type": "string",          "choose_qty": 0,          "chosen_qty": 0,          "variant_ids": [            0          ],          "product_ids": [            0          ],          "collection": {            "id": 0,            "slug": "string"          },          "unavailable": [            0          ],          "items": [            {              "variant_id": 0,              "product_id": 0,              "name": "string",              "slug": "string",              "sku": "string",              "thumbnail": "string",              "price": {                "amount": 0,                "currency": "string",                "formatted": "string"              },              "variant_count": 0            }          ]        }      ],      "tax_total": {        "amount": 0,        "currency": "string",        "formatted": "string"      },      "tax_zone": {        "id": 0,        "name": "string",        "price_display": "string",        "prices_include_tax": true      },      "total": {        "amount": 0,        "currency": "string",        "formatted": "string"      }    }  }}