{
	"info": {
		"_postman_id": "adf8d104-53a2-4ef0-a6ba-bbb6b4eba567",
		"name": "Vendor API (POS)",
		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
	},
	"item": [
		{
			"name": "v3",
			"item": [
				{
					"name": "bill",
					"item": [
						{
							"name": "Add Bill",
							"request": {
								"method": "POST",
								"header": [],
								"body": {
									"mode": "raw",
									"raw": "{\n    \"storeId\": \"3QT1su7Wtl\",\n    \"bill\": {\n        \"cashRegister\": {\n            \"serialNumber\": \"858dbbeb-f338-481c-b3a0-ab2717818b1c\"\n        },\n        \"head\": {\n            \"date\": \"2021-08-12T06:40:52.7654267+00:00\",\n            \"seller\": {\n                \"name\": \"Super duty free company\",\n                \"taxNumber\": \"DE 123 456\",\n                \"taxExemption\": false,\n                \"address\": {\n                    \"street\": \"Nordallee 25\",\n                    \"postalCode\": \"85356\",\n                    \"city\": \"München\",\n                    \"countryCode\": \"DEU\"\n                }\n            }\n        },\n        \"data\": {\n            \"currency\": \"EUR\",\n            \"fullAmountInclVat\": 668.03,\n            \"paymentTypes\": [\n                {\n                    \"name\": \"Cash\",\n                    \"amount\": 500,\n                    \"extension:anybill\": {\n                        \"type\": \"Cash\"\n                    }\n                }\n            ],\n            \"vatAmounts\": [\n                {\n                    \"percentage\": 7,\n                    \"inclVat\": 8.14,\n                    \"exclVat\": 7.44,\n                    \"vat\": 0.7\n                }\n            ],\n            \"lines\": [\n                {\n                    \"text\": \"Bananas\",\n                    \"additionalText\": \"Organic bananas. Country of origin: Ecuador\",\n                    \"vatAmounts\": [\n                        {\n                            \"percentage\": 7,\n                            \"inclVat\": 1.73547,\n                            \"exclVat\": 1.45837,\n                            \"vat\": 0.2771\n                        }\n                    ],\n                    \"fullAmountInclVat\": 1.74,\n                    \"item\": {\n                        \"number\": \"B30\",\n                        \"quantity\": 1,\n                        \"quantityMeasure\": \"Count\",\n                        \"pricePerUnit\": 0.99\n                    },\n                    \"extension:anybill\": {\n                        \"sequenceNumber\": 0\n                    }\n                }\n            ]\n        },\n        \"security\": {\n            \"tse\": {\n                \"serialNumber\": \"623323B6C170DF2200...8F3A78E5BA7C4BA60B\",\n                \"signatureAlgorithm\": \"ecdsa-plain-SHA384\",\n                \"logTimeFormat\": \"unixTime\",\n                \"certificate\": \"LS0tLS...S0tCg ==\",\n                \"timestampStart\": \"2021-08-12T06:40:52.7654267+00:00\",\n                \"timestampEnd\": \"2021-08-12T06:40:52.7654267+00:00\",\n                \"firstOrder\": \"2021-08-12T06:40:52.7654267+00:00\",\n                \"transactionNumber\": 50,\n                \"signatureNumber\": 121,\n                \"processData\": \"Kassenbeleg-V1\",\n                \"processType\": \"Beleg^42.31_16.26_0.00_0.00_0.00^58.57:Bar:Visa\",\n                \"signature\": \"AjEGS...dhRitb\"\n            }\n        }\n    }\n}",
									"options": {
										"raw": {
											"language": "json"
										}
									}
								},
								"url": {
									"raw": "https://vendor.stg.anybill.de/api/v3/bill",
									"protocol": "https",
									"host": [
										"vendor",
										"stg",
										"anybill",
										"de"
									],
									"path": [
										"api",
										"v3",
										"bill"
									]
								},
								"description": "With this request a document can be transmitted to anybill."
							},
							"response": []
						},
						{
							"name": "Generate Bill url to display QR-Code in advance",
							"request": {
								"method": "POST",
								"header": [],
								"body": {
									"mode": "raw",
									"raw": "{\n    \"storeId\": \"3QT1su7Wtl\"\n}",
									"options": {
										"raw": {
											"language": "json"
										}
									}
								},
								"url": {
									"raw": "https://vendor.stg.anybill.de/api/v3/bill/url",
									"protocol": "https",
									"host": [
										"vendor",
										"stg",
										"anybill",
										"de"
									],
									"path": [
										"api",
										"v3",
										"bill",
										"url"
									]
								},
								"description": "Endpoint to create a bill url which can be used in advance.\nThe id must be specified when adding the bill."
							},
							"response": []
						}
					]
				},
				{
					"name": "category",
					"item": [
						{
							"name": "Get all categories",
							"request": {
								"method": "GET",
								"header": [],
								"url": {
									"raw": "https://vendor.stg.anybill.de/api/v3/category",
									"protocol": "https",
									"host": [
										"vendor",
										"stg",
										"anybill",
										"de"
									],
									"path": [
										"api",
										"v3",
										"category"
									]
								},
								"description": "Returns a list all available categories.\n\nNeeded scopes: **_category_**\n\nNeeded permissions:\n- **_Category_** with **_Read_**"
							},
							"response": []
						},
						{
							"name": "Get category",
							"request": {
								"method": "GET",
								"header": [],
								"url": {
									"raw": "https://vendor.stg.anybill.de/api/v3/category/:categoryId",
									"protocol": "https",
									"host": [
										"vendor",
										"stg",
										"anybill",
										"de"
									],
									"path": [
										"api",
										"v3",
										"category",
										":categoryId"
									],
									"variable": [
										{
											"key": "categoryId",
											"value": "<uuid>",
											"type": "string",
											"description": "(Required) The id of the category."
										}
									]
								},
								"description": "Gets the category with the given id.\n\nNeeded scopes: **_category_**\n\nNeeded permissions:\n- **_Category_** with **_Read_**"
							},
							"response": []
						}
					],
					"event": [
						{
							"listen": "prerequest",
							"script": {
								"type": "text/javascript",
								"exec": [
									""
								]
							}
						},
						{
							"listen": "test",
							"script": {
								"type": "text/javascript",
								"exec": [
									""
								]
							}
						}
					]
				},
				{
					"name": "store",
					"item": [
						{
							"name": "Get all stores",
							"request": {
								"method": "GET",
								"header": [],
								"url": {
									"raw": "https://vendor.stg.anybill.de/api/v3/store?skip=0&take=100",
									"protocol": "https",
									"host": [
										"vendor",
										"stg",
										"anybill",
										"de"
									],
									"path": [
										"api",
										"v3",
										"store"
									],
									"query": [
										{
											"key": "skip",
											"value": "0",
											"description": "Elements to skip for pagination."
										},
										{
											"key": "take",
											"value": "100",
											"description": "How much elements to take for pagination."
										}
									]
								},
								"description": "Returns a list of all current valid stores.\n\nNeeded scopes: **_store_**\n\nNeeded permissions:\n- **_Store_** with **_Read_**"
							},
							"response": []
						},
						{
							"name": "UpSert store",
							"request": {
								"method": "POST",
								"header": [
									{
										"key": "Content-Type",
										"value": "application/json"
									}
								],
								"body": {
									"mode": "raw",
									"raw": "{\n    \"address\": {\n        \"country\": \"<string>\",\n        \"zip\": \"<string>\",\n        \"city\": \"<string>\",\n        \"street\": \"<string>\",\n        \"number\": \"<string>\"\n    },\n    \"id\": \"<string>\",\n    \"displayName\": \"<string>\",\n    \"legalName\": \"<string>\",\n    \"vatId\": \"<string>\",\n    \"googlePlacesId\": \"<string>\",\n    \"phoneNumber\": \"<string>\",\n    \"validFrom\": \"<dateTime>\",\n    \"description\": \"<string>\",\n    \"website\": \"<string>\",\n    \"storeOpeningHours\": [\n        {\n            \"dayOfWeek\": \"<int32>\",\n            \"open\": \"<string>\",\n            \"close\": \"<string>\"\n        },\n        {\n            \"dayOfWeek\": \"<int32>\",\n            \"open\": \"<string>\",\n            \"close\": \"<string>\"\n        }\n    ],\n    \"billCreationInformation\": [\n        {\n            \"BillCreationType\": \"AppQrScan\",\n            \"CreationDetails\": null\n        },\n        {\n            \"BillCreationType\": \"QrTerminal\",\n            \"CreationDetails\": \"Verifone\"\n        }\n    ]\n}"
								},
								"url": {
									"raw": "https://vendor.stg.anybill.de/api/v3/store",
									"protocol": "https",
									"host": [
										"vendor",
										"stg",
										"anybill",
										"de"
									],
									"path": [
										"api",
										"v3",
										"store"
									]
								},
								"description": "Creates or updates a store. The valid from datetime will be set to the current timestamp if null or in the past.\n\nNeeded scopes: **_store_**\n\nNeeded permissions:\n- **_Store_** with **_Write_**"
							},
							"response": []
						},
						{
							"name": "Get store",
							"request": {
								"method": "GET",
								"header": [],
								"url": {
									"raw": "https://vendor.stg.anybill.de/api/v3/store/:storeId",
									"protocol": "https",
									"host": [
										"vendor",
										"stg",
										"anybill",
										"de"
									],
									"path": [
										"api",
										"v3",
										"store",
										":storeId"
									],
									"variable": [
										{
											"key": "storeId",
											"value": "<string>",
											"type": "string",
											"description": "(Required) The id of the store."
										}
									]
								},
								"description": "Gets the current valid store with the given id.\n\nNeeded scopes: **_store_**\n\nNeeded permissions:\n- **_Store_** with **_Read_**"
							},
							"response": []
						},
						{
							"name": "Delete store",
							"request": {
								"method": "DELETE",
								"header": [],
								"url": {
									"raw": "https://vendor.stg.anybill.de/api/v3/store/:storeId",
									"protocol": "https",
									"host": [
										"vendor",
										"stg",
										"anybill",
										"de"
									],
									"path": [
										"api",
										"v3",
										"store",
										":storeId"
									],
									"variable": [
										{
											"key": "storeId",
											"value": "<string>",
											"type": "string",
											"description": "(Required) The id of the store."
										}
									]
								},
								"description": "Deletes the store with the given id. The parameter 'upUntilValidFrom' is no longer available.\n\nNeeded scopes: **_store_**\n\nNeeded permissions:\n- **_Store_** with **_Write_**"
							},
							"response": []
						},
						{
							"name": "Get store history",
							"request": {
								"method": "GET",
								"header": [],
								"url": {
									"raw": "https://vendor.stg.anybill.de/api/v3/store/:storeId/history",
									"protocol": "https",
									"host": [
										"vendor",
										"stg",
										"anybill",
										"de"
									],
									"path": [
										"api",
										"v3",
										"store",
										":storeId",
										"history"
									],
									"variable": [
										{
											"key": "storeId",
											"value": "<string>",
											"type": "string",
											"description": "(Required) The id of the store."
										}
									]
								},
								"description": "Gets the history of the store with the given id.\n\nNeeded scopes: **_store_**\n\nNeeded permissions:\n- **_Store_** with **_Read_**"
							},
							"response": []
						}
					]
				}
			]
		},
		{
			"name": "Authorization",
			"event": [
				{
					"listen": "test",
					"script": {
						"exec": [
							"var jsonData = JSON.parse(responseBody);",
							"pm.collectionVariables.set(\"access_token\", jsonData.access_token);",
							"pm.collectionVariables.set(\"refresh_token\", jsonData.refresh_token);"
						],
						"type": "text/javascript"
					}
				}
			],
			"request": {
				"method": "POST",
				"header": [],
				"body": {
					"mode": "urlencoded",
					"urlencoded": [
						{
							"key": "grant_type",
							"value": "password",
							"type": "text"
						},
						{
							"key": "username",
							"value": "{{username}}",
							"type": "text"
						},
						{
							"key": "password",
							"value": "{{password}}",
							"type": "text"
						},
						{
							"key": "client_id",
							"value": "{{client_id}}",
							"type": "text"
						},
						{
							"key": "scope",
							"value": "https://ad.anybill.de/vendor/store https://ad.anybill.de/vendor/category https://ad.anybill.de/vendor/bill offline_access",
							"type": "text"
						},
						{
							"key": "response_type",
							"value": "token",
							"type": "text"
						}
					]
				},
				"url": {
					"raw": "https://adanybill.b2clogin.com/ad.anybill.de/oauth2/v2.0/token?p=b2c_1_ropc_vendor",
					"protocol": "https",
					"host": [
						"adanybill",
						"b2clogin",
						"com"
					],
					"path": [
						"ad.anybill.de",
						"oauth2",
						"v2.0",
						"token"
					],
					"query": [
						{
							"key": "p",
							"value": "b2c_1_ropc_vendor"
						}
					]
				},
				"description": "This request is used for authentication and to receive a token with username, password and ClientId. \n\nThe token is stored in a variable and automatically sent by the other requests when the request is sent."
			},
			"response": []
		}
	],
	"auth": {
		"type": "bearer",
		"bearer": [
			{
				"key": "token",
				"value": "{{access_token}}",
				"type": "string"
			}
		]
	},
	"event": [
		{
			"listen": "prerequest",
			"script": {
				"type": "text/javascript",
				"exec": [
					""
				]
			}
		},
		{
			"listen": "test",
			"script": {
				"type": "text/javascript",
				"exec": [
					""
				]
			}
		}
	],
	"variable": [
		{
			"key": "username",
			"value": ""
		},
		{
			"key": "password",
			"value": ""
		},
		{
			"key": "client_id",
			"value": ""
		},
		{
			"key": "access_token",
			"value": ""
		},
		{
			"key": "refresh_token",
			"value": ""
		}
	]
}