Zid Docs
AppsThemes
Payments
AppsThemes
Payments
Help Center
Slack
  1. Checkout
  • Getting Started
    • Introduction
    • Theme Development
    • Vitrin Changelog
    • Creating and Managing Theme Presets
    • Legacy Theme Migration
      • Store Settings Mapping
      • Moving to Vitrin Using LLMs
      • Twig to Jinja
      • Breaking Changes
  • Key Concepts
    • Architecture
    • Templates
      • Overview
      • Overridable Templates
      • Legacy Templates
      • Template Replacements
      • Templates Library
        • home.jinja
        • product.jinja
        • cart.jinja
        • category.jinja
        • products.jinja
        • categories.jinja
        • page.jinja
        • blogs.jinja
        • blog.jinja
        • faqs.jinja
        • reviews.jinja
        • questions.jinja
        • shipping_payment.jinja
        • 404_not_found.jinja
    • Settings
      • Schema files
      • Input Settings
      • Media Settings
      • Form Controls Settings
      • Products Settings
      • Additional Settings
      • Conditional Visibility
      • Migrating twig settings schema
    • Localization
      • localization (jinja v. twig)
    • Theme Editor
      • Overview
  • Building with Vitrin
    • Jinja Basics
    • Vitrin's Jinja Extensions
  • Vitrin CLI
    • Introduction
    • CLI Commands
  • Tips & Tricks
    • Performance
  • JS Integration
    • Supporting both Vitrin and Legacy themes
    • Responses & Errors
    • Cart
    • Products
    • Categories
    • Store
    • Account
    • Blogs
    • Options
    • Events
  • Features
    • SDK Popups – Integration Guidelines
    • Custom Styles Guide
    • Gift Card as a Popup
    • Addresses as a Popup
    • Login as a Popup
    • Checkout as a Popup
    • Apple Pay Quick Checkout
    • Region & Language Popup
    • Dynamic Bundle Products
    • Progressive Discounts
    • Customer Wallet & Cashback
    • Add Preorder Support to Your Theme
  • Mobile Apps
    • Scripts
  • API's
    • Authentication
      • Logout
      • Login Status
      • SMS Login
      • Verify SMS Login
      • WhatsApp Login
      • Verify WhatsApp Login
      • Email Login
      • Verify Email Login
      • Register
      • Register Guest
    • Products
      • List Products
      • Search Products
      • Calculate Product Options Price
      • Notify Product Stock Availability
      • Fetch Bundle Offers
      • Fetch Bundle Offers for a Product
      • List My Product Reviews
      • List Product Reviews
      • Create Product Review
      • Update Product Review
      • Delete Product Review
      • List Product Questions
      • Create Product Question
      • Get Product by Slug
      • Get Selection Groups
    • Categories
      • List Categories
    • Checkout
      • Get Cart
        GET
      • Remove Cart
        DELETE
      • Duplicate Cart
        POST
      • Add Cart Item
        POST
      • Empty Cart
        DELETE
      • Update Cart Item
        PATCH
      • Remove Cart Item
        DELETE
      • Upload Cart Input Field
        POST
      • Add Gift Card
        POST
      • Remove Gift Card
        DELETE
      • Apply Coupon
        POST
      • Remove Coupon From Cart
        DELETE
      • Check Coupon Validity
        GET
      • Apply Loyalty Points
        POST
      • Remove Loyalty Points
        DELETE
      • Preview Rewarded Points
        GET
      • List Redemption Methods for Cart
        GET
      • Customer’s Loyalty Wallet
        GET
      • Customer’s Current Points Balance
        GET
    • Account
      • Get Profile
      • Delete Account
      • Update Customer Profile
      • Get Addresses
      • Create an Address
      • Get an Address by ID
      • Update an Existing Address
      • Delete Address
      • Get Orders
      • Get Shareable Wishlist Link
      • Get Wishlist
      • Add Products to Wishlist
      • Remove Product from Wishlist
      • Get Address Form Schema
      • Check Product Purchase Status
    • Storefront
      • Store Scripts
      • Pages
      • Blogs
    • Countries
      • Get Countries
      • Get Cities By Country
  1. Checkout

Add Cart Item

POST
{store_url}/api/v1//cart/items
Adds a new item to the current shopping cart.
This endpoint supports:
Standard products
Custom fields (e.g., text inputs, add-ons with pricing)
Selection groups / sub-items (e.g., bundles, modifiers)
Shared cart flows via share_token

Request

Body Params application/jsonRequired

Examples

Responses

🟢201Success
application/json
Bodyapplication/json

🟠422Validation Error
🟠401Unauthorized
🔴500Internal Server error
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --globoff '{store_url}/api/v1//cart/items' \
--header 'Content-Type: application/json' \
--data '{
    "product_id": "prod_123",
    "quantity": 2,
    "custom_fields": [
        {
            "group_id": "cf_group_1",
            "price_settings": {
                "price": "10",
                "currency": "SAR"
            },
            "type": "TEXT",
            "value": "Happy Birthday"
        }
    ],
    "sub_items": [
        {
            "id": "item_456",
            "quantity": 1,
            "selection_group_id": "sg_001"
        }
    ],
    "share_token": "share_tok_abc"
}'
Response Response Example
201 - Example 1
{
    "item": {
        "id": 10,
        "product_id": "prod_123",
        "name": "Custom Mug",
        "quantity": 2,
        "price": 50,
        "price_string": "50 ر.س",
        "custom_fields": [
            {
                "name": "string",
                "label": "string",
                "type": "string",
                "value": "string",
                "formatted_value": "string"
            }
        ]
    },
    "cart_items_quantity": 3
}
Modified at 2026-02-17 07:25:10
Previous
Duplicate Cart
Next
Empty Cart
Built with