Fetch purchase with discount
Use the Purchase API to fetch purchase information from purchases made with Zettle. For example, the purchase information is consumed in integrations with accounting systems and inventory updates.
Prerequisites
- Authorisation setup with the correct scope, and a valid authorisation token. See Purchase concept.
Purchase with discounts
Discounts can exist both on a specific row of items, and on the entire purchase. Discount on a row of items is applied to the entire amount of the row, and can be set either as a percentage or as a fixed amount. Item row discounts are applied first, and then the discount on the sum of the discounted row prices.
Example: This request returns a list of purchases with discounts applied. The example shows a purchase containing two t-shirts with a 20% discount for one, and a fixed amount of 2000 in the minor currency unit. In addition, there is a 5% discount on the entire purchase.
Request
1GET /purchases/v2?limit=10&descending=true
Response
1{2"purchases": [3{4"source": "POS",5"purchaseUUID": "9u9p8liUSmu9ZrH9NkzeOA",6"amount": 15200,7"vatAmount": 1628,8"country": "SE",9"currency": "SEK",10"timestamp": "2021-01-15T12:17:03.164+0000",11"gpsCoordinates": {12...13},14"purchaseNumber": 34,15"globalPurchaseNumber": 34,16"userDisplayName": "Sara Eriksen",17"userId": 5428764,18"organizationId": 37295469,19"products": [20{21"quantity": "1",22"productUuid": "c8037b10-5381-11eb-a35d-4df8c9434273",23"variantUuid": "f29e9da0-5381-11eb-b308-d53bdad1e1da",24"vatPercentage": 12,25"unitPrice": 10000,26"rowTaxableAmount": 6786,27"name": "T-shirt",28"description": "Cool T-shirt",29"variantName": "Small",30"discount": {31"percentage": 20,32"quantity": 133},34"discountValue": 2000,35"comment": "20% off",36"type": "PRODUCT",37"libraryProduct": true38},39{40"quantity": "1",41"productUuid": "c8037b10-5381-11eb-a35d-4df8c9434273",42"variantUuid": "f29e9da0-5381-11eb-80a8-3285f2ac85a4",43"vatPercentage": 12,44"unitPrice": 10000,45"rowTaxableAmount": 6786,46"name": "T-shirt",47"description": "Cool T-shirt",48"variantName": "Large",49"discount": {50"amount": 2000,51"quantity": 152},53"discountValue": 2000,54"comment": "Fixed amount discount",55"type": "PRODUCT",56"libraryProduct": true57}58],59"discounts": [60{61"percentage": 5,62"quantity": 1,63"value": 80064}65],66"payments": [67{68"uuid": "624bbc18-93f9-4334-84c6-16c660bef366",69"amount": 15200,70...71}72],73"receiptCopyAllowed": true,74"references": {75"checkoutUUID": "f7ee68f3-5995-4b6a-bc67-b0fc374ddf39"76},77"created": "2021-01-15T12:17:03.164+0000",78"refunded": false,79"purchaseUUID1": "f6ef69f2-5894-4a6b-bd66-b1fd364cde38",80"groupedVatAmounts": {81"12.0": 1520082},83"refund": false84}85],86...87}