### Make a Test Payment Source: https://docs.truelayer.com/llms.txt This quickstart guide provides a simplified example of making a test payment in the TrueLayer sandbox environment. It covers the essential steps to get a payment processed quickly for testing purposes. ```bash curl -X POST https://sandbox-api.truelayer.com/payments/v3/payments \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_SANDBOX_ACCESS_TOKEN" \ -d '{ "amount": 100, "currency": "GBP", "payment_method": { "type": "redirect", "return_uri": "https://example.com/success" }, "reference": "TEST-PAYMENT-123" }' ``` -------------------------------- ### Install TrueLayer Insomnia Plugin Source: https://docs.truelayer.com/docs/payments-only-integration Instructions for installing the TrueLayer Insomnia plugin to securely sign requests with your public and private keys. ```APIDOC ## Install TrueLayer Insomnia Plugin ### Description This section details how to install the TrueLayer Insomnia plugin, which is essential for securely signing API requests using your public and private keys. ### Method Manual Installation via Insomnia Preferences or Plugin Hub ### Endpoint N/A (Plugin Installation) ### Parameters None ### Request Example N/A ### Response N/A #### Notes - Ensure the plugin is enabled after installation. - If an error occurs during installation, verify the plugin is enabled. ``` -------------------------------- ### GET /hosted-payment-page Source: https://docs.truelayer.com/docs/payments-only-integration Generates a URL for the hosted payment page where users can authorize their payments. ```APIDOC ## GET /payments (Hosted Payment Page Link) ### Description Constructs a URL to redirect the user to TrueLayer's hosted payment page for authorization. ### Method GET ### Endpoint https://payment.truelayer-sandbox.com/payments#payment_id={id}&resource_token={resource_token}&return_uri={Redirect URI} ### Parameters #### Query Parameters - **payment_id** (string) - Required - The ID returned from the Create Payment endpoint. - **resource_token** (string) - Required - The resource token returned from the Create Payment endpoint. - **return_uri** (string) - Required - A pre-registered redirect URI from the TrueLayer Console. ### Request Example https://payment.truelayer-sandbox.com/payments#payment_id=7620aa1d...&resource_token=eyJhbGci...&return_uri=https://console.truelayer.com/redirect-page ``` -------------------------------- ### Console Setup and Reporting Source: https://docs.truelayer.com/llms.txt Guides for setting up your TrueLayer Console account and managing reporting features. ```APIDOC ## Quickstart: Create a Console account ### Description Learn how to set up your TrueLayer Console account. ### Method GET ### Endpoint /console/quickstart/account ### Parameters None ### Request Example None ### Response #### Success Response (200) - **setup_guide_url** (string) - URL to the account setup guide. #### Response Example { "setup_guide_url": "https://docs.truelayer.com/docs/quickstart-create-a-console-account.md" } ``` ```APIDOC ## Reporting in Console ### Description All the options for reporting in Console, and information about which one you should choose. ### Method GET ### Endpoint /console/reporting ### Parameters None ### Request Example None ### Response #### Success Response (200) - **reporting_options** (array) - Available reporting options. - **name** (string) - The name of the reporting option. - **description** (string) - A description of the reporting option. #### Response Example { "reporting_options": [ { "name": "Payments Reporting", "description": "Reporting for Payments API." } ] } ``` ```APIDOC ## SFTP in Console ### Description Configure SFTP in Console for data access. ### Method POST ### Endpoint /console/sftp/configure ### Parameters #### Request Body - **enable_sftp** (boolean) - Required - Whether to enable SFTP. - **username** (string) - Optional - SFTP username if enabling. - **password** (string) - Optional - SFTP password if enabling. ### Request Example { "enable_sftp": true, "username": "my_sftp_user" } ### Response #### Success Response (200) - **status** (string) - The status of the SFTP configuration. #### Response Example { "status": "configured" } ``` -------------------------------- ### Payment Creation Response Structure Source: https://docs.truelayer.com/docs/payments-only-integration An example of the JSON response received after successfully creating a payment. It includes the payment ID, user ID, a resource token for authorization, and the current payment status. ```json { "id": "7620aa1d-b188-4941-b85f-8dc9a76c202e", "user": { "id": "67638fba-8412-4233-b57c-35b9bd0f4542" }, "resource_token": "eyJhbGciOiJSUzUxMiIsImtpZCI6IkRCejExcEFuUGNXVndqaFBNWERuckNyQ0ZrT1p0Y2FqYWtjU21GNmJiVk0iLCJ0eXAiOiJKV1QifQ...", "status": "authorization_required" } ``` -------------------------------- ### GET /signup-plus/payments/{payment_id} Source: https://docs.truelayer.com/docs/payments-only-integration Retrieves user information associated with a specific payment ID. This endpoint is used after a successful payment authorization to obtain verified user details. ```APIDOC ## GET /signup-plus/payments/{payment_id} ### Description Retrieves user information (name, date of birth, address) associated with a completed payment. This endpoint requires a valid access token and request signing. ### Method GET ### Endpoint /signup-plus/payments/{payment_id} ### Parameters #### Path Parameters - **payment_id** (string) - Required - The unique identifier of the authorized payment. ### Request Example GET /signup-plus/payments/pay_123456789 ### Response #### Success Response (200) - **user_info** (object) - Contains the user's name, date of birth, and address details. #### Response Example { "user": { "name": "John Doe", "date_of_birth": "1990-01-01", "address": { "line1": "123 TrueLayer St", "city": "London", "postcode": "EC1A 1BB" } } } ``` -------------------------------- ### GET /v3/payouts/{id} Source: https://docs.truelayer.com/docs/quickstart-make-a-test-payout-closed-loop Retrieves the current status of a specific payout by its ID. ```APIDOC ## GET /v3/payouts/{id} ### Description Retrieves the status of a payout using the payout ID obtained during creation. ### Method GET ### Endpoint /v3/payouts/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the payout. ### Response #### Success Response (200) - **status** (string) - The current status of the payout (e.g., executed). ``` -------------------------------- ### Create UK Open-Loop Payout Request Source: https://docs.truelayer.com/docs/quickstart-make-a-test-payout-open-loop Example JSON payload for creating a payout to an external UK bank account. This includes beneficiary details like account number, sort code, and personal information. The currency is specified as GBP. ```json { "currency": "GBP", "beneficiary": { "type": "external_account", "account_identifier": { "type": "sort_code_account_number", "sort_code": 560029, "account_number": 26207729 }, "address": { "address_line1": "40 Finsbury Square", "city": "London", "country_code": "GB", "zip": "EC2A 1PX", "state": "London" }, "reference": "reference", "account_holder_name": "eg-name", "date_of_birth": "1990-01-31" } } ``` -------------------------------- ### Create EU Open-Loop Payout Request Source: https://docs.truelayer.com/docs/quickstart-make-a-test-payout-open-loop Example JSON payload for creating a payout to an external EU bank account using an IBAN. This structure is similar to the UK payout but uses IBAN for account identification. The currency is specified as EUR. ```json { "currency": "EUR", "beneficiary": { "type": "external_account", "account_identifier": { "type": "iban", "iban": "GB32CLRB04066800012315" }, "address": { "address_line1": "40 Finsbury Square", "city": "London", "country_code": "GB", "zip": "EC2A 1PX", "state": "London" }, "reference": "reference", "account_holder_name": "eg-name", "date_of_birth": "1990-01-31" } } ``` -------------------------------- ### Verification API - Get Started Source: https://docs.truelayer.com/docs/verification-api-basics This section outlines the steps to get started with the Verification API, including setting scopes, implementing authentication, and making requests. ```APIDOC ## Verification API - Get Started ### Description This guide provides the necessary steps to integrate with the Verification API. It covers selecting providers, implementing the authentication flow, obtaining access, and making API requests. ### Steps 1. **Choose Providers**: Select the providers you wish to integrate with. The Verification API is available in the UK, Germany, and Spain during its public beta phase. 2. **Implement Authentication Flow**: Follow the guide on [Connect an Account](/docs/connect-an-account) and ensure the following: * Set the `scopes` field to `verification` exclusively. * Configure the `providers` field based on your specific requirements. 3. **Enable Access**: Contact TrueLayer Support and provide your `client_id` to enable your access to the Verification API. 4. **Generate Auth Link and Whitelist URIs**: Generate an authorization link and ensure your redirect URIs are whitelisted in the **App Settings** within the <>. 5. **Generate Access Token**: Obtain an access token to authenticate your API requests. 6. **Make API Request**: Use the provided [Postman collection](https://www.postman.com/collections/13ad83dbb366131a7908) to interact with the Verification API. ### Additional Information For detailed information on the account holder name format returned by each bank, refer to the [Supported Providers](https://console.truelayer.com/providers) page on Console. ``` -------------------------------- ### Configure Remitter Object for Payment Requests Source: https://docs.truelayer.com/docs/select-a-provider-for-a-payment Examples showing how to structure the remitter object within a POST /v3/payments request. The first example demonstrates a SCAN setup for GBP, while the second demonstrates an IBAN setup for EUR. ```JSON POST /v3/payments HTTP/1.1 Content-Type: application/json Idempotency-Key: {RANDOM_UUID} Tl-Signature: {SIGNATURE} Authorization: Bearer {ACCESS_TOKEN} Host: api.truelayer-sandbox.com { "amount_in_minor": 30000, "currency": "GBP", "payment_method": { "provider_selection": { "type": "preselected", "provider_id": "mock-payments-gb-redirect", "scheme_selection": { "type": "user_selected" }, "remitter": { "account_holder_name": "John Sandbridge", "account_identifier": { "type": "sort_code_account_number", "sort_code": "500000", "account_number": "12345601" } } }, "type": "bank_transfer", "beneficiary": { "type": "merchant_account", "merchant_account_id": "200552da-13da-43c5-a9ba-04ee1502ac57" } } } ``` ```JSON POST /v3/payments HTTP/1.1 Content-Type: application/json Idempotency-Key: {RANDOM_UUID} Tl-Signature: {SIGNATURE} Authorization: Bearer {ACCESS_TOKEN} Host: api.truelayer-sandbox.com { "amount_in_minor": 1000, "currency": "EUR", "payment_method": { "provider_selection": { "type": "user_selected", "scheme_selection": { "type": "user_selected" }, "remitter": { "account_holder_name": "John Sandbridge", "account_identifier": { "type": "iban", "iban": "DE78740201006814567316" } } }, "type": "bank_transfer", "beneficiary": { "type": "merchant_account", "merchant_account_id": "2a485b0a-a29c-4aa2-bcef-b34d0f6f8d51" } } } ``` -------------------------------- ### Format Private Key for JSON Source: https://docs.truelayer.com/docs/payments-only-integration Provides a command-line utility to convert a PEM-formatted private key into a single-line string with escaped newline characters, suitable for use in JSON-based configuration files like Insomnia environments. ```bash awk 'NF {sub(/\r/, ""); printf "%s\\n",$0;}' file_location/cert-name.pem ``` -------------------------------- ### Install iOS Cocoapods dependencies Source: https://docs.truelayer.com/docs/authorise-mandates-with-the-react-native-sdk Commands to install iOS dependencies via Cocoapods, supporting both new and old React Native architectures. ```shell # New architecture RCT_NEW_ARCH_ENABLED=1 bundle exec pod install # Old architecture bundle exec pod install ``` -------------------------------- ### POST /payments Source: https://docs.truelayer.com/docs/payments-only-integration Creates a new payment request for a specified merchant account. This endpoint initializes the payment process and returns a resource token required for authorization. ```APIDOC ## POST /payments ### Description Creates a new payment. Upon success, the payment status is set to `authorization_required`. ### Method POST ### Endpoint /payments ### Parameters #### Request Body - **beneficiary_merchant_account_id** (string) - Required - The ID of the merchant account receiving the funds. ### Request Example { "beneficiary_merchant_account_id": "your-merchant-account-id" } ### Response #### Success Response (201) - **id** (string) - The unique identifier for the payment. - **user.id** (string) - The ID of the user associated with the payment. - **resource_token** (string) - Token used to authorize the payment (expires in 15 minutes). - **status** (string) - Current status of the payment. #### Response Example { "id": "7620aa1d-b188-4941-b85f-8dc9a76c202e", "user": { "id": "67638fba-8412-4233-b57c-35b9bd0f4542" }, "resource_token": "eyJhbGciOiJSUzUxMi...", "status": "authorization_required" } ``` -------------------------------- ### Install iOS Dependencies with Cocoapods Source: https://docs.truelayer.com/docs/authorise-mandates-with-the-react-native-sdk Commands to install iOS dependencies using Cocoapods, supporting both new and old React Native architectures. ```shell # New Architecture RCT_NEW_ARCH_ENABLED=1 bundle exec pod install # Old Architecture bundle exec pod install ``` -------------------------------- ### Initialize and Mount TrueLayer Web SDK Source: https://docs.truelayer.com/docs/web-sdk Demonstrates how to initialize the Web SDK and mount the payment button. Provides examples for both combined and separate initialization and mounting workflows. ```javascript initWebSdk({ hostedResultScreen: { returnUri: merchant_return_uri, }, }) .mount(node) .start({ paymentId: payment.id, resourceToken: payment.resource_token }) ``` ```javascript const { mount, start, cleanup } = initWebSdk({ hostedResultScreen: { returnUri: merchant_return_uri, }, }) mount(node) start({ paymentId: payment.id, resourceToken: payment.resource_token, }) ``` -------------------------------- ### Install React Native SDK Source: https://docs.truelayer.com/docs/authorise-mandates-with-the-react-native-sdk Commands to install the TrueLayer Payments SDK dependency using either Yarn or npm package managers. ```bash yarn add rn-truelayer-payments-sdk ``` ```bash npm install rn-truelayer-payments-sdk --save ``` -------------------------------- ### POST /v3/payouts Source: https://docs.truelayer.com/docs/quickstart-make-a-test-payout-closed-loop Creates a new closed-loop payout to a specific payment source. ```APIDOC ## POST /v3/payouts ### Description Creates a closed-loop payout to a beneficiary using an existing payment source. ### Method POST ### Endpoint /v3/payouts ### Parameters #### Request Body - **merchant_account_id** (string) - Required - The UUID of your merchant account. - **user_id** (string) - Required - The UUID of the beneficiary (payee). - **payment_source_id** (string) - Required - The UUID of the account that made the original payment. - **currency** (string) - Required - The currency code (e.g., GBP). - **amount_in_minor** (integer) - Required - The amount to payout in minor units. ### Request Example { "currency": "GBP", "beneficiary": { "type": "payment_source", "account_identifier": { "type": "sort_code_account_number" }, "reference": "reference", "payment_source_id": "example-payment-source", "user_id": "example-user-id" }, "merchant_account_id": "AB8FA060-3F1B-4AE8-9692-4AA3131020D0", "amount_in_minor": 1 } ### Response #### Success Response (200) - **id** (string) - The unique identifier for the created payout. #### Response Example { "id": "0cd1b0f7-71bc-4d24-b209-95259dadcc20" } ``` -------------------------------- ### Get Account Transactions (AUD) Source: https://docs.truelayer.com/reference/getaccountpendingtransactions Retrieves a list of transactions for a given account, with examples for AUD currency. ```APIDOC ## GET /data/v1/accounts/{account_id}/transactions ### Description Retrieves a list of transactions associated with a specific account. This example shows a response for transactions in AUD. ### Method GET ### Endpoint `/data/v1/accounts/{account_id}/transactions` ### Parameters #### Path Parameters - **account_id** (string) - Required - The unique identifier of the account. ### Response #### Success Response (200) - **results** (array) - A list of transaction objects. - **timestamp** (string) - The date and time of the transaction (ISO 8601 format). - **description** (string) - Description of the transaction. - **transaction_type** (string) - Type of transaction (e.g., "DEBIT", "CREDIT"). - **transaction_category** (string) - Categorization of the transaction. - **amount** (number) - The transaction amount. - **currency** (string) - The currency of the transaction (e.g., "AUD"). - **transaction_id** (string) - Unique identifier for the transaction. - **provider_transaction_id** (string) - Transaction ID from the provider. - **normalised_provider_transaction_id** (string) - Normalized transaction ID from the provider. ### Response Example ```json { "results": [ { "timestamp": "2022-03-02T00:00:00", "description": "TFR Westpac", "transaction_type": "CREDIT", "transaction_category": "OTHER", "amount": 100, "currency": "AUD", "transaction_id": "08b22f7ed7e222a0ac986d10cbacc2da", "provider_transaction_id": "32RJRrk-g5KzzOTDkVp631blQrzgsBOSAJ8J8qa3nlJsJaUDgK36mMCe", "normalised_provider_transaction_id": "txn-f88d587a7bd5fcd16" }, { "timestamp": "2022-03-01T00:00:00", "description": "DEBIT CARD PURCHASE WOOLWORTHS", "transaction_type": "DEBIT", "transaction_category": "OTHER", "amount": -50, "currency": "AUD", "transaction_id": "1289224494752e396fd21a496c34aa96", "provider_transaction_id": "42RJRrk-g5KzzOTDkVp631blQrzgsBOSAJ8J8qa3nlJsJaUDgK36mMCq", "normalised_provider_transaction_id": "txn-58fe8574b18e3e917" } ] } ``` ``` -------------------------------- ### Retrieve Signup+ User Data with Payment ID (JSON) Source: https://docs.truelayer.com/docs/payments-only-integration This code snippet demonstrates the JSON response received after successfully retrieving user information using a payment ID from the Signup+ endpoint. It includes details like name, date of birth, address, and account information. This data is crucial for simplifying user signup flows in live integrations. ```json { "first_name": "TOMMIE", "last_name": "BURKE", "date_of_birth": "2008-09-05", "address": { "address_line1": "339", "address_line2": "IDVERIFIER ST", "city": "ELY", "state": "CAMBS", "zip": "CB6 2AG", "country_code": "GB" }, "account_details": { "sort_code": "40-22-25", "account_number": "14375270", "iban": "GB75CLRB04066800000871", "provider_id": "mock-payments-gb-redirect" } } ``` -------------------------------- ### Get Account Transactions (GBP) Source: https://docs.truelayer.com/reference/getaccountpendingtransactions Retrieves a list of transactions for a given account, with examples for GBP currency. ```APIDOC ## GET /data/v1/accounts/{account_id}/transactions ### Description Retrieves a list of transactions associated with a specific account. This example shows a response for transactions in GBP. ### Method GET ### Endpoint `/data/v1/accounts/{account_id}/transactions` ### Parameters #### Path Parameters - **account_id** (string) - Required - The unique identifier of the account. ### Response #### Success Response (200) - **results** (array) - A list of transaction objects. - **transaction_id** (string) - Unique identifier for the transaction. - **normalised_provider_transaction_id** (string) - Normalized transaction ID from the provider. - **provider_transaction_id** (string) - Transaction ID from the provider. - **timestamp** (string) - The date and time of the transaction (ISO 8601 format). - **description** (string) - Description of the transaction. - **amount** (number) - The transaction amount. - **currency** (string) - The currency of the transaction (e.g., "GBP"). - **transaction_type** (string) - Type of transaction (e.g., "DEBIT", "CREDIT"). - **transaction_category** (string) - Categorization of the transaction. - **transaction_classification** (array) - Further classification details. - **merchant_name** (string) - Name of the merchant. - **running_balance** (object) - The running balance after the transaction. - **amount** (number) - Balance amount. - **currency** (string) - Balance currency. - **meta** (object) - Additional metadata. - **bank_transaction_id** (string) - Bank's transaction ID. - **provider_transaction_category** (string) - Provider's transaction category. ### Response Example ```json { "results": [ { "transaction_id": "03c333979b729315545816aaa365c33f", "normalised_provider_transaction_id": "txn-ajdifh38fheu5hgue", "provider_transaction_id": "9882ks-00js", "timestamp": "2018-03-06T00:00:00", "description": "GOOGLE PLAY STORE", "amount": -2.99, "currency": "GBP", "transaction_type": "DEBIT", "transaction_category": "PURCHASE", "transaction_classification": [ "Entertainment", "Games" ], "merchant_name": "Google play", "running_balance": { "amount": 1238.6, "currency": "GBP" }, "meta": { "bank_transaction_id": "9882ks-00js", "provider_transaction_category": "DEB" } }, { "transaction_id": "3484333edb2078e77cf2ed58f1dec11e", "normalised_provider_transaction_id": "txn-2jdh8whf8w9rh3udh", "provider_transaction_id": "33b5555724", "timestamp": "2018-02-18T00:00:00", "description": "PAYPAL EBAY", "amount": -25.25, "currency": "GBP", "transaction_type": "DEBIT", "transaction_category": "PURCHASE", "transaction_classification": [ "Shopping", "General" ], "merchant_name": "Ebay", "meta": { "bank_transaction_id": "33b5555724", "provider_transaction_category": "DEB" } } ] } ``` ``` -------------------------------- ### List Merchant Accounts Source: https://docs.truelayer.com/docs/payments-only-integration Retrieves details for your merchant accounts, including their IDs. This is necessary for performing payment-related operations. ```APIDOC ## List Merchant Accounts ### Description Retrieves a list of your merchant accounts, providing essential details such as account IDs for GBP and EUR. This information is crucial for subsequent payment operations. ### Method GET ### Endpoint 2. Merchant Accounts > 2A. List Merchant Accounts ### Parameters None ### Request Example N/A (Request is pre-configured in the Insomnia collection) ### Response #### Success Response (200) - **id** (string) - The unique identifier for the merchant account (e.g., for GBP or EUR). - Other account details may also be included. #### Response Example ```json { "accounts": [ { "id": "acc_xxxxxxxxxxxxxx", "currency": "GBP", "balance": { "amount": 10000, "currency": "GBP" } }, { "id": "acc_yyyyyyyyyyyyyy", "currency": "EUR", "balance": { "amount": 5000, "currency": "EUR" } } ] } ``` #### Alternative Method Merchant account IDs can also be found in the **Merchant Account** dashboard within the TrueLayer Console. ``` -------------------------------- ### Start Authorisation Flow Response Example (JSON) Source: https://docs.truelayer.com/docs/authorisation-flow-actions An example JSON response from the authorization flow endpoint, indicating that the next action required is 'provider_selection' and listing available providers. ```json { "authorization_flow": { "actions": { "next": { "type": "provider_selection", "providers": [ { "id": "ob-bank-name", "display_name": "Bank Name", "icon_uri": "https://truelayer-provider-assets.s3.amazonaws.com/global/icon/generic.svg", "logo_uri": "https://truelayer-provider-assets.s3.amazonaws.com/global/logos/generic.svg", "bg_color": "#000000", "country_code": "AT", "search_aliases": [ "string" ] } ] } } }, "status": "authorizing" } ``` -------------------------------- ### Hosted Payment Page URL Template Source: https://docs.truelayer.com/docs/payments-only-integration A template URL used to direct users to the TrueLayer hosted payment page. It requires the payment ID, resource token, and a pre-configured redirect URI. ```text https://payment.truelayer-sandbox.com/payments#payment_id={id}&resource_token={resource_token}&return_uri={Redirect URI} ``` -------------------------------- ### GET /v3/payouts/{id} Source: https://docs.truelayer.com/docs/quickstart-make-a-test-payout-open-loop Retrieves the status of a specific payout by its unique identifier. ```APIDOC ## GET /v3/payouts/{id} ### Description Retrieves the current status of a payout. Note that the terminal status for a successful payout is 'executed'. ### Method GET ### Endpoint /v3/payouts/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the payout. ### Response #### Success Response (200) - **status** (string) - The current status of the payout (e.g., executed). ``` -------------------------------- ### Generate Public Key using OpenSSL Source: https://docs.truelayer.com/docs/payments-only-integration This command derives the public key from a previously generated private key. The public key is used in conjunction with the private key for request signing in the Payments API v3. ```bash openssl ec -in ec512-private-key.pem -pubout -out ec512-public-key.pem ``` -------------------------------- ### Get Card Transactions 200 Response Example Source: https://docs.truelayer.com/reference/getcardtransactions This example demonstrates a successful 200 OK response for retrieving card transactions. It includes a list of transaction objects, each with details like ID, timestamp, amount, and merchant information. ```json { "results": [ { "transaction_id": "a15d8156569ba848d84c07c34d291bca", "normalised_provider_transaction_id": "txn-ajdifh38fheu5hgue", "provider_transaction_id": "9882ks-00js", "timestamp": "2018-01-16T00:00:00+00:00", "description": "SAINSBURYS SMRKT STORE 128", "amount": 24.25, "currency": "GBP", "transaction_type": "DEBIT", "transaction_category": "PURCHASE", "transaction_classification": [ "Shopping", "Groceries" ], "merchant_name": "Sainsburys", "running_balance": { "amount": 1238.6, "currency": "GBP" }, "meta": { "cardNumber": "1234********5678", "location": "INTERNET" } }, { "transaction_id": "af4d5470cc7ad6a83a02335ab8053481", "normalised_provider_transaction_id": "txn-2jdh8whf8w9rh3udh", "provider_transaction_id": "33b5555724", "timestamp": "2018-03-19T00:00:00", "description": "TALKTALK TELECOM", "amount": 46.82, "currency": "GBP", "transaction_type": "DEBIT", "transaction_category": "PURCHASE", "transaction_classification": [ "Bills and Utilities", "Internet" ], "merchant_name": "Talktalk", "running_balance": { "amount": 1262.85, "currency": "GBP" }, "meta": { "provider_transaction_category": "DEB", "cardNumber": "1234********5678", "location": "INTERNET" } } ] } ``` -------------------------------- ### POST /v3/payouts Source: https://docs.truelayer.com/docs/quickstart-make-a-test-payout-open-loop Creates a new payout to an external account. Supports both UK (sort code/account number) and EU (IBAN) payment schemes. ```APIDOC ## POST /v3/payouts ### Description Initiates a payout to an external bank account. You can specify the destination using either sort code and account number (UK) or IBAN (EU). ### Method POST ### Endpoint /v3/payouts ### Parameters #### Request Body - **merchant_account_id** (string) - Required - The UUID for the merchant account paying out. - **currency** (string) - Required - Currency code (e.g., GBP, EUR). - **beneficiary** (object) - Required - Details of the recipient. - **amount_in_minor** (integer) - Optional - The amount to pay in minor units. ### Request Example { "currency": "GBP", "beneficiary": { "type": "external_account", "account_identifier": { "type": "sort_code_account_number", "sort_code": 560029, "account_number": 26207729 }, "account_holder_name": "eg-name", "date_of_birth": "1990-01-31" } } ### Response #### Success Response (200) - **id** (string) - The unique identifier of the created payout. #### Response Example { "id": "0cd1b0f7-71bc-4d24-b209-95259dadcc20" } ``` -------------------------------- ### Configure Signup+ in Payment Request Source: https://docs.truelayer.com/docs/payments-integration-checklist Example of how to include the Signup+ product in a payment request body. This enables the retrieval of user information such as name, date of birth, and address after a payment is completed. ```json { "related_products": { "signup_plus": {} } } ``` -------------------------------- ### Initialize TrueLayer Web SDK v1 Source: https://docs.truelayer.com/docs/web-sdk-v0-to-v1-migration-guide Demonstrates the initialization of the Web SDK v1, including the mandatory configuration properties and the implementation of the onStartFlow callback to trigger payment creation. ```javascript const { start, mount } = initWebSdk({ currency: 'GBP', // or 'EUR' clientId: 'your-client-id', returnUri: 'https://example.org/return-page', user: { email: 'john.doe@example.org', }, async onStartFlow() { // Create payment via server call const { paymentId, resourceToken } = await createPayment(); // Kick off the payment flow start({ paymentId, resourceToken }); } }); // mount the Pay button mount(document.getElementById('your-container-id')); ``` -------------------------------- ### Install and Uninstall Packages for Web SDK Migration Source: https://docs.truelayer.com/docs/epp-to-web-sdk-migration-guide This snippet demonstrates how to install the `truelayer-web-sdk` and uninstall the `truelayer-embedded-payment-page` package using npm, yarn, and pnpm. This is the first step in migrating from the EPP to the Web SDK. ```bash npm i truelayer-web-sdk npm uninstall truelayer-embedded-payment-page --- yarn add truelayer-web-sdk yarn remove truelayer-embedded-payment-page --- pnpm install truelayer-web-sdk pnpm uninstall truelayer-embedded-payment-page ``` -------------------------------- ### Get Account Direct Debits 200 Response Example Source: https://docs.truelayer.com/reference/getaccountdirectdebits Provides an example of a successful 200 OK response for retrieving direct debit information. It includes a list of direct debit objects, each with details like ID, timestamp, name, status, and meta information. ```json { "results": [ { "direct_debit_id": "004ea8ce16b6ff57090b7bf8c7b483a1", "timestamp": "2019-07-19T17:28:37.798+01:00", "name": "EE", "status": "Active", "previous_payment_timestamp": "2018-09-17T00:00:00+01:00", "previous_payment_amount": 25, "currency": "GBP", "meta": { "provider_mandate_identification": "6", "provider_account_id": "1000000000000000001" } }, { "direct_debit_id": "8e5dfbc5b4d66c8aff248e9ca6440c55", "timestamp": "2019-07-19T17:28:37.805+01:00", "name": "PAYPAL", "status": "Active", "previous_payment_timestamp": "2019-07-18T00:00:00+01:00", "previous_payment_amount": 4.99, "currency": "GBP", "meta": { "provider_mandate_identification": "9", "provider_account_id": "1000000000000000001" } }, { "direct_debit_id": "72699309c9be1226e46e5257fb24133f", "timestamp": "2019-07-19T17:28:37.805+01:00", "name": "BT INTERNET", "status": "Active", "previous_payment_timestamp": "2018-09-18T00:00:00+01:00", "previous_payment_amount": 16.99, "currency": "GBP", "meta": { "provider_mandate_identification": "7", "provider_account_id": "1000000000000000001" } } ], "status": "Succeeded" } ``` -------------------------------- ### Signup+ API Source: https://docs.truelayer.com/llms.txt APIs for simplifying user onboarding through payments, including data-only integration and country-specific checklists. ```APIDOC ## Data Only Integration ### Description Integrate with Signup+ using the data-only integration flow to collect user information. ### Method POST ### Endpoint `/signup/data` ### Parameters #### Request Body - **redirect_uri** (string) - Required - The URI to redirect the user to after data collection. ### Request Example ```json { "redirect_uri": "https://your-app.com/callback" } ``` ### Response #### Success Response (200) - **authorization_url** (string) - The URL to redirect the user to for data collection. #### Response Example ```json { "authorization_url": "https://truelayer.com/auth?id=..." } ``` ## Signup+ with Payment ### Description Integrate Signup+ with a payment to quickly obtain test user details like name, date of birth, and address from a sandbox payment. ### Method POST ### Endpoint `/signup/payment` ### Parameters #### Request Body - **payment_id** (string) - Required - The ID of the sandbox payment. ### Request Example ```json { "payment_id": "pay_789ghi" } ``` ### Response #### Success Response (200) - **user_details** (object) - Contains user information such as name, date of birth, and address. #### Response Example ```json { "user_details": { "name": "John Doe", "date_of_birth": "1990-01-01", "address": "123 Main St" } } ``` ``` -------------------------------- ### Get Payment Sources Source: https://docs.truelayer.com/reference/get-merchant-account-payment-sources Retrieves all payment sources from which the merchant account has received payment. Note that all Payments API v3 endpoints now start with `/v3/`. ```APIDOC ## GET /v3/payment-sources ### Description Retrieves a list of payment sources from which the merchant account has received payment. ### Method GET ### Endpoint /v3/payment-sources ### Parameters #### Query Parameters - **account_id** (string) - Required - The ID of the merchant account. ### Request Example ```json { "account_id": "acc_12345abcde" } ``` ### Response #### Success Response (200) - **payment_sources** (array) - A list of payment source objects. - **id** (string) - The unique identifier for the payment source. - **type** (string) - The type of the payment source (e.g., 'card', 'bank_account'). - **details** (object) - Specific details about the payment source. #### Response Example ```json { "payment_sources": [ { "id": "ps_abcdef12345", "type": "card", "details": { "last_4_digits": "1234", "brand": "Visa" } }, { "id": "ps_ghijkl67890", "type": "bank_account", "details": { "account_number_last_4": "5678", "bank_name": "Example Bank" } } ] } ``` ``` -------------------------------- ### Launch Payment with AndroidX Activity Integration (Kotlin) Source: https://docs.truelayer.com/docs/authorise-payments-with-the-android-sdk Demonstrates how to initiate a payment flow using the TrueLayer SDK with an AndroidX Activity. It involves registering for activity results and launching the payment process with a `PaymentContext` object obtained from a backend. ```kotlin import android.widget.Toast import com.truelayer.payments.ui.screens.processor.ProcessorContext.PaymentContext import com.truelayer.payments.ui.screens.processor.ProcessorActivityContract import com.truelayer.payments.ui.screens.processor.ProcessorResult // Register for the end result. val contract = ProcessorActivityContract() val processorResult = registerForActivityResult(contract) { val text = when (it) { is ProcessorResult.Failure -> { "Failure ${it.reason}" } is ProcessorResult.Successful -> { "Successful ${it.step}" } } // present the final result Toast.makeText(this, text, Toast.LENGTH_LONG).show() } // Obtain your payment context from your backend val paymentContext = PaymentContext( id = "your-payment-identifier", resourceToken = "payment-resource-token", redirectUri = "redirect-uri-that-will-be-invoked-when-coming-back-from-bank" ) // 🚀 Launch the payment flow. processorResult.launch(paymentContext) ``` -------------------------------- ### Example Closed-Loop Payout Response Source: https://docs.truelayer.com/docs/make-a-payout-to-an-account-that-paid-in The response received after a successful closed-loop payout request. It contains only the payout 'id', which can be used to monitor the payout's progress via webhooks or GET requests. ```json { "id": "a7e4e74f-d7da-43e2-af7f-f953724a461c" } ``` -------------------------------- ### Example Redirect URI for Finnish Bank Authorization Source: https://docs.truelayer.com/docs/integrate-signup-in-finland A sample URL structure received after a user completes bank authentication. It contains the payment_id and the outcome status. ```text https://example.com/redirect?outcome=success&payment_id=f7f55a6b-edff-4669-8272-39117d3eef1e ``` -------------------------------- ### Initialize TrueLayer SDK Source: https://docs.truelayer.com/docs/authorise-payments-with-the-android-sdk Initializes the TrueLayerUI instance with the application context, environment settings, and custom HTTP configurations. ```kotlin import com.truelayer.payments.core.domain.configuration.Environment import com.truelayer.payments.core.domain.configuration.HttpConnectionConfiguration import com.truelayer.payments.core.domain.configuration.HttpLoggingLevel import com.truelayer.payments.ui.TrueLayerUI TrueLayerUI.init(context = applicationContext) { environment = Environment.PRODUCTION httpConnection = HttpConnectionConfiguration( httpDebugLoggingLevel = HttpLoggingLevel.None ) } ``` -------------------------------- ### Get Auth URI for Finnish Banks Source: https://docs.truelayer.com/docs/integrate-signup-in-finland Obtain an authorization URI to redirect users to their Finnish bank for identity verification. The user will be redirected back to your specified URI with payment and outcome details. ```APIDOC ## GET /signup-plus/auth ### Description This endpoint provides an authorization URI that redirects users to their selected Finnish bank for identity verification. After successful authentication, the user is redirected back to your specified redirect URI with `payment_id` and `outcome` query parameters. ### Method GET ### Endpoint `/signup-plus/auth` ### Query Parameters * **redirect_uri** (string) - Required - The URI to redirect the user to after authentication. * **payment_id** (string) - Required - The ID of the payment to link the identity flow to. ### Response #### Success Response (200) - **auth_uri** (string) - The authorization URI for the user to authenticate with their bank. #### Response Example ```json { "auth_uri": "https://sandbox.truelayer.com/connect/authorize?response_type=code&client_id=YOUR_CLIENT_ID&redirect_uri=https://example.com/redirect&scope=openid%20profile%20offline_access&state=YOUR_STATE" } ``` ```