# Cart Item API Reference
Endpoint:
https://[client].hiweb.io/api/cart_items
Cart item resource object:
{
"type": "cart_items",
"id": "(string)",
"attributes": {
"cart_id": "string|uuid",
"grams": (float),
"quantity": (integer),
"price": (float),
"discount": (float),
"total_price": (float),
"note": "string",
"created_at": "string|datetime",
"updated_at": "string|datetime"
},
"relationships": {
"product": {
"data": Object (Product Resource)
},
"variant": {
"data": Object (Variant Resource)
}
}
}
Related resources: Cart, Product, Variant
# Writable fields
| Field name | Creating | Updating |
|---|---|---|
| quantity | required|integer|min:1|max:100 | integer|min:1|max:100 |
| note | string | string |
# Writable relationships
| Relationship name | Relationship resource type | Type | Creating | Updating |
|---|---|---|---|---|
| cart | carts | To-one | Yes - Required | No |
| variant | variants | To-one | Yes - Required | Yes |