Create a payment

You can make payments into an external bank account or your Truelayer-managed merchant account with open banking infrastructure using our APIs

This guide focuses on making a payment into an arbitrary bank account. To find out more information about payments into merchant accounts, check out how to make withdrawals.

🚧

All requests need to be signed

All the requests in this guide should be signed on your server/backend.

There are several options you can use to create a payment
Using Java

To initiate a payment, you need to use your access token retrieved in previous steps in your Authorization header, with the Bearer prefix.

Make a payment initiation request

Make a POST request to /payments endpoint with the following parameters :

Parameters

Definition

payment_method

Method of the payment. Values: bank_transfer

payment_method.provider_filter

Filter for the list of providers through which a payment can be made. If left empty, every provider will become available. Learn more by checking our API reference.

amount_in_minor

The amount in minor units. Minor units are the smallest units of a currency, depending on the number of decimals.
For example: GBP 1 = 100 pence

beneficiary

Destination of the payment. Values:

beneficiary.scheme_identifier

The scheme of the account identifier. Values: scan

user

The user authorising the payment.

user.type

Type of the user. Values:

  • new: If new is selected, a new user entry will be created.
  • existing

The following example shows the request body of a payment initiation:

POST /payments HTTP/1.1
Content-Type: application/json
Idempotency-Key: random
Tl-Signature: {SIGNATURE}
Authorization: Bearer {TOKEN}
Host: test-pay-api.truelayer-sandbox.com
{
    "amount_in_minor": 1000,
    "currency": "GBP",
    "payment_method": {
        "type": "bank_transfer"
    },
    "beneficiary": {
        "type": "external_account",
        "name": "",
        "reference": "reference",
        "scheme_identifier": {
            "type": "sort_code_account_number",
            "sort_code": "xx-xx-xx",
            "account_number": "xxxxxxx"
        }
    },
    "user": {
        "type": "new",
        "name": "Wajid Malik",
        "email": "[email protected]"
    }
}

If the payment initiation is successful, you'll get a response like:

{
  "id": "string",
  "amount_in_minor": 1000,
  "currency": "GBP",
  "payment_method": {
    "type": "bank_transfer"
  },
  "user": {
    "type": "new",
    "name": "Remi Terr",
    "email": "[email protected]",
    "phone": "+44777777777"
  },
  "beneficiary": {
    "type": "external",
    "reference": "payref",
    "name": "Benny Fishery",
    "scheme_identifier": {
      "type": "sort_code_account_number",
        "sort_code": "041204",
        "account_number": "12345678"
    }
  },
  "payment_method": {
    "type": "bank_transfer",
    "statement_reference": "ref",
        "provider_filter": {}
  },
  "created_at": "2021-01-01T00:00:00",
  "status": "authorization_required",
  "resource_token": "a-secret-token"
}

A newly-created payment will have the status authorization_required. The payment needs to through an authorisation flow to have the funds reach the beneficiary. We provide multiple options to authorise payments.


Did this page help you?