{
	"info": {
		"_postman_id": "9b739797-6069-48d6-ba9b-6868667bee61",
		"name": "Poleepo REST API",
		"description": "Welcome to the Poleepo API documentation. Our REST API allows you to integrate your services with Poleepo, accessing its core features to manage products, listings, and orders.  \n  \nWith the Poleepo API, you can:\n\n- Manage your product catalog (create, update, and delete products in Poleepo)\n    \n- Manage your online listings (adjust prices, handle times, and shipping costs)\n    \n- Manage your orders (retrieve orders imported from your sales channels, update order statuses, send tracking information, and download carrier labels in PDF format)\n    \n\nWe are constantly expanding the API's capabilities to help you automate repetitive tasks and grow your business.\n\nOur Postman collection is pre-configured to use a variable for authentication. You just need to set it up once.\n\n1. Go to the Variables tab.\n    \n2. In the row for the `api_client_id` variable, paste the public key you generated in the **Value** field.\n    \n3. In the row for the `api_client_secret` variable, paste the secret key you generated in the **Value** field.\n    \n4. Save the changes\n    \n\nNow, every request in the collection will be automatically authenticated.",
		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
		"_exporter_id": "27514428"
	},
	"item": [
		{
			"name": "Authentication",
			"item": [
				{
					"name": "Retrieve Access Token",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"pm.collectionVariables.set(\"api_access_token\", pm.response.json().data.access_token);",
									"pm.collectionVariables.set(\"api_refresh_token\", pm.response.json().data.refresh_token);",
									"pm.collectionVariables.set(\"api_access_token_expiration\", new Date().getTime() + (pm.response.json().data.refresh_token * 1000));"
								],
								"type": "text/javascript",
								"packages": {},
								"requests": {}
							}
						}
					],
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "X-FE-NODE",
								"value": "gtw-1"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\r\n    \"client_id\": \"{{api_client_id}}\",\r\n    \"client_secret\": \"{{api_client_secret}}\",\r\n    \"grant\": \"client_credentials\"\r\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "{{api_url}}/oauth/access_token",
							"host": [
								"{{api_url}}"
							],
							"path": [
								"oauth",
								"access_token"
							]
						}
					},
					"response": []
				},
				{
					"name": "Refresh Access Token",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"pm.collectionVariables.set(\"api_access_token\", pm.response.json().data.access_token);",
									"pm.collectionVariables.set(\"api_refresh_token\", pm.response.json().data.refresh_token);",
									"pm.collectionVariables.set(\"api_access_token_expiration\", new Date().getTime() + (pm.response.json().data.refresh_token * 1000));"
								],
								"type": "text/javascript",
								"packages": {},
								"requests": {}
							}
						}
					],
					"request": {
						"method": "POST",
						"header": [],
						"body": {
							"mode": "raw",
							"raw": "{\r\n    \"client_id\": \"{{api_client_id}}\",\r\n    \"refresh_token\": \"{{api_refresh_token}}\",\r\n    \"grant\": \"refresh_token\"\r\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "{{api_url}}/oauth/access_token",
							"host": [
								"{{api_url}}"
							],
							"path": [
								"oauth",
								"access_token"
							]
						}
					},
					"response": []
				}
			]
		},
		{
			"name": "Orders",
			"item": [
				{
					"name": "Change Order Status",
					"event": [
						{
							"listen": "prerequest",
							"script": {
								"exec": [
									"let apiUrl = pm.collectionVariables.get(\"api_url\");",
									"let clientId = pm.collectionVariables.get(\"api_client_id\");",
									"let clientSecret = pm.collectionVariables.get(\"api_client_secret\");",
									"let accessToken = pm.collectionVariables.get(\"api_access_token\");",
									"let accessTokenExpiration = pm.collectionVariables.get(\"api_access_token_expiration\");",
									"let refreshToken = pm.collectionVariables.get(\"api_refresh_token\");",
									"",
									"/* if there is the access_token but is expired or if therein't the access_token but the there is a refresh_token */",
									"if(refreshToken != null && refreshToken != \"\" && (",
									"    (accessToken != null && accessToken !== \"\" && accessTokenExpiration <= new Date().getTime()) ||",
									"    (accessToken == null && accessToken === \"\" && refreshToken != null && refreshToken != \"\"))",
									"    ) {",
									"    /* refresh the access_token */",
									"    pm.sendRequest(",
									"        {",
									"            method: \"POST\",",
									"            url: apiUrl + \"/oauth/access_token\",",
									"            header: \"Content-Type:application/json\",",
									"            body: '{\"client_id\": \"' + clientId + '\", \"refresh_token\": \"' + refreshToken + '\", \"grant\": \"refresh_token\"}'",
									"        }, ",
									"        function (err, response) {",
									"            let resp = response.json();",
									"            if(resp.success) {",
									"                pm.collectionVariables.set(\"api_access_token\", resp.data.access_token);",
									"                pm.collectionVariables.set(\"api_refresh_token\", resp.data.refresh_token);",
									"                pm.collectionVariables.set(\"api_access_token_expiration\", new Date().getTime() + (resp.data.duration * 1000));",
									"            }",
									"        }",
									"    );",
									"}",
									"",
									"/* if no refresh_token, authenticate */",
									"if(refreshToken == null || refreshToken === \"\") {",
									"    pm.sendRequest(",
									"        {",
									"            method: \"POST\",",
									"            url: apiUrl + \"/oauth/access_token\",",
									"            header: \"Content-Type:application/json\",",
									"            body: '{\"client_id\": \"' + clientId + '\", \"client_secret\": \"' + clientSecret + '\", \"grant\": \"client_credentials\"}'",
									"        }, ",
									"        function (err, response) {",
									"            let resp = response.json()",
									"            if(resp.success) {",
									"                pm.collectionVariables.set(\"api_access_token\", resp.data.access_token);",
									"                pm.collectionVariables.set(\"api_refresh_token\", resp.data.refresh_token);",
									"                pm.collectionVariables.set(\"api_access_token_expiration\", new Date().getTime() + (resp.data.duration * 1000));",
									"            }",
									"        }",
									"    );",
									"}"
								],
								"type": "text/javascript",
								"packages": {},
								"requests": {}
							}
						}
					],
					"request": {
						"method": "PUT",
						"header": [],
						"body": {
							"mode": "raw",
							"raw": "{\r\n    \"status\": \"PAYMENT_ERROR\",\r\n    \"note\": \"Customer Payment fails\"\r\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "{{api_url}}/orders/:id/status",
							"host": [
								"{{api_url}}"
							],
							"path": [
								"orders",
								":id",
								"status"
							],
							"variable": [
								{
									"key": "id",
									"value": "",
									"description": "Identifier of the order"
								}
							]
						}
					},
					"response": []
				},
				{
					"name": "Create New Order",
					"event": [
						{
							"listen": "prerequest",
							"script": {
								"exec": [
									"let apiUrl = pm.collectionVariables.get(\"api_url\");",
									"let clientId = pm.collectionVariables.get(\"api_client_id\");",
									"let clientSecret = pm.collectionVariables.get(\"api_client_secret\");",
									"let accessToken = pm.collectionVariables.get(\"api_access_token\");",
									"let accessTokenExpiration = pm.collectionVariables.get(\"api_access_token_expiration\");",
									"let refreshToken = pm.collectionVariables.get(\"api_refresh_token\");",
									"",
									"/* if there is the access_token but is expired or if therein't the access_token but the there is a refresh_token */",
									"if(refreshToken != null && refreshToken != \"\" && (",
									"    (accessToken != null && accessToken !== \"\" && accessTokenExpiration <= new Date().getTime()) ||",
									"    (accessToken == null && accessToken === \"\" && refreshToken != null && refreshToken != \"\"))",
									"    ) {",
									"    /* refresh the access_token */",
									"    pm.sendRequest(",
									"        {",
									"            method: \"POST\",",
									"            url: apiUrl + \"/oauth/access_token\",",
									"            header: \"Content-Type:application/json\",",
									"            body: '{\"client_id\": \"' + clientId + '\", \"refresh_token\": \"' + refreshToken + '\", \"grant\": \"refresh_token\"}'",
									"        }, ",
									"        function (err, response) {",
									"            let resp = response.json();",
									"            if(resp.success) {",
									"                pm.collectionVariables.set(\"api_access_token\", resp.data.access_token);",
									"                pm.collectionVariables.set(\"api_refresh_token\", resp.data.refresh_token);",
									"                pm.collectionVariables.set(\"api_access_token_expiration\", new Date().getTime() + (resp.data.duration * 1000));",
									"            }",
									"        }",
									"    );",
									"}",
									"",
									"/* if no refresh_token, authenticate */",
									"if(refreshToken == null || refreshToken === \"\") {",
									"    pm.sendRequest(",
									"        {",
									"            method: \"POST\",",
									"            url: apiUrl + \"/oauth/access_token\",",
									"            header: \"Content-Type:application/json\",",
									"            body: '{\"client_id\": \"' + clientId + '\", \"client_secret\": \"' + clientSecret + '\", \"grant\": \"client_credentials\"}'",
									"        }, ",
									"        function (err, response) {",
									"            let resp = response.json()",
									"            if(resp.success) {",
									"                pm.collectionVariables.set(\"api_access_token\", resp.data.access_token);",
									"                pm.collectionVariables.set(\"api_refresh_token\", resp.data.refresh_token);",
									"                pm.collectionVariables.set(\"api_access_token_expiration\", new Date().getTime() + (resp.data.duration * 1000));",
									"            }",
									"        }",
									"    );",
									"}"
								],
								"type": "text/javascript",
								"packages": {},
								"requests": {}
							}
						}
					],
					"request": {
						"method": "POST",
						"header": [],
						"body": {
							"mode": "raw",
							"raw": "{\r\n    \"reference_id\": \"poleepo-postman-1\",\r\n    \"source\": \"GENERIC\",\r\n    \"source_description\": \"Poleepo Postman\",\r\n    \"status\": \"READY_TO_SHIP\",\r\n    \"creation_date\": \"2023-02-17T13:00:00Z\",\r\n    \"total_price\": \"5690\",\r\n    \"cod\": true,\r\n    \"cod_price\": 5.00,\r\n    \"shipped\": false,\r\n    \"shippings\": [],\r\n    \"customer\": {\r\n        \"id\": \"1234\",\r\n        \"firstname\": \"Poleepo\",\r\n        \"lastname\": \"Postman\",\r\n        \"email\": \"postman@poleepo.cloud\",\r\n        \"phones\": [\r\n            \"3334455666\"\r\n        ]\r\n    },\r\n    \"delivery_address\": {\r\n        \"address\": \"Via Roma 1\",\r\n        \"state_iso\": \"RM\",\r\n        \"country_iso\": \"IT\",\r\n        \"postcode\": \"00000\",\r\n        \"city\": \"Roma\"\r\n    },\r\n    \"invoice_address\": {\r\n        \"address\": \"Via Roma 1\",\r\n        \"state_iso\": \"RM\",\r\n        \"country_iso\": \"IT\",\r\n        \"postcode\": \"00000\",\r\n        \"city\": \"Roma\"\r\n    },\r\n    \"rows\": [\r\n        {\r\n            \"source_row_id\": \"poleepo-postman-1-1\",\r\n            \"description\": \"Poleepo Postman product 1\",\r\n            \"quantity\": \"1\",\r\n            \"vat_rate\": 22,\r\n            \"unit_price\": 5690,\r\n            \"total_price\": 5690,\r\n            \"item\": {\r\n                \"title\": \"Poleepo Postman product 1\",\r\n                \"sku\": \"PLP-PT-1-1\",\r\n                \"ean\": \"\",\r\n                \"deposit\": \"\",\r\n                \"area\": \"\",\r\n                \"shelf\": \"\",\r\n                \"plan\": \"\",\r\n                \"weight\": null,\r\n                \"width\": null,\r\n                \"height\": null,\r\n                \"depth\": null\r\n            },\r\n            \"fulfillments\": [\r\n                {\r\n                    \"supplier_id\": 0,\r\n                    \"quantity\": 1\r\n                }\r\n            ]\r\n        }\r\n    ]\r\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "{{api_url}}/orders",
							"host": [
								"{{api_url}}"
							],
							"path": [
								"orders"
							]
						}
					},
					"response": []
				},
				{
					"name": "Create Order Note",
					"event": [
						{
							"listen": "prerequest",
							"script": {
								"exec": [
									"let apiUrl = pm.collectionVariables.get(\"api_url\");",
									"let clientId = pm.collectionVariables.get(\"api_client_id\");",
									"let clientSecret = pm.collectionVariables.get(\"api_client_secret\");",
									"let accessToken = pm.collectionVariables.get(\"api_access_token\");",
									"let accessTokenExpiration = pm.collectionVariables.get(\"api_access_token_expiration\");",
									"let refreshToken = pm.collectionVariables.get(\"api_refresh_token\");",
									"",
									"/* if there is the access_token but is expired or if therein't the access_token but the there is a refresh_token */",
									"if(refreshToken != null && refreshToken != \"\" && (",
									"    (accessToken != null && accessToken !== \"\" && accessTokenExpiration <= new Date().getTime()) ||",
									"    (accessToken == null && accessToken === \"\" && refreshToken != null && refreshToken != \"\"))",
									"    ) {",
									"    /* refresh the access_token */",
									"    pm.sendRequest(",
									"        {",
									"            method: \"POST\",",
									"            url: apiUrl + \"/oauth/access_token\",",
									"            header: \"Content-Type:application/json\",",
									"            body: '{\"client_id\": \"' + clientId + '\", \"refresh_token\": \"' + refreshToken + '\", \"grant\": \"refresh_token\"}'",
									"        }, ",
									"        function (err, response) {",
									"            let resp = response.json();",
									"            if(resp.success) {",
									"                pm.collectionVariables.set(\"api_access_token\", resp.data.access_token);",
									"                pm.collectionVariables.set(\"api_refresh_token\", resp.data.refresh_token);",
									"                pm.collectionVariables.set(\"api_access_token_expiration\", new Date().getTime() + (resp.data.duration * 1000));",
									"            }",
									"        }",
									"    );",
									"}",
									"",
									"/* if no refresh_token, authenticate */",
									"if(refreshToken == null || refreshToken === \"\") {",
									"    pm.sendRequest(",
									"        {",
									"            method: \"POST\",",
									"            url: apiUrl + \"/oauth/access_token\",",
									"            header: \"Content-Type:application/json\",",
									"            body: '{\"client_id\": \"' + clientId + '\", \"client_secret\": \"' + clientSecret + '\", \"grant\": \"client_credentials\"}'",
									"        }, ",
									"        function (err, response) {",
									"            let resp = response.json()",
									"            if(resp.success) {",
									"                pm.collectionVariables.set(\"api_access_token\", resp.data.access_token);",
									"                pm.collectionVariables.set(\"api_refresh_token\", resp.data.refresh_token);",
									"                pm.collectionVariables.set(\"api_access_token_expiration\", new Date().getTime() + (resp.data.duration * 1000));",
									"            }",
									"        }",
									"    );",
									"}"
								],
								"type": "text/javascript",
								"packages": {},
								"requests": {}
							}
						}
					],
					"request": {
						"method": "POST",
						"header": [],
						"body": {
							"mode": "raw",
							"raw": "{\r\n    \"type\": \"WARNING\",\r\n    \"message\": \"Notification message\"\r\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "{{api_url}}/orders/:id/notes",
							"host": [
								"{{api_url}}"
							],
							"path": [
								"orders",
								":id",
								"notes"
							],
							"variable": [
								{
									"key": "id",
									"value": null,
									"description": "Identifier of the order"
								}
							]
						}
					},
					"response": []
				},
				{
					"name": "Delete Order",
					"event": [
						{
							"listen": "prerequest",
							"script": {
								"exec": [
									"let apiUrl = pm.collectionVariables.get(\"api_url\");",
									"let clientId = pm.collectionVariables.get(\"api_client_id\");",
									"let clientSecret = pm.collectionVariables.get(\"api_client_secret\");",
									"let accessToken = pm.collectionVariables.get(\"api_access_token\");",
									"let accessTokenExpiration = pm.collectionVariables.get(\"api_access_token_expiration\");",
									"let refreshToken = pm.collectionVariables.get(\"api_refresh_token\");",
									"",
									"/* if there is the access_token but is expired or if therein't the access_token but the there is a refresh_token */",
									"if(refreshToken != null && refreshToken != \"\" && (",
									"    (accessToken != null && accessToken !== \"\" && accessTokenExpiration <= new Date().getTime()) ||",
									"    (accessToken == null && accessToken === \"\" && refreshToken != null && refreshToken != \"\"))",
									"    ) {",
									"    /* refresh the access_token */",
									"    pm.sendRequest(",
									"        {",
									"            method: \"POST\",",
									"            url: apiUrl + \"/oauth/access_token\",",
									"            header: \"Content-Type:application/json\",",
									"            body: '{\"client_id\": \"' + clientId + '\", \"refresh_token\": \"' + refreshToken + '\", \"grant\": \"refresh_token\"}'",
									"        }, ",
									"        function (err, response) {",
									"            let resp = response.json();",
									"            if(resp.success) {",
									"                pm.collectionVariables.set(\"api_access_token\", resp.data.access_token);",
									"                pm.collectionVariables.set(\"api_refresh_token\", resp.data.refresh_token);",
									"                pm.collectionVariables.set(\"api_access_token_expiration\", new Date().getTime() + (resp.data.duration * 1000));",
									"            }",
									"        }",
									"    );",
									"}",
									"",
									"/* if no refresh_token, authenticate */",
									"if(refreshToken == null || refreshToken === \"\") {",
									"    pm.sendRequest(",
									"        {",
									"            method: \"POST\",",
									"            url: apiUrl + \"/oauth/access_token\",",
									"            header: \"Content-Type:application/json\",",
									"            body: '{\"client_id\": \"' + clientId + '\", \"client_secret\": \"' + clientSecret + '\", \"grant\": \"client_credentials\"}'",
									"        }, ",
									"        function (err, response) {",
									"            let resp = response.json()",
									"            if(resp.success) {",
									"                pm.collectionVariables.set(\"api_access_token\", resp.data.access_token);",
									"                pm.collectionVariables.set(\"api_refresh_token\", resp.data.refresh_token);",
									"                pm.collectionVariables.set(\"api_access_token_expiration\", new Date().getTime() + (resp.data.duration * 1000));",
									"            }",
									"        }",
									"    );",
									"}"
								],
								"type": "text/javascript",
								"packages": {},
								"requests": {}
							}
						}
					],
					"request": {
						"method": "DELETE",
						"header": [],
						"url": {
							"raw": "{{api_url}}/orders/:id",
							"host": [
								"{{api_url}}"
							],
							"path": [
								"orders",
								":id"
							],
							"variable": [
								{
									"key": "id",
									"value": "",
									"description": "Identifier of the order"
								}
							]
						}
					},
					"response": []
				},
				{
					"name": "Retrieve Order Detail",
					"event": [
						{
							"listen": "prerequest",
							"script": {
								"exec": [
									"let apiUrl = pm.collectionVariables.get(\"api_url\");",
									"let clientId = pm.collectionVariables.get(\"api_client_id\");",
									"let clientSecret = pm.collectionVariables.get(\"api_client_secret\");",
									"let accessToken = pm.collectionVariables.get(\"api_access_token\");",
									"let accessTokenExpiration = pm.collectionVariables.get(\"api_access_token_expiration\");",
									"let refreshToken = pm.collectionVariables.get(\"api_refresh_token\");",
									"",
									"/* if there is the access_token but is expired or if therein't the access_token but the there is a refresh_token */",
									"if(refreshToken != null && refreshToken != \"\" && (",
									"    (accessToken != null && accessToken !== \"\" && accessTokenExpiration <= new Date().getTime()) ||",
									"    (accessToken == null && accessToken === \"\" && refreshToken != null && refreshToken != \"\"))",
									"    ) {",
									"    /* refresh the access_token */",
									"    pm.sendRequest(",
									"        {",
									"            method: \"POST\",",
									"            url: apiUrl + \"/oauth/access_token\",",
									"            header: \"Content-Type:application/json\",",
									"            body: '{\"client_id\": \"' + clientId + '\", \"refresh_token\": \"' + refreshToken + '\", \"grant\": \"refresh_token\"}'",
									"        }, ",
									"        function (err, response) {",
									"            let resp = response.json();",
									"            if(resp.success) {",
									"                pm.collectionVariables.set(\"api_access_token\", resp.data.access_token);",
									"                pm.collectionVariables.set(\"api_refresh_token\", resp.data.refresh_token);",
									"                pm.collectionVariables.set(\"api_access_token_expiration\", new Date().getTime() + (resp.data.duration * 1000));",
									"            }",
									"        }",
									"    );",
									"}",
									"",
									"/* if no refresh_token, authenticate */",
									"if(refreshToken == null || refreshToken === \"\") {",
									"    pm.sendRequest(",
									"        {",
									"            method: \"POST\",",
									"            url: apiUrl + \"/oauth/access_token\",",
									"            header: \"Content-Type:application/json\",",
									"            body: '{\"client_id\": \"' + clientId + '\", \"client_secret\": \"' + clientSecret + '\", \"grant\": \"client_credentials\"}'",
									"        }, ",
									"        function (err, response) {",
									"            let resp = response.json()",
									"            if(resp.success) {",
									"                pm.collectionVariables.set(\"api_access_token\", resp.data.access_token);",
									"                pm.collectionVariables.set(\"api_refresh_token\", resp.data.refresh_token);",
									"                pm.collectionVariables.set(\"api_access_token_expiration\", new Date().getTime() + (resp.data.duration * 1000));",
									"            }",
									"        }",
									"    );",
									"}"
								],
								"type": "text/javascript",
								"packages": {},
								"requests": {}
							}
						}
					],
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "Authorization",
								"value": "Bearer {{access_token}}",
								"type": "text"
							}
						],
						"url": {
							"raw": "{{api_url}}/orders/:id",
							"host": [
								"{{api_url}}"
							],
							"path": [
								"orders",
								":id"
							],
							"variable": [
								{
									"key": "id",
									"value": "",
									"description": "Identifier of the order"
								}
							]
						}
					},
					"response": []
				},
				{
					"name": "Retrieve Order List",
					"event": [
						{
							"listen": "prerequest",
							"script": {
								"exec": [
									"let apiUrl = pm.collectionVariables.get(\"api_url\");",
									"let clientId = pm.collectionVariables.get(\"api_client_id\");",
									"let clientSecret = pm.collectionVariables.get(\"api_client_secret\");",
									"let accessToken = pm.collectionVariables.get(\"api_access_token\");",
									"let accessTokenExpiration = pm.collectionVariables.get(\"api_access_token_expiration\");",
									"let refreshToken = pm.collectionVariables.get(\"api_refresh_token\");",
									"",
									"/* if there is the access_token but is expired or if therein't the access_token but the there is a refresh_token */",
									"if(refreshToken != null && refreshToken != \"\" && (",
									"    (accessToken != null && accessToken !== \"\" && accessTokenExpiration <= new Date().getTime()) ||",
									"    (accessToken == null && accessToken === \"\" && refreshToken != null && refreshToken != \"\"))",
									"    ) {",
									"    /* refresh the access_token */",
									"    pm.sendRequest(",
									"        {",
									"            method: \"POST\",",
									"            url: apiUrl + \"/oauth/access_token\",",
									"            header: \"Content-Type:application/json\",",
									"            body: '{\"client_id\": \"' + clientId + '\", \"refresh_token\": \"' + refreshToken + '\", \"grant\": \"refresh_token\"}'",
									"        }, ",
									"        function (err, response) {",
									"            let resp = response.json();",
									"            if(resp.success) {",
									"                pm.collectionVariables.set(\"api_access_token\", resp.data.access_token);",
									"                pm.collectionVariables.set(\"api_refresh_token\", resp.data.refresh_token);",
									"                pm.collectionVariables.set(\"api_access_token_expiration\", new Date().getTime() + (resp.data.duration * 1000));",
									"            }",
									"        }",
									"    );",
									"}",
									"",
									"/* if no refresh_token, authenticate */",
									"if(refreshToken == null || refreshToken === \"\") {",
									"    pm.sendRequest(",
									"        {",
									"            method: \"POST\",",
									"            url: apiUrl + \"/oauth/access_token\",",
									"            header: \"Content-Type:application/json\",",
									"            body: '{\"client_id\": \"' + clientId + '\", \"client_secret\": \"' + clientSecret + '\", \"grant\": \"client_credentials\"}'",
									"        }, ",
									"        function (err, response) {",
									"            let resp = response.json()",
									"            if(resp.success) {",
									"                pm.collectionVariables.set(\"api_access_token\", resp.data.access_token);",
									"                pm.collectionVariables.set(\"api_refresh_token\", resp.data.refresh_token);",
									"                pm.collectionVariables.set(\"api_access_token_expiration\", new Date().getTime() + (resp.data.duration * 1000));",
									"            }",
									"        }",
									"    );",
									"}"
								],
								"type": "text/javascript",
								"packages": {},
								"requests": {}
							}
						}
					],
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "X-PLP-NODE",
								"value": "gtw-2",
								"type": "text",
								"disabled": true
							},
							{
								"key": "Authorization",
								"value": "Bearer {{access_token}}",
								"type": "text"
							}
						],
						"url": {
							"raw": "{{api_url}}/orders",
							"host": [
								"{{api_url}}"
							],
							"path": [
								"orders"
							],
							"query": [
								{
									"key": "created_after",
									"value": "2022-12-31T23:59:59Z",
									"description": "Retrieve orders created after this date",
									"disabled": true
								},
								{
									"key": "created_before",
									"value": "2022-12-31T23:59:59Z",
									"description": "Retrieve orders created before this date",
									"disabled": true
								},
								{
									"key": "states",
									"value": "READY_TO_SHIP",
									"description": "Retrieve orders in certain states",
									"disabled": true
								},
								{
									"key": "sources",
									"value": "AMAZON_IT",
									"description": "Retrieve orders received from a certain channels",
									"disabled": true
								},
								{
									"key": "shipped",
									"value": "false",
									"description": "If true returns only the full shipped orders, false return only the non full shipped orders",
									"disabled": true
								},
								{
									"key": "updated_after",
									"value": "2022-12-31T23:59:59Z",
									"description": "Retrieve orders updated after this date",
									"disabled": true
								},
								{
									"key": "updated_before",
									"value": "2022-12-31T23:59:59Z",
									"description": "Retrieve orders updated before this date",
									"disabled": true
								},
								{
									"key": "reference_id",
									"value": null,
									"description": "Retrieve the orders by the reference id field",
									"disabled": true
								},
								{
									"key": "source_description",
									"value": null,
									"description": "Retrieve the orders by the source description field",
									"disabled": true
								},
								{
									"key": "offset",
									"value": "90",
									"disabled": true
								},
								{
									"key": "max",
									"value": "5",
									"disabled": true
								}
							]
						}
					},
					"response": []
				},
				{
					"name": "Retrieve Status Preview",
					"event": [
						{
							"listen": "prerequest",
							"script": {
								"exec": [
									"let apiUrl = pm.collectionVariables.get(\"api_url\");",
									"let clientId = pm.collectionVariables.get(\"api_client_id\");",
									"let clientSecret = pm.collectionVariables.get(\"api_client_secret\");",
									"let accessToken = pm.collectionVariables.get(\"api_access_token\");",
									"let accessTokenExpiration = pm.collectionVariables.get(\"api_access_token_expiration\");",
									"let refreshToken = pm.collectionVariables.get(\"api_refresh_token\");",
									"",
									"/* if there is the access_token but is expired or if therein't the access_token but the there is a refresh_token */",
									"if(refreshToken != null && refreshToken != \"\" && (",
									"    (accessToken != null && accessToken !== \"\" && accessTokenExpiration <= new Date().getTime()) ||",
									"    (accessToken == null && accessToken === \"\" && refreshToken != null && refreshToken != \"\"))",
									"    ) {",
									"    /* refresh the access_token */",
									"    pm.sendRequest(",
									"        {",
									"            method: \"POST\",",
									"            url: apiUrl + \"/oauth/access_token\",",
									"            header: \"Content-Type:application/json\",",
									"            body: '{\"client_id\": \"' + clientId + '\", \"refresh_token\": \"' + refreshToken + '\", \"grant\": \"refresh_token\"}'",
									"        }, ",
									"        function (err, response) {",
									"            let resp = response.json();",
									"            if(resp.success) {",
									"                pm.collectionVariables.set(\"api_access_token\", resp.data.access_token);",
									"                pm.collectionVariables.set(\"api_refresh_token\", resp.data.refresh_token);",
									"                pm.collectionVariables.set(\"api_access_token_expiration\", new Date().getTime() + (resp.data.duration * 1000));",
									"            }",
									"        }",
									"    );",
									"}",
									"",
									"/* if no refresh_token, authenticate */",
									"if(refreshToken == null || refreshToken === \"\") {",
									"    pm.sendRequest(",
									"        {",
									"            method: \"POST\",",
									"            url: apiUrl + \"/oauth/access_token\",",
									"            header: \"Content-Type:application/json\",",
									"            body: '{\"client_id\": \"' + clientId + '\", \"client_secret\": \"' + clientSecret + '\", \"grant\": \"client_credentials\"}'",
									"        }, ",
									"        function (err, response) {",
									"            let resp = response.json()",
									"            if(resp.success) {",
									"                pm.collectionVariables.set(\"api_access_token\", resp.data.access_token);",
									"                pm.collectionVariables.set(\"api_refresh_token\", resp.data.refresh_token);",
									"                pm.collectionVariables.set(\"api_access_token_expiration\", new Date().getTime() + (resp.data.duration * 1000));",
									"            }",
									"        }",
									"    );",
									"}"
								],
								"type": "text/javascript",
								"packages": {},
								"requests": {}
							}
						}
					],
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "{{api_url}}/orders/:id/status/preview",
							"host": [
								"{{api_url}}"
							],
							"path": [
								"orders",
								":id",
								"status",
								"preview"
							],
							"variable": [
								{
									"key": "id",
									"value": "821",
									"description": "Identifier of the order"
								}
							]
						}
					},
					"response": []
				},
				{
					"name": "Set Order Shipped",
					"event": [
						{
							"listen": "prerequest",
							"script": {
								"exec": [
									"let apiUrl = pm.collectionVariables.get(\"api_url\");",
									"let clientId = pm.collectionVariables.get(\"api_client_id\");",
									"let clientSecret = pm.collectionVariables.get(\"api_client_secret\");",
									"let accessToken = pm.collectionVariables.get(\"api_access_token\");",
									"let accessTokenExpiration = pm.collectionVariables.get(\"api_access_token_expiration\");",
									"let refreshToken = pm.collectionVariables.get(\"api_refresh_token\");",
									"",
									"/* if there is the access_token but is expired or if therein't the access_token but the there is a refresh_token */",
									"if(refreshToken != null && refreshToken != \"\" && (",
									"    (accessToken != null && accessToken !== \"\" && accessTokenExpiration <= new Date().getTime()) ||",
									"    (accessToken == null && accessToken === \"\" && refreshToken != null && refreshToken != \"\"))",
									"    ) {",
									"    /* refresh the access_token */",
									"    pm.sendRequest(",
									"        {",
									"            method: \"POST\",",
									"            url: apiUrl + \"/oauth/access_token\",",
									"            header: \"Content-Type:application/json\",",
									"            body: '{\"client_id\": \"' + clientId + '\", \"refresh_token\": \"' + refreshToken + '\", \"grant\": \"refresh_token\"}'",
									"        }, ",
									"        function (err, response) {",
									"            let resp = response.json();",
									"            if(resp.success) {",
									"                pm.collectionVariables.set(\"api_access_token\", resp.data.access_token);",
									"                pm.collectionVariables.set(\"api_refresh_token\", resp.data.refresh_token);",
									"                pm.collectionVariables.set(\"api_access_token_expiration\", new Date().getTime() + (resp.data.duration * 1000));",
									"            }",
									"        }",
									"    );",
									"}",
									"",
									"/* if no refresh_token, authenticate */",
									"if(refreshToken == null || refreshToken === \"\") {",
									"    pm.sendRequest(",
									"        {",
									"            method: \"POST\",",
									"            url: apiUrl + \"/oauth/access_token\",",
									"            header: \"Content-Type:application/json\",",
									"            body: '{\"client_id\": \"' + clientId + '\", \"client_secret\": \"' + clientSecret + '\", \"grant\": \"client_credentials\"}'",
									"        }, ",
									"        function (err, response) {",
									"            let resp = response.json()",
									"            if(resp.success) {",
									"                pm.collectionVariables.set(\"api_access_token\", resp.data.access_token);",
									"                pm.collectionVariables.set(\"api_refresh_token\", resp.data.refresh_token);",
									"                pm.collectionVariables.set(\"api_access_token_expiration\", new Date().getTime() + (resp.data.duration * 1000));",
									"            }",
									"        }",
									"    );",
									"}"
								],
								"type": "text/javascript",
								"packages": {},
								"requests": {}
							}
						}
					],
					"request": {
						"method": "PUT",
						"header": [],
						"url": {
							"raw": "{{api_url}}/orders/:id/ship",
							"host": [
								"{{api_url}}"
							],
							"path": [
								"orders",
								":id",
								"ship"
							],
							"variable": [
								{
									"key": "id",
									"value": "",
									"description": "Identifier of the order"
								}
							]
						}
					},
					"response": []
				},
				{
					"name": "Update Order",
					"event": [
						{
							"listen": "prerequest",
							"script": {
								"exec": [
									"let apiUrl = pm.collectionVariables.get(\"api_url\");",
									"let clientId = pm.collectionVariables.get(\"api_client_id\");",
									"let clientSecret = pm.collectionVariables.get(\"api_client_secret\");",
									"let accessToken = pm.collectionVariables.get(\"api_access_token\");",
									"let accessTokenExpiration = pm.collectionVariables.get(\"api_access_token_expiration\");",
									"let refreshToken = pm.collectionVariables.get(\"api_refresh_token\");",
									"",
									"/* if there is the access_token but is expired or if therein't the access_token but the there is a refresh_token */",
									"if(refreshToken != null && refreshToken != \"\" && (",
									"    (accessToken != null && accessToken !== \"\" && accessTokenExpiration <= new Date().getTime()) ||",
									"    (accessToken == null && accessToken === \"\" && refreshToken != null && refreshToken != \"\"))",
									"    ) {",
									"    /* refresh the access_token */",
									"    pm.sendRequest(",
									"        {",
									"            method: \"POST\",",
									"            url: apiUrl + \"/oauth/access_token\",",
									"            header: \"Content-Type:application/json\",",
									"            body: '{\"client_id\": \"' + clientId + '\", \"refresh_token\": \"' + refreshToken + '\", \"grant\": \"refresh_token\"}'",
									"        }, ",
									"        function (err, response) {",
									"            let resp = response.json();",
									"            if(resp.success) {",
									"                pm.collectionVariables.set(\"api_access_token\", resp.data.access_token);",
									"                pm.collectionVariables.set(\"api_refresh_token\", resp.data.refresh_token);",
									"                pm.collectionVariables.set(\"api_access_token_expiration\", new Date().getTime() + (resp.data.duration * 1000));",
									"            }",
									"        }",
									"    );",
									"}",
									"",
									"/* if no refresh_token, authenticate */",
									"if(refreshToken == null || refreshToken === \"\") {",
									"    pm.sendRequest(",
									"        {",
									"            method: \"POST\",",
									"            url: apiUrl + \"/oauth/access_token\",",
									"            header: \"Content-Type:application/json\",",
									"            body: '{\"client_id\": \"' + clientId + '\", \"client_secret\": \"' + clientSecret + '\", \"grant\": \"client_credentials\"}'",
									"        }, ",
									"        function (err, response) {",
									"            let resp = response.json()",
									"            if(resp.success) {",
									"                pm.collectionVariables.set(\"api_access_token\", resp.data.access_token);",
									"                pm.collectionVariables.set(\"api_refresh_token\", resp.data.refresh_token);",
									"                pm.collectionVariables.set(\"api_access_token_expiration\", new Date().getTime() + (resp.data.duration * 1000));",
									"            }",
									"        }",
									"    );",
									"}"
								],
								"type": "text/javascript",
								"packages": {},
								"requests": {}
							}
						},
						{
							"listen": "test",
							"script": {
								"exec": [
									""
								],
								"type": "text/javascript",
								"packages": {},
								"requests": {}
							}
						}
					],
					"request": {
						"method": "PUT",
						"header": [],
						"body": {
							"mode": "raw",
							"raw": "{\r\n    \"reference_id\": \"poleepo-postman-1\",\r\n    \"source\": \"GENERIC\",\r\n    \"source_description\": \"Poleepo Postman\",\r\n    \"status\": \"READY_TO_SHIP\",\r\n    \"creation_date\": \"2023-02-17T13:00:00Z\",\r\n    \"total_price\": \"5690\",\r\n    \"cod\": true,\r\n    \"cod_price\": 5.00,\r\n    \"shipped\": false,\r\n    \"shippings\": [],\r\n    \"customer\": {\r\n        \"id\": \"1234\",\r\n        \"firstname\": \"Poleepo\",\r\n        \"lastname\": \"Postman\",\r\n        \"email\": \"postman@poleepo.cloud\",\r\n        \"phones\": [\r\n            \"3334455666\"\r\n        ]\r\n    },\r\n    \"delivery_address\": {\r\n        \"address\": \"Via Roma 1\",\r\n        \"state_iso\": \"RM\",\r\n        \"country_iso\": \"IT\",\r\n        \"postcode\": \"00000\",\r\n        \"city\": \"Roma\"\r\n    },\r\n    \"invoice_address\": {\r\n        \"address\": \"Via Roma 1\",\r\n        \"state_iso\": \"RM\",\r\n        \"country_iso\": \"IT\",\r\n        \"postcode\": \"00000\",\r\n        \"city\": \"Roma\"\r\n    },\r\n    \"rows\": [\r\n        {\r\n            \"source_row_id\": \"poleepo-postman-1-1\",\r\n            \"description\": \"Poleepo Postman product 1\",\r\n            \"quantity\": \"1\",\r\n            \"vat_rate\": 22,\r\n            \"unit_price\": 5690,\r\n            \"total_price\": 5690,\r\n            \"item\": {\r\n                \"title\": \"Poleepo Postman product 1\",\r\n                \"sku\": \"PLP-PT-1-1\",\r\n                \"ean\": \"\",\r\n                \"deposit\": \"\",\r\n                \"area\": \"\",\r\n                \"shelf\": \"\",\r\n                \"plan\": \"\",\r\n                \"weight\": null,\r\n                \"width\": null,\r\n                \"height\": null,\r\n                \"depth\": null\r\n            },\r\n            \"fulfillments\": [\r\n                {\r\n                    \"supplier_id\": 0,\r\n                    \"quantity\": 1\r\n                }\r\n            ]\r\n        }\r\n    ]\r\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "{{api_url}}/orders/:id",
							"host": [
								"{{api_url}}"
							],
							"path": [
								"orders",
								":id"
							],
							"variable": [
								{
									"key": "id",
									"value": "",
									"description": "Identifier of the order"
								}
							]
						}
					},
					"response": []
				}
			],
			"auth": {
				"type": "bearer",
				"bearer": [
					{
						"key": "token",
						"value": "{{api_access_token}}",
						"type": "string"
					}
				]
			},
			"event": [
				{
					"listen": "prerequest",
					"script": {
						"type": "text/javascript",
						"requests": {},
						"exec": [
							""
						]
					}
				},
				{
					"listen": "test",
					"script": {
						"type": "text/javascript",
						"requests": {},
						"exec": [
							""
						]
					}
				}
			]
		},
		{
			"name": "Others",
			"item": [
				{
					"name": "Retrieve Pickups Addresses",
					"event": [
						{
							"listen": "prerequest",
							"script": {
								"exec": [
									"let apiUrl = pm.collectionVariables.get(\"api_url\");",
									"let clientId = pm.collectionVariables.get(\"api_client_id\");",
									"let clientSecret = pm.collectionVariables.get(\"api_client_secret\");",
									"let accessToken = pm.collectionVariables.get(\"api_access_token\");",
									"let accessTokenExpiration = pm.collectionVariables.get(\"api_access_token_expiration\");",
									"let refreshToken = pm.collectionVariables.get(\"api_refresh_token\");",
									"",
									"/* if there is the access_token but is expired or if therein't the access_token but the there is a refresh_token */",
									"if(refreshToken != null && refreshToken != \"\" && (",
									"    (accessToken != null && accessToken !== \"\" && accessTokenExpiration <= new Date().getTime()) ||",
									"    (accessToken == null && accessToken === \"\" && refreshToken != null && refreshToken != \"\"))",
									"    ) {",
									"    /* refresh the access_token */",
									"    pm.sendRequest(",
									"        {",
									"            method: \"POST\",",
									"            url: apiUrl + \"/oauth/access_token\",",
									"            header: \"Content-Type:application/json\",",
									"            body: '{\"client_id\": \"' + clientId + '\", \"refresh_token\": \"' + refreshToken + '\", \"grant\": \"refresh_token\"}'",
									"        }, ",
									"        function (err, response) {",
									"            let resp = response.json();",
									"            if(resp.success) {",
									"                pm.collectionVariables.set(\"api_access_token\", resp.data.access_token);",
									"                pm.collectionVariables.set(\"api_refresh_token\", resp.data.refresh_token);",
									"                pm.collectionVariables.set(\"api_access_token_expiration\", new Date().getTime() + (resp.data.duration * 1000));",
									"            }",
									"        }",
									"    );",
									"}",
									"",
									"/* if no refresh_token, authenticate */",
									"if(refreshToken == null || refreshToken === \"\") {",
									"    pm.sendRequest(",
									"        {",
									"            method: \"POST\",",
									"            url: apiUrl + \"/oauth/access_token\",",
									"            header: \"Content-Type:application/json\",",
									"            body: '{\"client_id\": \"' + clientId + '\", \"client_secret\": \"' + clientSecret + '\", \"grant\": \"client_credentials\"}'",
									"        }, ",
									"        function (err, response) {",
									"            let resp = response.json()",
									"            if(resp.success) {",
									"                pm.collectionVariables.set(\"api_access_token\", resp.data.access_token);",
									"                pm.collectionVariables.set(\"api_refresh_token\", resp.data.refresh_token);",
									"                pm.collectionVariables.set(\"api_access_token_expiration\", new Date().getTime() + (resp.data.duration * 1000));",
									"            }",
									"        }",
									"    );",
									"}"
								],
								"type": "text/javascript",
								"packages": {},
								"requests": {}
							}
						}
					],
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "Authorization",
								"value": "Bearer {{access_token}}",
								"type": "text"
							}
						],
						"url": {
							"raw": "{{api_url}}/addresses/pickups",
							"host": [
								"{{api_url}}"
							],
							"path": [
								"addresses",
								"pickups"
							]
						}
					},
					"response": []
				}
			]
		},
		{
			"name": "Products",
			"item": [
				{
					"name": "Create New Product",
					"event": [
						{
							"listen": "prerequest",
							"script": {
								"exec": [
									"let apiUrl = pm.collectionVariables.get(\"api_url\");",
									"let clientId = pm.collectionVariables.get(\"api_client_id\");",
									"let clientSecret = pm.collectionVariables.get(\"api_client_secret\");",
									"let accessToken = pm.collectionVariables.get(\"api_access_token\");",
									"let accessTokenExpiration = pm.collectionVariables.get(\"api_access_token_expiration\");",
									"let refreshToken = pm.collectionVariables.get(\"api_refresh_token\");",
									"",
									"/* if there is the access_token but is expired or if therein't the access_token but the there is a refresh_token */",
									"if(refreshToken != null && refreshToken != \"\" && (",
									"    (accessToken != null && accessToken !== \"\" && accessTokenExpiration <= new Date().getTime()) ||",
									"    (accessToken == null && accessToken === \"\" && refreshToken != null && refreshToken != \"\"))",
									"    ) {",
									"    /* refresh the access_token */",
									"    pm.sendRequest(",
									"        {",
									"            method: \"POST\",",
									"            url: apiUrl + \"/oauth/access_token\",",
									"            header: \"Content-Type:application/json\",",
									"            body: '{\"client_id\": \"' + clientId + '\", \"refresh_token\": \"' + refreshToken + '\", \"grant\": \"refresh_token\"}'",
									"        }, ",
									"        function (err, response) {",
									"            let resp = response.json();",
									"            if(resp.success) {",
									"                pm.collectionVariables.set(\"api_access_token\", resp.data.access_token);",
									"                pm.collectionVariables.set(\"api_refresh_token\", resp.data.refresh_token);",
									"                pm.collectionVariables.set(\"api_access_token_expiration\", new Date().getTime() + (resp.data.duration * 1000));",
									"            }",
									"        }",
									"    );",
									"}",
									"",
									"/* if no refresh_token, authenticate */",
									"if(refreshToken == null || refreshToken === \"\") {",
									"    pm.sendRequest(",
									"        {",
									"            method: \"POST\",",
									"            url: apiUrl + \"/oauth/access_token\",",
									"            header: \"Content-Type:application/json\",",
									"            body: '{\"client_id\": \"' + clientId + '\", \"client_secret\": \"' + clientSecret + '\", \"grant\": \"client_credentials\"}'",
									"        }, ",
									"        function (err, response) {",
									"            let resp = response.json()",
									"            if(resp.success) {",
									"                pm.collectionVariables.set(\"api_access_token\", resp.data.access_token);",
									"                pm.collectionVariables.set(\"api_refresh_token\", resp.data.refresh_token);",
									"                pm.collectionVariables.set(\"api_access_token_expiration\", new Date().getTime() + (resp.data.duration * 1000));",
									"            }",
									"        }",
									"    );",
									"}"
								],
								"type": "text/javascript",
								"packages": {},
								"requests": {}
							}
						}
					],
					"request": {
						"method": "POST",
						"header": [],
						"body": {
							"mode": "raw",
							"raw": "{\r\n    \"title\": \"This is the first product created from the API\",\r\n    \"price_with_tax\": 25.90,\r\n    \"discount_price_with_tax\": 20.99,\r\n    \"vat_rate\": 22,\r\n    \"mpn\": \"102345\",\r\n    \"ean\": \"1234567890123\",\r\n    \"short_description\": \"This is the short desciption for the created product\",\r\n    \"long_description\": \"<p>This is the long desciption for the created product</p>\",\r\n    \"weight\": 1.52,\r\n    \"width\": 2.22,\r\n    \"height\": 3.33,\r\n    \"depth\": 4.44,\r\n    \"quantity\": 22,\r\n    \"area\": \"Area\",\r\n    \"deposit\": \"Deposit\",\r\n    \"main_category_id\": 121,\r\n    \"hole\": \"Hole\",\r\n    \"plan\": \"Plan\",\r\n    \"shelf\": \"Shelf\",\r\n    \"sales\": 25,\r\n    \"images\": [\r\n        {\r\n            \"principal\": true,\r\n            \"url\": \"https://perangustaadaugusta.altervista.org/wp-content/uploads/2017/03/test-big-1.png\"\r\n        }\r\n    ],\r\n    \"stock\": {\r\n        \"quantity\": 5,\r\n        \"price\": 10.22\r\n    }\r\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "{{api_url}}/products",
							"host": [
								"{{api_url}}"
							],
							"path": [
								"products"
							]
						}
					},
					"response": []
				},
				{
					"name": "Delete Product",
					"event": [
						{
							"listen": "prerequest",
							"script": {
								"exec": [
									"let apiUrl = pm.collectionVariables.get(\"api_url\");",
									"let clientId = pm.collectionVariables.get(\"api_client_id\");",
									"let clientSecret = pm.collectionVariables.get(\"api_client_secret\");",
									"let accessToken = pm.collectionVariables.get(\"api_access_token\");",
									"let accessTokenExpiration = pm.collectionVariables.get(\"api_access_token_expiration\");",
									"let refreshToken = pm.collectionVariables.get(\"api_refresh_token\");",
									"",
									"/* if there is the access_token but is expired or if therein't the access_token but the there is a refresh_token */",
									"if(refreshToken != null && refreshToken != \"\" && (",
									"    (accessToken != null && accessToken !== \"\" && accessTokenExpiration <= new Date().getTime()) ||",
									"    (accessToken == null && accessToken === \"\" && refreshToken != null && refreshToken != \"\"))",
									"    ) {",
									"    /* refresh the access_token */",
									"    pm.sendRequest(",
									"        {",
									"            method: \"POST\",",
									"            url: apiUrl + \"/oauth/access_token\",",
									"            header: \"Content-Type:application/json\",",
									"            body: '{\"client_id\": \"' + clientId + '\", \"refresh_token\": \"' + refreshToken + '\", \"grant\": \"refresh_token\"}'",
									"        }, ",
									"        function (err, response) {",
									"            let resp = response.json();",
									"            if(resp.success) {",
									"                pm.collectionVariables.set(\"api_access_token\", resp.data.access_token);",
									"                pm.collectionVariables.set(\"api_refresh_token\", resp.data.refresh_token);",
									"                pm.collectionVariables.set(\"api_access_token_expiration\", new Date().getTime() + (resp.data.duration * 1000));",
									"            }",
									"        }",
									"    );",
									"}",
									"",
									"/* if no refresh_token, authenticate */",
									"if(refreshToken == null || refreshToken === \"\") {",
									"    pm.sendRequest(",
									"        {",
									"            method: \"POST\",",
									"            url: apiUrl + \"/oauth/access_token\",",
									"            header: \"Content-Type:application/json\",",
									"            body: '{\"client_id\": \"' + clientId + '\", \"client_secret\": \"' + clientSecret + '\", \"grant\": \"client_credentials\"}'",
									"        }, ",
									"        function (err, response) {",
									"            let resp = response.json()",
									"            if(resp.success) {",
									"                pm.collectionVariables.set(\"api_access_token\", resp.data.access_token);",
									"                pm.collectionVariables.set(\"api_refresh_token\", resp.data.refresh_token);",
									"                pm.collectionVariables.set(\"api_access_token_expiration\", new Date().getTime() + (resp.data.duration * 1000));",
									"            }",
									"        }",
									"    );",
									"}"
								],
								"type": "text/javascript",
								"packages": {},
								"requests": {}
							}
						}
					],
					"request": {
						"method": "DELETE",
						"header": [],
						"url": {
							"raw": "{{api_url}}/products/:productId",
							"host": [
								"{{api_url}}"
							],
							"path": [
								"products",
								":productId"
							],
							"variable": [
								{
									"key": "productId",
									"value": "",
									"description": "Identifier of the product"
								}
							]
						}
					},
					"response": []
				},
				{
					"name": "Product Batches Upsert",
					"event": [
						{
							"listen": "prerequest",
							"script": {
								"exec": [
									"let apiUrl = pm.collectionVariables.get(\"api_url\");",
									"let clientId = pm.collectionVariables.get(\"api_client_id\");",
									"let clientSecret = pm.collectionVariables.get(\"api_client_secret\");",
									"let accessToken = pm.collectionVariables.get(\"api_access_token\");",
									"let accessTokenExpiration = pm.collectionVariables.get(\"api_access_token_expiration\");",
									"let refreshToken = pm.collectionVariables.get(\"api_refresh_token\");",
									"",
									"/* if there is the access_token but is expired or if therein't the access_token but the there is a refresh_token */",
									"if(refreshToken != null && refreshToken != \"\" && (",
									"    (accessToken != null && accessToken !== \"\" && accessTokenExpiration <= new Date().getTime()) ||",
									"    (accessToken == null && accessToken === \"\" && refreshToken != null && refreshToken != \"\"))",
									"    ) {",
									"    /* refresh the access_token */",
									"    pm.sendRequest(",
									"        {",
									"            method: \"POST\",",
									"            url: apiUrl + \"/oauth/access_token\",",
									"            header: \"Content-Type:application/json\",",
									"            body: '{\"client_id\": \"' + clientId + '\", \"refresh_token\": \"' + refreshToken + '\", \"grant\": \"refresh_token\"}'",
									"        }, ",
									"        function (err, response) {",
									"            let resp = response.json();",
									"            if(resp.success) {",
									"                pm.collectionVariables.set(\"api_access_token\", resp.data.access_token);",
									"                pm.collectionVariables.set(\"api_refresh_token\", resp.data.refresh_token);",
									"                pm.collectionVariables.set(\"api_access_token_expiration\", new Date().getTime() + (resp.data.duration * 1000));",
									"            }",
									"        }",
									"    );",
									"}",
									"",
									"/* if no refresh_token, authenticate */",
									"if(refreshToken == null || refreshToken === \"\") {",
									"    pm.sendRequest(",
									"        {",
									"            method: \"POST\",",
									"            url: apiUrl + \"/oauth/access_token\",",
									"            header: \"Content-Type:application/json\",",
									"            body: '{\"client_id\": \"' + clientId + '\", \"client_secret\": \"' + clientSecret + '\", \"grant\": \"client_credentials\"}'",
									"        }, ",
									"        function (err, response) {",
									"            let resp = response.json()",
									"            if(resp.success) {",
									"                pm.collectionVariables.set(\"api_access_token\", resp.data.access_token);",
									"                pm.collectionVariables.set(\"api_refresh_token\", resp.data.refresh_token);",
									"                pm.collectionVariables.set(\"api_access_token_expiration\", new Date().getTime() + (resp.data.duration * 1000));",
									"            }",
									"        }",
									"    );",
									"}"
								],
								"type": "text/javascript",
								"packages": {},
								"requests": {}
							}
						}
					],
					"request": {
						"method": "PUT",
						"header": [],
						"body": {
							"mode": "raw",
							"raw": "{\r\n    \"operation\": \"upsert\",\r\n    \"select_option_quantity\": \"override\",\r\n    \"data\": [\r\n        {\r\n            \"product_id\": 0,\r\n            \"price\": 10\r\n        }\r\n    ]\r\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "{{api_url}}/products/batches/upsert",
							"host": [
								"{{api_url}}"
							],
							"path": [
								"products",
								"batches",
								"upsert"
							]
						}
					},
					"response": []
				},
				{
					"name": "Product Report Detail",
					"event": [
						{
							"listen": "prerequest",
							"script": {
								"exec": [
									"let apiUrl = pm.collectionVariables.get(\"api_url\");",
									"let clientId = pm.collectionVariables.get(\"api_client_id\");",
									"let clientSecret = pm.collectionVariables.get(\"api_client_secret\");",
									"let accessToken = pm.collectionVariables.get(\"api_access_token\");",
									"let accessTokenExpiration = pm.collectionVariables.get(\"api_access_token_expiration\");",
									"let refreshToken = pm.collectionVariables.get(\"api_refresh_token\");",
									"",
									"/* if there is the access_token but is expired or if therein't the access_token but the there is a refresh_token */",
									"if(refreshToken != null && refreshToken != \"\" && (",
									"    (accessToken != null && accessToken !== \"\" && accessTokenExpiration <= new Date().getTime()) ||",
									"    (accessToken == null && accessToken === \"\" && refreshToken != null && refreshToken != \"\"))",
									"    ) {",
									"    /* refresh the access_token */",
									"    pm.sendRequest(",
									"        {",
									"            method: \"POST\",",
									"            url: apiUrl + \"/oauth/access_token\",",
									"            header: \"Content-Type:application/json\",",
									"            body: '{\"client_id\": \"' + clientId + '\", \"refresh_token\": \"' + refreshToken + '\", \"grant\": \"refresh_token\"}'",
									"        }, ",
									"        function (err, response) {",
									"            let resp = response.json();",
									"            if(resp.success) {",
									"                pm.collectionVariables.set(\"api_access_token\", resp.data.access_token);",
									"                pm.collectionVariables.set(\"api_refresh_token\", resp.data.refresh_token);",
									"                pm.collectionVariables.set(\"api_access_token_expiration\", new Date().getTime() + (resp.data.duration * 1000));",
									"            }",
									"        }",
									"    );",
									"}",
									"",
									"/* if no refresh_token, authenticate */",
									"if(refreshToken == null || refreshToken === \"\") {",
									"    pm.sendRequest(",
									"        {",
									"            method: \"POST\",",
									"            url: apiUrl + \"/oauth/access_token\",",
									"            header: \"Content-Type:application/json\",",
									"            body: '{\"client_id\": \"' + clientId + '\", \"client_secret\": \"' + clientSecret + '\", \"grant\": \"client_credentials\"}'",
									"        }, ",
									"        function (err, response) {",
									"            let resp = response.json()",
									"            if(resp.success) {",
									"                pm.collectionVariables.set(\"api_access_token\", resp.data.access_token);",
									"                pm.collectionVariables.set(\"api_refresh_token\", resp.data.refresh_token);",
									"                pm.collectionVariables.set(\"api_access_token_expiration\", new Date().getTime() + (resp.data.duration * 1000));",
									"            }",
									"        }",
									"    );",
									"}"
								],
								"type": "text/javascript",
								"packages": {},
								"requests": {}
							}
						}
					],
					"protocolProfileBehavior": {
						"disableBodyPruning": true
					},
					"request": {
						"method": "GET",
						"header": [],
						"body": {
							"mode": "urlencoded",
							"urlencoded": []
						},
						"url": {
							"raw": "{{api_url}}/products/report/:id",
							"host": [
								"{{api_url}}"
							],
							"path": [
								"products",
								"report",
								":id"
							],
							"variable": [
								{
									"key": "id",
									"value": "",
									"description": "Identifier of the report"
								}
							]
						}
					},
					"response": []
				},
				{
					"name": "Retrieve Product Detail",
					"event": [
						{
							"listen": "prerequest",
							"script": {
								"exec": [
									"let apiUrl = pm.collectionVariables.get(\"api_url\");",
									"let clientId = pm.collectionVariables.get(\"api_client_id\");",
									"let clientSecret = pm.collectionVariables.get(\"api_client_secret\");",
									"let accessToken = pm.collectionVariables.get(\"api_access_token\");",
									"let accessTokenExpiration = pm.collectionVariables.get(\"api_access_token_expiration\");",
									"let refreshToken = pm.collectionVariables.get(\"api_refresh_token\");",
									"",
									"/* if there is the access_token but is expired or if therein't the access_token but the there is a refresh_token */",
									"if(refreshToken != null && refreshToken != \"\" && (",
									"    (accessToken != null && accessToken !== \"\" && accessTokenExpiration <= new Date().getTime()) ||",
									"    (accessToken == null && accessToken === \"\" && refreshToken != null && refreshToken != \"\"))",
									"    ) {",
									"    /* refresh the access_token */",
									"    pm.sendRequest(",
									"        {",
									"            method: \"POST\",",
									"            url: apiUrl + \"/oauth/access_token\",",
									"            header: \"Content-Type:application/json\",",
									"            body: '{\"client_id\": \"' + clientId + '\", \"refresh_token\": \"' + refreshToken + '\", \"grant\": \"refresh_token\"}'",
									"        }, ",
									"        function (err, response) {",
									"            let resp = response.json();",
									"            if(resp.success) {",
									"                pm.collectionVariables.set(\"api_access_token\", resp.data.access_token);",
									"                pm.collectionVariables.set(\"api_refresh_token\", resp.data.refresh_token);",
									"                pm.collectionVariables.set(\"api_access_token_expiration\", new Date().getTime() + (resp.data.duration * 1000));",
									"            }",
									"        }",
									"    );",
									"}",
									"",
									"/* if no refresh_token, authenticate */",
									"if(refreshToken == null || refreshToken === \"\") {",
									"    pm.sendRequest(",
									"        {",
									"            method: \"POST\",",
									"            url: apiUrl + \"/oauth/access_token\",",
									"            header: \"Content-Type:application/json\",",
									"            body: '{\"client_id\": \"' + clientId + '\", \"client_secret\": \"' + clientSecret + '\", \"grant\": \"client_credentials\"}'",
									"        }, ",
									"        function (err, response) {",
									"            let resp = response.json()",
									"            if(resp.success) {",
									"                pm.collectionVariables.set(\"api_access_token\", resp.data.access_token);",
									"                pm.collectionVariables.set(\"api_refresh_token\", resp.data.refresh_token);",
									"                pm.collectionVariables.set(\"api_access_token_expiration\", new Date().getTime() + (resp.data.duration * 1000));",
									"            }",
									"        }",
									"    );",
									"}"
								],
								"type": "text/javascript",
								"packages": {},
								"requests": {}
							}
						}
					],
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "{{api_url}}/products/:id",
							"host": [
								"{{api_url}}"
							],
							"path": [
								"products",
								":id"
							],
							"variable": [
								{
									"key": "id",
									"value": "",
									"description": "Identifier of the product"
								}
							]
						}
					},
					"response": []
				},
				{
					"name": "Retrieve Product List",
					"event": [
						{
							"listen": "prerequest",
							"script": {
								"exec": [
									"let apiUrl = pm.collectionVariables.get(\"api_url\");",
									"let clientId = pm.collectionVariables.get(\"api_client_id\");",
									"let clientSecret = pm.collectionVariables.get(\"api_client_secret\");",
									"let accessToken = pm.collectionVariables.get(\"api_access_token\");",
									"let accessTokenExpiration = pm.collectionVariables.get(\"api_access_token_expiration\");",
									"let refreshToken = pm.collectionVariables.get(\"api_refresh_token\");",
									"",
									"/* if there is the access_token but is expired or if therein't the access_token but the there is a refresh_token */",
									"if(refreshToken != null && refreshToken != \"\" && (",
									"    (accessToken != null && accessToken !== \"\" && accessTokenExpiration <= new Date().getTime()) ||",
									"    (accessToken == null && accessToken === \"\" && refreshToken != null && refreshToken != \"\"))",
									"    ) {",
									"    /* refresh the access_token */",
									"    pm.sendRequest(",
									"        {",
									"            method: \"POST\",",
									"            url: apiUrl + \"/oauth/access_token\",",
									"            header: \"Content-Type:application/json\",",
									"            body: '{\"client_id\": \"' + clientId + '\", \"refresh_token\": \"' + refreshToken + '\", \"grant\": \"refresh_token\"}'",
									"        }, ",
									"        function (err, response) {",
									"            let resp = response.json();",
									"            if(resp.success) {",
									"                pm.collectionVariables.set(\"api_access_token\", resp.data.access_token);",
									"                pm.collectionVariables.set(\"api_refresh_token\", resp.data.refresh_token);",
									"                pm.collectionVariables.set(\"api_access_token_expiration\", new Date().getTime() + (resp.data.duration * 1000));",
									"            }",
									"        }",
									"    );",
									"}",
									"",
									"/* if no refresh_token, authenticate */",
									"if(refreshToken == null || refreshToken === \"\") {",
									"    pm.sendRequest(",
									"        {",
									"            method: \"POST\",",
									"            url: apiUrl + \"/oauth/access_token\",",
									"            header: \"Content-Type:application/json\",",
									"            body: '{\"client_id\": \"' + clientId + '\", \"client_secret\": \"' + clientSecret + '\", \"grant\": \"client_credentials\"}'",
									"        }, ",
									"        function (err, response) {",
									"            let resp = response.json()",
									"            if(resp.success) {",
									"                pm.collectionVariables.set(\"api_access_token\", resp.data.access_token);",
									"                pm.collectionVariables.set(\"api_refresh_token\", resp.data.refresh_token);",
									"                pm.collectionVariables.set(\"api_access_token_expiration\", new Date().getTime() + (resp.data.duration * 1000));",
									"            }",
									"        }",
									"    );",
									"}"
								],
								"type": "text/javascript",
								"packages": {},
								"requests": {}
							}
						}
					],
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "{{api_url}}/products",
							"host": [
								"{{api_url}}"
							],
							"path": [
								"products"
							],
							"query": [
								{
									"key": "active",
									"value": "true",
									"description": "If true, only active products are retrieved; if false, only inactive products are returned",
									"disabled": true
								},
								{
									"key": "variation",
									"value": "true",
									"description": "If true, only products with variations are retrieved; if false, only products without variations are returned",
									"disabled": true
								},
								{
									"key": "stock",
									"value": "true",
									"description": "If true, only products without external suppliers are retrieved; if false, only products with external suppliers are returned",
									"disabled": true
								},
								{
									"key": "supplier",
									"value": "1",
									"description": "Retrieves only the products of a specific supplier, based on the supplier’s identifier in Poleepo",
									"disabled": true
								},
								{
									"key": "type",
									"value": "PRODUCT",
									"description": "Retrieves only products of a specific type",
									"disabled": true
								},
								{
									"key": "identifier",
									"value": "sku",
									"description": "Searches for product identifiers such as SKU, EAN, UPC, ISBN, or MPN",
									"disabled": true
								},
								{
									"key": "updated_after",
									"value": "2022-12-31T23:59:59Z",
									"description": "Retrieves only products that were updated after the specified date",
									"disabled": true
								},
								{
									"key": "updated_before",
									"value": "2022-12-31T23:59:59Z",
									"description": "Retrieves only products that were updated before the specified date",
									"disabled": true
								},
								{
									"key": "sku",
									"value": null,
									"description": "Allows you to search for a product by SKU",
									"disabled": true
								},
								{
									"key": "ean",
									"value": null,
									"description": "Allows you to search for a product by EAN",
									"disabled": true
								},
								{
									"key": "mpn",
									"value": null,
									"description": "Allows you to search for a product by MPN",
									"disabled": true
								},
								{
									"key": "upc",
									"value": null,
									"description": "Allows you to search for a product by UPC",
									"disabled": true
								},
								{
									"key": "isbn",
									"value": null,
									"description": "Allows you to search for a product by ISBN",
									"disabled": true
								},
								{
									"key": "max",
									"value": "1",
									"description": "Max number of objects to retrieve.",
									"disabled": true
								},
								{
									"key": "offset",
									"value": "0",
									"description": "First object  to retrieve.",
									"disabled": true
								}
							]
						}
					},
					"response": []
				},
				{
					"name": "Update Product",
					"event": [
						{
							"listen": "prerequest",
							"script": {
								"exec": [
									"let apiUrl = pm.collectionVariables.get(\"api_url\");",
									"let clientId = pm.collectionVariables.get(\"api_client_id\");",
									"let clientSecret = pm.collectionVariables.get(\"api_client_secret\");",
									"let accessToken = pm.collectionVariables.get(\"api_access_token\");",
									"let accessTokenExpiration = pm.collectionVariables.get(\"api_access_token_expiration\");",
									"let refreshToken = pm.collectionVariables.get(\"api_refresh_token\");",
									"",
									"/* if there is the access_token but is expired or if therein't the access_token but the there is a refresh_token */",
									"if(refreshToken != null && refreshToken != \"\" && (",
									"    (accessToken != null && accessToken !== \"\" && accessTokenExpiration <= new Date().getTime()) ||",
									"    (accessToken == null && accessToken === \"\" && refreshToken != null && refreshToken != \"\"))",
									"    ) {",
									"    /* refresh the access_token */",
									"    pm.sendRequest(",
									"        {",
									"            method: \"POST\",",
									"            url: apiUrl + \"/oauth/access_token\",",
									"            header: \"Content-Type:application/json\",",
									"            body: '{\"client_id\": \"' + clientId + '\", \"refresh_token\": \"' + refreshToken + '\", \"grant\": \"refresh_token\"}'",
									"        }, ",
									"        function (err, response) {",
									"            let resp = response.json();",
									"            if(resp.success) {",
									"                pm.collectionVariables.set(\"api_access_token\", resp.data.access_token);",
									"                pm.collectionVariables.set(\"api_refresh_token\", resp.data.refresh_token);",
									"                pm.collectionVariables.set(\"api_access_token_expiration\", new Date().getTime() + (resp.data.duration * 1000));",
									"            }",
									"        }",
									"    );",
									"}",
									"",
									"/* if no refresh_token, authenticate */",
									"if(refreshToken == null || refreshToken === \"\") {",
									"    pm.sendRequest(",
									"        {",
									"            method: \"POST\",",
									"            url: apiUrl + \"/oauth/access_token\",",
									"            header: \"Content-Type:application/json\",",
									"            body: '{\"client_id\": \"' + clientId + '\", \"client_secret\": \"' + clientSecret + '\", \"grant\": \"client_credentials\"}'",
									"        }, ",
									"        function (err, response) {",
									"            let resp = response.json()",
									"            if(resp.success) {",
									"                pm.collectionVariables.set(\"api_access_token\", resp.data.access_token);",
									"                pm.collectionVariables.set(\"api_refresh_token\", resp.data.refresh_token);",
									"                pm.collectionVariables.set(\"api_access_token_expiration\", new Date().getTime() + (resp.data.duration * 1000));",
									"            }",
									"        }",
									"    );",
									"}"
								],
								"type": "text/javascript",
								"packages": {},
								"requests": {}
							}
						}
					],
					"request": {
						"method": "PUT",
						"header": [],
						"body": {
							"mode": "raw",
							"raw": "{\r\n    \"price_with_tax\": 47.90,\r\n    \"vat_rate\": 22\r\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "{{api_url}}/products/:id",
							"host": [
								"{{api_url}}"
							],
							"path": [
								"products",
								":id"
							],
							"variable": [
								{
									"key": "id",
									"value": "",
									"description": "Identifier of the product"
								}
							]
						}
					},
					"response": []
				},
				{
					"name": "Update Product Status",
					"event": [
						{
							"listen": "prerequest",
							"script": {
								"exec": [
									"let apiUrl = pm.collectionVariables.get(\"api_url\");",
									"let clientId = pm.collectionVariables.get(\"api_client_id\");",
									"let clientSecret = pm.collectionVariables.get(\"api_client_secret\");",
									"let accessToken = pm.collectionVariables.get(\"api_access_token\");",
									"let accessTokenExpiration = pm.collectionVariables.get(\"api_access_token_expiration\");",
									"let refreshToken = pm.collectionVariables.get(\"api_refresh_token\");",
									"",
									"/* if there is the access_token but is expired or if therein't the access_token but the there is a refresh_token */",
									"if(refreshToken != null && refreshToken != \"\" && (",
									"    (accessToken != null && accessToken !== \"\" && accessTokenExpiration <= new Date().getTime()) ||",
									"    (accessToken == null && accessToken === \"\" && refreshToken != null && refreshToken != \"\"))",
									"    ) {",
									"    /* refresh the access_token */",
									"    pm.sendRequest(",
									"        {",
									"            method: \"POST\",",
									"            url: apiUrl + \"/oauth/access_token\",",
									"            header: \"Content-Type:application/json\",",
									"            body: '{\"client_id\": \"' + clientId + '\", \"refresh_token\": \"' + refreshToken + '\", \"grant\": \"refresh_token\"}'",
									"        }, ",
									"        function (err, response) {",
									"            let resp = response.json();",
									"            if(resp.success) {",
									"                pm.collectionVariables.set(\"api_access_token\", resp.data.access_token);",
									"                pm.collectionVariables.set(\"api_refresh_token\", resp.data.refresh_token);",
									"                pm.collectionVariables.set(\"api_access_token_expiration\", new Date().getTime() + (resp.data.duration * 1000));",
									"            }",
									"        }",
									"    );",
									"}",
									"",
									"/* if no refresh_token, authenticate */",
									"if(refreshToken == null || refreshToken === \"\") {",
									"    pm.sendRequest(",
									"        {",
									"            method: \"POST\",",
									"            url: apiUrl + \"/oauth/access_token\",",
									"            header: \"Content-Type:application/json\",",
									"            body: '{\"client_id\": \"' + clientId + '\", \"client_secret\": \"' + clientSecret + '\", \"grant\": \"client_credentials\"}'",
									"        }, ",
									"        function (err, response) {",
									"            let resp = response.json()",
									"            if(resp.success) {",
									"                pm.collectionVariables.set(\"api_access_token\", resp.data.access_token);",
									"                pm.collectionVariables.set(\"api_refresh_token\", resp.data.refresh_token);",
									"                pm.collectionVariables.set(\"api_access_token_expiration\", new Date().getTime() + (resp.data.duration * 1000));",
									"            }",
									"        }",
									"    );",
									"}"
								],
								"type": "text/javascript",
								"packages": {},
								"requests": {}
							}
						}
					],
					"request": {
						"method": "PUT",
						"header": [],
						"body": {
							"mode": "raw",
							"raw": "{\r\n    \"active\": true\r\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "{{api_url}}/products/:id/status",
							"host": [
								"{{api_url}}"
							],
							"path": [
								"products",
								":id",
								"status"
							],
							"variable": [
								{
									"key": "id",
									"value": "",
									"description": "Identifier of the product"
								}
							]
						}
					},
					"response": []
				}
			],
			"auth": {
				"type": "bearer",
				"bearer": [
					{
						"key": "token",
						"value": "{{api_access_token}}",
						"type": "string"
					}
				]
			},
			"event": [
				{
					"listen": "prerequest",
					"script": {
						"type": "text/javascript",
						"requests": {},
						"exec": [
							""
						]
					}
				},
				{
					"listen": "test",
					"script": {
						"type": "text/javascript",
						"requests": {},
						"exec": [
							""
						]
					}
				}
			]
		},
		{
			"name": "Provisions",
			"item": [
				{
					"name": "Retrieve Product Provisions",
					"event": [
						{
							"listen": "prerequest",
							"script": {
								"exec": [
									"let apiUrl = pm.collectionVariables.get(\"api_url\");",
									"let clientId = pm.collectionVariables.get(\"api_client_id\");",
									"let clientSecret = pm.collectionVariables.get(\"api_client_secret\");",
									"let accessToken = pm.collectionVariables.get(\"api_access_token\");",
									"let accessTokenExpiration = pm.collectionVariables.get(\"api_access_token_expiration\");",
									"let refreshToken = pm.collectionVariables.get(\"api_refresh_token\");",
									"",
									"/* if there is the access_token but is expired or if therein't the access_token but the there is a refresh_token */",
									"if(refreshToken != null && refreshToken != \"\" && (",
									"    (accessToken != null && accessToken !== \"\" && accessTokenExpiration <= new Date().getTime()) ||",
									"    (accessToken == null && accessToken === \"\" && refreshToken != null && refreshToken != \"\"))",
									"    ) {",
									"    /* refresh the access_token */",
									"    pm.sendRequest(",
									"        {",
									"            method: \"POST\",",
									"            url: apiUrl + \"/oauth/access_token\",",
									"            header: \"Content-Type:application/json\",",
									"            body: '{\"client_id\": \"' + clientId + '\", \"refresh_token\": \"' + refreshToken + '\", \"grant\": \"refresh_token\"}'",
									"        }, ",
									"        function (err, response) {",
									"            let resp = response.json();",
									"            if(resp.success) {",
									"                pm.collectionVariables.set(\"api_access_token\", resp.data.access_token);",
									"                pm.collectionVariables.set(\"api_refresh_token\", resp.data.refresh_token);",
									"                pm.collectionVariables.set(\"api_access_token_expiration\", new Date().getTime() + (resp.data.duration * 1000));",
									"            }",
									"        }",
									"    );",
									"}",
									"",
									"/* if no refresh_token, authenticate */",
									"if(refreshToken == null || refreshToken === \"\") {",
									"    pm.sendRequest(",
									"        {",
									"            method: \"POST\",",
									"            url: apiUrl + \"/oauth/access_token\",",
									"            header: \"Content-Type:application/json\",",
									"            body: '{\"client_id\": \"' + clientId + '\", \"client_secret\": \"' + clientSecret + '\", \"grant\": \"client_credentials\"}'",
									"        }, ",
									"        function (err, response) {",
									"            let resp = response.json()",
									"            if(resp.success) {",
									"                pm.collectionVariables.set(\"api_access_token\", resp.data.access_token);",
									"                pm.collectionVariables.set(\"api_refresh_token\", resp.data.refresh_token);",
									"                pm.collectionVariables.set(\"api_access_token_expiration\", new Date().getTime() + (resp.data.duration * 1000));",
									"            }",
									"        }",
									"    );",
									"}"
								],
								"type": "text/javascript",
								"packages": {},
								"requests": {}
							}
						}
					],
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "{{api_url}}/products/:productId/provisions?stock&supplier",
							"host": [
								"{{api_url}}"
							],
							"path": [
								"products",
								":productId",
								"provisions"
							],
							"query": [
								{
									"key": "stock",
									"value": null,
									"description": "If true only internal supplies are retrieved, false only external supplies are retrieved"
								},
								{
									"key": "supplier",
									"value": null,
									"description": "Retrieve only provision of a supplier for the selected product based on the identifier of the supplier on Poleepo"
								}
							],
							"variable": [
								{
									"key": "productId",
									"value": "",
									"description": "Identifier of the product"
								}
							]
						}
					},
					"response": []
				},
				{
					"name": "Update Product Provision",
					"event": [
						{
							"listen": "prerequest",
							"script": {
								"exec": [
									"let apiUrl = pm.collectionVariables.get(\"api_url\");",
									"let clientId = pm.collectionVariables.get(\"api_client_id\");",
									"let clientSecret = pm.collectionVariables.get(\"api_client_secret\");",
									"let accessToken = pm.collectionVariables.get(\"api_access_token\");",
									"let accessTokenExpiration = pm.collectionVariables.get(\"api_access_token_expiration\");",
									"let refreshToken = pm.collectionVariables.get(\"api_refresh_token\");",
									"",
									"/* if there is the access_token but is expired or if therein't the access_token but the there is a refresh_token */",
									"if(refreshToken != null && refreshToken != \"\" && (",
									"    (accessToken != null && accessToken !== \"\" && accessTokenExpiration <= new Date().getTime()) ||",
									"    (accessToken == null && accessToken === \"\" && refreshToken != null && refreshToken != \"\"))",
									"    ) {",
									"    /* refresh the access_token */",
									"    pm.sendRequest(",
									"        {",
									"            method: \"POST\",",
									"            url: apiUrl + \"/oauth/access_token\",",
									"            header: \"Content-Type:application/json\",",
									"            body: '{\"client_id\": \"' + clientId + '\", \"refresh_token\": \"' + refreshToken + '\", \"grant\": \"refresh_token\"}'",
									"        }, ",
									"        function (err, response) {",
									"            let resp = response.json();",
									"            if(resp.success) {",
									"                pm.collectionVariables.set(\"api_access_token\", resp.data.access_token);",
									"                pm.collectionVariables.set(\"api_refresh_token\", resp.data.refresh_token);",
									"                pm.collectionVariables.set(\"api_access_token_expiration\", new Date().getTime() + (resp.data.duration * 1000));",
									"            }",
									"        }",
									"    );",
									"}",
									"",
									"/* if no refresh_token, authenticate */",
									"if(refreshToken == null || refreshToken === \"\") {",
									"    pm.sendRequest(",
									"        {",
									"            method: \"POST\",",
									"            url: apiUrl + \"/oauth/access_token\",",
									"            header: \"Content-Type:application/json\",",
									"            body: '{\"client_id\": \"' + clientId + '\", \"client_secret\": \"' + clientSecret + '\", \"grant\": \"client_credentials\"}'",
									"        }, ",
									"        function (err, response) {",
									"            let resp = response.json()",
									"            if(resp.success) {",
									"                pm.collectionVariables.set(\"api_access_token\", resp.data.access_token);",
									"                pm.collectionVariables.set(\"api_refresh_token\", resp.data.refresh_token);",
									"                pm.collectionVariables.set(\"api_access_token_expiration\", new Date().getTime() + (resp.data.duration * 1000));",
									"            }",
									"        }",
									"    );",
									"}"
								],
								"type": "text/javascript",
								"packages": {},
								"requests": {}
							}
						}
					],
					"request": {
						"method": "PUT",
						"header": [],
						"body": {
							"mode": "raw",
							"raw": "{\r\n    \"internal\": true,\r\n    \"properties\": [\r\n        {\r\n            \"key\": \"quantity\",\r\n            \"value\": 1\r\n        },\r\n        {\r\n            \"key\": \"price\",\r\n            \"value\": 73.3975\r\n        }\r\n    ]\r\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "{{api_url}}/products/:id/provisions",
							"host": [
								"{{api_url}}"
							],
							"path": [
								"products",
								":id",
								"provisions"
							],
							"variable": [
								{
									"key": "id",
									"value": "",
									"description": "Identifier of the product"
								}
							]
						}
					},
					"response": []
				},
				{
					"name": "Update Variation Provision",
					"event": [
						{
							"listen": "prerequest",
							"script": {
								"exec": [
									"let apiUrl = pm.collectionVariables.get(\"api_url\");",
									"let clientId = pm.collectionVariables.get(\"api_client_id\");",
									"let clientSecret = pm.collectionVariables.get(\"api_client_secret\");",
									"let accessToken = pm.collectionVariables.get(\"api_access_token\");",
									"let accessTokenExpiration = pm.collectionVariables.get(\"api_access_token_expiration\");",
									"let refreshToken = pm.collectionVariables.get(\"api_refresh_token\");",
									"",
									"/* if there is the access_token but is expired or if therein't the access_token but the there is a refresh_token */",
									"if(refreshToken != null && refreshToken != \"\" && (",
									"    (accessToken != null && accessToken !== \"\" && accessTokenExpiration <= new Date().getTime()) ||",
									"    (accessToken == null && accessToken === \"\" && refreshToken != null && refreshToken != \"\"))",
									"    ) {",
									"    /* refresh the access_token */",
									"    pm.sendRequest(",
									"        {",
									"            method: \"POST\",",
									"            url: apiUrl + \"/oauth/access_token\",",
									"            header: \"Content-Type:application/json\",",
									"            body: '{\"client_id\": \"' + clientId + '\", \"refresh_token\": \"' + refreshToken + '\", \"grant\": \"refresh_token\"}'",
									"        }, ",
									"        function (err, response) {",
									"            let resp = response.json();",
									"            if(resp.success) {",
									"                pm.collectionVariables.set(\"api_access_token\", resp.data.access_token);",
									"                pm.collectionVariables.set(\"api_refresh_token\", resp.data.refresh_token);",
									"                pm.collectionVariables.set(\"api_access_token_expiration\", new Date().getTime() + (resp.data.duration * 1000));",
									"            }",
									"        }",
									"    );",
									"}",
									"",
									"/* if no refresh_token, authenticate */",
									"if(refreshToken == null || refreshToken === \"\") {",
									"    pm.sendRequest(",
									"        {",
									"            method: \"POST\",",
									"            url: apiUrl + \"/oauth/access_token\",",
									"            header: \"Content-Type:application/json\",",
									"            body: '{\"client_id\": \"' + clientId + '\", \"client_secret\": \"' + clientSecret + '\", \"grant\": \"client_credentials\"}'",
									"        }, ",
									"        function (err, response) {",
									"            let resp = response.json()",
									"            if(resp.success) {",
									"                pm.collectionVariables.set(\"api_access_token\", resp.data.access_token);",
									"                pm.collectionVariables.set(\"api_refresh_token\", resp.data.refresh_token);",
									"                pm.collectionVariables.set(\"api_access_token_expiration\", new Date().getTime() + (resp.data.duration * 1000));",
									"            }",
									"        }",
									"    );",
									"}"
								],
								"type": "text/javascript",
								"packages": {},
								"requests": {}
							}
						}
					],
					"request": {
						"method": "PUT",
						"header": [],
						"body": {
							"mode": "raw",
							"raw": "{\r\n    \"internal\": true,\r\n    \"properties\": [\r\n        {\r\n            \"key\": \"quantity\",\r\n            \"value\": 1\r\n        },\r\n        {\r\n            \"key\": \"price\",\r\n            \"value\": 73.3975\r\n        }\r\n    ]\r\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "{{api_url}}/products/:id/variations/:vid/provisions",
							"host": [
								"{{api_url}}"
							],
							"path": [
								"products",
								":id",
								"variations",
								":vid",
								"provisions"
							],
							"variable": [
								{
									"key": "id",
									"value": "",
									"description": "Identifier of the product"
								},
								{
									"key": "vid",
									"value": "",
									"description": "Identifier of the variation"
								}
							]
						}
					},
					"response": []
				}
			],
			"auth": {
				"type": "bearer",
				"bearer": [
					{
						"key": "token",
						"value": "{{api_access_token}}",
						"type": "string"
					}
				]
			},
			"event": [
				{
					"listen": "prerequest",
					"script": {
						"type": "text/javascript",
						"requests": {},
						"exec": [
							""
						]
					}
				},
				{
					"listen": "test",
					"script": {
						"type": "text/javascript",
						"requests": {},
						"exec": [
							""
						]
					}
				}
			]
		},
		{
			"name": "Publications",
			"item": [
				{
					"name": "Create New Publication",
					"event": [
						{
							"listen": "prerequest",
							"script": {
								"exec": [
									"let apiUrl = pm.collectionVariables.get(\"api_url\");",
									"let clientId = pm.collectionVariables.get(\"api_client_id\");",
									"let clientSecret = pm.collectionVariables.get(\"api_client_secret\");",
									"let accessToken = pm.collectionVariables.get(\"api_access_token\");",
									"let accessTokenExpiration = pm.collectionVariables.get(\"api_access_token_expiration\");",
									"let refreshToken = pm.collectionVariables.get(\"api_refresh_token\");",
									"",
									"/* if there is the access_token but is expired or if therein't the access_token but the there is a refresh_token */",
									"if(refreshToken != null && refreshToken != \"\" && (",
									"    (accessToken != null && accessToken !== \"\" && accessTokenExpiration <= new Date().getTime()) ||",
									"    (accessToken == null && accessToken === \"\" && refreshToken != null && refreshToken != \"\"))",
									"    ) {",
									"    /* refresh the access_token */",
									"    pm.sendRequest(",
									"        {",
									"            method: \"POST\",",
									"            url: apiUrl + \"/oauth/access_token\",",
									"            header: \"Content-Type:application/json\",",
									"            body: '{\"client_id\": \"' + clientId + '\", \"refresh_token\": \"' + refreshToken + '\", \"grant\": \"refresh_token\"}'",
									"        }, ",
									"        function (err, response) {",
									"            let resp = response.json();",
									"            if(resp.success) {",
									"                pm.collectionVariables.set(\"api_access_token\", resp.data.access_token);",
									"                pm.collectionVariables.set(\"api_refresh_token\", resp.data.refresh_token);",
									"                pm.collectionVariables.set(\"api_access_token_expiration\", new Date().getTime() + (resp.data.duration * 1000));",
									"            }",
									"        }",
									"    );",
									"}",
									"",
									"/* if no refresh_token, authenticate */",
									"if(refreshToken == null || refreshToken === \"\") {",
									"    pm.sendRequest(",
									"        {",
									"            method: \"POST\",",
									"            url: apiUrl + \"/oauth/access_token\",",
									"            header: \"Content-Type:application/json\",",
									"            body: '{\"client_id\": \"' + clientId + '\", \"client_secret\": \"' + clientSecret + '\", \"grant\": \"client_credentials\"}'",
									"        }, ",
									"        function (err, response) {",
									"            let resp = response.json()",
									"            if(resp.success) {",
									"                pm.collectionVariables.set(\"api_access_token\", resp.data.access_token);",
									"                pm.collectionVariables.set(\"api_refresh_token\", resp.data.refresh_token);",
									"                pm.collectionVariables.set(\"api_access_token_expiration\", new Date().getTime() + (resp.data.duration * 1000));",
									"            }",
									"        }",
									"    );",
									"}"
								],
								"type": "text/javascript",
								"packages": {},
								"requests": {}
							}
						}
					],
					"request": {
						"method": "POST",
						"header": [],
						"body": {
							"mode": "raw",
							"raw": "{\r\n    \"source\": \"WOOCOMMERCE\",\r\n    \"product_id\": 0,\r\n    \"remote\": false,\r\n    \"properties\": [\r\n        {\r\n            \"key\": \"price_with_tax\",\r\n            \"value\": 0.0\r\n        }\r\n    ]\r\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "{{api_url}}/channels/publications",
							"host": [
								"{{api_url}}"
							],
							"path": [
								"channels",
								"publications"
							]
						}
					},
					"response": []
				},
				{
					"name": "Delete Publication",
					"event": [
						{
							"listen": "prerequest",
							"script": {
								"exec": [
									"let apiUrl = pm.collectionVariables.get(\"api_url\");",
									"let clientId = pm.collectionVariables.get(\"api_client_id\");",
									"let clientSecret = pm.collectionVariables.get(\"api_client_secret\");",
									"let accessToken = pm.collectionVariables.get(\"api_access_token\");",
									"let accessTokenExpiration = pm.collectionVariables.get(\"api_access_token_expiration\");",
									"let refreshToken = pm.collectionVariables.get(\"api_refresh_token\");",
									"",
									"/* if there is the access_token but is expired or if therein't the access_token but the there is a refresh_token */",
									"if(refreshToken != null && refreshToken != \"\" && (",
									"    (accessToken != null && accessToken !== \"\" && accessTokenExpiration <= new Date().getTime()) ||",
									"    (accessToken == null && accessToken === \"\" && refreshToken != null && refreshToken != \"\"))",
									"    ) {",
									"    /* refresh the access_token */",
									"    pm.sendRequest(",
									"        {",
									"            method: \"POST\",",
									"            url: apiUrl + \"/oauth/access_token\",",
									"            header: \"Content-Type:application/json\",",
									"            body: '{\"client_id\": \"' + clientId + '\", \"refresh_token\": \"' + refreshToken + '\", \"grant\": \"refresh_token\"}'",
									"        }, ",
									"        function (err, response) {",
									"            let resp = response.json();",
									"            if(resp.success) {",
									"                pm.collectionVariables.set(\"api_access_token\", resp.data.access_token);",
									"                pm.collectionVariables.set(\"api_refresh_token\", resp.data.refresh_token);",
									"                pm.collectionVariables.set(\"api_access_token_expiration\", new Date().getTime() + (resp.data.duration * 1000));",
									"            }",
									"        }",
									"    );",
									"}",
									"",
									"/* if no refresh_token, authenticate */",
									"if(refreshToken == null || refreshToken === \"\") {",
									"    pm.sendRequest(",
									"        {",
									"            method: \"POST\",",
									"            url: apiUrl + \"/oauth/access_token\",",
									"            header: \"Content-Type:application/json\",",
									"            body: '{\"client_id\": \"' + clientId + '\", \"client_secret\": \"' + clientSecret + '\", \"grant\": \"client_credentials\"}'",
									"        }, ",
									"        function (err, response) {",
									"            let resp = response.json()",
									"            if(resp.success) {",
									"                pm.collectionVariables.set(\"api_access_token\", resp.data.access_token);",
									"                pm.collectionVariables.set(\"api_refresh_token\", resp.data.refresh_token);",
									"                pm.collectionVariables.set(\"api_access_token_expiration\", new Date().getTime() + (resp.data.duration * 1000));",
									"            }",
									"        }",
									"    );",
									"}"
								],
								"type": "text/javascript",
								"packages": {},
								"requests": {}
							}
						}
					],
					"request": {
						"method": "DELETE",
						"header": [],
						"url": {
							"raw": "{{api_url}}/channels/publications/:id",
							"host": [
								"{{api_url}}"
							],
							"path": [
								"channels",
								"publications",
								":id"
							],
							"variable": [
								{
									"key": "id",
									"value": null,
									"description": "Identifier of the publication"
								}
							]
						}
					},
					"response": []
				},
				{
					"name": "Retrieve Publication Detail",
					"event": [
						{
							"listen": "prerequest",
							"script": {
								"exec": [
									"let apiUrl = pm.collectionVariables.get(\"api_url\");",
									"let clientId = pm.collectionVariables.get(\"api_client_id\");",
									"let clientSecret = pm.collectionVariables.get(\"api_client_secret\");",
									"let accessToken = pm.collectionVariables.get(\"api_access_token\");",
									"let accessTokenExpiration = pm.collectionVariables.get(\"api_access_token_expiration\");",
									"let refreshToken = pm.collectionVariables.get(\"api_refresh_token\");",
									"",
									"/* if there is the access_token but is expired or if therein't the access_token but the there is a refresh_token */",
									"if(refreshToken != null && refreshToken != \"\" && (",
									"    (accessToken != null && accessToken !== \"\" && accessTokenExpiration <= new Date().getTime()) ||",
									"    (accessToken == null && accessToken === \"\" && refreshToken != null && refreshToken != \"\"))",
									"    ) {",
									"    /* refresh the access_token */",
									"    pm.sendRequest(",
									"        {",
									"            method: \"POST\",",
									"            url: apiUrl + \"/oauth/access_token\",",
									"            header: \"Content-Type:application/json\",",
									"            body: '{\"client_id\": \"' + clientId + '\", \"refresh_token\": \"' + refreshToken + '\", \"grant\": \"refresh_token\"}'",
									"        }, ",
									"        function (err, response) {",
									"            let resp = response.json();",
									"            if(resp.success) {",
									"                pm.collectionVariables.set(\"api_access_token\", resp.data.access_token);",
									"                pm.collectionVariables.set(\"api_refresh_token\", resp.data.refresh_token);",
									"                pm.collectionVariables.set(\"api_access_token_expiration\", new Date().getTime() + (resp.data.duration * 1000));",
									"            }",
									"        }",
									"    );",
									"}",
									"",
									"/* if no refresh_token, authenticate */",
									"if(refreshToken == null || refreshToken === \"\") {",
									"    pm.sendRequest(",
									"        {",
									"            method: \"POST\",",
									"            url: apiUrl + \"/oauth/access_token\",",
									"            header: \"Content-Type:application/json\",",
									"            body: '{\"client_id\": \"' + clientId + '\", \"client_secret\": \"' + clientSecret + '\", \"grant\": \"client_credentials\"}'",
									"        }, ",
									"        function (err, response) {",
									"            let resp = response.json()",
									"            if(resp.success) {",
									"                pm.collectionVariables.set(\"api_access_token\", resp.data.access_token);",
									"                pm.collectionVariables.set(\"api_refresh_token\", resp.data.refresh_token);",
									"                pm.collectionVariables.set(\"api_access_token_expiration\", new Date().getTime() + (resp.data.duration * 1000));",
									"            }",
									"        }",
									"    );",
									"}"
								],
								"type": "text/javascript",
								"packages": {},
								"requests": {}
							}
						}
					],
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "{{api_url}}/channels/publications/:id",
							"host": [
								"{{api_url}}"
							],
							"path": [
								"channels",
								"publications",
								":id"
							],
							"variable": [
								{
									"key": "id",
									"value": null,
									"description": "Identifier of the publication"
								}
							]
						}
					},
					"response": []
				},
				{
					"name": "Retrieve Publication List",
					"event": [
						{
							"listen": "prerequest",
							"script": {
								"exec": [
									"let apiUrl = pm.collectionVariables.get(\"api_url\");",
									"let clientId = pm.collectionVariables.get(\"api_client_id\");",
									"let clientSecret = pm.collectionVariables.get(\"api_client_secret\");",
									"let accessToken = pm.collectionVariables.get(\"api_access_token\");",
									"let accessTokenExpiration = pm.collectionVariables.get(\"api_access_token_expiration\");",
									"let refreshToken = pm.collectionVariables.get(\"api_refresh_token\");",
									"",
									"/* if there is the access_token but is expired or if therein't the access_token but the there is a refresh_token */",
									"if(refreshToken != null && refreshToken != \"\" && (",
									"    (accessToken != null && accessToken !== \"\" && accessTokenExpiration <= new Date().getTime()) ||",
									"    (accessToken == null && accessToken === \"\" && refreshToken != null && refreshToken != \"\"))",
									"    ) {",
									"    /* refresh the access_token */",
									"    pm.sendRequest(",
									"        {",
									"            method: \"POST\",",
									"            url: apiUrl + \"/oauth/access_token\",",
									"            header: \"Content-Type:application/json\",",
									"            body: '{\"client_id\": \"' + clientId + '\", \"refresh_token\": \"' + refreshToken + '\", \"grant\": \"refresh_token\"}'",
									"        }, ",
									"        function (err, response) {",
									"            let resp = response.json();",
									"            if(resp.success) {",
									"                pm.collectionVariables.set(\"api_access_token\", resp.data.access_token);",
									"                pm.collectionVariables.set(\"api_refresh_token\", resp.data.refresh_token);",
									"                pm.collectionVariables.set(\"api_access_token_expiration\", new Date().getTime() + (resp.data.duration * 1000));",
									"            }",
									"        }",
									"    );",
									"}",
									"",
									"/* if no refresh_token, authenticate */",
									"if(refreshToken == null || refreshToken === \"\") {",
									"    pm.sendRequest(",
									"        {",
									"            method: \"POST\",",
									"            url: apiUrl + \"/oauth/access_token\",",
									"            header: \"Content-Type:application/json\",",
									"            body: '{\"client_id\": \"' + clientId + '\", \"client_secret\": \"' + clientSecret + '\", \"grant\": \"client_credentials\"}'",
									"        }, ",
									"        function (err, response) {",
									"            let resp = response.json()",
									"            if(resp.success) {",
									"                pm.collectionVariables.set(\"api_access_token\", resp.data.access_token);",
									"                pm.collectionVariables.set(\"api_refresh_token\", resp.data.refresh_token);",
									"                pm.collectionVariables.set(\"api_access_token_expiration\", new Date().getTime() + (resp.data.duration * 1000));",
									"            }",
									"        }",
									"    );",
									"}"
								],
								"type": "text/javascript",
								"packages": {},
								"requests": {}
							}
						}
					],
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "{{api_url}}/channels/publications",
							"host": [
								"{{api_url}}"
							],
							"path": [
								"channels",
								"publications"
							],
							"query": [
								{
									"key": "product",
									"value": null,
									"description": "Identifier of the main product to use for filter the publications",
									"disabled": true
								},
								{
									"key": "active",
									"value": null,
									"description": "If true only the active publications are retrieved, false only the not active publications are retrieved",
									"disabled": true
								},
								{
									"key": "sources",
									"value": null,
									"description": "Retrieve publications for a certain channels",
									"disabled": true
								},
								{
									"key": "identifier",
									"value": null,
									"description": "Search for publications identifers (SKU, EAN, MPN)",
									"disabled": true
								},
								{
									"key": "offset",
									"value": null,
									"disabled": true
								},
								{
									"key": "max",
									"value": null,
									"disabled": true
								}
							]
						}
					},
					"response": []
				},
				{
					"name": "Update Publication",
					"event": [
						{
							"listen": "prerequest",
							"script": {
								"exec": [
									"let apiUrl = pm.collectionVariables.get(\"api_url\");",
									"let clientId = pm.collectionVariables.get(\"api_client_id\");",
									"let clientSecret = pm.collectionVariables.get(\"api_client_secret\");",
									"let accessToken = pm.collectionVariables.get(\"api_access_token\");",
									"let accessTokenExpiration = pm.collectionVariables.get(\"api_access_token_expiration\");",
									"let refreshToken = pm.collectionVariables.get(\"api_refresh_token\");",
									"",
									"/* if there is the access_token but is expired or if therein't the access_token but the there is a refresh_token */",
									"if(refreshToken != null && refreshToken != \"\" && (",
									"    (accessToken != null && accessToken !== \"\" && accessTokenExpiration <= new Date().getTime()) ||",
									"    (accessToken == null && accessToken === \"\" && refreshToken != null && refreshToken != \"\"))",
									"    ) {",
									"    /* refresh the access_token */",
									"    pm.sendRequest(",
									"        {",
									"            method: \"POST\",",
									"            url: apiUrl + \"/oauth/access_token\",",
									"            header: \"Content-Type:application/json\",",
									"            body: '{\"client_id\": \"' + clientId + '\", \"refresh_token\": \"' + refreshToken + '\", \"grant\": \"refresh_token\"}'",
									"        }, ",
									"        function (err, response) {",
									"            let resp = response.json();",
									"            if(resp.success) {",
									"                pm.collectionVariables.set(\"api_access_token\", resp.data.access_token);",
									"                pm.collectionVariables.set(\"api_refresh_token\", resp.data.refresh_token);",
									"                pm.collectionVariables.set(\"api_access_token_expiration\", new Date().getTime() + (resp.data.duration * 1000));",
									"            }",
									"        }",
									"    );",
									"}",
									"",
									"/* if no refresh_token, authenticate */",
									"if(refreshToken == null || refreshToken === \"\") {",
									"    pm.sendRequest(",
									"        {",
									"            method: \"POST\",",
									"            url: apiUrl + \"/oauth/access_token\",",
									"            header: \"Content-Type:application/json\",",
									"            body: '{\"client_id\": \"' + clientId + '\", \"client_secret\": \"' + clientSecret + '\", \"grant\": \"client_credentials\"}'",
									"        }, ",
									"        function (err, response) {",
									"            let resp = response.json()",
									"            if(resp.success) {",
									"                pm.collectionVariables.set(\"api_access_token\", resp.data.access_token);",
									"                pm.collectionVariables.set(\"api_refresh_token\", resp.data.refresh_token);",
									"                pm.collectionVariables.set(\"api_access_token_expiration\", new Date().getTime() + (resp.data.duration * 1000));",
									"            }",
									"        }",
									"    );",
									"}"
								],
								"type": "text/javascript",
								"packages": {},
								"requests": {}
							}
						}
					],
					"request": {
						"method": "PUT",
						"header": [],
						"body": {
							"mode": "raw",
							"raw": "{\r\n    \"price_with_tax\": 19\r\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "{{api_url}}/channels/publications/:id",
							"host": [
								"{{api_url}}"
							],
							"path": [
								"channels",
								"publications",
								":id"
							],
							"variable": [
								{
									"key": "id",
									"value": "9947843",
									"description": "Identifier of the publication"
								}
							]
						}
					},
					"response": []
				},
				{
					"name": "Update Publication Status",
					"event": [
						{
							"listen": "prerequest",
							"script": {
								"exec": [
									"let apiUrl = pm.collectionVariables.get(\"api_url\");",
									"let clientId = pm.collectionVariables.get(\"api_client_id\");",
									"let clientSecret = pm.collectionVariables.get(\"api_client_secret\");",
									"let accessToken = pm.collectionVariables.get(\"api_access_token\");",
									"let accessTokenExpiration = pm.collectionVariables.get(\"api_access_token_expiration\");",
									"let refreshToken = pm.collectionVariables.get(\"api_refresh_token\");",
									"",
									"/* if there is the access_token but is expired or if therein't the access_token but the there is a refresh_token */",
									"if(refreshToken != null && refreshToken != \"\" && (",
									"    (accessToken != null && accessToken !== \"\" && accessTokenExpiration <= new Date().getTime()) ||",
									"    (accessToken == null && accessToken === \"\" && refreshToken != null && refreshToken != \"\"))",
									"    ) {",
									"    /* refresh the access_token */",
									"    pm.sendRequest(",
									"        {",
									"            method: \"POST\",",
									"            url: apiUrl + \"/oauth/access_token\",",
									"            header: \"Content-Type:application/json\",",
									"            body: '{\"client_id\": \"' + clientId + '\", \"refresh_token\": \"' + refreshToken + '\", \"grant\": \"refresh_token\"}'",
									"        }, ",
									"        function (err, response) {",
									"            let resp = response.json();",
									"            if(resp.success) {",
									"                pm.collectionVariables.set(\"api_access_token\", resp.data.access_token);",
									"                pm.collectionVariables.set(\"api_refresh_token\", resp.data.refresh_token);",
									"                pm.collectionVariables.set(\"api_access_token_expiration\", new Date().getTime() + (resp.data.duration * 1000));",
									"            }",
									"        }",
									"    );",
									"}",
									"",
									"/* if no refresh_token, authenticate */",
									"if(refreshToken == null || refreshToken === \"\") {",
									"    pm.sendRequest(",
									"        {",
									"            method: \"POST\",",
									"            url: apiUrl + \"/oauth/access_token\",",
									"            header: \"Content-Type:application/json\",",
									"            body: '{\"client_id\": \"' + clientId + '\", \"client_secret\": \"' + clientSecret + '\", \"grant\": \"client_credentials\"}'",
									"        }, ",
									"        function (err, response) {",
									"            let resp = response.json()",
									"            if(resp.success) {",
									"                pm.collectionVariables.set(\"api_access_token\", resp.data.access_token);",
									"                pm.collectionVariables.set(\"api_refresh_token\", resp.data.refresh_token);",
									"                pm.collectionVariables.set(\"api_access_token_expiration\", new Date().getTime() + (resp.data.duration * 1000));",
									"            }",
									"        }",
									"    );",
									"}"
								],
								"type": "text/javascript",
								"packages": {},
								"requests": {}
							}
						}
					],
					"request": {
						"method": "PUT",
						"header": [],
						"body": {
							"mode": "raw",
							"raw": "{\r\n    \"active\": true\r\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "{{api_url}}/channels/publications/:id/status",
							"host": [
								"{{api_url}}"
							],
							"path": [
								"channels",
								"publications",
								":id",
								"status"
							],
							"variable": [
								{
									"key": "id",
									"value": "",
									"description": "Identifier of the publication"
								}
							]
						}
					},
					"response": []
				}
			],
			"auth": {
				"type": "bearer",
				"bearer": [
					{
						"key": "token",
						"value": "{{api_access_token}}",
						"type": "string"
					}
				]
			},
			"event": [
				{
					"listen": "prerequest",
					"script": {
						"type": "text/javascript",
						"requests": {},
						"exec": [
							""
						]
					}
				},
				{
					"listen": "test",
					"script": {
						"type": "text/javascript",
						"requests": {},
						"exec": [
							""
						]
					}
				}
			]
		},
		{
			"name": "Shippings",
			"item": [
				{
					"name": "Create New Shipping",
					"event": [
						{
							"listen": "prerequest",
							"script": {
								"exec": [
									"let apiUrl = pm.collectionVariables.get(\"api_url\");",
									"let clientId = pm.collectionVariables.get(\"api_client_id\");",
									"let clientSecret = pm.collectionVariables.get(\"api_client_secret\");",
									"let accessToken = pm.collectionVariables.get(\"api_access_token\");",
									"let accessTokenExpiration = pm.collectionVariables.get(\"api_access_token_expiration\");",
									"let refreshToken = pm.collectionVariables.get(\"api_refresh_token\");",
									"",
									"/* if there is the access_token but is expired or if therein't the access_token but the there is a refresh_token */",
									"if(refreshToken != null && refreshToken != \"\" && (",
									"    (accessToken != null && accessToken !== \"\" && accessTokenExpiration <= new Date().getTime()) ||",
									"    (accessToken == null && accessToken === \"\" && refreshToken != null && refreshToken != \"\"))",
									"    ) {",
									"    /* refresh the access_token */",
									"    pm.sendRequest(",
									"        {",
									"            method: \"POST\",",
									"            url: apiUrl + \"/oauth/access_token\",",
									"            header: \"Content-Type:application/json\",",
									"            body: '{\"client_id\": \"' + clientId + '\", \"refresh_token\": \"' + refreshToken + '\", \"grant\": \"refresh_token\"}'",
									"        }, ",
									"        function (err, response) {",
									"            let resp = response.json();",
									"            if(resp.success) {",
									"                pm.collectionVariables.set(\"api_access_token\", resp.data.access_token);",
									"                pm.collectionVariables.set(\"api_refresh_token\", resp.data.refresh_token);",
									"                pm.collectionVariables.set(\"api_access_token_expiration\", new Date().getTime() + (resp.data.duration * 1000));",
									"            }",
									"        }",
									"    );",
									"}",
									"",
									"/* if no refresh_token, authenticate */",
									"if(refreshToken == null || refreshToken === \"\") {",
									"    pm.sendRequest(",
									"        {",
									"            method: \"POST\",",
									"            url: apiUrl + \"/oauth/access_token\",",
									"            header: \"Content-Type:application/json\",",
									"            body: '{\"client_id\": \"' + clientId + '\", \"client_secret\": \"' + clientSecret + '\", \"grant\": \"client_credentials\"}'",
									"        }, ",
									"        function (err, response) {",
									"            let resp = response.json()",
									"            if(resp.success) {",
									"                pm.collectionVariables.set(\"api_access_token\", resp.data.access_token);",
									"                pm.collectionVariables.set(\"api_refresh_token\", resp.data.refresh_token);",
									"                pm.collectionVariables.set(\"api_access_token_expiration\", new Date().getTime() + (resp.data.duration * 1000));",
									"            }",
									"        }",
									"    );",
									"}"
								],
								"type": "text/javascript",
								"packages": {},
								"requests": {}
							}
						}
					],
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Authorization",
								"value": "Bearer {{access_token}}",
								"type": "text"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\r\n    \"generate_label\": true,\r\n    \"order_id\": 0,\r\n    \"carrier\": \"GLS_IT\",\r\n    \"pickup_address_id\": 0,\r\n    \"label_format\": \"PDF\",\r\n    \"items\": [\r\n        {\r\n            \"order_row_id\": 0,\r\n            \"quantity\": 1\r\n        }\r\n    ],\r\n    \"packages\": [\r\n        {\r\n            \"type\": \"NORMAL\",\r\n            \"weight\": 10.0,\r\n            \"width\": 200,\r\n            \"height\": 50,\r\n            \"depth\": 50\r\n        }\r\n    ]\r\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "{{api_url}}/shippings",
							"host": [
								"{{api_url}}"
							],
							"path": [
								"shippings"
							]
						}
					},
					"response": []
				},
				{
					"name": "Delete Shipping",
					"event": [
						{
							"listen": "prerequest",
							"script": {
								"exec": [
									"let apiUrl = pm.collectionVariables.get(\"api_url\");",
									"let clientId = pm.collectionVariables.get(\"api_client_id\");",
									"let clientSecret = pm.collectionVariables.get(\"api_client_secret\");",
									"let accessToken = pm.collectionVariables.get(\"api_access_token\");",
									"let accessTokenExpiration = pm.collectionVariables.get(\"api_access_token_expiration\");",
									"let refreshToken = pm.collectionVariables.get(\"api_refresh_token\");",
									"",
									"/* if there is the access_token but is expired or if therein't the access_token but the there is a refresh_token */",
									"if(refreshToken != null && refreshToken != \"\" && (",
									"    (accessToken != null && accessToken !== \"\" && accessTokenExpiration <= new Date().getTime()) ||",
									"    (accessToken == null && accessToken === \"\" && refreshToken != null && refreshToken != \"\"))",
									"    ) {",
									"    /* refresh the access_token */",
									"    pm.sendRequest(",
									"        {",
									"            method: \"POST\",",
									"            url: apiUrl + \"/oauth/access_token\",",
									"            header: \"Content-Type:application/json\",",
									"            body: '{\"client_id\": \"' + clientId + '\", \"refresh_token\": \"' + refreshToken + '\", \"grant\": \"refresh_token\"}'",
									"        }, ",
									"        function (err, response) {",
									"            let resp = response.json();",
									"            if(resp.success) {",
									"                pm.collectionVariables.set(\"api_access_token\", resp.data.access_token);",
									"                pm.collectionVariables.set(\"api_refresh_token\", resp.data.refresh_token);",
									"                pm.collectionVariables.set(\"api_access_token_expiration\", new Date().getTime() + (resp.data.duration * 1000));",
									"            }",
									"        }",
									"    );",
									"}",
									"",
									"/* if no refresh_token, authenticate */",
									"if(refreshToken == null || refreshToken === \"\") {",
									"    pm.sendRequest(",
									"        {",
									"            method: \"POST\",",
									"            url: apiUrl + \"/oauth/access_token\",",
									"            header: \"Content-Type:application/json\",",
									"            body: '{\"client_id\": \"' + clientId + '\", \"client_secret\": \"' + clientSecret + '\", \"grant\": \"client_credentials\"}'",
									"        }, ",
									"        function (err, response) {",
									"            let resp = response.json()",
									"            if(resp.success) {",
									"                pm.collectionVariables.set(\"api_access_token\", resp.data.access_token);",
									"                pm.collectionVariables.set(\"api_refresh_token\", resp.data.refresh_token);",
									"                pm.collectionVariables.set(\"api_access_token_expiration\", new Date().getTime() + (resp.data.duration * 1000));",
									"            }",
									"        }",
									"    );",
									"}"
								],
								"type": "text/javascript",
								"packages": {},
								"requests": {}
							}
						}
					],
					"request": {
						"method": "DELETE",
						"header": [],
						"url": {
							"raw": "{{api_url}}/shippings/:id",
							"host": [
								"{{api_url}}"
							],
							"path": [
								"shippings",
								":id"
							],
							"variable": [
								{
									"key": "id",
									"value": "",
									"description": "Identifier of the shipping"
								}
							]
						}
					},
					"response": []
				},
				{
					"name": "Generate Shipping Label",
					"event": [
						{
							"listen": "prerequest",
							"script": {
								"exec": [
									"let apiUrl = pm.collectionVariables.get(\"api_url\");",
									"let clientId = pm.collectionVariables.get(\"api_client_id\");",
									"let clientSecret = pm.collectionVariables.get(\"api_client_secret\");",
									"let accessToken = pm.collectionVariables.get(\"api_access_token\");",
									"let accessTokenExpiration = pm.collectionVariables.get(\"api_access_token_expiration\");",
									"let refreshToken = pm.collectionVariables.get(\"api_refresh_token\");",
									"",
									"/* if there is the access_token but is expired or if therein't the access_token but the there is a refresh_token */",
									"if(refreshToken != null && refreshToken != \"\" && (",
									"    (accessToken != null && accessToken !== \"\" && accessTokenExpiration <= new Date().getTime()) ||",
									"    (accessToken == null && accessToken === \"\" && refreshToken != null && refreshToken != \"\"))",
									"    ) {",
									"    /* refresh the access_token */",
									"    pm.sendRequest(",
									"        {",
									"            method: \"POST\",",
									"            url: apiUrl + \"/oauth/access_token\",",
									"            header: \"Content-Type:application/json\",",
									"            body: '{\"client_id\": \"' + clientId + '\", \"refresh_token\": \"' + refreshToken + '\", \"grant\": \"refresh_token\"}'",
									"        }, ",
									"        function (err, response) {",
									"            let resp = response.json();",
									"            if(resp.success) {",
									"                pm.collectionVariables.set(\"api_access_token\", resp.data.access_token);",
									"                pm.collectionVariables.set(\"api_refresh_token\", resp.data.refresh_token);",
									"                pm.collectionVariables.set(\"api_access_token_expiration\", new Date().getTime() + (resp.data.duration * 1000));",
									"            }",
									"        }",
									"    );",
									"}",
									"",
									"/* if no refresh_token, authenticate */",
									"if(refreshToken == null || refreshToken === \"\") {",
									"    pm.sendRequest(",
									"        {",
									"            method: \"POST\",",
									"            url: apiUrl + \"/oauth/access_token\",",
									"            header: \"Content-Type:application/json\",",
									"            body: '{\"client_id\": \"' + clientId + '\", \"client_secret\": \"' + clientSecret + '\", \"grant\": \"client_credentials\"}'",
									"        }, ",
									"        function (err, response) {",
									"            let resp = response.json()",
									"            if(resp.success) {",
									"                pm.collectionVariables.set(\"api_access_token\", resp.data.access_token);",
									"                pm.collectionVariables.set(\"api_refresh_token\", resp.data.refresh_token);",
									"                pm.collectionVariables.set(\"api_access_token_expiration\", new Date().getTime() + (resp.data.duration * 1000));",
									"            }",
									"        }",
									"    );",
									"}"
								],
								"type": "text/javascript",
								"packages": {},
								"requests": {}
							}
						}
					],
					"request": {
						"method": "PUT",
						"header": [
							{
								"key": "Authorization",
								"value": "Bearer {{access_token}}",
								"type": "text"
							}
						],
						"url": {
							"raw": "{{api_url}}/shippings/:id/labels/generate",
							"host": [
								"{{api_url}}"
							],
							"path": [
								"shippings",
								":id",
								"labels",
								"generate"
							],
							"variable": [
								{
									"key": "id",
									"value": "",
									"description": "Identifier of the shipping"
								}
							]
						}
					},
					"response": []
				},
				{
					"name": "Retrieve Shipping Detail",
					"event": [
						{
							"listen": "prerequest",
							"script": {
								"exec": [
									"let apiUrl = pm.collectionVariables.get(\"api_url\");",
									"let clientId = pm.collectionVariables.get(\"api_client_id\");",
									"let clientSecret = pm.collectionVariables.get(\"api_client_secret\");",
									"let accessToken = pm.collectionVariables.get(\"api_access_token\");",
									"let accessTokenExpiration = pm.collectionVariables.get(\"api_access_token_expiration\");",
									"let refreshToken = pm.collectionVariables.get(\"api_refresh_token\");",
									"",
									"/* if there is the access_token but is expired or if therein't the access_token but the there is a refresh_token */",
									"if(refreshToken != null && refreshToken != \"\" && (",
									"    (accessToken != null && accessToken !== \"\" && accessTokenExpiration <= new Date().getTime()) ||",
									"    (accessToken == null && accessToken === \"\" && refreshToken != null && refreshToken != \"\"))",
									"    ) {",
									"    /* refresh the access_token */",
									"    pm.sendRequest(",
									"        {",
									"            method: \"POST\",",
									"            url: apiUrl + \"/oauth/access_token\",",
									"            header: \"Content-Type:application/json\",",
									"            body: '{\"client_id\": \"' + clientId + '\", \"refresh_token\": \"' + refreshToken + '\", \"grant\": \"refresh_token\"}'",
									"        }, ",
									"        function (err, response) {",
									"            let resp = response.json();",
									"            if(resp.success) {",
									"                pm.collectionVariables.set(\"api_access_token\", resp.data.access_token);",
									"                pm.collectionVariables.set(\"api_refresh_token\", resp.data.refresh_token);",
									"                pm.collectionVariables.set(\"api_access_token_expiration\", new Date().getTime() + (resp.data.duration * 1000));",
									"            }",
									"        }",
									"    );",
									"}",
									"",
									"/* if no refresh_token, authenticate */",
									"if(refreshToken == null || refreshToken === \"\") {",
									"    pm.sendRequest(",
									"        {",
									"            method: \"POST\",",
									"            url: apiUrl + \"/oauth/access_token\",",
									"            header: \"Content-Type:application/json\",",
									"            body: '{\"client_id\": \"' + clientId + '\", \"client_secret\": \"' + clientSecret + '\", \"grant\": \"client_credentials\"}'",
									"        }, ",
									"        function (err, response) {",
									"            let resp = response.json()",
									"            if(resp.success) {",
									"                pm.collectionVariables.set(\"api_access_token\", resp.data.access_token);",
									"                pm.collectionVariables.set(\"api_refresh_token\", resp.data.refresh_token);",
									"                pm.collectionVariables.set(\"api_access_token_expiration\", new Date().getTime() + (resp.data.duration * 1000));",
									"            }",
									"        }",
									"    );",
									"}"
								],
								"type": "text/javascript",
								"packages": {},
								"requests": {}
							}
						}
					],
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "{{api_url}}/shippings/:id",
							"host": [
								"{{api_url}}"
							],
							"path": [
								"shippings",
								":id"
							],
							"variable": [
								{
									"key": "id",
									"value": null,
									"description": "Identifier of the shipping"
								}
							]
						}
					},
					"response": []
				},
				{
					"name": "Retrieve Shipping List",
					"event": [
						{
							"listen": "prerequest",
							"script": {
								"exec": [
									"let apiUrl = pm.collectionVariables.get(\"api_url\");",
									"let clientId = pm.collectionVariables.get(\"api_client_id\");",
									"let clientSecret = pm.collectionVariables.get(\"api_client_secret\");",
									"let accessToken = pm.collectionVariables.get(\"api_access_token\");",
									"let accessTokenExpiration = pm.collectionVariables.get(\"api_access_token_expiration\");",
									"let refreshToken = pm.collectionVariables.get(\"api_refresh_token\");",
									"",
									"/* if there is the access_token but is expired or if therein't the access_token but the there is a refresh_token */",
									"if(refreshToken != null && refreshToken != \"\" && (",
									"    (accessToken != null && accessToken !== \"\" && accessTokenExpiration <= new Date().getTime()) ||",
									"    (accessToken == null && accessToken === \"\" && refreshToken != null && refreshToken != \"\"))",
									"    ) {",
									"    /* refresh the access_token */",
									"    pm.sendRequest(",
									"        {",
									"            method: \"POST\",",
									"            url: apiUrl + \"/oauth/access_token\",",
									"            header: \"Content-Type:application/json\",",
									"            body: '{\"client_id\": \"' + clientId + '\", \"refresh_token\": \"' + refreshToken + '\", \"grant\": \"refresh_token\"}'",
									"        }, ",
									"        function (err, response) {",
									"            let resp = response.json();",
									"            if(resp.success) {",
									"                pm.collectionVariables.set(\"api_access_token\", resp.data.access_token);",
									"                pm.collectionVariables.set(\"api_refresh_token\", resp.data.refresh_token);",
									"                pm.collectionVariables.set(\"api_access_token_expiration\", new Date().getTime() + (resp.data.duration * 1000));",
									"            }",
									"        }",
									"    );",
									"}",
									"",
									"/* if no refresh_token, authenticate */",
									"if(refreshToken == null || refreshToken === \"\") {",
									"    pm.sendRequest(",
									"        {",
									"            method: \"POST\",",
									"            url: apiUrl + \"/oauth/access_token\",",
									"            header: \"Content-Type:application/json\",",
									"            body: '{\"client_id\": \"' + clientId + '\", \"client_secret\": \"' + clientSecret + '\", \"grant\": \"client_credentials\"}'",
									"        }, ",
									"        function (err, response) {",
									"            let resp = response.json()",
									"            if(resp.success) {",
									"                pm.collectionVariables.set(\"api_access_token\", resp.data.access_token);",
									"                pm.collectionVariables.set(\"api_refresh_token\", resp.data.refresh_token);",
									"                pm.collectionVariables.set(\"api_access_token_expiration\", new Date().getTime() + (resp.data.duration * 1000));",
									"            }",
									"        }",
									"    );",
									"}"
								],
								"type": "text/javascript",
								"packages": {},
								"requests": {}
							}
						}
					],
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "{{api_url}}/shippings",
							"host": [
								"{{api_url}}"
							],
							"path": [
								"shippings"
							],
							"query": [
								{
									"key": "offset",
									"value": "0",
									"disabled": true
								},
								{
									"key": "max",
									"value": "1",
									"disabled": true
								}
							]
						}
					},
					"response": []
				},
				{
					"name": "Retrieve Shipping Services",
					"event": [
						{
							"listen": "prerequest",
							"script": {
								"exec": [
									"let apiUrl = pm.collectionVariables.get(\"api_url\");",
									"let clientId = pm.collectionVariables.get(\"api_client_id\");",
									"let clientSecret = pm.collectionVariables.get(\"api_client_secret\");",
									"let accessToken = pm.collectionVariables.get(\"api_access_token\");",
									"let accessTokenExpiration = pm.collectionVariables.get(\"api_access_token_expiration\");",
									"let refreshToken = pm.collectionVariables.get(\"api_refresh_token\");",
									"",
									"/* if there is the access_token but is expired or if therein't the access_token but the there is a refresh_token */",
									"if(refreshToken != null && refreshToken != \"\" && (",
									"    (accessToken != null && accessToken !== \"\" && accessTokenExpiration <= new Date().getTime()) ||",
									"    (accessToken == null && accessToken === \"\" && refreshToken != null && refreshToken != \"\"))",
									"    ) {",
									"    /* refresh the access_token */",
									"    pm.sendRequest(",
									"        {",
									"            method: \"POST\",",
									"            url: apiUrl + \"/oauth/access_token\",",
									"            header: \"Content-Type:application/json\",",
									"            body: '{\"client_id\": \"' + clientId + '\", \"refresh_token\": \"' + refreshToken + '\", \"grant\": \"refresh_token\"}'",
									"        }, ",
									"        function (err, response) {",
									"            let resp = response.json();",
									"            if(resp.success) {",
									"                pm.collectionVariables.set(\"api_access_token\", resp.data.access_token);",
									"                pm.collectionVariables.set(\"api_refresh_token\", resp.data.refresh_token);",
									"                pm.collectionVariables.set(\"api_access_token_expiration\", new Date().getTime() + (resp.data.duration * 1000));",
									"            }",
									"        }",
									"    );",
									"}",
									"",
									"/* if no refresh_token, authenticate */",
									"if(refreshToken == null || refreshToken === \"\") {",
									"    pm.sendRequest(",
									"        {",
									"            method: \"POST\",",
									"            url: apiUrl + \"/oauth/access_token\",",
									"            header: \"Content-Type:application/json\",",
									"            body: '{\"client_id\": \"' + clientId + '\", \"client_secret\": \"' + clientSecret + '\", \"grant\": \"client_credentials\"}'",
									"        }, ",
									"        function (err, response) {",
									"            let resp = response.json()",
									"            if(resp.success) {",
									"                pm.collectionVariables.set(\"api_access_token\", resp.data.access_token);",
									"                pm.collectionVariables.set(\"api_refresh_token\", resp.data.refresh_token);",
									"                pm.collectionVariables.set(\"api_access_token_expiration\", new Date().getTime() + (resp.data.duration * 1000));",
									"            }",
									"        }",
									"    );",
									"}"
								],
								"type": "text/javascript",
								"packages": {},
								"requests": {}
							}
						}
					],
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Authorization",
								"value": "Bearer {{access_token}}",
								"type": "text"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\r\n    \"order_id\": 0,\r\n    \"packages\": [\r\n        {\r\n            \"type\": \"NORMAL\",\r\n            \"weight\": 1,\r\n            \"height\": 1,\r\n            \"width\": 1,\r\n            \"depth\": 1\r\n        }\r\n    ]\r\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "{{api_url}}/shippings/services",
							"host": [
								"{{api_url}}"
							],
							"path": [
								"shippings",
								"services"
							]
						}
					},
					"response": []
				}
			],
			"auth": {
				"type": "bearer",
				"bearer": [
					{
						"key": "token",
						"value": "{{api_access_token}}",
						"type": "string"
					}
				]
			},
			"event": [
				{
					"listen": "prerequest",
					"script": {
						"type": "text/javascript",
						"requests": {},
						"exec": [
							""
						]
					}
				},
				{
					"listen": "test",
					"script": {
						"type": "text/javascript",
						"requests": {},
						"exec": [
							""
						]
					}
				}
			]
		},
		{
			"name": "Taxonomy",
			"item": [
				{
					"name": "Create New Brand",
					"event": [
						{
							"listen": "prerequest",
							"script": {
								"exec": [
									"let apiUrl = pm.collectionVariables.get(\"api_url\");",
									"let clientId = pm.collectionVariables.get(\"api_client_id\");",
									"let clientSecret = pm.collectionVariables.get(\"api_client_secret\");",
									"let accessToken = pm.collectionVariables.get(\"api_access_token\");",
									"let accessTokenExpiration = pm.collectionVariables.get(\"api_access_token_expiration\");",
									"let refreshToken = pm.collectionVariables.get(\"api_refresh_token\");",
									"",
									"/* if there is the access_token but is expired or if therein't the access_token but the there is a refresh_token */",
									"if(refreshToken != null && refreshToken != \"\" && (",
									"    (accessToken != null && accessToken !== \"\" && accessTokenExpiration <= new Date().getTime()) ||",
									"    (accessToken == null && accessToken === \"\" && refreshToken != null && refreshToken != \"\"))",
									"    ) {",
									"    /* refresh the access_token */",
									"    pm.sendRequest(",
									"        {",
									"            method: \"POST\",",
									"            url: apiUrl + \"/oauth/access_token\",",
									"            header: \"Content-Type:application/json\",",
									"            body: '{\"client_id\": \"' + clientId + '\", \"refresh_token\": \"' + refreshToken + '\", \"grant\": \"refresh_token\"}'",
									"        }, ",
									"        function (err, response) {",
									"            let resp = response.json();",
									"            if(resp.success) {",
									"                pm.collectionVariables.set(\"api_access_token\", resp.data.access_token);",
									"                pm.collectionVariables.set(\"api_refresh_token\", resp.data.refresh_token);",
									"                pm.collectionVariables.set(\"api_access_token_expiration\", new Date().getTime() + (resp.data.duration * 1000));",
									"            }",
									"        }",
									"    );",
									"}",
									"",
									"/* if no refresh_token, authenticate */",
									"if(refreshToken == null || refreshToken === \"\") {",
									"    pm.sendRequest(",
									"        {",
									"            method: \"POST\",",
									"            url: apiUrl + \"/oauth/access_token\",",
									"            header: \"Content-Type:application/json\",",
									"            body: '{\"client_id\": \"' + clientId + '\", \"client_secret\": \"' + clientSecret + '\", \"grant\": \"client_credentials\"}'",
									"        }, ",
									"        function (err, response) {",
									"            let resp = response.json()",
									"            if(resp.success) {",
									"                pm.collectionVariables.set(\"api_access_token\", resp.data.access_token);",
									"                pm.collectionVariables.set(\"api_refresh_token\", resp.data.refresh_token);",
									"                pm.collectionVariables.set(\"api_access_token_expiration\", new Date().getTime() + (resp.data.duration * 1000));",
									"            }",
									"        }",
									"    );",
									"}"
								],
								"type": "text/javascript",
								"packages": {},
								"requests": {}
							}
						}
					],
					"request": {
						"method": "POST",
						"header": [],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"name\": \"Poleepo\"\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "{{api_url}}/taxonomy/brands",
							"host": [
								"{{api_url}}"
							],
							"path": [
								"taxonomy",
								"brands"
							]
						}
					},
					"response": []
				},
				{
					"name": "Retrieve Brand Detail",
					"event": [
						{
							"listen": "prerequest",
							"script": {
								"exec": [
									"let apiUrl = pm.collectionVariables.get(\"api_url\");",
									"let clientId = pm.collectionVariables.get(\"api_client_id\");",
									"let clientSecret = pm.collectionVariables.get(\"api_client_secret\");",
									"let accessToken = pm.collectionVariables.get(\"api_access_token\");",
									"let accessTokenExpiration = pm.collectionVariables.get(\"api_access_token_expiration\");",
									"let refreshToken = pm.collectionVariables.get(\"api_refresh_token\");",
									"",
									"/* if there is the access_token but is expired or if therein't the access_token but the there is a refresh_token */",
									"if(refreshToken != null && refreshToken != \"\" && (",
									"    (accessToken != null && accessToken !== \"\" && accessTokenExpiration <= new Date().getTime()) ||",
									"    (accessToken == null && accessToken === \"\" && refreshToken != null && refreshToken != \"\"))",
									"    ) {",
									"    /* refresh the access_token */",
									"    pm.sendRequest(",
									"        {",
									"            method: \"POST\",",
									"            url: apiUrl + \"/oauth/access_token\",",
									"            header: \"Content-Type:application/json\",",
									"            body: '{\"client_id\": \"' + clientId + '\", \"refresh_token\": \"' + refreshToken + '\", \"grant\": \"refresh_token\"}'",
									"        }, ",
									"        function (err, response) {",
									"            let resp = response.json();",
									"            if(resp.success) {",
									"                pm.collectionVariables.set(\"api_access_token\", resp.data.access_token);",
									"                pm.collectionVariables.set(\"api_refresh_token\", resp.data.refresh_token);",
									"                pm.collectionVariables.set(\"api_access_token_expiration\", new Date().getTime() + (resp.data.duration * 1000));",
									"            }",
									"        }",
									"    );",
									"}",
									"",
									"/* if no refresh_token, authenticate */",
									"if(refreshToken == null || refreshToken === \"\") {",
									"    pm.sendRequest(",
									"        {",
									"            method: \"POST\",",
									"            url: apiUrl + \"/oauth/access_token\",",
									"            header: \"Content-Type:application/json\",",
									"            body: '{\"client_id\": \"' + clientId + '\", \"client_secret\": \"' + clientSecret + '\", \"grant\": \"client_credentials\"}'",
									"        }, ",
									"        function (err, response) {",
									"            let resp = response.json()",
									"            if(resp.success) {",
									"                pm.collectionVariables.set(\"api_access_token\", resp.data.access_token);",
									"                pm.collectionVariables.set(\"api_refresh_token\", resp.data.refresh_token);",
									"                pm.collectionVariables.set(\"api_access_token_expiration\", new Date().getTime() + (resp.data.duration * 1000));",
									"            }",
									"        }",
									"    );",
									"}"
								],
								"type": "text/javascript",
								"packages": {},
								"requests": {}
							}
						}
					],
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "{{api_url}}/taxonomy/brands/:id",
							"host": [
								"{{api_url}}"
							],
							"path": [
								"taxonomy",
								"brands",
								":id"
							],
							"variable": [
								{
									"key": "id",
									"value": null,
									"description": "Identifier of the brand"
								}
							]
						}
					},
					"response": []
				},
				{
					"name": "Retrieve Brand List",
					"event": [
						{
							"listen": "prerequest",
							"script": {
								"exec": [
									"let apiUrl = pm.collectionVariables.get(\"api_url\");",
									"let clientId = pm.collectionVariables.get(\"api_client_id\");",
									"let clientSecret = pm.collectionVariables.get(\"api_client_secret\");",
									"let accessToken = pm.collectionVariables.get(\"api_access_token\");",
									"let accessTokenExpiration = pm.collectionVariables.get(\"api_access_token_expiration\");",
									"let refreshToken = pm.collectionVariables.get(\"api_refresh_token\");",
									"",
									"/* if there is the access_token but is expired or if therein't the access_token but the there is a refresh_token */",
									"if(refreshToken != null && refreshToken != \"\" && (",
									"    (accessToken != null && accessToken !== \"\" && accessTokenExpiration <= new Date().getTime()) ||",
									"    (accessToken == null && accessToken === \"\" && refreshToken != null && refreshToken != \"\"))",
									"    ) {",
									"    /* refresh the access_token */",
									"    pm.sendRequest(",
									"        {",
									"            method: \"POST\",",
									"            url: apiUrl + \"/oauth/access_token\",",
									"            header: \"Content-Type:application/json\",",
									"            body: '{\"client_id\": \"' + clientId + '\", \"refresh_token\": \"' + refreshToken + '\", \"grant\": \"refresh_token\"}'",
									"        }, ",
									"        function (err, response) {",
									"            let resp = response.json();",
									"            if(resp.success) {",
									"                pm.collectionVariables.set(\"api_access_token\", resp.data.access_token);",
									"                pm.collectionVariables.set(\"api_refresh_token\", resp.data.refresh_token);",
									"                pm.collectionVariables.set(\"api_access_token_expiration\", new Date().getTime() + (resp.data.duration * 1000));",
									"            }",
									"        }",
									"    );",
									"}",
									"",
									"/* if no refresh_token, authenticate */",
									"if(refreshToken == null || refreshToken === \"\") {",
									"    pm.sendRequest(",
									"        {",
									"            method: \"POST\",",
									"            url: apiUrl + \"/oauth/access_token\",",
									"            header: \"Content-Type:application/json\",",
									"            body: '{\"client_id\": \"' + clientId + '\", \"client_secret\": \"' + clientSecret + '\", \"grant\": \"client_credentials\"}'",
									"        }, ",
									"        function (err, response) {",
									"            let resp = response.json()",
									"            if(resp.success) {",
									"                pm.collectionVariables.set(\"api_access_token\", resp.data.access_token);",
									"                pm.collectionVariables.set(\"api_refresh_token\", resp.data.refresh_token);",
									"                pm.collectionVariables.set(\"api_access_token_expiration\", new Date().getTime() + (resp.data.duration * 1000));",
									"            }",
									"        }",
									"    );",
									"}"
								],
								"type": "text/javascript",
								"packages": {},
								"requests": {}
							}
						}
					],
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "{{api_url}}/taxonomy/brands",
							"host": [
								"{{api_url}}"
							],
							"path": [
								"taxonomy",
								"brands"
							],
							"query": [
								{
									"key": "search",
									"value": "",
									"description": "Search a brand by name",
									"disabled": true
								},
								{
									"key": "offset",
									"value": "0",
									"description": "First object  to retrieve.",
									"disabled": true
								},
								{
									"key": "max",
									"value": "1",
									"description": "Max number of objects to retrieve.",
									"disabled": true
								}
							]
						}
					},
					"response": []
				},
				{
					"name": "Retrieve Category List",
					"event": [
						{
							"listen": "prerequest",
							"script": {
								"exec": [
									"let apiUrl = pm.collectionVariables.get(\"api_url\");",
									"let clientId = pm.collectionVariables.get(\"api_client_id\");",
									"let clientSecret = pm.collectionVariables.get(\"api_client_secret\");",
									"let accessToken = pm.collectionVariables.get(\"api_access_token\");",
									"let accessTokenExpiration = pm.collectionVariables.get(\"api_access_token_expiration\");",
									"let refreshToken = pm.collectionVariables.get(\"api_refresh_token\");",
									"",
									"/* if there is the access_token but is expired or if therein't the access_token but the there is a refresh_token */",
									"if(refreshToken != null && refreshToken != \"\" && (",
									"    (accessToken != null && accessToken !== \"\" && accessTokenExpiration <= new Date().getTime()) ||",
									"    (accessToken == null && accessToken === \"\" && refreshToken != null && refreshToken != \"\"))",
									"    ) {",
									"    /* refresh the access_token */",
									"    pm.sendRequest(",
									"        {",
									"            method: \"POST\",",
									"            url: apiUrl + \"/oauth/access_token\",",
									"            header: \"Content-Type:application/json\",",
									"            body: '{\"client_id\": \"' + clientId + '\", \"refresh_token\": \"' + refreshToken + '\", \"grant\": \"refresh_token\"}'",
									"        }, ",
									"        function (err, response) {",
									"            let resp = response.json();",
									"            if(resp.success) {",
									"                pm.collectionVariables.set(\"api_access_token\", resp.data.access_token);",
									"                pm.collectionVariables.set(\"api_refresh_token\", resp.data.refresh_token);",
									"                pm.collectionVariables.set(\"api_access_token_expiration\", new Date().getTime() + (resp.data.duration * 1000));",
									"            }",
									"        }",
									"    );",
									"}",
									"",
									"/* if no refresh_token, authenticate */",
									"if(refreshToken == null || refreshToken === \"\") {",
									"    pm.sendRequest(",
									"        {",
									"            method: \"POST\",",
									"            url: apiUrl + \"/oauth/access_token\",",
									"            header: \"Content-Type:application/json\",",
									"            body: '{\"client_id\": \"' + clientId + '\", \"client_secret\": \"' + clientSecret + '\", \"grant\": \"client_credentials\"}'",
									"        }, ",
									"        function (err, response) {",
									"            let resp = response.json()",
									"            if(resp.success) {",
									"                pm.collectionVariables.set(\"api_access_token\", resp.data.access_token);",
									"                pm.collectionVariables.set(\"api_refresh_token\", resp.data.refresh_token);",
									"                pm.collectionVariables.set(\"api_access_token_expiration\", new Date().getTime() + (resp.data.duration * 1000));",
									"            }",
									"        }",
									"    );",
									"}"
								],
								"type": "text/javascript",
								"packages": {},
								"requests": {}
							}
						}
					],
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "{{api_url}}/taxonomy/categories",
							"host": [
								"{{api_url}}"
							],
							"path": [
								"taxonomy",
								"categories"
							],
							"query": [
								{
									"key": "search",
									"value": "Altro libri e riviste",
									"description": "Search a category by name and path",
									"disabled": true
								},
								{
									"key": "leaf",
									"value": null,
									"description": "if true return only the leaf categories",
									"disabled": true
								},
								{
									"key": "offset",
									"value": "0",
									"description": "First object to retrieve.",
									"disabled": true
								},
								{
									"key": "max",
									"value": "1",
									"description": "Max number of objects to retrieve.",
									"disabled": true
								}
							]
						}
					},
					"response": []
				},
				{
					"name": "Retrieve Category Detail",
					"event": [
						{
							"listen": "prerequest",
							"script": {
								"exec": [
									"let apiUrl = pm.collectionVariables.get(\"api_url\");",
									"let clientId = pm.collectionVariables.get(\"api_client_id\");",
									"let clientSecret = pm.collectionVariables.get(\"api_client_secret\");",
									"let accessToken = pm.collectionVariables.get(\"api_access_token\");",
									"let accessTokenExpiration = pm.collectionVariables.get(\"api_access_token_expiration\");",
									"let refreshToken = pm.collectionVariables.get(\"api_refresh_token\");",
									"",
									"/* if there is the access_token but is expired or if therein't the access_token but the there is a refresh_token */",
									"if(refreshToken != null && refreshToken != \"\" && (",
									"    (accessToken != null && accessToken !== \"\" && accessTokenExpiration <= new Date().getTime()) ||",
									"    (accessToken == null && accessToken === \"\" && refreshToken != null && refreshToken != \"\"))",
									"    ) {",
									"    /* refresh the access_token */",
									"    pm.sendRequest(",
									"        {",
									"            method: \"POST\",",
									"            url: apiUrl + \"/oauth/access_token\",",
									"            header: \"Content-Type:application/json\",",
									"            body: '{\"client_id\": \"' + clientId + '\", \"refresh_token\": \"' + refreshToken + '\", \"grant\": \"refresh_token\"}'",
									"        }, ",
									"        function (err, response) {",
									"            let resp = response.json();",
									"            if(resp.success) {",
									"                pm.collectionVariables.set(\"api_access_token\", resp.data.access_token);",
									"                pm.collectionVariables.set(\"api_refresh_token\", resp.data.refresh_token);",
									"                pm.collectionVariables.set(\"api_access_token_expiration\", new Date().getTime() + (resp.data.duration * 1000));",
									"            }",
									"        }",
									"    );",
									"}",
									"",
									"/* if no refresh_token, authenticate */",
									"if(refreshToken == null || refreshToken === \"\") {",
									"    pm.sendRequest(",
									"        {",
									"            method: \"POST\",",
									"            url: apiUrl + \"/oauth/access_token\",",
									"            header: \"Content-Type:application/json\",",
									"            body: '{\"client_id\": \"' + clientId + '\", \"client_secret\": \"' + clientSecret + '\", \"grant\": \"client_credentials\"}'",
									"        }, ",
									"        function (err, response) {",
									"            let resp = response.json()",
									"            if(resp.success) {",
									"                pm.collectionVariables.set(\"api_access_token\", resp.data.access_token);",
									"                pm.collectionVariables.set(\"api_refresh_token\", resp.data.refresh_token);",
									"                pm.collectionVariables.set(\"api_access_token_expiration\", new Date().getTime() + (resp.data.duration * 1000));",
									"            }",
									"        }",
									"    );",
									"}"
								],
								"type": "text/javascript",
								"packages": {},
								"requests": {}
							}
						}
					],
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "{{api_url}}/taxonomy/categories/:id",
							"host": [
								"{{api_url}}"
							],
							"path": [
								"taxonomy",
								"categories",
								":id"
							],
							"variable": [
								{
									"key": "id",
									"value": null,
									"description": "Identifier of the category"
								}
							]
						}
					},
					"response": []
				}
			],
			"auth": {
				"type": "bearer",
				"bearer": [
					{
						"key": "token",
						"value": "{{api_access_token}}",
						"type": "string"
					}
				]
			},
			"event": [
				{
					"listen": "prerequest",
					"script": {
						"type": "text/javascript",
						"requests": {},
						"exec": [
							""
						]
					}
				},
				{
					"listen": "test",
					"script": {
						"type": "text/javascript",
						"requests": {},
						"exec": [
							""
						]
					}
				}
			]
		}
	],
	"event": [
		{
			"listen": "prerequest",
			"script": {
				"type": "text/javascript",
				"requests": {},
				"exec": [
					""
				]
			}
		},
		{
			"listen": "test",
			"script": {
				"type": "text/javascript",
				"requests": {},
				"exec": [
					""
				]
			}
		}
	],
	"variable": [
		{
			"key": "api_url",
			"value": "https://api.poleepo.cloud"
		},
		{
			"key": "api_client_id",
			"value": ""
		},
		{
			"key": "api_client_secret",
			"value": ""
		}
	]
}