{
	"info": {
		"_postman_id": "adf8d104-53a2-4ef0-a6ba-bbb6b4eba567",
		"name": "Vendor API (developer.anybill.de POS Documentation)",
		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
		"_exporter_id": "41091635"
	},
	"item": [
		{
			"name": "v3",
			"item": [
				{
					"name": "bill",
					"item": [
						{
							"name": "Add Bill",
							"request": {
								"auth": {
									"type": "bearer",
									"bearer": [
										{
											"key": "token",
											"value": "{{access_token}}",
											"type": "string"
										}
									]
								},
								"method": "POST",
								"header": [],
								"body": {
									"mode": "raw",
									"raw": "{\n    \"storeId\": \"{{store_id}}\",\n    \"bill\": {\n        \"cashRegister\": {\n            \"serialNumber\": \"IS4858AE123\"\n        },\n        \"head\": {\n            \"id\": \"621000164\",\n            \"number\": \"2342\",\n            \"date\": \"2025-01-15T16:18:43+02:00\",\n            \"deliveryPeriodStart\": \"16:18:43\",\n            \"deliveryPeriodEnd\": \"16:45:00\"\n        },\n        \"data\": {\n            \"currency\": \"EUR\",\n            \"fullAmountInclVat\": 35.55,\n            \"positionCount\": 1,\n            \"paymentTypes\": [\n                {\n                    \"name\": \"MasterCard\",\n                    \"amount\": 35.55,\n                    \"extension:anybill\": {\n                        \"type\": \"CardPayment\",\n                        \"paymentDetails\": {\n                            \"cardNumber\": \"123456\",\n                            \"terminalId\": \"123456789\",\n                            \"terminalDateTime\": null,\n                            \"terminalTime\": \"16:18:43\",\n                            \"terminalDate\": \"15.01.2025\",\n                            \"traceNumber\": \"4321\",\n                            \"cardPan\": \"123456XXXXXXXXX2424\",\n                            \"cardSequenceNumber\": 1,\n                            \"cardExpiryDate\": \"12/27\"\n                        }\n                    }\n                }\n            ],\n            \"vatAmounts\": [\n                {\n                    \"percentage\": 19.00,\n                    \"inclVat\": 35.55,\n                    \"exclVat\": 29.87,\n                    \"vat\": 5.68\n                }\n            ],\n            \"lines\": [\n                {\n                    \"text\": \"Geladene Energie\",\n                    \"vatAmounts\": [\n                        {\n                            \"percentage\": 19.00,\n                            \"inclVat\": 35.55,\n                            \"exclVat\": 29.87,\n                            \"vat\": 5.68\n                        }\n                    ],\n                    \"fullAmountInclVat\": 35.55,\n                    \"item\": {\n                        \"number\": \"1\",\n                        \"quantity\": 0.0711,\n                        \"quantityMeasure\": \"KilowattHour\",\n                        \"pricePerUnit\": 500\n                    },\n                    \"extension:anybill\": {\n                        \"sequenceNumber\": 0\n                    }\n                }\n            ],\n        },\n        \"security\": {\n            \"fiscalization\": {\n                \"type\": \"Tse\",\n                \"signature\": \"AjEGS...dhRitb\",\n                \"certificate\": \"LS0tLS...S0tCg ==\",\n                \"signatureAlgorithm\": \"ecdsa-plain-SHA384\",\n                \"serialNumber\": \"Tpzx/mesZGSu/XO6ZaKZO/bk87HKejMaU2VCDoAgmp4=\",\n                \"logTimeFormat\": \"unixTime\",\n                \"timestampStart\": \"2025-01-15T16:18:43+02:00\",\n                \"timestampEnd\": \"2025-01-15T16:18:43+02:00\",\n                \"firstOrder\": \"2021-01-01T16:18:43+02:00\",\n                \"transactionNumber\": 1459,\n                \"signatureNumber\": 3833\n            },\n            \"extension:anybill\": {\n                \"required\": true,\n                \"failure\": false,\n                \"publicKey\": \"pubKey-123\",\n                \"signedData\": \"OCMF|{\\\"FV\\\":\\\"1.0\\\",\\\"GI\\\":\\\"BAUER Electronic BSM-  WS36A-H01-1311-0000\\\",\\\"GS\\\":\\\"001BZR1522311920\\\",\\\"GV\\\":\\\"1.9:32CA:AFF4, 6d1dd3c\\\",\\\"PG\\\":\\\"T1141\\\",\\\"MV\\\":\\\"BAUER Electronic\\\",\\\"MM\\\":\\\"BSM-WS36A-H01-1311-0000\\\",\\\"MS\\\":\\\"001BZR1522311920\\\",\\\"IS\\\":true,\\\"IT\\\":\\\"UNDEFINED\\\",\\\"ID\\\":\\\"4573595\\\",\\\"RD\\\":[{\\\"TM\\\":\\\"2023-09-01T13:59:23,000+0200 S\\\",\\\"TX\\\":\\\"B\\\",\\\"RV\\\":0,\\\"RI\\\":\\\"1-0:1.8.0*198\\\",\\\"RU\\\":\\\"Wh\\\",\\\"XV\\\":188290,\\\"XI\\\":\\\"1-0:1.8.0*255\\\",\\\"XU\\\":\\\"Wh\\\",\\\"XT\\\":3,\\\"RT\\\":\\\"AC\\\",\\\"EF\\\":\\\"\\\",\\\"ST\\\":\\\"G\\\"}]}|{\\\"SA\\\":\\\"ECDSA-secp256r1-SHA256\\\",\\\"SD\\\":\\\"304502200725d721cb1b7ccde30aa8d0feef8fb9dd7b40fa709b46dbcbb1cc7345936d03022100f478f5f31ca87d850d6455215cf9f046902163f8bc566c316691e8ba4007fb74\\\"} OCMF|{\\\"FV\\\":\\\"1.0\\\",\\\"GI\\\":\\\"BAUER Electronic BSM-WS36A-H01-1311-0000\\\",\\\"GS\\\":\\\"001BZR1522311920\\\",\\\"GV\\\":\\\"1.9:32CA:AFF4, 6d1dd3c\\\",\\\"PG\\\":\\\"T1142\\\",\\\"MV\\\":\\\"BAUER Electronic\\\",\\\"MM\\\":\\\"BSM-WS36A-H01-1311-0000\\\",\\\"MS\\\":\\\"001BZR1522311920\\\",\\\"IS\\\":true,\\\"IT\\\":\\\"UNDEFINED\\\",\\\"ID\\\":\\\"4573595\\\",\\\"RD\\\":[{\\\"TM\\\":\\\"2023-09-01T14:16:03,000+0200 S\\\",\\\"TX\\\":\\\"E\\\",\\\"RV\\\":790,\\\"RI\\\":\\\"1-0:1.8.0*198\\\",\\\"RU\\\":\\\"Wh\\\",\\\"XV\\\":189090,\\\"XI\\\":\\\"1-0:1.8.0*255\\\",\\\"XU\\\":\\\"Wh\\\",\\\"XT\\\":4,\\\"RT\\\":\\\"AC\\\",\\\"EF\\\":\\\"\\\",\\\"ST\\\":\\\"G\\\"}]}|{\\\"SA\\\":\\\"ECDSA-secp256r1-SHA256\\\",\\\"SD\\\":\\\"3045022100ff5e1313bc78b3763d4236f42c914727c0f1781da86ae93669ec8b88002f40f4022018ead9e2ed62b0de33bac1fa19d1e03a73e934a02675761f0b5d640afbe842a4\\\"}\"\n            }\n        },\n        \"misc\": {\n            \"additionalReceipts\": [\n                    {\n                        \"type\": \"BasicReceipt\",\n                        \"isPrimaryReceipt\": false,\n                        \"isPrintBuffer\": true,\n                        \"contentType\": \"text/plain\",\n                        \"content\": \"ICAgICAgLUstVS1OLUQtRS1OLUItRS1MLUUtRy1cblxuICAgICAgICAgICAgTXlTaG9wIEdtYkhcbiAgICAgICAgICBNdXN0ZXJzdHJhw59lIDFcbiAgICAgICAgICAgODE1NDMgTcO8bmNoZW5cblxuVGVybWluYWwtSUQgOiAgICAgICAgICAgICAgNTQwNjE1ODNcblRBLU5yIDA3MDk0MiAgICAgICAgICAgICAgIEJOciA0MzAzXG5cbiAgICAgICAgICAgS2FydGVuemFobHVuZ1xuICAgICAgICAgICAga29udGFrdGxvc1xuICAgICAgICAgICAgTUFTVEVSQ0FSRFxuXG4gICAgRVVSIDM1LjU1IDRcblxuUEFOICAgICAgICAgICAgICAgICMjIyMjIyMjIyMjIzMyODdcbkthcnRlIDBcbkVNVi1BSUQgICAgICAgICAgICAgIEEwMDAwMDAwMDQxMDEwXG5WVS1OciAgICAgICAgICAgICAgICAgICAgIDgwMzYyNDQ1MFxuQUlEUGFyYSAgICAgICAgICAgICAgICAgIDAxMDAwMDAwMDJcbkdlbmVobWlndW5ncy1OciAgICAgICAgICAgICAgMDcwMzExXG5EYXR1bSAxNS4wMS4yMDI1ICAgICAgICAgICAxNjoxOCBVaHJcbkVNVi1EYXRlblxuMDAwMDAwODAwMS9BODAwLzAwMDAwMDAwMDAvRjQ1MDg0ODBcbjBDL0Y0NTA4NDgwMEMvM0YwMDAyLy8vMjE3OEEwOTQvODBcblxuWmFobHVuZyBlcmZvbGd0XG5cbj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG5BUy1Qcm9jLUNvZGUgPSAwMCAwNzUgMDBcbkNhcHQuLVJlZi49IDAyNjBcbkFJRDU5OiAxNDI5OTFcbj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG5cbiAgICAgIEJJVFRFIEJFTEVHIEFVRkJFV0FIUkVOXG5cbgo=\"                    \n                    },\n                    {\n                        \"type\": \"VendorReceipt\",\n                        \"content\": \"ICAgICAgLUgtw4QtTi1ELUwtRS1SLUItRS1MLUUtRy1cblxuICAgICAgICAgICAgTXkgU2hvcFxuICAgICAgICAgIEZyYW56LU1heWVyLVN0cmHDn2UgMVxuICAgICAgICAgICA5MzA1MSBSZWdlbnNidXJnXG5cblRlcm1pbmFsLUlEIDogICAgICAgICAgICAxMjM0NTY3ODlcblRBLU5yIDEyMzQ1NjcgICAgICAgICAgICAgICBCTnIgMTIzNFxuXG4gICAgICAgICAgIEthcnRlbnphaGx1bmdcbiAgICAgICAgICAgIGtvbnRha3Rsb3NcbiAgICAgICAgICAgIE1BU1RFUkNBUkRcblxuICAgIEVVUiAzNSw1NVxuXG5QQU4gICAgICAgICAgICAgICAgIyMjIyMjIyMjIyMjMjQyNFxuS2FydGUgMFxuRU1WLUFJRCAgICAgICAgICAgICAgQTAwMDAwMDAwNDEwMTBcblZVLU5yICAgICAgICAgICAgICAgICAgICAgODAzNjI0MTIzXG5BSURQYXJhICAgICAgICAgICAgICAgICAgMDEwMDAwMDAwMlxuR2VuZWhtaWd1bmdzLU5yICAgICAgICAgICAgICAwNzAzMTFcbkRhdHVtIDE1LjAxLjI1ICAgICAgICAgICAgMTY6MTggVWhyXG5FTVYtRGF0ZW5cbjAwMDAwMDgwMDEvQTgwMC8wMDAwMDAwMDAwL0Y0NTA4NDgwXG4wQy9GNDUwODQ3MDBDLzNGMDAwMi8vLzIxNzdBMDk0LzkwXG5cblphaGx1bmcgZXJmb2xndFxuXG49PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuQVMtUHJvYy1Db2RlID0gMDAgMDc1IDAwXG5DYXB0Li1SZWYuPSAwMjYwXG5BSUQ1OTogMTQyOTkxXG49PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuXG4gICAgICBCSVRURSBCRUxFRyBBVUZCRVdBSFJFTlxuXG4=\",\n                        \"contentType\": \"text/plain\"\n                    }\n                ],\n            \"extension:anybill\": {\n                \"footerText\": \"Wir bedanken uns bei Ihnen für den Besuch.\",\n                \"isExample\": true,\n                \"afterSalesCoupons\": [],\n                \"customSections\": [\n                    {\n                        \"position\": 1,\n                        \"section\": 50,\n                        \"title\": \"After Data\",\n                        \"data\": [\n                            {\n                                \"type\": \"Text\",\n                                \"sequenceNumber\": 1,\n                                \"text\": \"\\nThis is a Custom Information\",\n                                \"alignment\": 1\n                            }\n                        ]\n                    }\n                ]\n        }\n    }\n    }\n}",
									"options": {
										"raw": {
											"language": "json"
										}
									}
								},
								"url": {
									"raw": "{{baseUrl}}/v3/bill",
									"host": [
										"{{baseUrl}}"
									],
									"path": [
										"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\": \"{{store_id}}\"\n}",
									"options": {
										"raw": {
											"language": "json"
										}
									}
								},
								"url": {
									"raw": "{{baseUrl}}/v3/bill/url",
									"host": [
										"{{baseUrl}}"
									],
									"path": [
										"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": "store",
					"item": [
						{
							"name": "Get all stores",
							"request": {
								"method": "GET",
								"header": [],
								"url": {
									"raw": "{{baseUrl}}/v3/store?skip=0&take=100",
									"host": [
										"{{baseUrl}}"
									],
									"path": [
										"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        \"countryCode\": \"<string ISO 3166-1 alpha-3>\",\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    \"language\": \"<string  RFC 4646 / ISO 639-1, Default 'de'>\"\n}"
								},
								"url": {
									"raw": "{{baseUrl}}/v3/store",
									"host": [
										"{{baseUrl}}"
									],
									"path": [
										"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": "{{baseUrl}}/v3/store/:storeId",
									"host": [
										"{{baseUrl}}"
									],
									"path": [
										"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": "{{baseUrl}}/v3/store/:storeId",
									"host": [
										"{{baseUrl}}"
									],
									"path": [
										"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": "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",
						"packages": {},
						"requests": {}
					}
				}
			],
			"request": {
				"auth": {
					"type": "noauth"
				},
				"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 https://ad.anybill.de/vendor/customer https://ad.anybill.de/vendor/user offline_access",
							"type": "text"
						},
						{
							"key": "response_type",
							"value": "token",
							"type": "text"
						}
					]
				},
				"url": {
					"raw": "{{baseUrl}}/oauth/token",
					"host": [
						"{{baseUrl}}"
					],
					"path": [
						"oauth",
						"token"
					],
					"query": [
						{
							"key": "grant_type",
							"value": null,
							"type": "text",
							"disabled": true
						}
					]
				},
				"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",
				"requests": {},
				"exec": [
					""
				]
			}
		},
		{
			"listen": "test",
			"script": {
				"type": "text/javascript",
				"requests": {},
				"exec": [
					""
				]
			}
		}
	],
	"variable": [
		{
			"key": "username",
			"value": ""
		},
		{
			"key": "password",
			"value": ""
		},
		{
			"key": "store_id",
			"value": ""
		},
		{
			"key": "client_id",
			"value": ""
		},
		{
			"key": "baseUrl",
			"value": ""
		},
		{
			"key": "scope",
			"value": ""
		},
		{
			"key": "access_token",
			"value": ""
		},
		{
			"key": "refresh_token",
			"value": ""
		}
	]
}