Payment links

Create payment link

Create a new payment link

This API must be called using a backend bearer token.

post/v3/payment-links

Request

  • Base URL
    https://api.truelayer-sandbox.com
  • URL
    https://api.truelayer-sandbox.com/v3/payment-links
  • Auth
    OAuth 2
    Client credentials
    Token URL: https://auth.truelayer.com/connect/token scopes: payments, payment_links:create

Headers

Idempotency-Keystring required

An idempotency key to allow safe retrying without the operation being performed multiple times. The value should be unique for each operation, e.g. a UUID, with the same key being sent on a retry of the same request.

Tl-Signaturestring required

A JWS with detached content, signed with your private key. See Request Signing

Request body

type'single_payment' required

The type of the Payment link

expires_atstring datetime

The date and time the payment link will expire at. If this property isn't specified, the payment link will expire 24 hours after its creation.

referencestring

Reference for the payment link. This reference will be shown in the link's UI. This reference won't be shared with the provider or any other third-party.

return_uristring url

This URL determines where the end user will be redirected back once they successfully completed the authorization flow of a payment attempt. If no URL is provided, the end user won't be redirected anywhere, but will instead be shown TrueLayer's page notifying success.

Example request

{
  "expires_at": "2023-01-22T07:30:53.527Z",
  "payment_configuration": {
    "amount_in_minor": 1,
    "currency": "GBP",
    "payment_method": {
      "provider_selection": {
        "filter": {
          "countries": [
            "GB"
          ],
          "release_channel": "general_availability",
          "customer_segments": [
            "retail"
          ],
          "provider_ids": [
            "mock-payments-gb-redirect"
          ],
          "excludes": {
            "provider_ids": [
              "ob-exclude-this-bank"
            ]
          }
        },
        "remitter": {
          "account_holder_name": "Mike Smith"
        }
      },
      "beneficiary": {
        "merchant_account_id": "AB8FA060-3F1B-4AE8-9692-4AA3131020D0",
        "account_holder_name": "Ben Eficiary",
        "reference": "payment-ref",
        "statement_reference": "payment-ref"
      }
    },
    "user": {
      "id": "f9b48c9d-176b-46dd-b2da-fe1a2b77350c",
      "name": "Remi Terr",
      "email": "remi.terr@aol.com",
      "phone": "+447777777777",
      "date_of_birth": "1990-01-31",
      "address": {
        "address_line1": "40 Finsbury Square",
        "address_line2": "The Gilbert",
        "city": "London",
        "state": "London",
        "zip": "EC2A 1PX",
        "country_code": "GB"
      }
    },
    "metadata": {
      "prop1": "value1",
      "prop2": "value2"
    }
  },
  "product_items": [
    {
      "name": "Oak Table",
      "price_in_minor": 1,
      "quantity": 1,
      "url": "https://tablesrus.com/oak-table-42"
    }
  ],
  "reference": "TABLES_R_US_LINK_42",
  "return_uri": "https://tablesrus.com/thank-you-for-your-order"
}

Response

Payment link

idstring required

Unique ID for the Payment Link

uristring required

Link to HPP checkout page.

Example response

{
  "id": "aKiW35RWSyF",
  "uri": "https://payment.truelayer.com/checkout/aKiW35RWSyF"
}

Changes

No recorded changes to this operation across all 1 revision of this API.