Skip to main content
POST
https://api.usegately.com
/
api
/
v1
/
shop
/
cart
curl -X POST "https://api.usegately.com/api/v1/shop/cart" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "X-User-ID: user_123" \
  -H "Content-Type: application/json" \
  -d '{
    "product_id": "prod_456",
    "quantity": 1
  }'
{
  "success": true,
  "item": {
    "id": "cart_item_789",
    "product_id": "prod_456",
    "quantity": 1,
    "created_at": "2024-01-15T10:30:00Z"
  }
}
Manage shopping cart for ecommerce functionality.
X-User-ID
string
required
The user ID for the cart owner

Request Body

product_id
string
required
ID of the product to add
quantity
number
default:"1"
Quantity to add
variant_id
string
Product variant ID if applicable

Response

success
boolean
Whether the item was added
item
object
The cart item object
curl -X POST "https://api.usegately.com/api/v1/shop/cart" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "X-User-ID: user_123" \
  -H "Content-Type: application/json" \
  -d '{
    "product_id": "prod_456",
    "quantity": 1
  }'
{
  "success": true,
  "item": {
    "id": "cart_item_789",
    "product_id": "prod_456",
    "quantity": 1,
    "created_at": "2024-01-15T10:30:00Z"
  }
}