{
	"info": {
		"name": "Food-Trace Developer API (Local)",
		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
		"description": "Local dev collection — base URL: http://localhost/developer/api/v1. Includes Billy test data. ADMIN USE ONLY — do not share."
	},
	"variable": [
		{
			"key": "base_url",
			"value": "http://localhost/developer/api/v1",
			"type": "string"
		},
		{
			"key": "api_key",
			"value": "aHdMVVZBTU9XTEZUTmorUWtRUDFJNThpZzUvSkRJQXBDQUZOaXh3bGNuSmMzQnNsNGtRTVFxdGk0MjRuTDZNTjEzbXZUS3VrU3B4RExsc2JDUEJBRHZ1cVlVcE8yMmEvM2hlVXpQbkV2eWc9Ojo3ugjACud3dv+JjUEbTE6B",
			"type": "string"
		},
		{
			"key": "user_id",
			"value": "14",
			"type": "string"
		},
		{
			"key": "product_id",
			"value": "1",
			"type": "string"
		},
		{
			"key": "newline_id",
			"value": "1",
			"type": "string"
		},
		{
			"key": "supplier_id",
			"value": "1",
			"type": "string"
		},
		{
			"key": "billy_api_key",
			"value": "aHdMVVZBTU9XTEZUTmorUWtRUDFJNThpZzUvSkRJQXBDQUZOaXh3bGNuSmMzQnNsNGtRTVFxdGk0MjRuTDZNTjEzbXZUS3VrU3B4RExsc2JDUEJBRHZ1cVlVcE8yMmEvM2hlVXpQbkV2eWc9Ojo3ugjACud3dv+JjUEbTE6B",
			"type": "string",
			"description": "ADMIN ONLY — Billy test account API key (local dev)"
		},
		{
			"key": "billy_email_1",
			"value": "billy1@billyone.co.uk",
			"type": "string"
		},
		{
			"key": "billy_email_2",
			"value": "billy2@billytwo.co.uk",
			"type": "string"
		},
		{
			"key": "billy_email_3",
			"value": "billy3@billythree.co.uk",
			"type": "string"
		}
	],
	"item": [
		{
			"name": "Users",
			"item": [
				{
					"name": "Create User",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "x-api-key",
								"value": "{{api_key}}"
							},
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n\t\"emailaddress\": \"john.doe@example.com\",\n\t\"password\": \"SecurePass123!\",\n\t\"firstname\": \"John\",\n\t\"lastname\": \"Doe\",\n\t\"landlineno\": \"01234567890\",\n\t\"mobileno\": \"07700000000\",\n\t\"companyid\": 1,\n\t\"jobtitle\": \"Developer\",\n\t\"accesslevelid\": 1,\n\t\"departmentid\": 1,\n\t\"comments\": \"\"\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "{{base_url}}/users",
							"host": ["{{base_url}}"],
							"path": ["users"]
						}
					}
				},
				{
					"name": "Get User",
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "x-api-key",
								"value": "{{api_key}}"
							}
						],
						"url": {
							"raw": "{{base_url}}/users/{{user_id}}",
							"host": ["{{base_url}}"],
							"path": ["users", "{{user_id}}"]
						}
					}
				},
				{
					"name": "Update User",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "x-api-key",
								"value": "{{api_key}}"
							},
							{
								"key": "Content-Type",
								"value": "application/json"
							},
							{
								"key": "X-HTTP-Method-Override",
								"value": "PUT"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n\t\"firstname\": \"John\",\n\t\"lastname\": \"Doe\",\n\t\"emailaddress\": \"john.doe@example.com\",\n\t\"landlineno\": \"01234567890\",\n\t\"mobileno\": \"07700000000\",\n\t\"jobtitle\": \"Senior Developer\",\n\t\"comments\": \"Updated via API\"\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "{{base_url}}/users/{{user_id}}",
							"host": ["{{base_url}}"],
							"path": ["users", "{{user_id}}"]
						}
					}
				},
				{
					"name": "Delete User",
					"request": {
						"method": "DELETE",
						"header": [
							{
								"key": "x-api-key",
								"value": "{{api_key}}"
							}
						],
						"url": {
							"raw": "{{base_url}}/users/{{user_id}}",
							"host": ["{{base_url}}"],
							"path": ["users", "{{user_id}}"]
						}
					}
				}
			]
		},
		{
			"name": "Products",
			"item": [
				{
					"name": "Create Product",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "x-api-key",
								"value": "{{api_key}}"
							},
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n\t\"newlineid\": 1,\n\t\"statusid\": 1,\n\t\"productdescription\": \"New product description\",\n\t\"version\": \"1.0\",\n\t\"comments\": \"\"\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "{{base_url}}/products",
							"host": ["{{base_url}}"],
							"path": ["products"]
						}
					}
				},
				{
					"name": "Get Product",
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "x-api-key",
								"value": "{{api_key}}"
							}
						],
						"url": {
							"raw": "{{base_url}}/products/{{product_id}}",
							"host": ["{{base_url}}"],
							"path": ["products", "{{product_id}}"]
						}
					}
				},
				{
					"name": "Update Product",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "x-api-key",
								"value": "{{api_key}}"
							},
							{
								"key": "Content-Type",
								"value": "application/json"
							},
							{
								"key": "X-HTTP-Method-Override",
								"value": "PUT"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n\t\"productdescription\": \"Updated product description\",\n\t\"version\": \"1.1\",\n\t\"statusid\": 2,\n\t\"comments\": \"Updated via API\",\n\t\"weight\": 500,\n\t\"uom\": \"g\",\n\t\"shelflife\": 30,\n\t\"minlife\": 10,\n\t\"readytoeat\": 1\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "{{base_url}}/products/{{product_id}}",
							"host": ["{{base_url}}"],
							"path": ["products", "{{product_id}}"]
						}
					}
				},
				{
					"name": "Delete Product",
					"request": {
						"method": "DELETE",
						"header": [
							{
								"key": "x-api-key",
								"value": "{{api_key}}"
							}
						],
						"url": {
							"raw": "{{base_url}}/products/{{product_id}}",
							"host": ["{{base_url}}"],
							"path": ["products", "{{product_id}}"]
						}
					}
				}
			]
		},
		{
			"name": "Newlines",
			"item": [
				{
					"name": "Create Newline",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "x-api-key",
								"value": "{{api_key}}"
							},
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n\t\"companyid\": 2,\n\t\"siteid\": 2,\n\t\"productname\": \"New Product Name\",\n\t\"productcode\": \"PROD001\",\n\t\"description\": \"Product description\",\n\t\"producttype\": 1,\n\t\"category\": 1,\n\t\"alcoholic\": 0,\n\t\"cannedfish\": 0,\n\t\"cbd\": 0,\n\t\"chocolate\": 0,\n\t\"coffee\": 0,\n\t\"curedmeats\": 0,\n\t\"freshfish\": 0,\n\t\"freshfruit\": 0,\n\t\"freshmeat\": 0,\n\t\"honey\": 0,\n\t\"jam\": 0,\n\t\"oliveoil\": 0,\n\t\"smokedfish\": 0,\n\t\"supplements\": 0,\n\t\"cheese\": 0,\n\t\"fish\": 0,\n\t\"mcs\": null,\n\t\"buyer\": 4,\n\t\"buyercomments\": \"\"\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "{{base_url}}/newlines",
							"host": ["{{base_url}}"],
							"path": ["newlines"]
						}
					}
				},
				{
					"name": "Create Newline Bulk (Billy Test — ADMIN ONLY)",
					"request": {
						"method": "POST",
						"header": [
							{"key": "x-api-key", "value": "{{billy_api_key}}"},
							{"key": "Content-Type", "value": "application/json"}
						],
						"body": {
							"mode": "raw",
							"raw": "[\n\t{\n\t\t\"companyid\": 2,\n\t\t\"siteid\": 2,\n\t\t\"productname\": \"Billy Raw Organic Honey\",\n\t\t\"productcode\": \"BHON001\",\n\t\t\"description\": \"Raw organic wildflower honey, 340g jar\",\n\t\t\"producttype\": 1,\n\t\t\"category\": 2,\n\t\t\"alcoholic\": 0,\n\t\t\"cannedfish\": 0,\n\t\t\"cbd\": 0,\n\t\t\"chocolate\": 0,\n\t\t\"coffee\": 0,\n\t\t\"curedmeats\": 0,\n\t\t\"freshfish\": 0,\n\t\t\"freshfruit\": 0,\n\t\t\"freshmeat\": 0,\n\t\t\"honey\": 1,\n\t\t\"jam\": 0,\n\t\t\"oliveoil\": 0,\n\t\t\"smokedfish\": 0,\n\t\t\"supplements\": 0,\n\t\t\"cheese\": 0,\n\t\t\"fish\": 0,\n\t\t\"mcs\": null,\n\t\t\"buyer\": 4,\n\t\t\"buyercomments\": \"Billy bulk test - newline 1\"\n\t},\n\t{\n\t\t\"companyid\": 2,\n\t\t\"siteid\": 2,\n\t\t\"productname\": \"Billy Dark Chocolate Bar\",\n\t\t\"productcode\": \"BCHOC001\",\n\t\t\"description\": \"70% dark chocolate bar, 100g\",\n\t\t\"producttype\": 1,\n\t\t\"category\": 2,\n\t\t\"alcoholic\": 0,\n\t\t\"cannedfish\": 0,\n\t\t\"cbd\": 0,\n\t\t\"chocolate\": 1,\n\t\t\"coffee\": 0,\n\t\t\"curedmeats\": 0,\n\t\t\"freshfish\": 0,\n\t\t\"freshfruit\": 0,\n\t\t\"freshmeat\": 0,\n\t\t\"honey\": 0,\n\t\t\"jam\": 0,\n\t\t\"oliveoil\": 0,\n\t\t\"smokedfish\": 0,\n\t\t\"supplements\": 0,\n\t\t\"cheese\": 0,\n\t\t\"fish\": 0,\n\t\t\"mcs\": null,\n\t\t\"buyer\": 4,\n\t\t\"buyercomments\": \"Billy bulk test - newline 2\"\n\t}\n]",
							"options": {"raw": {"language": "json"}}
						},
						"url": {
							"raw": "{{base_url}}/newlines/createNewlineBulk",
							"host": ["{{base_url}}"],
							"path": ["newlines", "createNewlineBulk"]
						}
					}
				},
				{
					"name": "Create Newline Bulk",
					"request": {
						"method": "POST",
						"header": [
							{"key": "x-api-key", "value": "{{api_key}}"},
							{"key": "Content-Type", "value": "application/json"}
						],
						"body": {
							"mode": "raw",
							"raw": "[\n\t{\n\t\t\"companyid\": 2,\n\t\t\"siteid\": 2,\n\t\t\"productname\": \"Organic Honey\",\n\t\t\"productcode\": \"HON001\",\n\t\t\"description\": \"Pure organic honeydew\",\n\t\t\"honey\": 1,\n\t\t\"buyer\": 4,\n\t\t\"buyercomments\": \"\"\n\t}\n]",
							"options": {"raw": {"language": "json"}}
						},
						"url": {
							"raw": "{{base_url}}/newlines/createNewlineBulk",
							"host": ["{{base_url}}"],
							"path": ["newlines", "createNewlineBulk"]
						}
					}
				},
				{
					"name": "Get Newline",
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "x-api-key",
								"value": "{{api_key}}"
							}
						],
						"url": {
							"raw": "{{base_url}}/newlines/{{newline_id}}",
							"host": ["{{base_url}}"],
							"path": ["newlines", "{{newline_id}}"]
						}
					}
				},
				{
					"name": "Update Newline",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "x-api-key",
								"value": "{{api_key}}"
							},
							{
								"key": "Content-Type",
								"value": "application/json"
							},
							{
								"key": "X-HTTP-Method-Override",
								"value": "PUT"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n\t\"productname\": \"Updated Product Name\",\n\t\"productcode\": \"PROD001-V2\",\n\t\"description\": \"Updated description\",\n\t\"producttype\": 1,\n\t\"category\": 1,\n\t\"alcoholic\": 0,\n\t\"cannedfish\": 0,\n\t\"cbd\": 0,\n\t\"chocolate\": 0,\n\t\"coffee\": 0,\n\t\"curedmeats\": 0,\n\t\"freshfish\": 0,\n\t\"freshfruit\": 0,\n\t\"freshmeat\": 0,\n\t\"honey\": 0,\n\t\"jam\": 0,\n\t\"oliveoil\": 0,\n\t\"smokedfish\": 0,\n\t\"supplements\": 0,\n\t\"cheese\": 0,\n\t\"fish\": 0,\n\t\"mcs\": 0,\n\t\"buyer\": 4,\n\t\"buyercomments\": \"Reviewed\",\n\t\"isactive\": 1\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "{{base_url}}/newlines/{{newline_id}}",
							"host": ["{{base_url}}"],
							"path": ["newlines", "{{newline_id}}"]
						}
					}
				},
				{
					"name": "Delete Newline",
					"request": {
						"method": "DELETE",
						"header": [
							{
								"key": "x-api-key",
								"value": "{{api_key}}"
							}
						],
						"url": {
							"raw": "{{base_url}}/newlines/{{newline_id}}",
							"host": ["{{base_url}}"],
							"path": ["newlines", "{{newline_id}}"]
						}
					}
				}
			]
		},
		{
			"name": "Suppliers",
			"item": [
				{
					"name": "Create Supplier",
					"request": {
						"method": "POST",
						"header": [
							{"key": "x-api-key", "value": "{{api_key}}"},
							{"key": "Content-Type", "value": "application/json"}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n\t\"companyname\": \"Acme Foods Ltd\",\n\t\"address1\": \"1 High Street\",\n\t\"address2\": \"\",\n\t\"address3\": \"\",\n\t\"city\": \"London\",\n\t\"postcode\": \"EC1A 1BB\",\n\t\"country\": 1,\n\t\"techcontactname\": \"Jane Smith\",\n\t\"techcontactemail\": \"jane.tech@acmefoods.co.uk\",\n\t\"techmobileno\": \"+44 7700 900001\",\n\t\"tracealluserfirstname\": \"John\",\n\t\"traceallusersurname\": \"Smith\",\n\t\"tracealluseremail\": \"john.smith@acmefoods.co.uk\",\n\t\"traceallusermobileno\": \"+44 7700 900001\",\n\t\"comcontactname\": \"Bob Jones\",\n\t\"comcontactemail\": \"bob.com@acmefoods.co.uk\",\n\t\"commobileno\": \"+44 7700 900002\",\n\t\"supplier_type\": 1,\n\t\"risk\": 1,\n\t\"comments\": \"\"\n}",
							"options": {"raw": {"language": "json"}}
						},
						"url": {
							"raw": "{{base_url}}/suppliers",
							"host": ["{{base_url}}"],
							"path": ["suppliers"]
						}
					}
				},
				{
					"name": "Create Supplier Bulk (Billy Test — ADMIN ONLY)",
					"request": {
						"method": "POST",
						"header": [
							{"key": "x-api-key", "value": "{{billy_api_key}}"},
							{"key": "Content-Type", "value": "application/json"}
						],
						"body": {
							"mode": "raw",
							"raw": "[\n\t{\n\t\t\"companyname\": \"Billy One Supplies Ltd\",\n\t\t\"address1\": \"1 Billy Lane\",\n\t\t\"address2\": \"\",\n\t\t\"address3\": \"\",\n\t\t\"city\": \"Leeds\",\n\t\t\"postcode\": \"LS1 1AA\",\n\t\t\"country\": 1,\n\t\t\"techcontactname\": \"Billy One\",\n\t\t\"techcontactemail\": \"billy1.tech@billyone.co.uk\",\n\t\t\"techmobileno\": \"+44 7700 200001\",\n\t\t\"tracealluserfirstname\": \"Billy\",\n\t\t\"traceallusersurname\": \"One\",\n\t\t\"tracealluseremail\": \"billy1@billyone.co.uk\",\n\t\t\"traceallusermobileno\": \"+44 7700 200001\",\n\t\t\"comcontactname\": \"Billy One Com\",\n\t\t\"comcontactemail\": \"billy1.com@billyone.co.uk\",\n\t\t\"commobileno\": \"+44 7700 200002\",\n\t\t\"supplier_type\": 1,\n\t\t\"risk\": 1,\n\t\t\"comments\": \"Billy 1 test supplier\"\n\t},\n\t{\n\t\t\"companyname\": \"Billy Two Supplies Ltd\",\n\t\t\"address1\": \"2 Billy Lane\",\n\t\t\"address2\": \"\",\n\t\t\"address3\": \"\",\n\t\t\"city\": \"Sheffield\",\n\t\t\"postcode\": \"S1 2BB\",\n\t\t\"country\": 1,\n\t\t\"techcontactname\": \"Billy Two\",\n\t\t\"techcontactemail\": \"billy2.tech@billytwo.co.uk\",\n\t\t\"techmobileno\": \"+44 7700 200003\",\n\t\t\"tracealluserfirstname\": \"Billy\",\n\t\t\"traceallusersurname\": \"Two\",\n\t\t\"tracealluseremail\": \"billy2@billytwo.co.uk\",\n\t\t\"traceallusermobileno\": \"+44 7700 200003\",\n\t\t\"comcontactname\": \"Billy Two Com\",\n\t\t\"comcontactemail\": \"billy2.com@billytwo.co.uk\",\n\t\t\"commobileno\": \"+44 7700 200004\",\n\t\t\"supplier_type\": 1,\n\t\t\"risk\": 2,\n\t\t\"comments\": \"Billy 2 test supplier\"\n\t},\n\t{\n\t\t\"companyname\": \"Billy Three Supplies Ltd\",\n\t\t\"address1\": \"3 Billy Lane\",\n\t\t\"address2\": \"\",\n\t\t\"address3\": \"\",\n\t\t\"city\": \"Liverpool\",\n\t\t\"postcode\": \"L1 3CC\",\n\t\t\"country\": 1,\n\t\t\"techcontactname\": \"Billy Three\",\n\t\t\"techcontactemail\": \"billy3.tech@billythree.co.uk\",\n\t\t\"techmobileno\": \"+44 7700 200005\",\n\t\t\"tracealluserfirstname\": \"Billy\",\n\t\t\"traceallusersurname\": \"Three\",\n\t\t\"tracealluseremail\": \"billy3@billythree.co.uk\",\n\t\t\"traceallusermobileno\": \"+44 7700 200005\",\n\t\t\"comcontactname\": \"Billy Three Com\",\n\t\t\"comcontactemail\": \"billy3.com@billythree.co.uk\",\n\t\t\"commobileno\": \"+44 7700 200006\",\n\t\t\"supplier_type\": 2,\n\t\t\"risk\": 1,\n\t\t\"comments\": \"Billy 3 test supplier\"\n\t}\n]",
							"options": {"raw": {"language": "json"}}
						},
						"url": {
							"raw": "{{base_url}}/suppliers/createSupplierBulk",
							"host": ["{{base_url}}"],
							"path": ["suppliers", "createSupplierBulk"]
						}
					}
				},
				{
					"name": "Create Supplier Bulk",
					"request": {
						"method": "POST",
						"header": [
							{"key": "x-api-key", "value": "{{api_key}}"},
							{"key": "Content-Type", "value": "application/json"}
						],
						"body": {
							"mode": "raw",
							"raw": "[\n\t{\n\t\t\"companyname\": \"Acme Foods Ltd\",\n\t\t\"address1\": \"1 High Street\",\n\t\t\"address2\": \"\",\n\t\t\"address3\": \"\",\n\t\t\"city\": \"London\",\n\t\t\"postcode\": \"EC1A 1BB\",\n\t\t\"country\": 1,\n\t\t\"techcontactname\": \"Jane Smith\",\n\t\t\"techcontactemail\": \"jane.tech@acmefoods.co.uk\",\n\t\t\"techmobileno\": \"+44 7700 900001\",\n\t\t\"tracealluserfirstname\": \"John\",\n\t\t\"traceallusersurname\": \"Smith\",\n\t\t\"tracealluseremail\": \"john.smith@acmefoods.co.uk\",\n\t\t\"traceallusermobileno\": \"+44 7700 900001\",\n\t\t\"comcontactname\": \"Bob Jones\",\n\t\t\"comcontactemail\": \"bob.com@acmefoods.co.uk\",\n\t\t\"commobileno\": \"+44 7700 900002\",\n\t\t\"supplier_type\": 1,\n\t\t\"risk\": 1,\n\t\t\"comments\": \"\"\n\t}\n]",
							"options": {"raw": {"language": "json"}}
						},
						"url": {
							"raw": "{{base_url}}/suppliers/createSupplierBulk",
							"host": ["{{base_url}}"],
							"path": ["suppliers", "createSupplierBulk"]
						}
					}
				},
				{
					"name": "Get Supplier",
					"request": {
						"method": "GET",
						"header": [{"key": "x-api-key", "value": "{{api_key}}"}],
						"url": {
							"raw": "{{base_url}}/suppliers/{{supplier_id}}",
							"host": ["{{base_url}}"],
							"path": ["suppliers", "{{supplier_id}}"]
						}
					}
				},
				{
					"name": "Update Supplier",
					"request": {
						"method": "POST",
						"header": [
							{"key": "x-api-key", "value": "{{api_key}}"},
							{"key": "Content-Type", "value": "application/json"},
							{"key": "X-HTTP-Method-Override", "value": "PUT"}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n\t\"companyname\": \"Acme Foods Ltd Updated\",\n\t\"city\": \"Manchester\",\n\t\"postcode\": \"M1 1AA\"\n}",
							"options": {"raw": {"language": "json"}}
						},
						"url": {
							"raw": "{{base_url}}/suppliers/{{supplier_id}}",
							"host": ["{{base_url}}"],
							"path": ["suppliers", "{{supplier_id}}"]
						}
					}
				},
				{
					"name": "Delete Supplier",
					"request": {
						"method": "DELETE",
						"header": [{"key": "x-api-key", "value": "{{api_key}}"}],
						"url": {
							"raw": "{{base_url}}/suppliers/{{supplier_id}}",
							"host": ["{{base_url}}"],
							"path": ["suppliers", "{{supplier_id}}"]
						}
					}
				}
			]
		}
	]
}
