StoreLyne API docs 2026-11

Start a cart

POST/storefront/2026-11/carts

storefront tokenIdempotency-Key required

Headers

  • Idempotency-Keystringrequired

    Unique key for this request. Retries with the same key return the first response.

    At least 1 characters · Up to 255 characters

Request body

  • linesarray of object

    Up to 100 items

  • lines[].variant_idID (var_...)required
  • lines[].quantityintegerrequired

    1 to 1000

  • buyer_statestring or null
  • sourcestring

    page:<slug> when the cart starts on a payment page.

Response 201

  • idID (crt_...)required
  • statusenumrequired

    One of open converted abandoned

  • currencystringrequired
  • buyer_statestring or nullrequired
  • linesarray of objectrequired
  • lines[].idID (cln_...)required
  • lines[].variant_idID (var_...)required
  • lines[].product_idID (prd_...) or nullrequired
  • lines[].titlestringrequired
  • lines[].variant_titlestringrequired
  • lines[].quantityintegerrequired
  • lines[].unit_priceintegerrequired
  • lines[].totalintegerrequired
  • lines[].taxintegerrequired
  • lines[].requires_shippingbooleanrequired
  • lines[].availablebooleanrequired

    False when the product is no longer on sale; such lines are left out of the totals.

  • lines[].price_changedobject or nullrequired
  • lines[].price_changed.fromintegerrequired
  • lines[].price_changed.tointegerrequired
  • subtotalintegerrequired

    Lines total minus the discount.

  • discountobject or nullrequired
  • discount.codestringrequired
  • discount.amountintegerrequired
  • shippingintegerrequired
  • taxobjectrequired
  • tax.totalintegerrequired
  • tax.cgstinteger or nullrequired
  • tax.sgstinteger or nullrequired
  • tax.igstinteger or nullrequired
  • totalintegerrequired
  • noticesarray of stringrequired

    Plain sentences for the buyer, for example a changed price.

Errors

400idempotency_key_requiredEvery POST needs an Idempotency-Key header.
400validation_failedA field in the request is missing or invalid. See param.
401authentication_requiredSend a valid access token or session.
409idempotency_in_progressA request with this Idempotency-Key is still running.
422idempotency_key_reusedThis Idempotency-Key was used with a different request.
429rate_limitedToo many requests. Wait for the time in RateLimit-Reset.
500internal_errorSomething went wrong on our side. Quote the trace_id to support.
curl -X POST https://api.storelyne.com/storefront/2026-11/carts \
  -H "Storefront-Token: <storefront token>" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "lines": [
    {
      "variant_id": "var_01JCG8ZQ5S7T0V4X8K2M3N6P9R",
      "quantity": 1
    }
  ],
  "buyer_state": "string",
  "source": ""
}'
Response 201
{
  "id": "crt_01JCG8ZQ5S7T0V4X8K2M3N6P9R",
  "status": "open",
  "currency": "INR",
  "buyer_state": "string",
  "lines": [
    {
      "id": "cln_01JCG8ZQ5S7T0V4X8K2M3N6P9R",
      "variant_id": "var_01JCG8ZQ5S7T0V4X8K2M3N6P9R",
      "product_id": "prd_01JCG8ZQ5S7T0V4X8K2M3N6P9R",
      "title": "Festive saree",
      "variant_title": "Festive saree",
      "quantity": 1,
      "unit_price": 49900,
      "total": 49900,
      "tax": 1,
      "requires_shipping": false,
      "available": false,
      "price_changed": {
        "from": 1,
        "to": 1
      }
    }
  ],
  "subtotal": 49900,
  "discount": {
    "code": "string",
    "amount": 49900
  },
  "shipping": 1,
  "tax": {
    "total": 49900,
    "cgst": 1,
    "sgst": 1,
    "igst": 1
  },
  "total": 49900,
  "notices": [
    "string"
  ]
}

A cart with current prices and totals

GET/storefront/2026-11/carts/{id}

storefront token

Path parameters

  • idID (crt_...)required

