POST
/
carts
/
{id}
/
items
curl --request POST \
  --url https://services.commercengine.dev/api/v1/x2yh61zw4k/storefront/carts/{id}/items \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "product_id": "<string>",
  "sku": "<string>",
  "quantity": 123,
  "on_subscription": false,
  "subscription_plan": "<string>"
}'
{
  "message": "<string>",
  "success": "<string>",
  "content": {
    "cart": {
      "id": "<string>",
      "active": true,
      "customer_email": "<string>",
      "customer_phone": "<string>",
      "customer_note": "<string>",
      "is_promotion_applied": true,
      "promotion_discount_amount": 123,
      "is_coupon_applied": true,
      "coupon_code": "<string>",
      "coupon_discount_amount": 123,
      "on_subscription": true,
      "subtotal": 123,
      "item_total_tax": 123,
      "subtotal_including_tax": 123,
      "shipping_amount": 123,
      "shipping_total_tax": 123,
      "shipping_amount_including_tax": 123,
      "total_tax": 123,
      "grand_total": 123,
      "credit_balance_used": 123,
      "to_be_paid": 123,
      "loyalty_point_redeemed": 1,
      "loyalty_point_earned": 1,
      "cart_items_count": 1,
      "cart_items": [
        {
          "product_id": "<string>",
          "product_name": "<string>",
          "product_image_url": "<string>",
          "sku": "SKU1254",
          "on_offer": false,
          "on_promotion": false,
          "subscription_eligibility": false,
          "on_subscription": false,
          "subscription_plan": "<string>",
          "subscription_interval": 123,
          "subscription_frequency": "<string>",
          "quantity": 123,
          "is_free_item": true,
          "free_quantity": 123,
          "selling_price": 123,
          "listing_price": 123,
          "promotion_discount_amount": 123,
          "coupon_discount_amount": 123,
          "tax_type": "GST",
          "tax_rate": 123,
          "tax_amount": 123,
          "shipping_additional_cost": 123
        }
      ],
      "billing_address": {
        "id": "<string>",
        "first_name": "<string>",
        "last_name": "<string>",
        "country_code": "<string>",
        "phone": "<string>",
        "email": "<string>",
        "address_line1": "<string>",
        "address_line2": "<string>",
        "landmark": "<string>",
        "pincode": "<string>",
        "city": "<string>",
        "state": "<string>",
        "country": "India",
        "gstin": "<string>",
        "business_name": "<string>",
        "is_phone_verified": true,
        "is_email_verified": true
      },
      "shipping_address": {
        "id": "<string>",
        "first_name": "<string>",
        "last_name": "<string>",
        "country_code": "<string>",
        "phone": "<string>",
        "email": "<string>",
        "address_line1": "<string>",
        "address_line2": "<string>",
        "landmark": "<string>",
        "pincode": "<string>",
        "city": "<string>",
        "state": "<string>",
        "country": "India",
        "gstin": "<string>",
        "business_name": "<string>",
        "is_phone_verified": true,
        "is_email_verified": true
      },
      "currency": {
        "name": "Indian Rupee",
        "code": "INR",
        "symbol": "₹"
      },
      "metadata": [
        {}
      ],
      "expires_at": "2023-11-07T05:31:56Z"
    }
  }
}

Authorizations

Authorization
string
header
required

Access token

Path Parameters

id
string
required

cart id

Body

application/json
product_id
string
required
sku
string
required
quantity
integer
required
on_subscription
boolean
default:
false
required
subscription_plan
string | null

Response

200
application/json
OK
message
string
required
success
string
required
content
object