Skip to content
Elara One docs
Cart

Remove a line

DELETE
/v1/cart/lines/{id}

Authorization

tenantKey
headerX-Tenant-Key<token>

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

Path Parameters

id*integer

Header Parameters

X-Cart-Token*string

The cart token from POST /api/v1/cart.

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.

Idempotency-Key?string

Optional; recommended (a UUID made once per user action, reused only to retry that action). Only a success is stored (24 hours): the same key with the same body, URI and credentials (Authorization, X-Cart-Token, X-Chat-Token) replays it (Idempotent-Replayed: true); anything else under that key is 422 IDEMPOTENCY_KEY_REUSED. An error is never stored: after a 4xx or 5xx, retrying with the same key runs the request again.

X-Session-Id?string

Optional. The shopper's sid cookie value (8-128 of letters, digits, . _ : -). Recorded on the basket as a SHA-256 hash only (never the raw value), so the order can be checked against the consent in force when it is placed, even when Stripe or PayPal settle it later without a request. Send it on every basket write; an absent header keeps the stored hash, and a malformed one is ignored.

X-Visitor-Id?string

Optional. The vid cookie value, when the shopper has one. Recorded on the basket as a SHA-256 hash only (never the raw value), so the order can be checked against the consent in force when it is placed, even when Stripe or PayPal settle it later without a request. Send it on every basket write; an absent header keeps the stored hash, and a malformed one is ignored.

X-GA-Client-Id?string

Optional. The GA4 client id from the _ga cookie that the Google tag of the merchant set: its last two numbers (GA1.1.1234567890.1699999999 → 1234567890.1699999999, ^\d{1,10}\.\d{1,10}$). Send it only when the shopper has granted analytics AND advertising. Kept with the basket and the order only while both are in force (removed when either is withdrawn, on erasure, and after its window), and sent to Google Analytics as the client_id of the purchase, so GA4 joins it to the visit. An absent header keeps the stored id; a malformed one is ignored (never a 422).

Response Body

Success.

application/json
  1. response
data*
Example Request
curl -X DELETE 'https://api.elaraone.app/api/v1/cart/lines/0' \  -H 'X-Tenant-Key: pk_live_…' \  -H 'X-Tenant-Secret: your-server-secret' \  -H 'X-Cart-Token: 01JB9K3N7Q2W5X8Z4C6V1T0R3M'
Example Response
{  "data": {    "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"    }  }}