---
id: transactions
title: "Settlement transactions"
sidebar_label: Settlement transactions
hide_title: true
description: "Reports API - Settlements - Transactions"
---

import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
import Ingress from "../../../src/components/ingress/ingress.react";

<Ingress title="Settlement transactions">
  Retrieve the transactions included in a settlement.
</Ingress>

## Example

<Tabs defaultValue="req" values={[
{ label: 'Request', value: 'req', },
{ label: 'Response', value: 'res', }
]}>

<TabItem value="req">

```http
GET /reports/settlements/{{settlementId}}/transactions?page=1&perPage=1&includeProductCode=false HTTP/1.1
Host: api.uat.walleydev.com // Test environment. Production uses a different hostname.
Authorization: Bearer bXlVc2VybmFtZTpmN2E1ODA4MGQzZTk0M2VmNWYyMTZlMDE...
```

</TabItem>

<TabItem value="res">

```json
{
  "data": [
    {
      "customerNumber": "",
      "firstName": "Test",
      "lastName": "Test",
      "amount": 1000.0,
      "purchaseDate": "2022-01-01",
      "transactionDate": "2020-01-01",
      "orderNumber": "TEST_230116_011045",
      "invoiceNumber": "11111111",
      "type": "Purchase",
      "totalVatAmountPerRate": [
        {
          "vatRate": 25.0,
          "amount": 180
        },
        {
          "vatRate": 6.0,
          "amount": 5.66
        }
      ],
      "currency": "SEK",
      "settlementDate": null,
      "payoutReference": null,
      "actionReference": null,
      "orderId": "4f35934d-dcf7-4929-b1ec-179155a6db58",
      "productCode": "DI001"
    }
  ],
  "links": {
    "self": {
      "method": "GET",
      "href": "/settlements?page=1&perPage=1",
      "query": "page=1&perPage=1"
    },
    "next": {
      "method": "GET",
      "href": "/settlements?page=2&perPage=1",
      "query": "page=2&perPage=1"
    }
  },
  "metaData": {
    "totalNumberOfRecords": 100,
    "numberOfPages": 100,
    "currentPage": 1,
    "range": {
      "from": 1,
      "to": 1
    }
  }
}
```

</TabItem>

</Tabs>

## Data Model

### Request

#### Request path

| Path             | Required | Explanation                                      |
| ---------------- | -------- | ------------------------------------------------ |
| **settlementId** | Yes      | The id for the requested settlement transactions |

#### Request headers

| Header            | Required | Explanation                                                                                              |
| ----------------- | -------- | -------------------------------------------------------------------------------------------------------- |
| **Authorization** | Yes      | See [Authentication](/docs/reports/authentication) for how to generate the Bearer token value |
| **Accept**        | No       | The default response format is JSON. To return transactions in CSV format, set the Accept header to `text/csv` |

:::note CSV responses use the settlement file format
With `Accept: text/csv`, the response follows the same format as the example files on the
[Settlements page](/docs/reports/settlements-api/settlements).
:::

#### Request querystrings

| Parameter              | Required | Explanation                                                                   |
| ---------------------- | -------- | ----------------------------------------------------------------------------- |
| **page**               | No       | Page of items that should be returned in request                              |
| **perPage**            | No       | Number of items to be returned in each request. Largest allowed value is 5000 |
| **includeProductCode** | No       | Specify whether you want productCode values in the response. Defaults to false |

### Response

#### Possible responses

| Http status code | Description                                                                                                       |
| ---------------- | ----------------------------------------------------------------------------------------------------------------- |
| 200              | Successful request                                                                                                |
| 401              | Token missing, expired, or invalid. See [Authentication](/docs/reports/authentication)                             |
| 403              | No permission for this store                                                                                       |
| 404              | Transactions not found                                                                                            |
| 409              | Request with same idempotency key already in progress                                                             |
| 422              | Query with incorrect format                                                                                       |

#### Response body from 200 OK

`response.data` object is an array of the following structure:

```json
{
  "customerNumber": "",
  "firstName": "Test",
  "lastName": "Test",
  "amount": 1000.0,
  "purchaseDate": "2022-01-01",
  "transactionDate": "2020-01-01",
  "invoiceNumber": "11111111",
  "orderNumber": "TEST_230116_011045",
  "type": "Purchase",
  "totalVatAmountPerRate": [
    {
      "vatRate": 25.0,
      "amount": 180
    },
    {
      "vatRate": 6.0,
      "amount": 5.66
    }
  ],
  "currency": "SEK",
  "settlementDate": null,
  "payoutReference": null,
  "actionReference": null,
  "orderId": "4f35934d-dcf7-4929-b1ec-179155a6db58",
  "productCode": "DI001"
}
```

| Property                  | Explanation                                                             | Comment                                                               |
| ------------------------- | ----------------------------------------------------------------------- | --------------------------------------------------------------------- |
| **customerNumber**        | Custom value that can be provided at purchase                           |                                                                       |
| **firstName**             | The customer's first name for B2C, the company name for B2B             |                                                                       |
| **lastName**              | The customer's last name for B2C, empty for B2B                          |                                                                       |
| **amount**                | Transaction amount                                                      |                                                                       |
| **purchaseDate**          | The date when the purchase was captured                                 |                                                                       |
| **transactionDate**       | Custom date value provided at purchase                                  | In SOAP OrderDate                                                     |
| **invoiceNumber**         | The purchase invoice number                                             |                                                                       |
| **orderNumber**           | Custom value that can be provided at purchase                           | In checkout reference                                                 |
| **type**                  | [Settlement types](/docs/reports/settlements-api/settlement-types)      |                                                                       |
| **totalVatAmountPerRate** | The amount of VAT paid for each VAT rate                                |                                                                       |
| **currency**              | The purchase currency                                                   |                                                                       |
| **settlementDate**        | The date the settlement is created                                      | Only available when extended CSV is configured                        |
| **payoutReference**       | The reference used for the bank payout                                  | Only available when extended CSV is configured                        |
| **actionReference**       | Custom value that can be provided when purchase is captured or refunded | Only available when extended CSV is configured                        |
| **orderId**               | The id of the order associated with the transaction                     | Available on type `Purchase`, `Return` and `PurchaseAmountAdjustment` |
| **productCode**           | The product code associated with the transaction                        | Possibly empty. Included if includeProductCode query param is true    |
