# TrueLayer

> Take and send bank payments with TrueLayer: create payments and payment links that people approve at their own bank, send payouts, check their status, and watch the money coming into your merchant accounts.

App · 12 actions. Web page: https://docs.lodol.com/docs/integrations/truelayer

## Actions

### Cancel payment

Cancel a payment the payer has not started to approve yet (status authorization_required). Returns the payment as it is after.

**Inputs**

- Payment ID (`payment_id`, text, required): The payment's ID, from Create payment, a payment link's payments or an earlier step.

**Outputs**

- `payment` (object): The payment

**Example output**

```json
{
  "payment": {
    "amount": 12.5,
    "amount_in_minor": 1250,
    "created_at": "2026-11-13T18:43:40.853998Z",
    "currency": "GBP",
    "executed_at": "",
    "failed_at": "",
    "failure_reason": "",
    "failure_stage": "",
    "id": "f2042528-d842-401b-982b-63f54792fd20",
    "merchant_account_id": "ec0460e4-ac94-86fa-f749-b6d6fea4de41",
    "reference": "INV-1042",
    "settled_at": "",
    "status": "failed",
    "user_id": "5adeb0cd-31c4-4cfd-8d05-d658c36d62df"
  }
}
```

### Create payment

Start a bank payment into one of your merchant accounts. The payer picks their bank and approves it on TrueLayer's page; give a return address to get the payment_url to send them.

**Inputs**

- Merchant account (`merchant_account_id`, text, required): The merchant account. Pick one, or give its id from an earlier step.
- Amount (`amount`, number, required): How much, in the account's currency and normal units, such as 12.50. At most two decimal places. At least 0.01.
- Payer's name (`user_name`, text, required): The full name of the person paying.
- Payer's email (`user_email`, text, required): The email address of the person paying.
- Payer's phone (`user_phone`, text): Their phone number with its country code, such as +447700900123. Optional.
- Reference (`reference`, text): What shows on the payer's and your bank statement, up to 18 characters, such as INV-1042.
- Return address (`return_url`, text): Where TrueLayer sends the payer after they approve or cancel. It must also be listed as a redirect URI for your app in the Console, or the payer's page shows an error. Fill it in to get a payment_url to send them; leave it empty if you only need the payment's ID.

**Outputs**

- `payment` (object): The payment
- `payment_url` (text): Where to send the payer to pay. Empty unless a return address was given

**Example output**

```json
{
  "payment": {
    "amount": 12.5,
    "amount_in_minor": 1250,
    "created_at": "2026-11-13T18:43:40.853998Z",
    "currency": "GBP",
    "executed_at": "",
    "failed_at": "",
    "failure_reason": "",
    "failure_stage": "",
    "id": "f2042528-d842-401b-982b-63f54792fd20",
    "merchant_account_id": "ec0460e4-ac94-86fa-f749-b6d6fea4de41",
    "reference": "INV-1042",
    "settled_at": "",
    "status": "authorization_required",
    "user_id": "5adeb0cd-31c4-4cfd-8d05-d658c36d62df"
  },
  "payment_url": "https://payment.truelayer.com/payments#payment_id=f2042528"
}
```

### Create payment link

Make a shareable link where someone can pay a fixed amount into a merchant account by bank transfer. TrueLayer cannot switch a link off again.

**Inputs**

- Merchant account (`merchant_account_id`, text, required): The merchant account. Pick one, or give its id from an earlier step.
- Amount (`amount`, number, required): How much, in the account's currency and normal units, such as 12.50. At most two decimal places. At least 0.01.
- Payer's name (`user_name`, text, required): The full name of the person paying.
- Payer's email (`user_email`, text, required): The email address of the person paying.
- Payer's phone (`user_phone`, text): Their phone number with its country code, such as +447700900123. Optional.
- Reference (`reference`, text): What shows on the payer's and your bank statement, up to 18 characters, such as INV-1042.
- Description (`description`, text): A note for your own records about what the link is for, up to 140 characters.

**Outputs**

- `payment_link` (object): The payment link

**Example output**

```json
{
  "payment_link": {
    "id": "CAB7AQnlAki",
    "status": "enabled",
    "type": "single_payment",
    "url": "https://payment.truelayer.com/links/CAB7AQnlAki"
  }
}
```

### Create payout

Send money from a merchant account to a bank account, given as a UK sort code and account number or as an IBAN. The money moves as soon as TrueLayer accepts it.

