{
	"info": {
		"_postman_id": "bf4aa925-7cf9-40a6-b8f1-a71002700eeb",
		"name": "Product Bundles API",
		"description": "Complete API collection for Product Bundles management",
		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
		"_exporter_id": "50681087",
		"_collection_link": "https://speeding-station-761692.postman.co/workspace/Team-Workspace~749708e5-00c2-41b9-8163-eb8de19b77f2/collection/50681087-bf4aa925-7cf9-40a6-b8f1-a71002700eeb?action=share&source=collection_link&creator=50681087"
	},
	"item": [
		{
			"name": "List Bundles",
			"request": {
				"method": "GET",
				"header": [
					{
						"key": "Accept",
						"value": "application/json"
					},
					{
						"key": "Content-Type",
						"value": "application/json"
					},
					{
						"key": "Authorization",
						"value": "Bearer {{access_token}}"
					}
				],
				"url": {
					"raw": "{{BASE_URL}}/catalog/bundles?per_page=15&search=&type=fixed",
					"host": [
						"{{BASE_URL}}"
					],
					"path": [
						"catalog",
						"bundles"
					],
					"query": [
						{
							"key": "per_page",
							"value": "15"
						},
						{
							"key": "search",
							"value": ""
						},
						{
							"key": "type",
							"value": "fixed",
							"description": "'fixed', 'configurable', 'volume_discount'"
						}
					]
				},
				"description": "Get paginated list of all bundles with optional filtering"
			},
			"response": []
		},
		{
			"name": "Get Available Bundles",
			"request": {
				"method": "GET",
				"header": [
					{
						"key": "Accept",
						"value": "application/json"
					},
					{
						"key": "Content-Type",
						"value": "application/json"
					},
					{
						"key": "Authorization",
						"value": "Bearer {{access_token}}"
					}
				],
				"url": {
					"raw": "{{BASE_URL}}/catalog/bundles/available?per_page=15",
					"host": [
						"{{BASE_URL}}"
					],
					"path": [
						"catalog",
						"bundles",
						"available"
					],
					"query": [
						{
							"key": "per_page",
							"value": "15"
						}
					]
				},
				"description": "Get active and valid bundles (customer-facing)"
			},
			"response": []
		},
		{
			"name": "Create Bundle",
			"request": {
				"method": "POST",
				"header": [
					{
						"key": "Accept",
						"value": "application/json"
					},
					{
						"key": "Content-Type",
						"value": "application/json"
					},
					{
						"key": "Authorization",
						"value": "Bearer {{access_token}}"
					}
				],
				"body": {
					"mode": "raw",
					"raw": "{\n  \"name\": {\n    \"en\": \"Office Starter Pack\",\n    \"ar\": \"مجموعة المكتب الأساسية\"\n  },\n  \"description\": {\n    \"en\": \"Complete office setup with desk, chair, and accessories\",\n    \"ar\": \"مجموعة المكتب الكاملة مع مكتب وكرسي والملحقات\"\n  },\n  \"bundle_type\": \"fixed\", // 'fixed', 'configurable', 'volume_discount'\n  \"status\": \"active\",\n  \"discount_type\": \"percentage\", // 'percentage', 'fixed'\n  \"discount_value\": 15,\n  \"min_quantity\": 1,\n  \"max_quantity\": 100,\n  \"valid_from\": \"2025-01-01T00:00:00Z\",\n  \"valid_until\": \"2025-12-31T23:59:59Z\",\n  \"metadata\": {\n    \"category\": \"office\",\n    \"target_audience\": \"corporate\"\n  },\n  \"items\": [\n    {\n      \"product_id\": 1,\n      \"quantity\": 1,\n      \"min_quantity\": 1,\n      \"max_quantity\": 5,\n      \"is_required\": true,\n      \"sort_order\": 1\n    },\n    {\n      \"product_id\": 2,\n      \"quantity\": 2,\n      \"min_quantity\": 1,\n      \"max_quantity\": 10,\n      \"is_required\": true,\n      \"sort_order\": 2\n    },\n    {\n      \"product_id\": 3,\n      \"quantity\": 1,\n      \"min_quantity\": 1,\n      \"max_quantity\": 5,\n      \"is_required\": false,\n      \"sort_order\": 3\n    }\n  ],\n  \"rules\": [\n    {\n      \"name\": \"Volume Discount\",\n      \"rule_type\": \"discount\",\n      \"condition_field\": \"quantity\",\n      \"condition_operator\": \"greater_or_equal\",\n      \"condition_value\": \"5\",\n      \"action_type\": \"percentage_discount\",\n      \"action_value\": 10,\n      \"priority\": 1,\n      \"is_active\": true\n    },\n    {\n      \"name\": \"Bulk Order Discount\",\n      \"rule_type\": \"discount\",\n      \"condition_field\": \"quantity\",\n      \"condition_operator\": \"greater_or_equal\",\n      \"condition_value\": \"10\",\n      \"action_type\": \"percentage_discount\",\n      \"action_value\": 20,\n      \"priority\": 2,\n      \"is_active\": true\n    }\n  ]\n}"
				},
				"url": {
					"raw": "{{BASE_URL}}/catalog/bundles",
					"host": [
						"{{BASE_URL}}"
					],
					"path": [
						"catalog",
						"bundles"
					]
				},
				"description": "Create a new product bundle with items and pricing rules"
			},
			"response": []
		},
		{
			"name": "Get Bundle Details",
			"request": {
				"method": "GET",
				"header": [
					{
						"key": "Accept",
						"value": "application/json"
					},
					{
						"key": "Content-Type",
						"value": "application/json"
					},
					{
						"key": "Authorization",
						"value": "Bearer {{access_token}}"
					}
				],
				"url": {
					"raw": "{{BASE_URL}}/catalog/bundles/1",
					"host": [
						"{{BASE_URL}}"
					],
					"path": [
						"catalog",
						"bundles",
						"1"
					]
				},
				"description": "Get complete bundle details with items and rules"
			},
			"response": []
		},
		{
			"name": "Calculate Bundle Pricing",
			"request": {
				"method": "GET",
				"header": [
					{
						"key": "Accept",
						"value": "application/json"
					},
					{
						"key": "Content-Type",
						"value": "application/json"
					},
					{
						"key": "Authorization",
						"value": "Bearer {{access_token}}"
					}
				],
				"url": {
					"raw": "{{BASE_URL}}/catalog/bundles/1/pricing?quantity=5",
					"host": [
						"{{BASE_URL}}"
					],
					"path": [
						"catalog",
						"bundles",
						"1",
						"pricing"
					],
					"query": [
						{
							"key": "quantity",
							"value": "5"
						}
					]
				},
				"description": "Calculate final price with all discounts and rules applied"
			},
			"response": []
		},
		{
			"name": "Get Bundle Statistics",
			"request": {
				"method": "GET",
				"header": [
					{
						"key": "Accept",
						"value": "application/json"
					},
					{
						"key": "Content-Type",
						"value": "application/json"
					},
					{
						"key": "Authorization",
						"value": "Bearer {{access_token}}"
					}
				],
				"url": {
					"raw": "{{BASE_URL}}/catalog/bundles/1/stats",
					"host": [
						"{{BASE_URL}}"
					],
					"path": [
						"catalog",
						"bundles",
						"1",
						"stats"
					]
				},
				"description": "Get bundle statistics (items count, pricing breakdown, rules)"
			},
			"response": []
		},
		{
			"name": "Validate Bundle for Purchase",
			"request": {
				"method": "POST",
				"header": [
					{
						"key": "Accept",
						"value": "application/json"
					},
					{
						"key": "Content-Type",
						"value": "application/json"
					},
					{
						"key": "Authorization",
						"value": "Bearer {{access_token}}"
					}
				],
				"body": {
					"mode": "raw",
					"raw": "{\n  \"items\": [\n    {\n      \"product_id\": 1,\n      \"quantity\": 1\n    },\n    {\n      \"product_id\": 2,\n      \"quantity\": 2\n    },\n    {\n      \"product_id\": 3,\n      \"quantity\": 1\n    }\n  ]\n}"
				},
				"url": {
					"raw": "{{BASE_URL}}/catalog/bundles/1/validate",
					"host": [
						"{{BASE_URL}}"
					],
					"path": [
						"catalog",
						"bundles",
						"1",
						"validate"
					]
				},
				"description": "Validate bundle items and quantities before purchase"
			},
			"response": []
		},
		{
			"name": "Update Bundle",
			"request": {
				"method": "PUT",
				"header": [
					{
						"key": "Accept",
						"value": "application/json"
					},
					{
						"key": "Content-Type",
						"value": "application/json"
					},
					{
						"key": "Authorization",
						"value": "Bearer {{access_token}}"
					}
				],
				"body": {
					"mode": "raw",
					"raw": "{\n  \"name\": {\n    \"en\": \"Office Deluxe Pack\",\n    \"ar\": \"مجموعة المكتب الفاخرة\"\n  },\n  \"description\": {\n    \"en\": \"Premium office setup with desk, premium chair, and accessories\",\n    \"ar\": \"مجموعة المكتب الفاخرة مع مكتب وكرسي فاخر والملحقات\"\n  },\n  \"bundle_type\": \"configurable\", // 'fixed', 'configurable', 'volume_discount'\n  \"status\": \"active\",\n  \"discount_type\": \"percentage\", // 'percentage', 'fixed'\n  \"discount_value\": 20,\n  \"min_quantity\": 1,\n  \"max_quantity\": 50,\n  \"valid_from\": \"2025-02-01T00:00:00Z\",\n  \"valid_until\": \"2025-12-31T23:59:59Z\",\n  \"items\": [\n    {\n      \"product_id\": 1,\n      \"quantity\": 1,\n      \"min_quantity\": 1,\n      \"max_quantity\": 5,\n      \"is_required\": true,\n      \"sort_order\": 1\n    },\n    {\n      \"product_id\": 2,\n      \"quantity\": 2,\n      \"min_quantity\": 1,\n      \"max_quantity\": 10,\n      \"is_required\": true,\n      \"sort_order\": 2\n    }\n  ],\n  \"rules\": [\n    {\n      \"name\": \"Bulk Discount\",\n      \"rule_type\": \"discount\",\n      \"condition_field\": \"quantity\",\n      \"condition_operator\": \"greater_or_equal\",\n      \"condition_value\": \"5\",\n      \"action_type\": \"percentage_discount\",\n      \"action_value\": 15,\n      \"priority\": 1,\n      \"is_active\": true\n    }\n  ]\n}"
				},
				"url": {
					"raw": "{{BASE_URL}}/catalog/bundles/1",
					"host": [
						"{{BASE_URL}}"
					],
					"path": [
						"catalog",
						"bundles",
						"1"
					]
				},
				"description": "Update an existing bundle with new items and rules"
			},
			"response": []
		},
		{
			"name": "Delete Bundle",
			"request": {
				"method": "DELETE",
				"header": [
					{
						"key": "Accept",
						"value": "application/json"
					},
					{
						"key": "Content-Type",
						"value": "application/json"
					},
					{
						"key": "Authorization",
						"value": "Bearer {{access_token}}"
					}
				],
				"url": {
					"raw": "{{BASE_URL}}/catalog/bundles/5",
					"host": [
						"{{BASE_URL}}"
					],
					"path": [
						"catalog",
						"bundles",
						"5"
					]
				},
				"description": "Delete a bundle and all its items and rules"
			},
			"response": []
		},
		{
			"name": "Restore Bundle",
			"request": {
				"method": "POST",
				"header": [
					{
						"key": "Accept",
						"value": "application/json"
					},
					{
						"key": "Content-Type",
						"value": "application/json"
					},
					{
						"key": "Authorization",
						"value": "Bearer {{access_token}}"
					}
				],
				"body": {
					"mode": "raw",
					"raw": ""
				},
				"url": {
					"raw": "{{BASE_URL}}/catalog/bundles/1/restore",
					"host": [
						"{{BASE_URL}}"
					],
					"path": [
						"catalog",
						"bundles",
						"1",
						"restore"
					]
				},
				"description": "Restore a soft-deleted bundle and recover all its data"
			},
			"response": []
		},
		{
			"name": "Duplicate Bundle",
			"request": {
				"method": "POST",
				"header": [
					{
						"key": "Accept",
						"value": "application/json"
					},
					{
						"key": "Content-Type",
						"value": "application/json"
					},
					{
						"key": "Authorization",
						"value": "Bearer {{access_token}}"
					}
				],
				"body": {
					"mode": "raw",
					"raw": ""
				},
				"url": {
					"raw": "{{BASE_URL}}/catalog/bundles/1/duplicate",
					"host": [
						"{{BASE_URL}}"
					],
					"path": [
						"catalog",
						"bundles",
						"1",
						"duplicate"
					]
				},
				"description": "Create a copy of an existing bundle with all its items and rules. The new bundle will have '(Copy)' appended to its name"
			},
			"response": []
		}
	],
	"variable": [
		{
			"key": "BASE_URL",
			"value": "http://localhost:8000/api/v1",
			"type": "string"
		},
		{
			"key": "access_token",
			"value": "your_access_token_here",
			"type": "string"
		}
	]
}