Fetch a purchase

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. The following illustrate a simple case of fetching a single purchase to explore the information you can retrieve from the Purchase API.

Prerequisites

  • Authorization setup with the correct scope, and a valid authorization token. See Purchase concept.
  • The purchase UUID for the specific purchase autogenerated by the Purchase service. See Fetch a list of purchases to get purchase IDs.

Fetch a specific purchase

This request returns a purchase with a given UUID. This is the unique ID of the purchase created by the Purchase service.

1
GET /purchase/v2/{purchaseUuid}

The response contains information like source of the purchase (Zettle app, online store, or SDK payment), timestamp, receipt number, amount, products, and payment methods. See Purchase API reference for parameter details.

Example: This example fetches a purchase with the UUID 589c2de6-3ee4-11eb-9e70-a2ac075b17fd.

Request

1
GET /purchase/v2/589c2de6-3ee4-11eb-9e70-a2ac075b17fd

Response

1
{
2
"source": "POS",
3
"purchaseUUID": "WJwt5j7kEeuecKKsB1sX_Q",
4
"purchaseUUID1": "589c2de6-3ee4-11eb-9e70-a2ac075b17fd",
5
"amount": 70000,
6
"vatAmount": 14000,
7
"country": "SE",
8
"currency": "SEK",
9
"timestamp": "2020-12-15T14:46:43.592+0000",
10
"gpsCoordinates": {
11
"longitude": 19.80452501310729,
12
"latitude": 66.609375,
13
"accuracyMeters": 165
14
},
15
"purchaseNumber": 1366,
16
"globalPurchaseNumber": 1366,
17
"userDisplayName": "Sara Johansson",
18
"userId": 11111,
19
"organizationId": 11111,
20
"products": [
21
{
22
"quantity": "1",
23
"productUuid": "2f2a8d60-9c76-11e5-8a3b-82916dc77adc",
24
"variantUuid": "234ee5f0-b188-11e5-aa17-721c907d3875",
25
"vatPercentage": 25,
26
"unitPrice": 70000,
27
"rowTaxableAmount": 56000,
28
"name": "Haircut",
29
"variantName": "1 hour",
30
"fromLocationUuid": "4c03eec0-183c-11e7-a3f8-037fdcd360ec",
31
"toLocationUuid": "4c03eec0-183c-11e7-a15a-cda93ab15db3",
32
"autoGenerated": false,
33
"id": "0",
34
"type": "PRODUCT",
35
"libraryProduct": true
36
}
37
],
38
"discounts": [],
39
"payments": [
40
{
41
"uuid": "592b82f2-3ee4-11eb-9f71-a3ad065a16fc",
42
"amount": 70000,
43
"type": "SWISH",
44
"attributes": {}
45
}
46
],
47
"receiptCopyAllowed": true,
48
"references": {
49
"checkoutUUID": "589c2de6-3ee4-11eb-9f71-a3ad065a16fc"
50
},
51
"created": "2020-12-15T14:46:43.592+0000",
52
"refunded": false,
53
"groupedVatAmounts": {
54
"25.0": 70000
55
},
56
"refund": false
57
}

A successful request returns Status: 200 OK.