Response 200

  • idID (crt_...)required
  • statusenumrequired

    One of open converted abandoned

  • currencystringrequired
  • buyer_statestring or nullrequired
  • linesarray of objectrequired
  • lines[].idID (cln_...)required
  • lines[].variant_idID (var_...)required
  • lines[].product_idID (prd_...) or nullrequired
  • lines[].titlestringrequired
  • lines[].variant_titlestringrequired
  • lines[].quantityintegerrequired
  • lines[].unit_priceintegerrequired
  • lines[].totalintegerrequired
  • lines[].taxintegerrequired
  • lines[].requires_shippingbooleanrequired
  • lines[].availablebooleanrequired

    False when the product is no longer on sale; such lines are left out of the totals.

  • lines[].price_changedobject or nullrequired
  • lines[].price_changed.fromintegerrequired
  • lines[].price_changed.tointegerrequired
  • subtotalintegerrequired

    Lines total minus the discount.

  • discountobject or nullrequired
  • discount.codestringrequired
  • discount.amountintegerrequired
  • shippingintegerrequired
  • taxobjectrequired
  • tax.totalintegerrequired
  • tax.cgstinteger or nullrequired
  • tax.sgstinteger or nullrequired
  • tax.igstinteger or nullrequired
  • totalintegerrequired
  • noticesarray of stringrequired

    Plain sentences for the buyer, for example a changed price.

Errors

400validation_failedA field in the request is missing or invalid. See param.
401authentication_requiredSend a valid access token or session.
404resource_not_foundThe object does not exist or belongs to another store.
429rate_limitedToo many requests. Wait for the time in RateLimit-Reset.
500internal_errorSomething went wrong on our side. Quote the trace_id to support.
curl https://api.storelyne.com/storefront/2026-11/carts/crt_01JCG8ZQ5S7T0V4X8K2M3N6P9R \
  -H "Storefront-Token: <storefront token>"
Response 200
{
  "id": "crt_01JCG8ZQ5S7T0V4X8K2M3N6P9R",
  "status": "open",
  "currency": "INR",
  "buyer_state": "string",
  "lines": [
    {
      "id": "cln_01JCG8ZQ5S7T0V4X8K2M3N6P9R",
      "variant_id": "var_01JCG8ZQ5S7T0V4X8K2M3N6P9R",
      "product_id": "prd_01JCG8ZQ5S7T0V4X8K2M3N6P9R",
      "title": "Festive saree",
      "variant_title": "Festive saree",
      "quantity": 1,
      "unit_price": 49900,
      "total": 49900,
      "tax": 1,
      "requires_shipping": false,
      "available": false,
      "price_changed": {
        "from": 1,
        "to": 1
      }
    }
  ],
  "subtotal": 49900,
  "discount": {
    "code": "string",
    "amount": 49900
  },
  "shipping": 1,
  "tax": {
    "total": 49900,
    "cgst": 1,
    "sgst": 1,
    "igst": 1
  },
  "total": 49900,
  "notices": [
    "string"
  ]
}

Set the buyer state (for the GST split)

PATCH/storefront/2026-11/carts/{id}

storefront token

Path parameters

  • idID (crt_...)required

Request body

  • buyer_statestring or null
  • discount_codestring or null

    A discount code; null removes it.

Response 200

  • idID (crt_...)required
  • statusenumrequired

    One of open converted abandoned

  • currencystringrequired
  • buyer_statestring or nullrequired
  • linesarray of objectrequired
  • lines[].idID (cln_...)required
  • lines[].variant_idID (var_...)required
  • lines[].product_idID (prd_...) or nullrequired
  • lines[].titlestringrequired
  • lines[].variant_titlestringrequired
  • lines[].quantityintegerrequired
  • lines[].unit_priceintegerrequired
  • lines[].totalintegerrequired
  • lines[].taxintegerrequired
  • lines[].requires_shippingbooleanrequired
  • lines[].availablebooleanrequired

    False when the product is no longer on sale; such lines are left out of the totals.

  • lines[].price_changedobject or nullrequired
  • lines[].price_changed.fromintegerrequired
  • lines[].price_changed.tointegerrequired
  • subtotalintegerrequired

    Lines total minus the discount.

  • discountobject or nullrequired
  • discount.codestringrequired
  • discount.amountintegerrequired
  • shippingintegerrequired
  • taxobjectrequired
  • tax.totalintegerrequired
  • tax.cgstinteger or nullrequired
  • tax.sgstinteger or nullrequired
  • tax.igstinteger or nullrequired
  • totalintegerrequired
  • noticesarray of stringrequired

    Plain sentences for the buyer, for example a changed price.

