{
	"info": {
		"_postman_id": "ea1df31c-c77f-47fc-915b-419e4b828dd2",
		"name": "Supply Domain - Purchase Orders API",
		"description": "Complete API collection for Supply Domain Purchase Orders Management with full request/response examples",
		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
		"_exporter_id": "50681087"
	},
	"item": [
		{
			"name": "List All Purchase Orders",
			"request": {
				"method": "GET",
				"header": [
					{
						"key": "Authorization",
						"value": "Bearer {{access_token}}",
						"type": "text"
					},
					{
						"key": "Accept",
						"value": "application/json",
						"type": "text"
					}
				],
				"url": {
					"raw": "{{BASE_URL}}/supply/purchase-orders?per_page=15&page=1",
					"host": [
						"{{BASE_URL}}"
					],
					"path": [
						"supply",
						"purchase-orders"
					],
					"query": [
						{
							"key": "per_page",
							"value": "15"
						},
						{
							"key": "page",
							"value": "1"
						}
					]
				},
				"description": "Get list of all purchase orders with pagination"
			},
			"response": [
				{
					"name": "List All Purchase Orders - Success",
					"originalRequest": {
						"method": "GET",
						"header": [
							{
								"key": "Authorization",
								"value": "Bearer token",
								"type": "text"
							},
							{
								"key": "Accept",
								"value": "application/json",
								"type": "text"
							}
						],
						"url": {
							"raw": "http://localhost:8000/api/v1/supply/purchase-orders",
							"protocol": "http",
							"host": [
								"localhost"
							],
							"port": "8000",
							"path": [
								"api",
								"v1",
								"supply",
								"purchase-orders"
							]
						}
					},
					"status": "OK",
					"code": 200,
					"_postman_previewlanguage": "Text",
					"header": [
						{
							"key": "Content-Type",
							"value": "application/json"
						}
					],
					"cookie": [],
					"body": "{\n  \"success\": true,\n  \"message\": \"Purchase orders retrieved successfully\",\n  \"data\": {\n    \"data\": [\n      {\n        \"id\": 1,\n        \"po_number\": \"PO-2025-001\",\n        \"supplier_id\": 1,\n        \"status\": \"pending\",\n        \"order_date\": \"2025-12-20\",\n        \"expected_delivery_date\": \"2025-12-30\",\n        \"subtotal\": 5000.00,\n        \"tax_amount\": 500.00,\n        \"discount_amount\": 250.00,\n        \"total_amount\": 5250.00,\n        \"currency\": \"USD\",\n        \"payment_terms\": \"30 days net\",\n        \"notes\": \"Standard delivery terms apply\",\n        \"created_at\": \"2025-12-20T10:30:00.000000Z\",\n        \"updated_at\": \"2025-12-20T10:30:00.000000Z\",\n        \"deleted_at\": null\n      },\n      {\n        \"id\": 2,\n        \"po_number\": \"PO-2025-002\",\n        \"supplier_id\": 2,\n        \"status\": \"confirmed\",\n        \"order_date\": \"2025-12-21\",\n        \"expected_delivery_date\": \"2025-12-31\",\n        \"subtotal\": 8500.00,\n        \"tax_amount\": 850.00,\n        \"discount_amount\": 425.00,\n        \"total_amount\": 8925.00,\n        \"currency\": \"USD\",\n        \"payment_terms\": \"15 days net\",\n        \"notes\": \"Expedited delivery requested\",\n        \"created_at\": \"2025-12-21T11:45:00.000000Z\",\n        \"updated_at\": \"2025-12-21T11:45:00.000000Z\",\n        \"deleted_at\": null\n      },\n      {\n        \"id\": 3,\n        \"po_number\": \"PO-2025-003\",\n        \"supplier_id\": 3,\n        \"status\": \"shipped\",\n        \"order_date\": \"2025-12-18\",\n        \"expected_delivery_date\": \"2025-12-25\",\n        \"subtotal\": 3200.00,\n        \"tax_amount\": 320.00,\n        \"discount_amount\": 160.00,\n        \"total_amount\": 3360.00,\n        \"currency\": \"USD\",\n        \"payment_terms\": \"COD\",\n        \"notes\": \"Rush order for inventory replenishment\",\n        \"created_at\": \"2025-12-18T09:15:00.000000Z\",\n        \"updated_at\": \"2025-12-22T14:20:00.000000Z\",\n        \"deleted_at\": null\n      }\n    ],\n    \"links\": {\n      \"first\": \"http://localhost:8000/api/v1/supply/purchase-orders?page=1\",\n      \"last\": \"http://localhost:8000/api/v1/supply/purchase-orders?page=1\",\n      \"prev\": null,\n      \"next\": null\n    },\n    \"meta\": {\n      \"current_page\": 1,\n      \"from\": 1,\n      \"last_page\": 1,\n      \"path\": \"http://localhost:8000/api/v1/supply/purchase-orders\",\n      \"per_page\": 15,\n      \"to\": 3,\n      \"total\": 3\n    }\n  },\n  \"status_code\": 200\n}\n"
				}
			]
		},
		{
			"name": "Get Purchase Order by ID",
			"request": {
				"method": "GET",
				"header": [
					{
						"key": "Authorization",
						"value": "Bearer {{access_token}}",
						"type": "text"
					},
					{
						"key": "Accept",
						"value": "application/json",
						"type": "text"
					}
				],
				"url": {
					"raw": "{{BASE_URL}}/supply/purchase-orders/1",
					"host": [
						"{{BASE_URL}}"
					],
					"path": [
						"supply",
						"purchase-orders",
						"1"
					]
				},
				"description": "Get a specific purchase order by ID"
			},
			"response": [
				{
					"name": "Get Purchase Order - Success",
					"originalRequest": {
						"method": "GET",
						"header": [
							{
								"key": "Authorization",
								"value": "Bearer token",
								"type": "text"
							}
						],
						"url": {
							"raw": "http://localhost:8000/api/v1/supply/purchase-orders/1",
							"protocol": "http",
							"host": [
								"localhost"
							],
							"port": "8000",
							"path": [
								"api",
								"v1",
								"supply",
								"purchase-orders",
								"1"
							]
						}
					},
					"status": "OK",
					"code": 200,
					"_postman_previewlanguage": "Text",
					"header": [],
					"cookie": [],
					"body": "{\n  \"success\": true,\n  \"message\": \"Purchase order retrieved successfully\",\n  \"data\": {\n    \"id\": 1,\n    \"po_number\": \"PO-2025-001\",\n    \"supplier_id\": 1,\n    \"status\": \"pending\",\n    \"order_date\": \"2025-12-20\",\n    \"expected_delivery_date\": \"2025-12-30\",\n    \"subtotal\": 5000.00,\n    \"tax_amount\": 500.00,\n    \"discount_amount\": 250.00,\n    \"total_amount\": 5250.00,\n    \"currency\": \"USD\",\n    \"payment_terms\": \"30 days net\",\n    \"notes\": \"Standard delivery terms apply\",\n    \"created_at\": \"2025-12-20T10:30:00.000000Z\",\n    \"updated_at\": \"2025-12-20T10:30:00.000000Z\",\n    \"deleted_at\": null\n  },\n  \"status_code\": 200\n}\n"
				},
				{
					"name": "Get Purchase Order - Not Found",
					"originalRequest": {
						"method": "GET",
						"header": [
							{
								"key": "Authorization",
								"value": "Bearer token",
								"type": "text"
							}
						],
						"url": {
							"raw": "http://localhost:8000/api/v1/supply/purchase-orders/999",
							"protocol": "http",
							"host": [
								"localhost"
							],
							"port": "8000",
							"path": [
								"api",
								"v1",
								"supply",
								"purchase-orders",
								"999"
							]
						}
					},
					"status": "Not Found",
					"code": 404,
					"_postman_previewlanguage": "Text",
					"header": [],
					"cookie": [],
					"body": "{\n  \"success\": false,\n  \"message\": \"No query results found for model [App\\\\Domains\\\\Supply\\\\PurchaseOrders\\\\Models\\\\PurchaseOrder]\",\n  \"status_code\": 404\n}\n"
				}
			]
		},
		{
			"name": "Create Purchase Order",
			"request": {
				"method": "POST",
				"header": [
					{
						"key": "Authorization",
						"value": "Bearer {{access_token}}",
						"type": "text"
					},
					{
						"key": "Content-Type",
						"value": "application/json",
						"type": "text"
					},
					{
						"key": "Accept",
						"value": "application/json",
						"type": "text"
					}
				],
				"body": {
					"mode": "raw",
					"raw": "{\n  \"po_number\": \"PO-2025-005\",\n  \"supplier_id\": 1,\n  \"supply_order_id\": 1,\n  \"status\": \"pending\",\n  \"total_amount\": 10500.00,\n  \"expected_delivery_date\": \"2026-01-15\",\n  \"notes\": \"Standard purchase order for inventory replenishment\",\n  \"created_by\": 1,\n  \"updated_by\": 1\n}"
				},
				"url": {
					"raw": "{{BASE_URL}}/supply/purchase-orders",
					"host": [
						"{{BASE_URL}}"
					],
					"path": [
						"supply",
						"purchase-orders"
					]
				},
				"description": "Create a new purchase order"
			},
			"response": [
				{
					"name": "Create Purchase Order - Success",
					"originalRequest": {
						"method": "POST",
						"header": [
							{
								"key": "Authorization",
								"value": "Bearer token",
								"type": "text"
							},
							{
								"key": "Content-Type",
								"value": "application/json",
								"type": "text"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"po_number\": \"PO-2025-004\",\n  \"supplier_id\": 4,\n  \"status\": \"pending\",\n  \"order_date\": \"2025-12-23\",\n  \"expected_delivery_date\": \"2026-01-10\",\n  \"subtotal\": 12000.00,\n  \"tax_amount\": 1200.00,\n  \"discount_amount\": 600.00,\n  \"total_amount\": 12600.00,\n  \"currency\": \"USD\",\n  \"payment_terms\": \"Net 45\",\n  \"notes\": \"Large bulk order for warehouse stock\"\n}"
						},
						"url": {
							"raw": "http://localhost:8000/api/v1/supply/purchase-orders",
							"protocol": "http",
							"host": [
								"localhost"
							],
							"port": "8000",
							"path": [
								"api",
								"v1",
								"supply",
								"purchase-orders"
							]
						}
					},
					"status": "Created",
					"code": 201,
					"_postman_previewlanguage": "Text",
					"header": [],
					"cookie": [],
					"body": "{\n  \"success\": true,\n  \"message\": \"Purchase order created successfully\",\n  \"data\": {\n    \"id\": 4,\n    \"po_number\": \"PO-2025-004\",\n    \"supplier_id\": 4,\n    \"status\": \"pending\",\n    \"order_date\": \"2025-12-23\",\n    \"expected_delivery_date\": \"2026-01-10\",\n    \"subtotal\": 12000.00,\n    \"tax_amount\": 1200.00,\n    \"discount_amount\": 600.00,\n    \"total_amount\": 12600.00,\n    \"currency\": \"USD\",\n    \"payment_terms\": \"Net 45\",\n    \"notes\": \"Large bulk order for warehouse stock\",\n    \"created_at\": \"2025-12-23T14:30:00.000000Z\",\n    \"updated_at\": \"2025-12-23T14:30:00.000000Z\",\n    \"deleted_at\": null\n  },\n  \"status_code\": 201\n}\n"
				},
				{
					"name": "Create Purchase Order - Validation Error",
					"originalRequest": {
						"method": "POST",
						"header": [
							{
								"key": "Authorization",
								"value": "Bearer token",
								"type": "text"
							},
							{
								"key": "Content-Type",
								"value": "application/json",
								"type": "text"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"po_number\": \"PO-2025-001\",\n  \"supplier_id\": 4\n}"
						},
						"url": {
							"raw": "http://localhost:8000/api/v1/supply/purchase-orders",
							"protocol": "http",
							"host": [
								"localhost"
							],
							"port": "8000",
							"path": [
								"api",
								"v1",
								"supply",
								"purchase-orders"
							]
						}
					},
					"status": "Unprocessable Entity",
					"code": 422,
					"_postman_previewlanguage": "Text",
					"header": [],
					"cookie": [],
					"body": "{\n  \"success\": false,\n  \"message\": \"Validation failed\",\n  \"data\": {\n    \"errors\": {\n      \"po_number\": [\n        \"The po number has already been taken.\"\n      ],\n      \"order_date\": [\n        \"The order date field is required.\"\n      ]\n    }\n  },\n  \"status_code\": 422\n}\n"
				}
			]
		},
		{
			"name": "Update Purchase Order",
			"request": {
				"method": "PUT",
				"header": [
					{
						"key": "Authorization",
						"value": "Bearer {{access_token}}",
						"type": "text"
					},
					{
						"key": "Content-Type",
						"value": "application/json",
						"type": "text"
					},
					{
						"key": "Accept",
						"value": "application/json",
						"type": "text"
					}
				],
				"body": {
					"mode": "raw",
					"raw": "{\n  \"po_number\": \"PO-2025-005\",\n  \"supplier_id\": 1,\n  \"supply_order_id\": 1,\n  \"status\": \"pending\",\n  \"total_amount\": 10500.00,\n  \"expected_delivery_date\": \"2026-01-15\",\n  \"notes\": \"Standard purchase order for inventory replenishment\",\n  \"created_by\": 1,\n  \"updated_by\": 1\n}"
				},
				"url": {
					"raw": "{{BASE_URL}}/supply/purchase-orders/1",
					"host": [
						"{{BASE_URL}}"
					],
					"path": [
						"supply",
						"purchase-orders",
						"1"
					]
				},
				"description": "Update an existing purchase order"
			},
			"response": [
				{
					"name": "Update Purchase Order - Success",
					"originalRequest": {
						"method": "PUT",
						"header": [
							{
								"key": "Authorization",
								"value": "Bearer token",
								"type": "text"
							},
							{
								"key": "Content-Type",
								"value": "application/json",
								"type": "text"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"status\": \"confirmed\",\n  \"expected_delivery_date\": \"2025-12-28\",\n  \"notes\": \"Order confirmed by supplier, expedited processing\"\n}"
						},
						"url": {
							"raw": "http://localhost:8000/api/v1/supply/purchase-orders/1",
							"protocol": "http",
							"host": [
								"localhost"
							],
							"port": "8000",
							"path": [
								"api",
								"v1",
								"supply",
								"purchase-orders",
								"1"
							]
						}
					},
					"status": "OK",
					"code": 200,
					"_postman_previewlanguage": "Text",
					"header": [],
					"cookie": [],
					"body": "{\n  \"success\": true,\n  \"message\": \"Purchase order updated successfully\",\n  \"data\": {\n    \"id\": 1,\n    \"po_number\": \"PO-2025-001\",\n    \"supplier_id\": 1,\n    \"status\": \"confirmed\",\n    \"order_date\": \"2025-12-20\",\n    \"expected_delivery_date\": \"2025-12-28\",\n    \"subtotal\": 5000.00,\n    \"tax_amount\": 500.00,\n    \"discount_amount\": 250.00,\n    \"total_amount\": 5250.00,\n    \"currency\": \"USD\",\n    \"payment_terms\": \"30 days net\",\n    \"notes\": \"Order confirmed by supplier, expedited processing\",\n    \"created_at\": \"2025-12-20T10:30:00.000000Z\",\n    \"updated_at\": \"2025-12-23T15:45:30.000000Z\",\n    \"deleted_at\": null\n  },\n  \"status_code\": 200\n}\n"
				}
			]
		},
		{
			"name": "Delete Purchase Order",
			"request": {
				"method": "DELETE",
				"header": [
					{
						"key": "Authorization",
						"value": "Bearer {{access_token}}",
						"type": "text"
					},
					{
						"key": "Accept",
						"value": "application/json",
						"type": "text"
					}
				],
				"url": {
					"raw": "{{BASE_URL}}/supply/purchase-orders/1",
					"host": [
						"{{BASE_URL}}"
					],
					"path": [
						"supply",
						"purchase-orders",
						"1"
					]
				},
				"description": "Delete a purchase order (soft delete)"
			},
			"response": [
				{
					"name": "Delete Purchase Order - Success",
					"originalRequest": {
						"method": "DELETE",
						"header": [
							{
								"key": "Authorization",
								"value": "Bearer token",
								"type": "text"
							}
						],
						"url": {
							"raw": "http://localhost:8000/api/v1/supply/purchase-orders/1",
							"protocol": "http",
							"host": [
								"localhost"
							],
							"port": "8000",
							"path": [
								"api",
								"v1",
								"supply",
								"purchase-orders",
								"1"
							]
						}
					},
					"status": "OK",
					"code": 200,
					"_postman_previewlanguage": "Text",
					"header": [],
					"cookie": [],
					"body": "{\n  \"success\": true,\n  \"message\": \"Purchase order deleted successfully\",\n  \"status_code\": 200\n}\n"
				}
			]
		},
		{
			"name": "Restore Purchase Order",
			"request": {
				"method": "POST",
				"header": [
					{
						"key": "Authorization",
						"value": "Bearer {{access_token}}",
						"type": "text"
					},
					{
						"key": "Accept",
						"value": "application/json",
						"type": "text"
					}
				],
				"url": {
					"raw": "{{BASE_URL}}/supply/purchase-orders/1/restore",
					"host": [
						"{{BASE_URL}}"
					],
					"path": [
						"supply",
						"purchase-orders",
						"1",
						"restore"
					]
				},
				"description": "Restore a soft-deleted purchase order"
			},
			"response": [
				{
					"name": "Restore Purchase Order - Success",
					"originalRequest": {
						"method": "POST",
						"header": [
							{
								"key": "Authorization",
								"value": "Bearer token",
								"type": "text"
							}
						],
						"url": {
							"raw": "http://localhost:8000/api/v1/supply/purchase-orders/1/restore",
							"protocol": "http",
							"host": [
								"localhost"
							],
							"port": "8000",
							"path": [
								"api",
								"v1",
								"supply",
								"purchase-orders",
								"1",
								"restore"
							]
						}
					},
					"status": "OK",
					"code": 200,
					"_postman_previewlanguage": "Text",
					"header": [],
					"cookie": [],
					"body": "{\n  \"success\": true,\n  \"message\": \"Purchase order restored successfully\",\n  \"data\": {\n    \"id\": 1,\n    \"po_number\": \"PO-2025-001\",\n    \"supplier_id\": 1,\n    \"status\": \"confirmed\",\n    \"order_date\": \"2025-12-20\",\n    \"expected_delivery_date\": \"2025-12-28\",\n    \"subtotal\": 5000.00,\n    \"tax_amount\": 500.00,\n    \"discount_amount\": 250.00,\n    \"total_amount\": 5250.00,\n    \"currency\": \"USD\",\n    \"payment_terms\": \"30 days net\",\n    \"notes\": \"Order confirmed by supplier, expedited processing\",\n    \"created_at\": \"2025-12-20T10:30:00.000000Z\",\n    \"updated_at\": \"2025-12-23T15:45:30.000000Z\",\n    \"deleted_at\": null\n  },\n  \"status_code\": 200\n}\n"
				}
			]
		}
	],
	"variable": [
		{
			"key": "BASE_URL",
			"value": "http://localhost:8000/api/v1",
			"type": "string"
		},
		{
			"key": "access_token",
			"value": "your_bearer_token_here",
			"type": "string"
		}
	]
}