**Inputs**

- Merchant account (`merchant_account_id`, text, required): The merchant account. Pick one, or give its id from an earlier step.
- Amount (`amount`, number, required): How much, in the account's currency and normal units, such as 12.50. At most two decimal places. At least 0.01.
- Beneficiary name (`beneficiary_name`, text, required): The name on the bank account being paid.
- Sort code (`sort_code`, text): For a UK account: the 6-digit sort code, such as 04-06-68.
- Account number (`account_number`, text): For a UK account: the 8-digit account number.
- IBAN (`iban`, text): For a euro account: the IBAN. Use this instead of the sort code and account number.
- Reference (`reference`, text, required): What shows on the beneficiary's statement, up to 18 characters.

**Outputs**

- `payout` (object): The payout

**Example output**

```json
{
  "payout": {
    "account_number": "00000001",
    "amount": 1.0,
    "amount_in_minor": 100,
    "beneficiary_name": "Jane Doe",
    "created_at": "2026-11-13T18:44:02.252256Z",
    "currency": "GBP",
    "executed_at": "",
    "failed_at": "",
    "failure_reason": "",
    "iban": "",
    "id": "54fdb0a5-19f9-4c64-92ba-ef2255055031",
    "merchant_account_id": "ec0460e4-ac94-86fa-f749-b6d6fea4de41",
    "reference": "Refund",
    "sort_code": "040668",
    "status": "pending"
  }
}
```

### Get merchant account

Get one merchant account: its currency, available and current balance, and the bank details payers can pay into.

**Inputs**

- Merchant account (`merchant_account_id`, text, required): The merchant account. Pick one, or give its id from an earlier step.

**Outputs**

- `merchant_account` (object): The merchant account

**Example output**

```json
{
  "merchant_account": {
    "account_holder_name": "Acme Ltd",
    "account_number": "00171716",
    "available_balance": 1000.0,
    "available_balance_in_minor": 100000,
    "currency": "GBP",
    "current_balance": 1000.0,
    "current_balance_in_minor": 100000,
    "iban": "GB95CLRB04066800171716",
    "id": "ec0460e4-ac94-86fa-f749-b6d6fea4de41",
    "sort_code": "040668"
  }
}
```

### Get payment

Get a payment's status and details, including when it was executed or settled, or why it failed.

**Inputs**

- Payment ID (`payment_id`, text, required): The payment's ID, from Create payment, a payment link's payments or an earlier step.

**Outputs**

- `payment` (object): The payment

**Example output**

```json
{
  "payment": {
    "amount": 12.5,
    "amount_in_minor": 1250,
    "created_at": "2026-11-13T18:43:40.853998Z",
    "currency": "GBP",
    "executed_at": "",
    "failed_at": "",
    "failure_reason": "",
    "failure_stage": "",
    "id": "f2042528-d842-401b-982b-63f54792fd20",
    "merchant_account_id": "ec0460e4-ac94-86fa-f749-b6d6fea4de41",
    "reference": "INV-1042",
    "settled_at": "",
    "status": "authorization_required",
    "user_id": "5adeb0cd-31c4-4cfd-8d05-d658c36d62df"
  }
}
```

### Get payment link

Get a payment link's status and its address.

**Inputs**

- Payment link ID (`payment_link_id`, text, required): The payment link's ID, from Create payment link or an earlier step.

**Outputs**

- `payment_link` (object): The payment link

**Example output**

```json
{
  "payment_link": {
    "id": "CAB7AQnlAki",
    "status": "enabled",
    "type": "single_payment",
    "url": "https://payment.truelayer.com/links/CAB7AQnlAki"
  }
}
```

### Get payout

Get a payout's status and details.

**Inputs**

- Payout ID (`payout_id`, text, required): The payout's ID, from Create payout or an earlier step.

**Outputs**

- `payout` (object): The payout

**Example output**

```json
{
  "payout": {
    "account_number": "00000001",
    "amount": 1.0,
    "amount_in_minor": 100,
    "beneficiary_name": "Jane Doe",
    "created_at": "2026-11-13T18:44:02.252256Z",
    "currency": "GBP",
    "executed_at": "",
    "failed_at": "",
    "failure_reason": "",
    "iban": "",
    "id": "54fdb0a5-19f9-4c64-92ba-ef2255055031",
    "merchant_account_id": "ec0460e4-ac94-86fa-f749-b6d6fea4de41",
    "reference": "Refund",
    "sort_code": "040668",
    "status": "pending"
  }
}
```

