Get cart
curl --request GET \
--url https://store.salesive.com/api/v1/cart \
--header 'Authorization: Bearer <token>' \
--header 'x-shop-id: <api-key>'import requests
url = "https://store.salesive.com/api/v1/cart"
headers = {
"Authorization": "Bearer <token>",
"x-shop-id": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {Authorization: 'Bearer <token>', 'x-shop-id': '<api-key>'}
};
fetch('https://store.salesive.com/api/v1/cart', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://store.salesive.com/api/v1/cart",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"x-shop-id: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://store.salesive.com/api/v1/cart"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("x-shop-id", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://store.salesive.com/api/v1/cart")
.header("Authorization", "Bearer <token>")
.header("x-shop-id", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://store.salesive.com/api/v1/cart")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
request["x-shop-id"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"status": 123,
"success": true,
"message": "<string>",
"data": {
"_id": "<string>",
"items": [
{
"name": "<string>",
"image": "<string>",
"price": 123,
"quantity": 2,
"_id": "<string>",
"product": {
"_id": "<string>",
"id": "<string>",
"name": "<string>",
"images": [
"<string>"
],
"price": 123,
"promoPrice": 123,
"sku": "<string>",
"parentProductId": "<string>",
"variantAttributes": {}
},
"food": {
"_id": "<string>",
"id": "<string>",
"name": "<string>",
"images": [
"<string>"
],
"price": 123,
"promoPrice": 123
},
"foodId": "<string>",
"variant": "<string>",
"sku": "<string>",
"variantAttributes": {},
"selectedAddons": [
{
"addonId": "<string>",
"name": "<string>",
"price": 123,
"quantity": 2,
"description": "<string>"
}
]
}
],
"totalPrice": 123,
"user": "<string>",
"shop": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}Cart
Get cart
Retrieve the current cart for the authenticated shopper.
GET
/
cart
Get cart
curl --request GET \
--url https://store.salesive.com/api/v1/cart \
--header 'Authorization: Bearer <token>' \
--header 'x-shop-id: <api-key>'import requests
url = "https://store.salesive.com/api/v1/cart"
headers = {
"Authorization": "Bearer <token>",
"x-shop-id": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {Authorization: 'Bearer <token>', 'x-shop-id': '<api-key>'}
};
fetch('https://store.salesive.com/api/v1/cart', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://store.salesive.com/api/v1/cart",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"x-shop-id: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://store.salesive.com/api/v1/cart"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("x-shop-id", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://store.salesive.com/api/v1/cart")
.header("Authorization", "Bearer <token>")
.header("x-shop-id", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://store.salesive.com/api/v1/cart")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
request["x-shop-id"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"status": 123,
"success": true,
"message": "<string>",
"data": {
"_id": "<string>",
"items": [
{
"name": "<string>",
"image": "<string>",
"price": 123,
"quantity": 2,
"_id": "<string>",
"product": {
"_id": "<string>",
"id": "<string>",
"name": "<string>",
"images": [
"<string>"
],
"price": 123,
"promoPrice": 123,
"sku": "<string>",
"parentProductId": "<string>",
"variantAttributes": {}
},
"food": {
"_id": "<string>",
"id": "<string>",
"name": "<string>",
"images": [
"<string>"
],
"price": 123,
"promoPrice": 123
},
"foodId": "<string>",
"variant": "<string>",
"sku": "<string>",
"variantAttributes": {},
"selectedAddons": [
{
"addonId": "<string>",
"name": "<string>",
"price": 123,
"quantity": 2,
"description": "<string>"
}
]
}
],
"totalPrice": 123,
"user": "<string>",
"shop": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}Request
GET /cart
Authorization: Bearer {{token}}
x-shop-id: {{shopId}}
Headers
| Header | Type | Description |
|---|---|---|
Authorization | string | Provide the customer token in the format Bearer <jwt>. |
x-shop-id | string | Identify the shop that owns the cart. |
Successful response
{
"status": 200,
"success": true,
"message": "Cart retrieved",
"data": {
"_id": "693606ada7a8f7dc8ae32d80",
"items": [
{
"itemType": "food",
"food": {
"_id": "68e5bb463a1fc56a8ac150c0",
"name": "Margherita Pizza",
"price": 8500,
"promoPrice": 7500,
"images": [
"https://cdn.salesive.com/foods/margherita.webp"
]
},
"foodId": "68e5bb463a1fc56a8ac150c0",
"name": "Margherita Pizza",
"image": "https://cdn.salesive.com/foods/margherita.webp",
"price": 7500,
"quantity": 1,
"selectedAddons": [
{
"addonId": "68e5bb463a1fc56a8ac150d1",
"name": "Extra Cheese",
"description": "A richer mozzarella finish baked on top.",
"price": 1500,
"quantity": 2
}
],
"_id": "6937b6e9e455c711f1fc9064",
"id": "6937b6e9e455c711f1fc9064"
},
{
"itemType": "product",
"product": null,
"variant": null,
"name": "Laptop Stand",
"image": "https://cdn.salesive.com/products/laptop-stand.jpg",
"price": 8500,
"sku": null,
"variantAttributes": {},
"quantity": 1,
"_id": "693c06a05b24f53cda948082",
"selectedAddons": [],
"id": "693c06a05b24f53cda948082"
}
],
"totalPrice": 19000,
"createdAt": "2025-12-07T22:58:53.640Z",
"updatedAt": "2025-12-12T14:38:55.782Z",
"__v": 3,
"id": "693606ada7a8f7dc8ae32d80"
}
}
Notes
- Food line items include
itemType: "food",food,foodId, andselectedAddons. - Each selected add-on snapshots
name,description,price, andquantityat the time it was added to cart. - Use the cart item
_idwith/cart/item/:itemIdwhen managing food lines or any item with a unique add-on combination.
Error response
{
"status": 401,
"success": false,
"message": "Unauthorized",
"data": {}
}
Authorizations
JWT issued by the Salesive Store API for authenticated shoppers.
Optional storefront identifier sent as a header to scope responses to a specific shop. Try It requests remember this value once provided.
Headers
Optional identifier that scopes responses to a specific storefront when the referer cannot be inferred.
Was this page helpful?
⌘I

