# Cart API Reference
Endpoint:
https://[client].hiweb.io/api/carts
Cart resource object:
{
"type": "carts",
"id": "(string)",
"attributes": {
"item_count": {Integer},
"total_grams": {Float},
"subtotal_price": {Float},
"total_discount": {Float},
"discount_rule": {Object},
"total_price": {Float},
"is_locked": {Boolean},
"note": "string",
"created_at": "string|datetime",
"updated_at": "string|datetime"
},
"relationships": {
"invoice": {
"data": Object (Invoice Resource) | null
},
"cart_items": {
"data": Array [Cart Item Resources]
},
"discount": {
"data": Object (Discount Resource) | null
}
}
}
Related resources: Invoice, Cart Item, Discount
# Writable fields
| Field name | Detail |
|---|---|
| is_locked | boolean |
| note | string |
# Writable relationships
| Relationship name | Relationship resource type | Type | Creating | Updating |
|---|---|---|---|---|
| discount | discounts | To-one | yes | yes |
← Addresses Cart Items →