Skip to main content

Increase Item in Cart

Increases the quantity of a cart item by 1.

HTTP Request

POST/api/shop/cart/items/:id/increase

Authorization

Authorization

  • Required: Yes
  • Permission: Authenticated User
  • Authentication: Token-based (Authorization: Token <your_api_key>)

Path Parameters

ParameterTypeRequiredDescription
idIntegerYesID of the cart item to increase

Example Requests

1import requests
2
3response = requests.post('http://www.example.com/api/shop/cart/items/789/increase', 
4  headers={'Authorization': 'Token <your_api_key>'}
5)
6print(response.json())

Response Fields

FieldTypeDescription
idIntegerUnique ID of the product
addressIntegerSelected delivery address ID
shipping_methodIntegerSelected shipping method ID
payment_methodIntegerSelected payment method ID
created_atString (ISO 8601)Timestamp when cart was created
updated_atString (ISO 8601)Timestamp when cart was last updated
countIntegerNumber of unique items in cart
quantityIntegerTotal quantity of all items
is_emptyBooleanWhether the cart is empty
items_subtotalIntegerSubtotal of all items before discounts
items_discountIntegerTotal discount amount on items
subtotalIntegerCart subtotal after item discounts
discountIntegerAdditional cart-level discount
totalIntegerFinal cart total
itemsArrayArray of cart items (see Cart Item fields)

Cart Item Fields

FieldTypeDescription
idIntegerUnique ID of the cart item
refStringItem reference (read-only)
productObjectProduct information with `id`, `name`, `image`
quantityIntegerItem quantity
notesStringCustomer notes for this item
created_atString (ISO 8601)Timestamp when item was added
updated_atString (ISO 8601)Timestamp when item was last updated
unit_priceIntegerPrice per unit (read-only)
unit_discountIntegerDiscount per unit (read-only)
subtotalIntegerItem subtotal before discount (read-only)
discountIntegerTotal item discount (read-only)
totalIntegerFinal item total (read-only)

Product Object Data Structure

FieldTypeDescription
idIntegerUnique id of the product
titleStringProduct title
imageObjectProduct image details

Image Data Structure

FieldTypeDescription
idIntegerUnique ID of the image
typeStringFile type (e.g., image/jpeg)
nameStringOriginal file name
sizeIntegerFile size in bytes
human_readable_sizeStringHuman readable file size (e.g., 2.5 MB)
fStringURL to access the image file
widthIntegerImage width in pixels
heightIntegerImage height in pixels
modeStringColor mode (e.g., RGB, CMYK)

Example Response

{
"id": 1,
"address": 1,
"shipping_method": 1,
"payment_method": 1,
"created_at": "2025-11-22T15:26:59.108182Z",
"updated_at": "2025-12-30T12:53:24.505447Z",
"count": 1,
"quantity": 3,
"is_empty": false,
"items_subtotal": 36000000,
"items_discount": 3720000,
"subtotal": 36000000,
"discount": 3720000,
"shipping_cost": 0,
"total": 32280000,
"items": [
{
"id": 5,
"ref": "36",
"product": {
"id": 36,
"title": "ماوس لاجیتک MX Vertical",
"image": {
"id": 2,
"type": "image",
"name": "logitech-mx-1",
"size": 4766,
"human_readable_size": "4.65 KB",
"f": "http://127.0.0.1:8000/media/core_media/2025/11/22/logitech-mx-1.jpg",
"width": 225,
"height": 225,
"mode": "RGB"
}
},
"quantity": 3,
"notes": "Voluptatem sint sunt corrupti vitae recusandae. Tenetur ratione ipsum quaerat. Architecto rerum voluptatem quod.",
"created_at": "2025-12-30T13:38:25.196625Z",
"updated_at": "2025-12-30T13:38:25.196632Z",
"unit_price": 12000000,
"unit_discount": 1240000,
"subtotal": 36000000,
"discount": 3720000,
"total": 32280000
}
]
}