Errors

400validation_failedA field in the request is missing or invalid. See param.
401authentication_requiredSend a valid access token or session.
404resource_not_foundThe object does not exist or belongs to another store.
429rate_limitedToo many requests. Wait for the time in RateLimit-Reset.
500internal_errorSomething went wrong on our side. Quote the trace_id to support.
curl -X PATCH https://api.storelyne.com/storefront/2026-11/carts/crt_01JCG8ZQ5S7T0V4X8K2M3N6P9R \
  -H "Storefront-Token: <storefront token>" \
  -H "Content-Type: application/json" \
  -d '{
  "buyer_state": "string",
  "discount_code": "string"
}'
Response 200
{
  "id": "crt_01JCG8ZQ5S7T0V4X8K2M3N6P9R",
  "status": "open",
  "currency": "INR",
  "buyer_state": "string",
  "lines": [
    {
      "id": "cln_01JCG8ZQ5S7T0V4X8K2M3N6P9R",
      "variant_id": "var_01JCG8ZQ5S7T0V4X8K2M3N6P9R",
      "product_id": "prd_01JCG8ZQ5S7T0V4X8K2M3N6P9R",
      "title": "Festive saree",
      "variant_title": "Festive saree",
      "quantity": 1,
      "unit_price": 49900,
      "total": 49900,
      "tax": 1,
      "requires_shipping": false,
      "available": false,
      "price_changed": {
        "from": 1,
        "to": 1
      }
    }
  ],
  "subtotal": 49900,
  "discount": {
    "code": "string",
    "amount": 49900
  },
  "shipping": 1,
  "tax": {
    "total": 49900,
    "cgst": 1,
    "sgst": 1,
    "igst": 1
  },
  "total": 49900,
  "notices": [
    "string"
  ]
}

Add a variant (adds to the quantity when it is already in the cart)

POST/storefront/2026-11/carts/{id}/lines

storefront tokenIdempotency-Key required

Path parameters

  • idID (crt_...)required

Headers

  • Idempotency-Keystringrequired

    Unique key for this request. Retries with the same key return the first response.

    At least 1 characters · Up to 255 characters

Request body

  • variant_idID (var_...)required
  • quantityintegerrequired

    1 to 1000

Response 200

  • idID (crt_...)required
  • statusenumrequired

    One of open converted abandoned

  • currencystringrequired
  • buyer_statestring or nullrequired
  • linesarray of objectrequired
  • lines[].idID (cln_...)required
  • lines[].variant_idID (var_...)required
  • lines[].product_idID (prd_...) or nullrequired
  • lines[].titlestringrequired
  • lines[].variant_titlestringrequired
  • lines[].quantityintegerrequired
  • lines[].unit_priceintegerrequired
  • lines[].totalintegerrequired
  • lines[].taxintegerrequired
  • lines[].requires_shippingbooleanrequired
  • lines[].availablebooleanrequired

    False when the product is no longer on sale; such lines are left out of the totals.

  • lines[].price_changedobject or nullrequired
  • lines[].price_changed.fromintegerrequired
  • lines[].price_changed.tointegerrequired
  • subtotalintegerrequired

    Lines total minus the discount.

  • discountobject or nullrequired
  • discount.codestringrequired
  • discount.amountintegerrequired
  • shippingintegerrequired
  • taxobjectrequired
  • tax.totalintegerrequired
  • tax.cgstinteger or nullrequired
  • tax.sgstinteger or nullrequired
  • tax.igstinteger or nullrequired
  • totalintegerrequired
  • noticesarray of stringrequired

    Plain sentences for the buyer, for example a changed price.

Errors

