{
	"info": {
		"_postman_id": "goods-receipt-from-po-2026",
		"name": "Goods Receipt From PO - Document Receipt of Items from Supplier",
		"description": "# Document Receipt of Items from Supplier\n\nThis collection covers all operations for documenting the receipt of items from suppliers based on an approved Purchase Order.\n\n## Operational Scenario\n\n### Phase 1: Display Purchase Orders Ready for Receipt\n- User (supervisor / delegate) navigates to: Supply Chain Management → Items Assigned to Delegate → Delivery and Receipt Tab\n- All purchase orders assigned to the delegate and pending receipt are displayed\n\n### Conditions for Displaying Purchase Orders:\n- Financially committed (is_financially_committed = true)\n- Sent to supplier (sent_to_supplier_at != null)\n- Status = pending_receipt or partial_receipt\n- Full receipt has not been documented\n\n### Phase 2: Document Receipt\n- Select items to receive\n- Enter received quantities\n- Upload supplier invoice (required)\n\n### Business Rules:\n- Cannot enter received quantity greater than ordered quantity\n- Partial receipt is allowed\n- For partial receipt: notes field is required\n- Uploading supplier invoice is mandatory",
		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
	},
	"item": [
		{
			"name": "Phase 1 & 2: Display Purchase Orders Ready for Receipt",
			"item": [
				{
					"name": "1.1 List All Purchase Orders Pending Receipt",
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "Accept",
								"value": "application/json"
							},
							{
								"key": "Authorization",
								"value": "Bearer {{access_token}}"
							}
						],
						"url": {
							"raw": "{{BASE_URL}}/supply/receipts/pending-pos?per_page=15",
							"host": [
								"{{BASE_URL}}"
							],
							"path": [

								"supply",
								"receipts",
								"pending-pos"
							],
							"query": [
								{
									"key": "per_page",
									"value": "15",
									"description": "Number of results per page"
								}
							]
						},
						"description": "## Phase 1: Display Purchase Orders Ready for Receipt\n\n**Description:**\n> User (supervisor / delegate) navigates to: Supply Chain Management → Items Assigned to Delegate → Delivery and Receipt Tab\n>\n> All purchase orders assigned to the delegate and pending receipt are displayed:\n> - Financially committed\n> - Sent to supplier\n> - Status = pending receipt\n> - Full receipt has not been documented\n\n**Data Displayed in Purchase Orders Table:**\n- PO Number\n- Related Order Number\n- Customer Name\n- Supplier Name\n- PO Creation Date\n- Expected Delivery Date\n- Number of Items\n- Delivery Status (Pending Receipt / Partial Receipt / Received)\n- Receiving Person (Delegate)\n- Items in the Purchase Order"
					},
					"response": [
						{
							"name": "Success Response",
							"originalRequest": {
								"method": "GET",
								"header": [],
								"url": {
									"raw": "{{BASE_URL}}/supply/receipts/pending-pos",
									"host": [
										"{{BASE_URL}}"
									],
									"path": [

										"supply",
										"receipts",
										"pending-pos"
									]
								}
							},
							"status": "OK",
							"code": 200,
							"_postman_previewlanguage": "json",
							"header": [
								{
									"key": "Content-Type",
									"value": "application/json"
								}
							],
							"body": "{\n    \"success\": true,\n    \"message\": \"Purchase orders pending receipt retrieved successfully\",\n    \"data\": {\n        \"data\": [\n            {\n                \"id\": 1,\n                \"po_number\": \"PO-2026-00001\",\n                \"order_date\": \"2026-02-20T00:00:00+00:00\",\n                \"expected_delivery_date\": \"2026-02-25T00:00:00+00:00\",\n                \"supply_order\": {\n                    \"id\": 5,\n                    \"order_number\": \"SO-2026-00005\"\n                },\n                \"customer\": {\n                    \"id\": 10,\n                    \"name\": \"Riyadh Trading Company\"\n                },\n                \"supplier\": {\n                    \"id\": 3,\n                    \"name\": \"General Supplies Corp\",\n                    \"email\": \"supplier@example.com\",\n                    \"phone\": \"+966501234567\"\n                },\n                \"status\": \"confirmed\",\n                \"receipt_status\": \"pending_receipt\",\n                \"receipt_status_label\": \"Pending Receipt\",\n                \"receipt_status_color\": \"warning\",\n                \"is_financially_committed\": true,\n                \"sent_to_supplier_at\": \"2026-02-20T10:30:00+00:00\",\n                \"item_count\": 5,\n                \"items_pending_receipt\": 5,\n                \"receiving_person\": {\n                    \"id\": 15,\n                    \"name\": \"Ahmed Mohamed\",\n                    \"email\": \"ahmed@example.com\"\n                },\n                \"items\": [\n                    {\n                        \"id\": 101,\n                        \"item_name\": \"Motor Spare Part\",\n                        \"customer_item_name\": \"Motor Spare Part\",\n                        \"item_type\": \"spare_part\",\n                        \"unit\": \"piece\",\n                        \"ordered_quantity\": 10.000,\n                        \"received_quantity\": 0.000,\n                        \"remaining_quantity\": 10.000,\n                        \"item_status\": \"pending\",\n                        \"item_status_label\": \"Pending Receipt\",\n                        \"item_status_color\": \"warning\",\n                        \"can_receive\": true,\n                        \"unit_price\": 150.00,\n                        \"line_total\": 1500.00,\n                        \"currency\": \"SAR\"\n                    },\n                    {\n                        \"id\": 102,\n                        \"item_name\": \"Oil Filter\",\n                        \"customer_item_name\": \"Oil Filter\",\n                        \"item_type\": \"consumable\",\n                        \"unit\": \"piece\",\n                        \"ordered_quantity\": 20.000,\n                        \"received_quantity\": 0.000,\n                        \"remaining_quantity\": 20.000,\n                        \"item_status\": \"pending\",\n                        \"item_status_label\": \"Pending Receipt\",\n                        \"item_status_color\": \"warning\",\n                        \"can_receive\": true,\n                        \"unit_price\": 25.00,\n                        \"line_total\": 500.00,\n                        \"currency\": \"SAR\"\n                    }\n                ],\n                \"total_amount\": 2000.00,\n                \"currency\": \"SAR\",\n                \"created_at\": \"2026-02-20T08:00:00+00:00\",\n                \"updated_at\": \"2026-02-20T10:30:00+00:00\"\n            }\n        ],\n        \"pagination\": {\n            \"current_page\": 1,\n            \"last_page\": 1,\n            \"per_page\": 15,\n            \"total\": 1\n        }\n    }\n}"
						}
					]
				},
				{
					"name": "1.2 List Purchase Orders Assigned to Current Delegate Only",
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "Accept",
								"value": "application/json"
							},
							{
								"key": "Authorization",
								"value": "Bearer {{access_token}}"
							}
						],
						"url": {
							"raw": "{{BASE_URL}}/supply/receipts/pending-pos?my_orders=true&per_page=15",
							"host": [
								"{{BASE_URL}}"
							],
							"path": [

								"supply",
								"receipts",
								"pending-pos"
							],
							"query": [
								{
									"key": "my_orders",
									"value": "true",
									"description": "Show only purchase orders assigned to current user"
								},
								{
									"key": "per_page",
									"value": "15"
								}
							]
						},
						"description": "## Display Purchase Orders Assigned to Current Delegate\n\n**Description:**\n> All purchase orders assigned to the delegate and pending receipt are displayed\n\nThe delegate uses this request to view only purchase orders assigned to them."
					},
					"response": []
				},
				{
					"name": "1.3 List Purchase Orders for a Specific Delegate",
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "Accept",
								"value": "application/json"
							},
							{
								"key": "Authorization",
								"value": "Bearer {{access_token}}"
							}
						],
						"url": {
							"raw": "{{BASE_URL}}/supply/receipts/pending-pos?delegate_id=15&per_page=15",
							"host": [
								"{{BASE_URL}}"
							],
							"path": [

								"supply",
								"receipts",
								"pending-pos"
							],
							"query": [
								{
									"key": "delegate_id",
									"value": "15",
									"description": "Delegate ID (receiving_person_id)"
								},
								{
									"key": "per_page",
									"value": "15"
								}
							]
						},
						"description": "## Display Purchase Orders for a Specific Delegate\n\n**Description:**\n> Receiving Person (Delegate)\n\nThe supervisor uses this request to view purchase orders assigned to a specific delegate."
					},
					"response": []
				},
				{
					"name": "1.4 View Single Purchase Order Details for Receipt",
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "Accept",
								"value": "application/json"
							},
							{
								"key": "Authorization",
								"value": "Bearer {{access_token}}"
							}
						],
						"url": {
							"raw": "{{BASE_URL}}/supply/receipts/pending-pos/:purchase_order_id",
							"host": [
								"{{BASE_URL}}"
							],
							"path": [

								"supply",
								"receipts",
								"pending-pos",
								":purchase_order_id"
							],
							"variable": [
								{
									"key": "purchase_order_id",
									"value": "1",
									"description": "Purchase Order ID"
								}
							]
						},
						"description": "## View Single Purchase Order Details\n\n**Description:**\n> Dropdown for items in the purchase order (to select all items or specific items for receipt documentation)\n\nThis request displays details of a specific purchase order with all items available for receipt.\n\n**Data Displayed:**\n- General Information (PO Number, Order Number, Supplier, Customer)\n- Items List with:\n  - Ordered Quantity\n  - Previously Received Quantity\n  - Remaining Quantity\n  - Status of Each Item"
					},
					"response": [
						{
							"name": "Success Response",
							"originalRequest": {
								"method": "GET",
								"header": [],
								"url": {
									"raw": "{{BASE_URL}}/supply/receipts/pending-pos/1",
									"host": [
										"{{BASE_URL}}"
									],
									"path": [

										"supply",
										"receipts",
										"pending-pos",
										"1"
									]
								}
							},
							"status": "OK",
							"code": 200,
							"_postman_previewlanguage": "json",
							"header": [
								{
									"key": "Content-Type",
									"value": "application/json"
								}
							],
							"body": "{\n    \"success\": true,\n    \"message\": \"Purchase order retrieved successfully\",\n    \"data\": {\n        \"id\": 1,\n        \"po_number\": \"PO-2026-00001\",\n        \"order_date\": \"2026-02-20T00:00:00+00:00\",\n        \"expected_delivery_date\": \"2026-02-25T00:00:00+00:00\",\n        \"supply_order\": {\n            \"id\": 5,\n            \"order_number\": \"SO-2026-00005\"\n        },\n        \"supplier\": {\n            \"id\": 3,\n            \"name\": \"General Supplies Corp\",\n            \"email\": \"supplier@example.com\",\n            \"phone\": \"+966501234567\"\n        },\n        \"receipt_status\": \"pending_receipt\",\n        \"receipt_status_label\": \"Pending Receipt\",\n        \"is_financially_committed\": true,\n        \"sent_to_supplier_at\": \"2026-02-20T10:30:00+00:00\",\n        \"item_count\": 3,\n        \"items_pending_receipt\": 3,\n        \"receiving_person\": {\n            \"id\": 15,\n            \"name\": \"Ahmed Mohamed\",\n            \"email\": \"ahmed@example.com\"\n        },\n        \"items\": [\n            {\n                \"id\": 101,\n                \"item_name\": \"Motor Spare Part\",\n                \"customer_item_name\": \"Motor Spare Part\",\n                \"unit\": \"piece\",\n                \"ordered_quantity\": 10.000,\n                \"received_quantity\": 0.000,\n                \"remaining_quantity\": 10.000,\n                \"item_status\": \"pending\",\n                \"item_status_label\": \"Pending Receipt\",\n                \"can_receive\": true,\n                \"unit_price\": 150.00,\n                \"currency\": \"SAR\"\n            },\n            {\n                \"id\": 102,\n                \"item_name\": \"Oil Filter\",\n                \"customer_item_name\": \"Oil Filter\",\n                \"unit\": \"piece\",\n                \"ordered_quantity\": 20.000,\n                \"received_quantity\": 0.000,\n                \"remaining_quantity\": 20.000,\n                \"item_status\": \"pending\",\n                \"item_status_label\": \"Pending Receipt\",\n                \"can_receive\": true,\n                \"unit_price\": 25.00,\n                \"currency\": \"SAR\"\n            },\n            {\n                \"id\": 103,\n                \"item_name\": \"Battery\",\n                \"customer_item_name\": \"Battery\",\n                \"unit\": \"piece\",\n                \"ordered_quantity\": 5.000,\n                \"received_quantity\": 0.000,\n                \"remaining_quantity\": 5.000,\n                \"item_status\": \"pending\",\n                \"item_status_label\": \"Pending Receipt\",\n                \"can_receive\": true,\n                \"unit_price\": 300.00,\n                \"currency\": \"SAR\"\n            }\n        ],\n        \"total_amount\": 3500.00,\n        \"currency\": \"SAR\"\n    }\n}"
						},
						{
							"name": "Error - PO Not Eligible",
							"originalRequest": {
								"method": "GET",
								"header": [],
								"url": {
									"raw": "{{BASE_URL}}/supply/receipts/pending-pos/999",
									"host": [
										"{{BASE_URL}}"
									],
									"path": [

										"supply",
										"receipts",
										"pending-pos",
										"999"
									]
								}
							},
							"status": "Unprocessable Entity",
							"code": 422,
							"_postman_previewlanguage": "json",
							"header": [
								{
									"key": "Content-Type",
									"value": "application/json"
								}
							],
							"body": "{\n    \"success\": false,\n    \"message\": \"Purchase order is not eligible for receipt (status: received)\"\n}"
						}
					]
				}
			],
			"description": "## Phase 1 & 2 Description\n\n**Description:**\n> System Entry: User (supervisor / delegate) navigates to: Supply Chain Management → Items Assigned to Delegate → Delivery and Receipt Tab\n\n> All purchase orders assigned to the delegate and pending receipt are displayed\n\n**Conditions for Displaying Purchase Orders:**\n- Financially committed (is_financially_committed = true)\n- Sent to supplier (sent_to_supplier_at != null)\n- Status = pending_receipt or partial_receipt\n- Full receipt has not been documented"
		},
		{
			"name": "Phase 3 & 4: Document Receipt from Supplier",
			"item": [
				{
					"name": "3.1 Document Full Receipt - All Items",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Accept",
								"value": "application/json"
							},
							{
								"key": "Authorization",
								"value": "Bearer {{access_token}}"
							}
						],
						"body": {
							"mode": "formdata",
							"formdata": [
								{
									"key": "purchase_order_id",
									"value": "1",
									"description": "Purchase Order ID (required)",
									"type": "text"
								},
								{
									"key": "received_at",
									"value": "2026-02-21 14:30:00",
									"description": "Receipt date and time (optional - defaults to current time)",
									"type": "text"
								},
								{
									"key": "supplier_delivery_note_number",
									"value": "DN-2026-001",
									"description": "Supplier delivery note number (optional)",
									"type": "text"
								},
								{
									"key": "supplier_invoice",
									"description": "Supplier invoice PDF/JPG (required)",
									"type": "file",
									"src": "/path/to/supplier_invoice.pdf"
								},
								{
									"key": "notes",
									"value": "Received in presence of delegate",
									"description": "General notes (optional)",
									"type": "text"
								},
								{
									"key": "items[0][purchase_order_item_id]",
									"value": "101",
									"description": "First PO item ID",
									"type": "text"
								},
								{
									"key": "items[0][quantity_received]",
									"value": "10",
									"description": "Quantity received for first item (full)",
									"type": "text"
								},
								{
									"key": "items[1][purchase_order_item_id]",
									"value": "102",
									"description": "Second PO item ID",
									"type": "text"
								},
								{
									"key": "items[1][quantity_received]",
									"value": "20",
									"description": "Quantity received for second item (full)",
									"type": "text"
								},
								{
									"key": "items[2][purchase_order_item_id]",
									"value": "103",
									"description": "Third PO item ID",
									"type": "text"
								},
								{
									"key": "items[2][quantity_received]",
									"value": "5",
									"description": "Quantity received for third item (full)",
									"type": "text"
								}
							]
						},
						"url": {
							"raw": "{{BASE_URL}}/supply/receipts/from-po",
							"host": [
								"{{BASE_URL}}"
							],
							"path": [

								"supply",
								"receipts",
								"from-po"
							]
						},
						"description": "## Phase 3: Document Receipt from Supplier (Full Receipt)\n\n**Description:**\n> When clicking on Document Receipt, a form opens (Modal / Standalone Page)\n\n**First: General Information:**\n> - Purchase Order Number\n> - Order Number\n> - Supplier Name\n> - Customer Name\n> - Receipt Date and Time (editable - defaults to current time)\n> - Receiving Person Name (Delegate)\n\n**Second: Items List:**\n> The system displays all items associated with the PO\n\n**Third: Documentation Data:**\n> Upload supplier invoice (PDF / JPG) (required)\n\n**Phase 4: When Saving Receipt:**\n> The system:\n> - Saves receipt data\n> - Updates item quantities (received / remaining)\n> - Updates purchase order status\n\n**Phase 5: Automatic System Updates:**\n> Updates status of received items to: Ready for Customer Delivery"
					},
					"response": [
						{
							"name": "Success - Full Receipt",
							"originalRequest": {
								"method": "POST",
								"header": [],
								"body": {
									"mode": "formdata",
									"formdata": [
										{
											"key": "purchase_order_id",
											"value": "1",
											"type": "text"
										},
										{
											"key": "supplier_invoice",
											"type": "file",
											"src": "/path/to/invoice.pdf"
										},
										{
											"key": "items[0][purchase_order_item_id]",
											"value": "101",
											"type": "text"
										},
										{
											"key": "items[0][quantity_received]",
											"value": "10",
											"type": "text"
										}
									]
								},
								"url": {
									"raw": "{{BASE_URL}}/supply/receipts/from-po",
									"host": [
										"{{BASE_URL}}"
									],
									"path": [

										"supply",
										"receipts",
										"from-po"
									]
								}
							},
							"status": "Created",
							"code": 201,
							"_postman_previewlanguage": "json",
							"header": [
								{
									"key": "Content-Type",
									"value": "application/json"
								}
							],
							"body": "{\n    \"success\": true,\n    \"message\": \"Goods receipt created from purchase order successfully\",\n    \"data\": {\n        \"id\": 50,\n        \"receipt_number\": \"GR-2026-00050\",\n        \"supplier_delivery_note_number\": \"DN-2026-001\",\n        \"purchase_order\": {\n            \"id\": 1,\n            \"po_number\": \"PO-2026-00001\",\n            \"receipt_status\": \"received\",\n            \"receipt_status_label\": \"Received\",\n            \"supplier\": {\n                \"id\": 3,\n                \"name\": \"General Supplies Corp\"\n            },\n            \"supply_order\": {\n                \"id\": 5,\n                \"order_number\": \"SO-2026-00005\"\n            }\n        },\n        \"received_by\": {\n            \"id\": 15,\n            \"name\": \"Ahmed Mohamed\",\n            \"email\": \"ahmed@example.com\"\n        },\n        \"received_at\": \"2026-02-21T14:30:00+00:00\",\n        \"status\": \"completed\",\n        \"status_label\": \"Completed\",\n        \"status_color\": \"success\",\n        \"supplier_invoice\": \"https://example.com/storage/goods_receipts/50/invoice.pdf\",\n        \"notes\": \"Received in presence of delegate\",\n        \"items\": [\n            {\n                \"id\": 200,\n                \"goods_receipt_id\": 50,\n                \"purchase_order_item\": {\n                    \"id\": 101,\n                    \"item_name\": \"Motor Spare Part\",\n                    \"unit\": \"piece\",\n                    \"ordered_quantity\": 10.000,\n                    \"total_received\": 10.000,\n                    \"remaining_quantity\": 0.000,\n                    \"item_status\": \"ready_for_delivery\",\n                    \"item_status_label\": \"Ready for Delivery\"\n                },\n                \"ordered_quantity\": 10.000,\n                \"quantity_received\": 10.000,\n                \"status\": \"received\"\n            },\n            {\n                \"id\": 201,\n                \"goods_receipt_id\": 50,\n                \"purchase_order_item\": {\n                    \"id\": 102,\n                    \"item_name\": \"Oil Filter\",\n                    \"unit\": \"piece\",\n                    \"ordered_quantity\": 20.000,\n                    \"total_received\": 20.000,\n                    \"remaining_quantity\": 0.000,\n                    \"item_status\": \"ready_for_delivery\",\n                    \"item_status_label\": \"Ready for Delivery\"\n                },\n                \"ordered_quantity\": 20.000,\n                \"quantity_received\": 20.000,\n                \"status\": \"received\"\n            },\n            {\n                \"id\": 202,\n                \"goods_receipt_id\": 50,\n                \"purchase_order_item\": {\n                    \"id\": 103,\n                    \"item_name\": \"Battery\",\n                    \"unit\": \"piece\",\n                    \"ordered_quantity\": 5.000,\n                    \"total_received\": 5.000,\n                    \"remaining_quantity\": 0.000,\n                    \"item_status\": \"ready_for_delivery\",\n                    \"item_status_label\": \"Ready for Delivery\"\n                },\n                \"ordered_quantity\": 5.000,\n                \"quantity_received\": 5.000,\n                \"status\": \"received\"\n            }\n        ],\n        \"created_at\": \"2026-02-21T14:30:00+00:00\"\n    }\n}"
						}
					]
				},
				{
					"name": "3.2 Document Partial Receipt - Some Items Only",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Accept",
								"value": "application/json"
							},
							{
								"key": "Authorization",
								"value": "Bearer {{access_token}}"
							}
						],
						"body": {
							"mode": "formdata",
							"formdata": [
								{
									"key": "purchase_order_id",
									"value": "1",
									"description": "Purchase Order ID",
									"type": "text"
								},
								{
									"key": "received_at",
									"value": "2026-02-21 14:30:00",
									"description": "Receipt date and time",
									"type": "text"
								},
								{
									"key": "supplier_invoice",
									"description": "Supplier invoice (required)",
									"type": "file",
									"src": "/path/to/supplier_invoice.pdf"
								},
								{
									"key": "items[0][purchase_order_item_id]",
									"value": "101",
									"description": "First item ID only",
									"type": "text"
								},
								{
									"key": "items[0][quantity_received]",
									"value": "10",
									"description": "Quantity received for first item",
									"type": "text"
								}
							]
						},
						"url": {
							"raw": "{{BASE_URL}}/supply/receipts/from-po",
							"host": [
								"{{BASE_URL}}"
							],
							"path": [

								"supply",
								"receipts",
								"from-po"
							]
						},
						"description": "## Document Partial Receipt - Select Some Items\n\n**Description:**\n> You can select to receive only some items by checking the checkbox for items that were received, leaving other items with status pending receipt\n\nIn this example:\n- Only the first item is received (ID: 101)\n- Other items (102, 103) remain with status \"Pending Receipt\"\n- Purchase order status changes to \"Partial Receipt\""
					},
					"response": [
						{
							"name": "Success - Partial Items",
							"originalRequest": {
								"method": "POST",
								"header": [],
								"url": {
									"raw": "{{BASE_URL}}/supply/receipts/from-po",
									"host": [
										"{{BASE_URL}}"
									],
									"path": [

										"supply",
										"receipts",
										"from-po"
									]
								}
							},
							"status": "Created",
							"code": 201,
							"_postman_previewlanguage": "json",
							"header": [
								{
									"key": "Content-Type",
									"value": "application/json"
								}
							],
							"body": "{\n    \"success\": true,\n    \"message\": \"Goods receipt created from purchase order successfully\",\n    \"data\": {\n        \"id\": 51,\n        \"receipt_number\": \"GR-2026-00051\",\n        \"purchase_order\": {\n            \"id\": 1,\n            \"po_number\": \"PO-2026-00001\",\n            \"receipt_status\": \"partial_receipt\",\n            \"receipt_status_label\": \"Partial Receipt\",\n            \"supplier\": {\n                \"id\": 3,\n                \"name\": \"General Supplies Corp\"\n            }\n        },\n        \"received_at\": \"2026-02-21T14:30:00+00:00\",\n        \"status\": \"completed\",\n        \"items\": [\n            {\n                \"id\": 203,\n                \"purchase_order_item\": {\n                    \"id\": 101,\n                    \"item_name\": \"Motor Spare Part\",\n                    \"ordered_quantity\": 10.000,\n                    \"total_received\": 10.000,\n                    \"remaining_quantity\": 0.000,\n                    \"item_status\": \"ready_for_delivery\",\n                    \"item_status_label\": \"Ready for Delivery\"\n                },\n                \"quantity_received\": 10.000,\n                \"status\": \"received\"\n            }\n        ]\n    }\n}"
						}
					]
				},
				{
					"name": "3.3 Document Partial Receipt - Less Than Ordered Quantity",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Accept",
								"value": "application/json"
							},
							{
								"key": "Authorization",
								"value": "Bearer {{access_token}}"
							}
						],
						"body": {
							"mode": "formdata",
							"formdata": [
								{
									"key": "purchase_order_id",
									"value": "1",
									"type": "text"
								},
								{
									"key": "received_at",
									"value": "2026-02-21 14:30:00",
									"type": "text"
								},
								{
									"key": "supplier_invoice",
									"type": "file",
									"src": "/path/to/supplier_invoice.pdf"
								},
								{
									"key": "items[0][purchase_order_item_id]",
									"value": "101",
									"type": "text"
								},
								{
									"key": "items[0][quantity_received]",
									"value": "7",
									"description": "Receiving 7 out of 10 (less than ordered)",
									"type": "text"
								},
								{
									"key": "items[0][notes]",
									"value": "Received 7 pieces only, 3 pieces will be delivered later due to supplier stock shortage",
									"description": "Required notes for partial receipt",
									"type": "text"
								}
							]
						},
						"url": {
							"raw": "{{BASE_URL}}/supply/receipts/from-po",
							"host": [
								"{{BASE_URL}}"
							],
							"path": [

								"supply",
								"receipts",
								"from-po"
							]
						},
						"description": "## Document Partial Receipt - Less Than Ordered Quantity\n\n**Description:**\n> Quantity Entry Rules:\n> - Cannot enter received quantity greater than ordered quantity\n> - Partial receipt is allowed\n> - If received quantity is less than ordered:\n>   - Notes field becomes required\n>   - Quantity difference is recorded automatically\n\nIn this example:\n- Ordered Quantity: 10 pieces\n- Received Quantity: 7 pieces\n- Notes: Required (explains the shortage)\n- Remaining Quantity: 3 pieces (calculated automatically by system)"
					},
					"response": [
						{
							"name": "Success - Partial Quantity",
							"originalRequest": {
								"method": "POST",
								"header": [],
								"url": {
									"raw": "{{BASE_URL}}/supply/receipts/from-po",
									"host": [
										"{{BASE_URL}}"
									],
									"path": [

										"supply",
										"receipts",
										"from-po"
									]
								}
							},
							"status": "Created",
							"code": 201,
							"_postman_previewlanguage": "json",
							"header": [
								{
									"key": "Content-Type",
									"value": "application/json"
								}
							],
							"body": "{\n    \"success\": true,\n    \"message\": \"Goods receipt created from purchase order successfully\",\n    \"data\": {\n        \"id\": 52,\n        \"receipt_number\": \"GR-2026-00052\",\n        \"purchase_order\": {\n            \"id\": 1,\n            \"po_number\": \"PO-2026-00001\",\n            \"receipt_status\": \"partial_receipt\",\n            \"receipt_status_label\": \"Partial Receipt\"\n        },\n        \"items\": [\n            {\n                \"id\": 204,\n                \"purchase_order_item\": {\n                    \"id\": 101,\n                    \"item_name\": \"Motor Spare Part\",\n                    \"ordered_quantity\": 10.000,\n                    \"total_received\": 7.000,\n                    \"remaining_quantity\": 3.000,\n                    \"item_status\": \"partially_received\",\n                    \"item_status_label\": \"Partially Received\"\n                },\n                \"ordered_quantity\": 10.000,\n                \"quantity_received\": 7.000,\n                \"status\": \"received\",\n                \"notes\": \"Received 7 pieces only, 3 pieces will be delivered later due to supplier stock shortage\"\n            }\n        ]\n    }\n}"
						}
					]
				},
				{
					"name": "3.4 Error - Quantity Exceeds Ordered",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Accept",
								"value": "application/json"
							},
							{
								"key": "Authorization",
								"value": "Bearer {{access_token}}"
							}
						],
						"body": {
							"mode": "formdata",
							"formdata": [
								{
									"key": "purchase_order_id",
									"value": "1",
									"type": "text"
								},
								{
									"key": "supplier_invoice",
									"type": "file",
									"src": "/path/to/invoice.pdf"
								},
								{
									"key": "items[0][purchase_order_item_id]",
									"value": "101",
									"type": "text"
								},
								{
									"key": "items[0][quantity_received]",
									"value": "15",
									"description": "Attempting to receive 15 out of 10 (error)",
									"type": "text"
								}
							]
						},
						"url": {
							"raw": "{{BASE_URL}}/supply/receipts/from-po",
							"host": [
								"{{BASE_URL}}"
							],
							"path": [

								"supply",
								"receipts",
								"from-po"
							]
						},
						"description": "## Error - Received Quantity Exceeds Ordered Quantity\n\n**Description:**\n> Cannot enter received quantity greater than ordered quantity\n\n**Acceptance Criteria:**\n> Cannot enter received quantity greater than PO quantity"
					},
					"response": [
						{
							"name": "Error - Quantity Exceeds",
							"originalRequest": {
								"method": "POST",
								"header": [],
								"url": {
									"raw": "{{BASE_URL}}/supply/receipts/from-po",
									"host": [
										"{{BASE_URL}}"
									],
									"path": [

										"supply",
										"receipts",
										"from-po"
									]
								}
							},
							"status": "Unprocessable Entity",
							"code": 422,
							"_postman_previewlanguage": "json",
							"header": [
								{
									"key": "Content-Type",
									"value": "application/json"
								}
							],
							"body": "{\n    \"success\": false,\n    \"message\": \"Validation failed\",\n    \"errors\": {\n        \"items.0.quantity_received\": [\n            \"Received quantity (15) exceeds remaining quantity (10) for item: Motor Spare Part\"\n        ]\n    }\n}"
						}
					]
				},
				{
					"name": "3.5 Error - Partial Receipt Without Notes",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Accept",
								"value": "application/json"
							},
							{
								"key": "Authorization",
								"value": "Bearer {{access_token}}"
							}
						],
						"body": {
							"mode": "formdata",
							"formdata": [
								{
									"key": "purchase_order_id",
									"value": "1",
									"type": "text"
								},
								{
									"key": "supplier_invoice",
									"type": "file",
									"src": "/path/to/invoice.pdf"
								},
								{
									"key": "items[0][purchase_order_item_id]",
									"value": "101",
									"type": "text"
								},
								{
									"key": "items[0][quantity_received]",
									"value": "7",
									"description": "Partial quantity without notes (error)",
									"type": "text"
								}
							]
						},
						"url": {
							"raw": "{{BASE_URL}}/supply/receipts/from-po",
							"host": [
								"{{BASE_URL}}"
							],
							"path": [

								"supply",
								"receipts",
								"from-po"
							]
						},
						"description": "## Error - Partial Receipt Without Notes\n\n**Description:**\n> If received quantity is less than ordered:\n> - Notes field becomes required"
					},
					"response": [
						{
							"name": "Error - Notes Required",
							"originalRequest": {
								"method": "POST",
								"header": [],
								"url": {
									"raw": "{{BASE_URL}}/supply/receipts/from-po",
									"host": [
										"{{BASE_URL}}"
									],
									"path": [

										"supply",
										"receipts",
										"from-po"
									]
								}
							},
							"status": "Unprocessable Entity",
							"code": 422,
							"_postman_previewlanguage": "json",
							"header": [
								{
									"key": "Content-Type",
									"value": "application/json"
								}
							],
							"body": "{\n    \"success\": false,\n    \"message\": \"Validation failed\",\n    \"errors\": {\n        \"items.0.notes\": [\n            \"Notes are required for partial receipt of item: Motor Spare Part\"\n        ]\n    }\n}"
						}
					]
				},
				{
					"name": "3.6 Error - PO Not Financially Committed",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Accept",
								"value": "application/json"
							},
							{
								"key": "Authorization",
								"value": "Bearer {{access_token}}"
							}
						],
						"body": {
							"mode": "formdata",
							"formdata": [
								{
									"key": "purchase_order_id",
									"value": "999",
									"description": "PO not financially committed",
									"type": "text"
								},
								{
									"key": "supplier_invoice",
									"type": "file",
									"src": "/path/to/invoice.pdf"
								},
								{
									"key": "items[0][purchase_order_item_id]",
									"value": "501",
									"type": "text"
								},
								{
									"key": "items[0][quantity_received]",
									"value": "5",
									"type": "text"
								}
							]
						},
						"url": {
							"raw": "{{BASE_URL}}/supply/receipts/from-po",
							"host": [
								"{{BASE_URL}}"
							],
							"path": [

								"supply",
								"receipts",
								"from-po"
							]
						},
						"description": "## Error - PO Not Financially Committed\n\n**Acceptance Criteria:**\n> Cannot document receipt without financially committed PO"
					},
					"response": [
						{
							"name": "Error - Not Financially Committed",
							"originalRequest": {
								"method": "POST",
								"header": [],
								"url": {
									"raw": "{{BASE_URL}}/supply/receipts/from-po",
									"host": [
										"{{BASE_URL}}"
									],
									"path": [

										"supply",
										"receipts",
										"from-po"
									]
								}
							},
							"status": "Unprocessable Entity",
							"code": 422,
							"_postman_previewlanguage": "json",
							"header": [
								{
									"key": "Content-Type",
									"value": "application/json"
								}
							],
							"body": "{\n    \"success\": false,\n    \"message\": \"Validation failed\",\n    \"errors\": {\n        \"purchase_order_id\": [\n            \"Purchase order is not financially committed\"\n        ]\n    }\n}"
						}
					]
				},
				{
					"name": "3.7 Error - Missing Supplier Invoice",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Accept",
								"value": "application/json"
							},
							{
								"key": "Authorization",
								"value": "Bearer {{access_token}}"
							}
						],
						"body": {
							"mode": "formdata",
							"formdata": [
								{
									"key": "purchase_order_id",
									"value": "1",
									"type": "text"
								},
								{
									"key": "items[0][purchase_order_item_id]",
									"value": "101",
									"type": "text"
								},
								{
									"key": "items[0][quantity_received]",
									"value": "10",
									"type": "text"
								}
							]
						},
						"url": {
							"raw": "{{BASE_URL}}/supply/receipts/from-po",
							"host": [
								"{{BASE_URL}}"
							],
							"path": [

								"supply",
								"receipts",
								"from-po"
							]
						},
						"description": "## Error - Missing Supplier Invoice\n\n**Description:**\n> Upload supplier invoice (PDF / JPG) (required)"
					},
					"response": [
						{
							"name": "Error - Invoice Required",
							"originalRequest": {
								"method": "POST",
								"header": [],
								"url": {
									"raw": "{{BASE_URL}}/supply/receipts/from-po",
									"host": [
										"{{BASE_URL}}"
									],
									"path": [

										"supply",
										"receipts",
										"from-po"
									]
								}
							},
							"status": "Unprocessable Entity",
							"code": 422,
							"_postman_previewlanguage": "json",
							"header": [
								{
									"key": "Content-Type",
									"value": "application/json"
								}
							],
							"body": "{\n    \"success\": false,\n    \"message\": \"Validation failed\",\n    \"errors\": {\n        \"supplier_invoice\": [\n            \"Supplier invoice file is required\"\n        ]\n    }\n}"
						}
					]
				}
			],
			"description": "## Phase 3 & 4 Description\n\n**Phase 3: Document Receipt from Supplier**\n\n**Receipt Documentation Form:**\n- General Information (display only)\n- Items List with selection capability\n- Documentation Data (invoice)\n\n**Quantity Entry Rules:**\n- Cannot enter quantity greater than ordered\n- Partial receipt is allowed\n- Notes are required for partial receipt\n\n**Phase 4: When Saving Receipt**\n- Save receipt data\n- Update item quantities\n- Update purchase order status"
		},
		{
			"name": "Phase 5: View Receipt Details",
			"item": [
				{
					"name": "5.1 View Goods Receipt Details",
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "Accept",
								"value": "application/json"
							},
							{
								"key": "Authorization",
								"value": "Bearer {{access_token}}"
							}
						],
						"url": {
							"raw": "{{BASE_URL}}/supply/receipts/:receipt_id/details",
							"host": [
								"{{BASE_URL}}"
							],
							"path": [

								"supply",
								"receipts",
								":receipt_id",
								"details"
							],
							"variable": [
								{
									"key": "receipt_id",
									"value": "50",
									"description": "Goods Receipt ID"
								}
							]
						},
						"description": "## View Goods Receipt Details\n\n**Phase 5: Post-Receipt**\n\n**Description:**\n> Automatic System Updates:\n> Update status of received items to: Ready for Customer Delivery\n\nThis request displays:\n- Goods receipt details\n- Received items with updated statuses\n- Attached supplier invoice\n- Updated purchase order status"
					},
					"response": [
						{
							"name": "Success Response",
							"originalRequest": {
								"method": "GET",
								"header": [],
								"url": {
									"raw": "{{BASE_URL}}/supply/receipts/50/details",
									"host": [
										"{{BASE_URL}}"
									],
									"path": [

										"supply",
										"receipts",
										"50",
										"details"
									]
								}
							},
							"status": "OK",
							"code": 200,
							"_postman_previewlanguage": "json",
							"header": [
								{
									"key": "Content-Type",
									"value": "application/json"
								}
							],
							"body": "{\n    \"success\": true,\n    \"message\": \"Receipt details retrieved successfully\",\n    \"data\": {\n        \"id\": 50,\n        \"receipt_number\": \"GR-2026-00050\",\n        \"supplier_delivery_note_number\": \"DN-2026-001\",\n        \"purchase_order\": {\n            \"id\": 1,\n            \"po_number\": \"PO-2026-00001\",\n            \"receipt_status\": \"received\",\n            \"receipt_status_label\": \"Received\",\n            \"supplier\": {\n                \"id\": 3,\n                \"name\": \"General Supplies Corp\"\n            },\n            \"supply_order\": {\n                \"id\": 5,\n                \"order_number\": \"SO-2026-00005\"\n            }\n        },\n        \"received_by\": {\n            \"id\": 15,\n            \"name\": \"Ahmed Mohamed\",\n            \"email\": \"ahmed@example.com\"\n        },\n        \"received_at\": \"2026-02-21T14:30:00+00:00\",\n        \"status\": \"completed\",\n        \"status_label\": \"Completed\",\n        \"supplier_invoice\": \"https://example.com/storage/goods_receipts/50/invoice.pdf\",\n        \"notes\": \"Received in presence of delegate\",\n        \"items\": [\n            {\n                \"id\": 200,\n                \"purchase_order_item\": {\n                    \"id\": 101,\n                    \"item_name\": \"Motor Spare Part\",\n                    \"customer_item_name\": \"Motor Spare Part\",\n                    \"unit\": \"piece\",\n                    \"ordered_quantity\": 10.000,\n                    \"total_received\": 10.000,\n                    \"remaining_quantity\": 0.000,\n                    \"item_status\": \"ready_for_delivery\",\n                    \"item_status_label\": \"Ready for Delivery\"\n                },\n                \"ordered_quantity\": 10.000,\n                \"quantity_received\": 10.000,\n                \"status\": \"received\"\n            }\n        ],\n        \"created_at\": \"2026-02-21T14:30:00+00:00\",\n        \"updated_at\": \"2026-02-21T14:30:00+00:00\"\n    }\n}"
						}
					]
				},
				{
					"name": "5.2 View Goods Receipt Documents",
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "Accept",
								"value": "application/json"
							},
							{
								"key": "Authorization",
								"value": "Bearer {{access_token}}"
							}
						],
						"url": {
							"raw": "{{BASE_URL}}/supply/receipts/:receipt_id/documents",
							"host": [
								"{{BASE_URL}}"
							],
							"path": [

								"supply",
								"receipts",
								":receipt_id",
								"documents"
							],
							"variable": [
								{
									"key": "receipt_id",
									"value": "50"
								}
							]
						},
						"description": "## View Goods Receipt Documents\n\nDisplays the supplier invoice attached with the goods receipt."
					},
					"response": []
				},
				{
					"name": "5.3 Download Goods Receipt PDF",
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "Accept",
								"value": "application/pdf"
							},
							{
								"key": "Authorization",
								"value": "Bearer {{access_token}}"
							}
						],
						"url": {
							"raw": "{{BASE_URL}}/supply/receipts/:receipt_id/download-pdf",
							"host": [
								"{{BASE_URL}}"
							],
							"path": [

								"supply",
								"receipts",
								":receipt_id",
								"download-pdf"
							],
							"variable": [
								{
									"key": "receipt_id",
									"value": "50"
								}
							]
						},
						"description": "## Download Goods Receipt as PDF\n\nGenerates and downloads the goods receipt document as a PDF file."
					},
					"response": []
				}
			],
			"description": "## Phase 5: Post-Receipt\n\n**Description:**\n> Automatic System Updates:\n> Update status of received items to: Ready for Customer Delivery"
		},
		{
			"name": "Phase 6: Items Ready for Delivery",
			"item": [
				{
					"name": "6.1 List Items Ready for Delivery (from PO)",
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "Accept",
								"value": "application/json"
							},
							{
								"key": "Authorization",
								"value": "Bearer {{access_token}}"
							}
						],
						"url": {
							"raw": "{{BASE_URL}}/supply/orders/:order_id/items-ready-for-delivery",
							"host": [
								"{{BASE_URL}}"
							],
							"path": [

								"supply",
								"orders",
								":order_id",
								"items-ready-for-delivery"
							],
							"variable": [
								{
									"key": "order_id",
									"value": "5",
									"description": "Supply Order ID"
								}
							]
						},
						"description": "## Phase 6: Select Items for Delivery\n\n**Description:**\n> Selection Interface:\n> From the same items table:\n> - Checkboxes appear next to deliverable items\n> - User can:\n>   - Select a single item\n>   - Or multiple items\n>\n> Opens customer delivery documentation form and transitions to completion certificate generation task\n\nThis request displays items with status \"Ready for Delivery\" that can be delivered to the customer."
					},
					"response": [
						{
							"name": "Success Response",
							"originalRequest": {
								"method": "GET",
								"header": [],
								"url": {
									"raw": "{{BASE_URL}}/supply/orders/5/items-ready-for-delivery",
									"host": [
										"{{BASE_URL}}"
									],
									"path": [

										"supply",
										"orders",
										"5",
										"items-ready-for-delivery"
									]
								}
							},
							"status": "OK",
							"code": 200,
							"_postman_previewlanguage": "json",
							"header": [
								{
									"key": "Content-Type",
									"value": "application/json"
								}
							],
							"body": "{\n    \"success\": true,\n    \"message\": \"Items ready for delivery retrieved successfully\",\n    \"data\": {\n        \"order\": {\n            \"id\": 5,\n            \"order_number\": \"SO-2026-00005\",\n            \"customer\": {\n                \"id\": 10,\n                \"name\": \"Riyadh Trading Company\"\n            }\n        },\n        \"items\": [\n            {\n                \"id\": 101,\n                \"item_name\": \"Motor Spare Part\",\n                \"customer_item_name\": \"Motor Spare Part\",\n                \"unit\": \"piece\",\n                \"quantity\": 10.000,\n                \"received_quantity\": 10.000,\n                \"delivered_quantity\": 0.000,\n                \"available_for_delivery\": 10.000,\n                \"status\": \"ready_for_delivery\",\n                \"status_label\": \"Ready for Delivery\",\n                \"can_deliver\": true\n            },\n            {\n                \"id\": 102,\n                \"item_name\": \"Oil Filter\",\n                \"customer_item_name\": \"Oil Filter\",\n                \"unit\": \"piece\",\n                \"quantity\": 20.000,\n                \"received_quantity\": 20.000,\n                \"delivered_quantity\": 0.000,\n                \"available_for_delivery\": 20.000,\n                \"status\": \"ready_for_delivery\",\n                \"status_label\": \"Ready for Delivery\",\n                \"can_deliver\": true\n            }\n        ],\n        \"summary\": {\n            \"total_items\": 2,\n            \"total_quantity_ready\": 30.000\n        }\n    }\n}"
						}
					]
				}
			],
			"description": "## Phase 6: Select Items for Delivery\n\n**Description:**\n> Selection Interface:\n> From the same items table:\n> - Checkboxes appear next to deliverable items\n> - User can select a single item or multiple items\n\n**Note:** This phase transitions to the \"Generate Completion Certificate for Customer Delivery\" task which is outside the scope of this collection."
		},
		{
			"name": "Additional APIs",
			"item": [
				{
					"name": "List All Goods Receipts",
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "Accept",
								"value": "application/json"
							},
							{
								"key": "Authorization",
								"value": "Bearer {{access_token}}"
							}
						],
						"url": {
							"raw": "{{BASE_URL}}/supply/receipts?per_page=15&status=completed",
							"host": [
								"{{BASE_URL}}"
							],
							"path": [

								"supply",
								"receipts"
							],
							"query": [
								{
									"key": "per_page",
									"value": "15"
								},
								{
									"key": "status",
									"value": "completed",
									"description": "Filter by status: pending, completed"
								}
							]
						},
						"description": "List all goods receipts with optional status filtering."
					},
					"response": []
				},
				{
					"name": "View Single Goods Receipt",
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "Accept",
								"value": "application/json"
							},
							{
								"key": "Authorization",
								"value": "Bearer {{access_token}}"
							}
						],
						"url": {
							"raw": "{{BASE_URL}}/supply/receipts/:receipt_id",
							"host": [
								"{{BASE_URL}}"
							],
							"path": [

								"supply",
								"receipts",
								":receipt_id"
							],
							"variable": [
								{
									"key": "receipt_id",
									"value": "50"
								}
							]
						},
						"description": "View details of a single goods receipt."
					},
					"response": []
				}
			],
			"description": "Additional APIs for managing goods receipts"
		}
	],
	"event": [
		{
			"listen": "prerequest",
			"script": {
				"type": "text/javascript",
				"exec": [
					""
				]
			}
		},
		{
			"listen": "test",
			"script": {
				"type": "text/javascript",
				"exec": [
					""
				]
			}
		}
	],
	"variable": [
		{
			"key": "BASE_URL",
			"value": "http://localhost:8000",
			"type": "string"
		},
		{
			"key": "access_token",
			"value": "your_access_token_here",
			"type": "string"
		}
	]
}
