Skip to main content
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>'
{
  "status": 123,
  "success": true,
  "message": "<string>",
  "data": {
    "_id": "<string>",
    "user": "<string>",
    "shop": "<string>",
    "items": [
      {
        "name": "<string>",
        "image": "<string>",
        "price": 123,
        "quantity": 2,
        "product": {
          "_id": "<string>",
          "id": "<string>",
          "name": "<string>",
          "images": [
            "<string>"
          ],
          "price": 123,
          "promoPrice": 123,
          "sku": "<string>",
          "parentProductId": "<string>",
          "variantAttributes": {}
        },
        "variant": "<string>",
        "sku": "<string>",
        "variantAttributes": {}
      }
    ],
    "totalPrice": 123,
    "createdAt": "2023-11-07T05:31:56Z",
    "updatedAt": "2023-11-07T05:31:56Z"
  }
}

Request

GET /cart
Authorization: Bearer {{token}}
x-shop-id: {{shopId}}

Headers

HeaderTypeDescription
AuthorizationstringProvide the customer token in the format Bearer <jwt>.
x-shop-idstringIdentify the shop that owns the cart.

Successful response

{
  "status": 200,
  "success": true,
  "message": "Cart retrieved",
  "data": {
    "_id": "68f98d77c8502e9619569c24",
    "user": "68f976e92bb0b821425fdda6",
    "shop": "68b8f52575da81b332af29f1",
    "items": [
      {
        "product": {
          "_id": "68e5bb463a1fc56a8ac150bf",
          "name": "Head phone",
          "price": 10000,
          "promoPrice": null,
          "images": [
            "http://192.168.1.39:3000/api/files/68e21c6d59f42b8348c416a6",
            "http://192.168.1.39:3000/api/files/68e21c6c59f42b8348c4169f"
          ],
          "formattedPrice": "10000.00",
          "promoActive": false,
          "formattedPromoPrice": null,
          "isAvailable": false,
          "lowestPrice": 10000,
          "highestPrice": 10000,
          "id": "68e5bb463a1fc56a8ac150bf"
        },
        "name": "Head phone",
        "image": "http://192.168.1.39:3000/api/files/68e21c6d59f42b8348c416a6",
        "price": 10000,
        "quantity": 2,
        "_id": "68f98ea8e3e4237fed91c653"
      },
      {
        "product": {
          "_id": "68e5c1303a1fc56a8ac151e2",
          "id": "68e5c1303a1fc56a8ac151e2",
          "name": "Head phone",
          "images": [
            "http://192.168.1.39:3000/api/files/68e21c6d59f42b8348c416a6",
            "http://192.168.1.39:3000/api/files/68e21c6c59f42b8348c4169f"
          ],
          "price": 1,
          "promoPrice": null,
          "formattedPrice": "1.00",
          "formattedPromoPrice": null,
          "promoActive": false,
          "isAvailable": true,
          "lowestPrice": 1,
          "highestPrice": 1,
          "sku": "HEAD-PHONE-1-A",
          "parentProductId": "68e5bb463a1fc56a8ac150bf",
          "variantAttributes": {
            "size": "1",
            "color": "a"
          }
        },
        "variant": "68e5c1303a1fc56a8ac151e2",
        "name": "Head phone",
        "image": "http://192.168.1.39:3000/api/files/68e21c6d59f42b8348c416a6",
        "price": 1,
        "sku": "HEAD-PHONE-1-A",
        "variantAttributes": {
          "size": "1",
          "color": "a"
        },
        "quantity": 1,
        "_id": "68f9903ae3e4237fed91c68b"
      }
    ],
    "totalPrice": 20001,
    "createdAt": "2025-10-23T02:05:43.597Z",
    "updatedAt": "2025-10-23T02:17:30.681Z",
    "__v": 2
  }
}

Error response

{
  "status": 401,
  "success": false,
  "message": "Unauthorized",
  "data": {}
}

Authorizations

Authorization
string
header
required

JWT issued by the Salesive Store API for authenticated shoppers.

x-shop-id
string
header
required

Optional storefront identifier sent as a header to scope responses to a specific shop. Try It requests remember this value once provided.

Headers

x-shop-id
string

Optional identifier that scopes responses to a specific storefront when the referer cannot be inferred.

Response

Cart retrieved successfully.

status
integer
required

HTTP status code returned by the API.

success
boolean
required

Indicates whether the request succeeded.

message
string
required

Human-readable response message.

data
object
required