400idempotency_key_requiredEvery POST needs an Idempotency-Key header.
400validation_failedA field in the request is missing or invalid. See param.
401authentication_requiredSend a valid access token or session.
404resource_not_foundThe object does not exist or belongs to another store.
409idempotency_in_progressA request with this Idempotency-Key is still running.
422idempotency_key_reusedThis Idempotency-Key was used with a different request.
429rate_limitedToo many requests. Wait for the time in RateLimit-Reset.
500internal_errorSomething went wrong on our side. Quote the trace_id to support.
curl -X POST https://api.storelyne.com/storefront/2026-11/carts/crt_01JCG8ZQ5S7T0V4X8K2M3N6P9R/lines \
  -H "Storefront-Token: <storefront token>" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "variant_id": "var_01JCG8ZQ5S7T0V4X8K2M3N6P9R",
  "quantity": 1
}'
Response 200
{
  "id": "crt_01JCG8ZQ5S7T0V4X8K2M3N6P9R",
  "status": "open",
  "currency": "INR",
  "buyer_state": "string",
  "lines": [
    {
      "id": "cln_01JCG8ZQ5S7T0V4X8K2M3N6P9R",
      "variant_id": "var_01JCG8ZQ5S7T0V4X8K2M3N6P9R",
      "product_id": "prd_01JCG8ZQ5S7T0V4X8K2M3N6P9R",
      "title": "Festive saree",
      "variant_title": "Festive saree",
      "quantity": 1,
      "unit_price": 49900,
      "total": 49900,
      "tax": 1,
      "requires_shipping": false,
      "available": false,
      "price_changed": {
        "from": 1,
        "to": 1
      }
    }
  ],
  "subtotal": 49900,
  "discount": {
    "code": "string",
    "amount": 49900
  },
  "shipping": 1,
  "tax": {
    "total": 49900,
    "cgst": 1,
    "sgst": 1,
    "igst": 1
  },
  "total": 49900,
  "notices": [
    "string"
  ]
}

Change a quantity

PATCH/storefront/2026-11/carts/{id}/lines/{line_id}

storefront token

Path parameters

  • idID (crt_...)required
  • line_idID (cln_...)required

Request body

  • quantityintegerrequired

    1 to 1000

Response 200

  • idID (crt_...)required
  • statusenumrequired

    One of open converted abandoned

  • currencystringrequired
  • buyer_statestring or nullrequired
  • linesarray of objectrequired
  • lines[].idID (cln_...)required
  • lines[].variant_idID (var_...)required
  • lines[].product_idID (prd_...) or nullrequired
  • lines[].titlestringrequired
  • lines[].variant_titlestringrequired
  • lines[].quantityintegerrequired
  • lines[].unit_priceintegerrequired
  • lines[].totalintegerrequired
  • lines[].taxintegerrequired
  • lines[].requires_shippingbooleanrequired
  • lines[].availablebooleanrequired

    False when the product is no longer on sale; such lines are left out of the totals.

  • lines[].price_changedobject or nullrequired
  • lines[].price_changed.fromintegerrequired
  • lines[].price_changed.tointegerrequired
  • subtotalintegerrequired

    Lines total minus the discount.

  • discountobject or nullrequired
  • discount.codestringrequired
  • discount.amountintegerrequired
  • shippingintegerrequired
  • taxobjectrequired
  • tax.totalintegerrequired
  • tax.cgstinteger or nullrequired
  • tax.sgstinteger or nullrequired
  • tax.igstinteger or nullrequired
  • totalintegerrequired
  • noticesarray of stringrequired

    Plain sentences for the buyer, for example a changed price.

Errors

400validation_failedA field in the request is missing or invalid. See param.
401authentication_requiredSend a valid access token or session.
404resource_not_foundThe object does not exist or belongs to another store.
429rate_limitedToo many requests. Wait for the time in RateLimit-Reset.
500internal_errorSomething went wrong on our side. Quote the trace_id to support.
curl -X PATCH https://api.storelyne.com/storefront/2026-11/carts/crt_01JCG8ZQ5S7T0V4X8K2M3N6P9R/lines/cln_01JCG8ZQ5S7T0V4X8K2M3N6P9R \
  -H "Storefront-Token: <storefront token>" \
  -H "Content-Type: application/json" \
  -d '{
  "quantity": 1
}'
Response 200
{
  "id": "crt_01JCG8ZQ5S7T0V4X8K2M3N6P9R",
  "status": "open",
  "currency": "INR",
  "buyer_state": "string",
  "lines": [
    {
      "id": "cln_01JCG8ZQ5S7T0V4X8K2M3N6P9R",
      "variant_id": "var_01JCG8ZQ5S7T0V4X8K2M3N6P9R",
      "product_id": "prd_01JCG8ZQ5S7T0V4X8K2M3N6P9R",
      "title": "Festive saree",
      "variant_title": "Festive saree",
      "quantity": 1,
      "unit_price": 49900,
      "total": 49900,
      "tax": 1,
      "requires_shipping": false,
      "available": false,
      "price_changed": {
        "from": 1,
        "to": 1
      }
    }
  ],
  "subtotal": 49900,
  "discount": {
    "code": "string",
    "amount": 49900
  },
  "shipping": 1,
  "tax": {
    "total": 49900,
    "cgst": 1,
    "sgst": 1,
    "igst": 1
  },
  "total": 49900,
  "notices": [
    "string"
  ]
}

