Fetch a list of purchases
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 describes how to retrieve multiple
purchases for merchant.
- Authorisation setup with the correct scope, and a valid authorisation token. See Purchase concept.
Returns a list of purchases for a merchant. Purchases up to three years old are available for fetching.
You can limit the request through the following query parameters:
- Retrieve next page of purchases using
lastPurchaseHash
. - Start/end dates using
startDate
andendDate
. - Maximum number of records to return using
limit
. - Most recent purchases first in response using
descending
.
See Purchase API reference for more details about query parameters.
Example: Fetch all purchases for a merchant. This is done in multiple steps as described in the following.
Step 1: Send a request with the limit parameter set to 50 to define the number of purchases to retrieve.
Step 2: At the bottom of the response, find the values of
lastPurchaseHash
.Step 3: Send another request with these settings: The
limit
parameter the same as in the initial
request; lastPurchaseHash
with the value from the previous response.Step 4: Repeat step 2 and step 3 until the response is empty.