When working with carts through the Venddor API, the products
array contains detailed information about each product item within the cart. This documentation explains the structure and properties of product objects in the cart.
Each product in the cart products array has the following fields:
Field name | Description | Available for methods | Supported values |
---|---|---|---|
product_id | A unique identifier for the product. This ID corresponds to the product in your catalog. | GET | integer |
amount | The quantity of this specific product in the cart. This value can be updated through the API. | GET | string |
price | The unit price of the product. This may differ from the catalog price if promotions or customer-specific pricing is applied. | GET | integer/float |
product | The name or title of the product as it appears to customers. | GET | string |
options | Product variations or customizations selected by the customer (e.g., size, color, etc.). | GET | array |
subtotal | The total price for this product (price × amount). | GET | integer/float |
{ "product_id": "123", "amount": "2", "price": 49.99, "product": "Premium T-Shirt", "options": [ { "option_id": "12", "option_name": "Size", "value": "Large" }, { "option_id": "14", "option_name": "Color", "value": "Blue" } ], "subtotal": 99.98 }
To retrieve products in a cart, use the GET request to fetch cart details. The products array will be included in the response.
Returns the detailed information about a specific cart, including all products.
To add a product to a cart, use the POST request with product details.
Adds a new product to the specified cart.
{ "product_id": "456", "amount": "1", "options": [ { "option_id": "23", "value": "Medium" } ] }