{
	"info": {
		"_postman_id": "ruxr-api-collection",
		"name": "Ruxr API",
		"description": "API collection for the Ruxr application backend.",
		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
	},
	"item": [
		{
			"name": "User Registration",
			"request": {
				"method": "POST",
				"header": [],
				"body": {
					"mode": "raw",
					"raw": "{\n    \"username\": \"johndoe99\",\n    \"email\": \"johndoe@example.com\",\n    \"password\": \"secret123\",\n    \"confirm_password\": \"secret123\"\n}",
					"options": {
						"raw": {
							"language": "json"
						}
					}
				},
				"url": {
					"raw": "{{base_url}}/register.php",
					"host": [
						"{{base_url}}"
					],
					"path": [
						"register.php"
					]
				}
			},
			"response": [
				{
					"name": "Success (201 Created)",
					"originalRequest": {
						"method": "POST",
						"header": [],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"username\": \"johndoe99\",\n    \"email\": \"johndoe@example.com\",\n    \"password\": \"secret123\",\n    \"confirm_password\": \"secret123\"\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "{{base_url}}/register.php",
							"host": [
								"{{base_url}}"
							],
							"path": [
								"register.php"
							]
						}
					},
					"status": "Created",
					"code": 201,
					"_postman_previewlanguage": "json",
					"header": [
						{
							"key": "Content-Type",
							"value": "application/json; charset=UTF-8"
						}
					],
					"cookie": [],
					"body": "{\n    \"message\": \"User was created.\",\n    \"customer_id\": \"RUXR-A1B2C3D4E5\"\n}"
				},
				{
					"name": "Error (400 Bad Request - Missing Data)",
					"originalRequest": {
						"method": "POST",
						"header": [],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"username\": \"johndoe99\"\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "{{base_url}}/register.php",
							"host": [
								"{{base_url}}"
							],
							"path": [
								"register.php"
							]
						}
					},
					"status": "Bad Request",
					"code": 400,
					"_postman_previewlanguage": "json",
					"header": [
						{
							"key": "Content-Type",
							"value": "application/json; charset=UTF-8"
						}
					],
					"cookie": [],
					"body": "{\n    \"message\": \"Incomplete data. Please provide username, email, password, and confirm_password.\"\n}"
				},
				{
					"name": "Error (400 Bad Request - Duplicate User/Email)",
					"originalRequest": {
						"method": "POST",
						"header": [],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"username\": \"existing_user\",\n    \"email\": \"existing@example.com\",\n    \"password\": \"secret123\",\n    \"confirm_password\": \"secret123\"\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "{{base_url}}/register.php",
							"host": [
								"{{base_url}}"
							],
							"path": [
								"register.php"
							]
						}
					},
					"status": "Bad Request",
					"code": 400,
					"_postman_previewlanguage": "json",
					"header": [
						{
							"key": "Content-Type",
							"value": "application/json; charset=UTF-8"
						}
					],
					"cookie": [],
					"body": "{\n    \"message\": \"Email or Username already exists.\"\n}"
				}
			]
		},
		{
			"name": "User Login",
			"request": {
				"method": "POST",
				"header": [],
				"body": {
					"mode": "raw",
					"raw": "{\n    \"email\": \"johndoe@example.com\",\n    \"password\": \"secret123\"\n}",
					"options": {
						"raw": {
							"language": "json"
						}
					}
				},
				"url": {
					"raw": "{{base_url}}/login.php",
					"host": [
						"{{base_url}}"
					],
					"path": [
						"login.php"
					]
				}
			},
			"response": [
				{
					"name": "Success (200 OK)",
					"originalRequest": {
						"method": "POST",
						"header": [],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"email\": \"johndoe@example.com\",\n    \"password\": \"secret123\"\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "{{base_url}}/login.php",
							"host": [
								"{{base_url}}"
							],
							"path": [
								"login.php"
							]
						}
					},
					"status": "OK",
					"code": 200,
					"_postman_previewlanguage": "json",
					"header": [
						{
							"key": "Content-Type",
							"value": "application/json; charset=UTF-8"
						}
					],
					"cookie": [
                        {
                            "name": "PHPSESSID",
                            "value": "abcdef1234567890",
                            "domain": "api.teesamempire.uk",
                            "path": "/",
                            "httpOnly": true
                        }
                    ],
					"body": "{\n    \"message\": \"Login successful.\",\n    \"data\": {\n        \"customer_id\": \"RUXR-A1B2C3D4E5\",\n        \"username\": \"johndoe99\",\n        \"email\": \"johndoe@example.com\",\n        \"full_name\": null,\n        \"fname\": null,\n        \"lname\": null,\n        \"shopname\": null,\n        \"country_code\": null,\n        \"phone_number\": null,\n        \"address\": null,\n        \"city\": null,\n        \"state\": null,\n        \"zip_code\": null,\n        \"created_at\": \"2026-03-14 12:00:00\"\n    }\n}"
				},
				{
					"name": "Error (401 Unauthorized - Invalid Password)",
					"originalRequest": {
						"method": "POST",
						"header": [],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"email\": \"johndoe@example.com\",\n    \"password\": \"wrongpassword\"\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "{{base_url}}/login.php",
							"host": [
								"{{base_url}}"
							],
							"path": [
								"login.php"
							]
						}
					},
					"status": "Unauthorized",
					"code": 401,
					"_postman_previewlanguage": "json",
					"header": [
						{
							"key": "Content-Type",
							"value": "application/json; charset=UTF-8"
						}
					],
					"cookie": [],
					"body": "{\n    \"message\": \"Invalid password.\"\n}"
				},
				{
					"name": "Error (401 Unauthorized - User Not Found)",
					"originalRequest": {
						"method": "POST",
						"header": [],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"email\": \"nonexistent@example.com\",\n    \"password\": \"secret123\"\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "{{base_url}}/login.php",
							"host": [
								"{{base_url}}"
							],
							"path": [
								"login.php"
							]
						}
					},
					"status": "Unauthorized",
					"code": 401,
					"_postman_previewlanguage": "json",
					"header": [
						{
							"key": "Content-Type",
							"value": "application/json; charset=UTF-8"
						}
					],
					"cookie": [],
					"body": "{\n    \"message\": \"User not found.\"\n}"
				}
			]
		},
        {
			"name": "Edit Profile (Requires Login Session)",
			"request": {
				"method": "POST",
				"header": [],
				"body": {
					"mode": "raw",
					"raw": "{\n    \"fname\": \"John\",\n    \"lname\": \"Doe\",\n    \"shopname\": \"John's Vintage\",\n    \"country_code\": \"+44\",\n    \"phone_number\": \"1234567890\",\n    \"address\": \"123 High Street\"\n}",
					"options": {
						"raw": {
							"language": "json"
						}
					}
				},
				"url": {
					"raw": "{{base_url}}/edit-profile.php",
					"host": [
						"{{base_url}}"
					],
					"path": [
						"edit-profile.php"
					]
				}
			},
			"response": [
                {
					"name": "Success (200 OK)",
					"originalRequest": {
						"method": "POST",
						"header": [],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"fname\": \"John\",\n    \"lname\": \"Doe\",\n    \"shopname\": \"John's Vintage\",\n    \"country_code\": \"+44\",\n    \"phone_number\": \"1234567890\",\n    \"address\": \"123 High Street\"\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "{{base_url}}/edit-profile.php",
							"host": [
								"{{base_url}}"
							],
							"path": [
								"edit-profile.php"
							]
						}
					},
					"status": "OK",
					"code": 200,
					"_postman_previewlanguage": "json",
					"header": [
						{
							"key": "Content-Type",
							"value": "application/json; charset=UTF-8"
						}
					],
					"cookie": [],
					"body": "{\n    \"message\": \"Profile updated successfully.\"\n}"
				},
                {
					"name": "Error (401 Unauthorized - No session)",
					"originalRequest": {
						"method": "POST",
						"header": [],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"fname\": \"John\"\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "{{base_url}}/edit-profile.php",
							"host": [
								"{{base_url}}"
							],
							"path": [
								"edit-profile.php"
							]
						}
					},
					"status": "Unauthorized",
					"code": 401,
					"_postman_previewlanguage": "json",
					"header": [
						{
							"key": "Content-Type",
							"value": "application/json; charset=UTF-8"
						}
					],
					"cookie": [],
					"body": "{\n    \"message\": \"Unauthorized. Please login to edit profile.\"\n}"
				}
            ]
		},
        {
			"name": "Upload Item (FormData - Requires Login Session)",
			"request": {
				"method": "POST",
				"header": [],
				"body": {
					"mode": "formdata",
					"formdata": [
						{
							"key": "title",
							"value": "Vintage Leather Jacket",
							"type": "text"
						},
						{
							"key": "category",
							"value": "Outerwear",
							"type": "text"
						},
						{
							"key": "price",
							"value": "120.50",
							"type": "text"
						},
						{
							"key": "item_condition",
							"value": "Good",
							"type": "text"
						},
						{
							"key": "shipping",
							"value": "Standard £5",
							"type": "text"
						},
						{
							"key": "description",
							"value": "A beautiful vintage leather jacket in great condition.",
							"type": "text"
						},
						{
							"key": "images[]",
							"type": "file",
							"src": []
						},
                        {
							"key": "images[]",
							"type": "file",
							"src": []
						}
					]
				},
				"url": {
					"raw": "{{base_url}}/upload-item.php",
					"host": [
						"{{base_url}}"
					],
					"path": [
						"upload-item.php"
					]
				}
			},
			"response": [
                {
					"name": "Success (201 Created)",
					"originalRequest": {
						"method": "POST",
						"header": [],
						"body": {
							"mode": "formdata",
							"formdata": [
                                {
                                    "key": "title",
                                    "value": "Vintage Leather Jacket",
                                    "type": "text"
                                },
                                {
                                    "key": "category",
                                    "value": "Outerwear",
                                    "type": "text"
                                },
                                {
                                    "key": "price",
                                    "value": "120.50",
                                    "type": "text"
                                },
                                {
                                    "key": "item_condition",
                                    "value": "Good",
                                    "type": "text"
                                },
                                {
                                    "key": "shipping",
                                    "value": "Standard £5",
                                    "type": "text"
                                },
                                {
                                    "key": "description",
                                    "value": "A beautiful vintage leather jacket.",
                                    "type": "text"
                                },
                                {
                                    "key": "images[]",
                                    "type": "file",
                                    "src": []
                                }
                            ]
						},
						"url": {
							"raw": "{{base_url}}/upload-item.php",
							"host": [
								"{{base_url}}"
							],
							"path": [
								"upload-item.php"
							]
						}
					},
					"status": "Created",
					"code": 201,
					"_postman_previewlanguage": "json",
					"header": [
						{
							"key": "Content-Type",
							"value": "application/json; charset=UTF-8"
						}
					],
					"cookie": [],
					"body": "{\n    \"message\": \"Item uploaded successfully.\",\n    \"item_id\": \"ITEM-A1B2C3D4E5F6\",\n    \"images_saved\": 1\n}"
				},
                {
					"name": "Error (401 Unauthorized - No session)",
					"originalRequest": {
						"method": "POST",
						"header": [],
						"body": {
							"mode": "formdata",
							"formdata": [
                                {
                                    "key": "title",
                                    "value": "Vintage Leather Jacket",
                                    "type": "text"
                                }
                            ]
						},
						"url": {
							"raw": "{{base_url}}/upload-item.php",
							"host": [
								"{{base_url}}"
							],
							"path": [
								"upload-item.php"
							]
						}
					},
					"status": "Unauthorized",
					"code": 401,
					"_postman_previewlanguage": "json",
					"header": [
						{
							"key": "Content-Type",
							"value": "application/json; charset=UTF-8"
						}
					],
					"cookie": [],
					"body": "{\n    \"message\": \"Unauthorized. Please login to upload an item.\"\n}"
				}
            ]
		}
	],
	"variable": [
		{
			"key": "base_url",
			"value": "https://api.teesamempire.uk/api",
			"type": "string"
		}
	]
}