### List merchant account transactions

List the money in and out of a merchant account over a window of up to 31 days (the last seven days unless one is given). Gets one page; to see more, run it again with the next page it gives.

**Inputs**

- Merchant account (`merchant_account_id`, text, required): The merchant account. Pick one, or give its id from an earlier step.
- From (`from_time`, date and time): Start of the window. Defaults to seven days before the end.
- To (`to_time`, date and time): End of the window, at most 31 days after the start. Defaults to now.
- Type (`transaction_type`, text): Which kind of transaction to include. Defaults to all. One of: `all` (All types (default)), `merchant_account_payment` (Payments received), `external_payment` (Money added from a bank), `payout` (Payouts), `merchant_account_refund` (Refunds).
- Next page cursor (`cursor`, text): The 'next_cursor' from an earlier page, to get the page after it.

**Outputs**

- `count` (number): How many came back on this page
- `next_cursor` (text): Pass this as Next page cursor to get the next page. Empty on the last page
- `transactions` (list): The transactions

**Example output**

```json
{
  "count": 1,
  "next_cursor": "",
  "transactions": [
    {
      "amount": 1000.0,
      "amount_in_minor": 100000,
      "counterparty_name": "JOHN SANDBRIDGE",
      "created_at": "",
      "currency": "GBP",
      "executed_at": "",
      "id": "0f8d5f72-165c-563c-b189-f1535abae276",
      "payment_id": "",
      "payout_id": "",
      "reference": "Internal topup",
      "settled_at": "2026-11-13T18:39:04.588939Z",
      "status": "settled",
      "type": "external_payment"
    }
  ]
}
```

### List merchant accounts

List the merchant accounts that hold your TrueLayer money, with their balances and bank details.

**Inputs**: None.

**Outputs**

- `count` (number): How many came back on this page
- `merchant_accounts` (list): The merchant accounts

**Example output**

```json
{
  "count": 1,
  "merchant_accounts": [
    {
      "account_holder_name": "Acme Ltd",
      "account_number": "00171716",
      "available_balance": 1000.0,
      "available_balance_in_minor": 100000,
      "currency": "GBP",
      "current_balance": 1000.0,
      "current_balance_in_minor": 100000,
      "iban": "GB95CLRB04066800171716",
      "id": "ec0460e4-ac94-86fa-f749-b6d6fea4de41",
      "sort_code": "040668"
    }
  ]
}
```

### List payment link payments

List the payments people have made through a payment link.

**Inputs**

- Payment link ID (`payment_link_id`, text, required): The payment link's ID, from Create payment link or an earlier step.

**Outputs**

- `count` (number): How many came back on this page
- `payments` (list): The payments

**Example output**

```json
{
  "count": 1,
  "payments": [
    {
      "amount": 12.5,
      "amount_in_minor": 1250,
      "created_at": "2026-11-13T18:43:40.853998Z",
      "currency": "GBP",
      "executed_at": "",
      "failed_at": "",
      "failure_reason": "",
      "failure_stage": "",
      "id": "f2042528-d842-401b-982b-63f54792fd20",
      "merchant_account_id": "ec0460e4-ac94-86fa-f749-b6d6fea4de41",
      "reference": "INV-1042",
      "settled_at": "",
      "status": "authorization_required",
      "user_id": "5adeb0cd-31c4-4cfd-8d05-d658c36d62df"
    }
  ]
}
```

### List payment refunds

List the refunds made against a payment.

**Inputs**

- Payment ID (`payment_id`, text, required): The payment's ID, from Create payment, a payment link's payments or an earlier step.

**Outputs**

- `count` (number): How many came back on this page
- `refunds` (list): The refunds

**Example output**

```json
{
  "count": 1,
  "refunds": [
    {
      "amount": 5.0,
      "amount_in_minor": 500,
      "created_at": "2026-11-14T09:00:00Z",
      "currency": "GBP",
      "executed_at": "2026-11-14T09:00:05Z",
      "failed_at": "",
      "failure_reason": "",
      "id": "a8d1f6c4-6c2b-4a63-9c41-0f2a1b7f2d11",
      "reference": "Refund INV-1042",
      "status": "executed"
    }
  ]
}
```
