{
	"info": {
		"_postman_id": "carts-api-collection",
		"name": "Carts API",
		"description": "Cart management endpoints for client API",
		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
	},
	"variable": [
		{
			"key": "base_url",
			"value": "http://localhost:8000/api",
			"type": "string"
		},
		{
			"key": "token",
			"value": "your-jwt-token-here",
			"type": "string"
		},
		{
			"key": "product_id",
			"value": "1",
			"type": "string"
		},
		{
			"key": "address_id",
			"value": "1",
			"type": "string"
		}
	],
	"item": [
		{
			"name": "Get Cart",
			"request": {
				"method": "GET",
				"header": [
					{
						"key": "Accept",
						"value": "application/json",
						"type": "text"
					},
					{
						"key": "Authorization",
						"value": "Bearer {{token}}",
						"type": "text"
					}
				],
				"url": {
					"raw": "{{base_url}}/carts",
					"host": [
						"{{base_url}}"
					],
					"path": [
						"carts"
					]
				},
				"description": "Get the authenticated user's cart with all items"
			},
			"response": []
		},
		{
			"name": "Add to Cart",
			"request": {
				"method": "POST",
				"header": [
					{
						"key": "Accept",
						"value": "application/json",
						"type": "text"
					},
					{
						"key": "Content-Type",
						"value": "application/json",
						"type": "text"
					},
					{
						"key": "Authorization",
						"value": "Bearer {{token}}",
						"type": "text"
					}
				],
				"body": {
					"mode": "raw",
					"raw": "{\n    \"product_id\": {{product_id}},\n    \"amount\": 2\n}",
					"options": {
						"raw": {
							"language": "json"
						}
					}
				},
				"url": {
					"raw": "{{base_url}}/carts/add",
					"host": [
						"{{base_url}}"
					],
					"path": [
						"carts",
						"add"
					]
				},
				"description": "Add a product to cart. If product already exists, it will increment the quantity."
			},
			"response": [
				{
					"name": "Success Response",
					"originalRequest": {
						"method": "POST",
						"header": [
							{
								"key": "Accept",
								"value": "application/json",
								"type": "text"
							},
							{
								"key": "Content-Type",
								"value": "application/json",
								"type": "text"
							},
							{
								"key": "Authorization",
								"value": "Bearer {{token}}",
								"type": "text"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"product_id\": 1,\n    \"amount\": 2\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "{{base_url}}/carts/add",
							"host": [
								"{{base_url}}"
							],
							"path": [
								"carts",
								"add"
							]
						}
					},
					"status": "OK",
					"code": 200,
					"_postman_previewlanguage": "json",
					"header": [
						{
							"key": "Content-Type",
							"value": "application/json"
						}
					],
					"cookie": [],
					"body": "{\n    \"status\": \"success\",\n    \"message\": \"Product added to cart successfully\",\n    \"data\": null\n}"
				}
			]
		},
		{
			"name": "Remove from Cart",
			"request": {
				"method": "POST",
				"header": [
					{
						"key": "Accept",
						"value": "application/json",
						"type": "text"
					},
					{
						"key": "Content-Type",
						"value": "application/json",
						"type": "text"
					},
					{
						"key": "Authorization",
						"value": "Bearer {{token}}",
						"type": "text"
					}
				],
				"body": {
					"mode": "raw",
					"raw": "{\n    \"product_id\": {{product_id}}\n}",
					"options": {
						"raw": {
							"language": "json"
						}
					}
				},
				"url": {
					"raw": "{{base_url}}/carts/remove",
					"host": [
						"{{base_url}}"
					],
					"path": [
						"carts",
						"remove"
					]
				},
				"description": "Remove a product from cart completely"
			},
			"response": [
				{
					"name": "Success Response",
					"originalRequest": {
						"method": "POST",
						"header": [
							{
								"key": "Accept",
								"value": "application/json",
								"type": "text"
							},
							{
								"key": "Content-Type",
								"value": "application/json",
								"type": "text"
							},
							{
								"key": "Authorization",
								"value": "Bearer {{token}}",
								"type": "text"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"product_id\": 1\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "{{base_url}}/carts/remove",
							"host": [
								"{{base_url}}"
							],
							"path": [
								"carts",
								"remove"
							]
						}
					},
					"status": "OK",
					"code": 200,
					"_postman_previewlanguage": "json",
					"header": [
						{
							"key": "Content-Type",
							"value": "application/json"
						}
					],
					"cookie": [],
					"body": "{\n    \"status\": \"success\",\n    \"message\": \"Product removed from cart successfully\",\n    \"data\": null\n}"
				}
			]
		},
		{
			"name": "Increment Cart Item",
			"request": {
				"method": "POST",
				"header": [
					{
						"key": "Accept",
						"value": "application/json",
						"type": "text"
					},
					{
						"key": "Content-Type",
						"value": "application/json",
						"type": "text"
					},
					{
						"key": "Authorization",
						"value": "Bearer {{token}}",
						"type": "text"
					}
				],
				"body": {
					"mode": "raw",
					"raw": "{\n    \"product_id\": {{product_id}},\n    \"amount\": 1\n}",
					"options": {
						"raw": {
							"language": "json"
						}
					}
				},
				"url": {
					"raw": "{{base_url}}/carts/increment",
					"host": [
						"{{base_url}}"
					],
					"path": [
						"carts",
						"increment"
					]
				},
				"description": "Increase the quantity of a product in cart by specified amount (default: 1)"
			},
			"response": [
				{
					"name": "Success Response",
					"originalRequest": {
						"method": "POST",
						"header": [
							{
								"key": "Accept",
								"value": "application/json",
								"type": "text"
							},
							{
								"key": "Content-Type",
								"value": "application/json",
								"type": "text"
							},
							{
								"key": "Authorization",
								"value": "Bearer {{token}}",
								"type": "text"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"product_id\": 1,\n    \"amount\": 1\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "{{base_url}}/carts/increment",
							"host": [
								"{{base_url}}"
							],
							"path": [
								"carts",
								"increment"
							]
						}
					},
					"status": "OK",
					"code": 200,
					"_postman_previewlanguage": "json",
					"header": [
						{
							"key": "Content-Type",
							"value": "application/json"
						}
					],
					"cookie": [],
					"body": "{\n    \"status\": \"success\",\n    \"message\": \"Cart item quantity increased successfully\",\n    \"data\": null\n}"
				}
			]
		},
		{
			"name": "Decrement Cart Item",
			"request": {
				"method": "POST",
				"header": [
					{
						"key": "Accept",
						"value": "application/json",
						"type": "text"
					},
					{
						"key": "Content-Type",
						"value": "application/json",
						"type": "text"
					},
					{
						"key": "Authorization",
						"value": "Bearer {{token}}",
						"type": "text"
					}
				],
				"body": {
					"mode": "raw",
					"raw": "{\n    \"product_id\": {{product_id}},\n    \"amount\": 1\n}",
					"options": {
						"raw": {
							"language": "json"
						}
					}
				},
				"url": {
					"raw": "{{base_url}}/carts/decrement",
					"host": [
						"{{base_url}}"
					],
					"path": [
						"carts",
						"decrement"
					]
				},
				"description": "Decrease the quantity of a product in cart by specified amount (default: 1). If quantity reaches 0 or below, the item will be removed from cart."
			},
			"response": [
				{
					"name": "Success Response - Decremented",
					"originalRequest": {
						"method": "POST",
						"header": [
							{
								"key": "Accept",
								"value": "application/json",
								"type": "text"
							},
							{
								"key": "Content-Type",
								"value": "application/json",
								"type": "text"
							},
							{
								"key": "Authorization",
								"value": "Bearer {{token}}",
								"type": "text"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"product_id\": 1,\n    \"amount\": 1\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "{{base_url}}/carts/decrement",
							"host": [
								"{{base_url}}"
							],
							"path": [
								"carts",
								"decrement"
							]
						}
					},
					"status": "OK",
					"code": 200,
					"_postman_previewlanguage": "json",
					"header": [
						{
							"key": "Content-Type",
							"value": "application/json"
						}
					],
					"cookie": [],
					"body": "{\n    \"status\": \"success\",\n    \"message\": \"Cart item quantity decreased successfully\",\n    \"data\": null\n}"
				},
				{
					"name": "Success Response - Removed",
					"originalRequest": {
						"method": "POST",
						"header": [
							{
								"key": "Accept",
								"value": "application/json",
								"type": "text"
							},
							{
								"key": "Content-Type",
								"value": "application/json",
								"type": "text"
							},
							{
								"key": "Authorization",
								"value": "Bearer {{token}}",
								"type": "text"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"product_id\": 1,\n    \"amount\": 5\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "{{base_url}}/carts/decrement",
							"host": [
								"{{base_url}}"
							],
							"path": [
								"carts",
								"decrement"
							]
						}
					},
					"status": "OK",
					"code": 200,
					"_postman_previewlanguage": "json",
					"header": [
						{
							"key": "Content-Type",
							"value": "application/json"
						}
					],
					"cookie": [],
					"body": "{\n    \"status\": \"success\",\n    \"message\": \"Product removed from cart successfully\",\n    \"data\": null\n}"
				}
			]
		},
		{
			"name": "Update Cart Address",
			"request": {
				"method": "PUT",
				"header": [
					{
						"key": "Accept",
						"value": "application/json",
						"type": "text"
					},
					{
						"key": "Content-Type",
						"value": "application/json",
						"type": "text"
					},
					{
						"key": "Authorization",
						"value": "Bearer {{token}}",
						"type": "text"
					}
				],
				"body": {
					"mode": "raw",
					"raw": "{\n    \"address_id\": {{address_id}}\n}",
					"options": {
						"raw": {
							"language": "json"
						}
					}
				},
				"url": {
					"raw": "{{base_url}}/carts/update-address",
					"host": [
						"{{base_url}}"
					],
					"path": [
						"carts",
						"update-address"
					]
				},
				"description": "Update the shipping address for the cart. The address must belong to the authenticated user."
			},
			"response": [
				{
					"name": "Success Response",
					"originalRequest": {
						"method": "PUT",
						"header": [
							{
								"key": "Accept",
								"value": "application/json",
								"type": "text"
							},
							{
								"key": "Content-Type",
								"value": "application/json",
								"type": "text"
							},
							{
								"key": "Authorization",
								"value": "Bearer {{token}}",
								"type": "text"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"address_id\": 1\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "{{base_url}}/carts/update-address",
							"host": [
								"{{base_url}}"
							],
							"path": [
								"carts",
								"update-address"
							]
						}
					},
					"status": "OK",
					"code": 200,
					"_postman_previewlanguage": "json",
					"header": [
						{
							"key": "Content-Type",
							"value": "application/json"
						}
					],
					"cookie": [],
					"body": "{\n    \"status\": \"success\",\n    \"message\": \"Cart address updated successfully\",\n    \"data\": null\n}"
				},
				{
					"name": "Error - Address Not Found",
					"originalRequest": {
						"method": "PUT",
						"header": [
							{
								"key": "Accept",
								"value": "application/json",
								"type": "text"
							},
							{
								"key": "Content-Type",
								"value": "application/json",
								"type": "text"
							},
							{
								"key": "Authorization",
								"value": "Bearer {{token}}",
								"type": "text"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"address_id\": 999\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "{{base_url}}/carts/update-address",
							"host": [
								"{{base_url}}"
							],
							"path": [
								"carts",
								"update-address"
							]
						}
					},
					"status": "Unprocessable Entity",
					"code": 422,
					"_postman_previewlanguage": "json",
					"header": [
						{
							"key": "Content-Type",
							"value": "application/json"
						}
					],
					"cookie": [],
					"body": "{\n    \"status\": \"fail\",\n    \"message\": \"No query results for model [App\\\\Models\\\\Address] 999\",\n    \"data\": null\n}"
				}
			]
		}
	]
}