Remove a line

DEL/storefront/2026-11/carts/{id}/lines/{line_id}

storefront token

Path parameters

  • idID (crt_...)required
  • line_idID (cln_...)required

Response 200

  • idID (crt_...)required
  • statusenumrequired

    One of open converted abandoned

  • currencystringrequired
  • buyer_statestring or nullrequired
  • linesarray of objectrequired
  • lines[].idID (cln_...)required
  • lines[].variant_idID (var_...)required
  • lines[].product_idID (prd_...) or nullrequired
  • lines[].titlestringrequired
  • lines[].variant_titlestringrequired
  • lines[].quantityintegerrequired
  • lines[].unit_priceintegerrequired
  • lines[].totalintegerrequired
  • lines[].taxintegerrequired
  • lines[].requires_shippingbooleanrequired
  • lines[].availablebooleanrequired

    False when the product is no longer on sale; such lines are left out of the totals.

  • lines[].price_changedobject or nullrequired
  • lines[].price_changed.fromintegerrequired
  • lines[].price_changed.tointegerrequired
  • subtotalintegerrequired

    Lines total minus the discount.

  • discountobject or nullrequired
  • discount.codestringrequired
  • discount.amountintegerrequired
  • shippingintegerrequired
  • taxobjectrequired
  • tax.totalintegerrequired
  • tax.cgstinteger or nullrequired
  • tax.sgstinteger or nullrequired
  • tax.igstinteger or nullrequired
  • totalintegerrequired
  • noticesarray of stringrequired

    Plain sentences for the buyer, for example a changed price.

Errors

400validation_failedA field in the request is missing or invalid. See param.
401authentication_requiredSend a valid access token or session.
404resource_not_foundThe object does not exist or belongs to another store.
429rate_limitedToo many requests. Wait for the time in RateLimit-Reset.
500internal_errorSomething went wrong on our side. Quote the trace_id to support.
curl -X DELETE https://api.storelyne.com/storefront/2026-11/carts/crt_01JCG8ZQ5S7T0V4X8K2M3N6P9R/lines/cln_01JCG8ZQ5S7T0V4X8K2M3N6P9R \
  -H "Storefront-Token: <storefront token>"
Response 200
{
  "id": "crt_01JCG8ZQ5S7T0V4X8K2M3N6P9R",
  "status": "open",
  "currency": "INR",
  "buyer_state": "string",
  "lines": [
    {
      "id": "cln_01JCG8ZQ5S7T0V4X8K2M3N6P9R",
      "variant_id": "var_01JCG8ZQ5S7T0V4X8K2M3N6P9R",
      "product_id": "prd_01JCG8ZQ5S7T0V4X8K2M3N6P9R",
      "title": "Festive saree",
      "variant_title": "Festive saree",
      "quantity": 1,
      "unit_price": 49900,
      "total": 49900,
      "tax": 1,
      "requires_shipping": false,
      "available": false,
      "price_changed": {
        "from": 1,
        "to": 1
      }
    }
  ],
  "subtotal": 49900,
  "discount": {
    "code": "string",
    "amount": 49900
  },
  "shipping": 1,
  "tax": {
    "total": 49900,
    "cgst": 1,
    "sgst": 1,
    "igst": 1
  },
  "total": 49900,
  "notices": [
    "string"
  ]
}