Payments only integration

Learn how to integrate Signup+ with the payments only flow.

There are three stages to integrating Signup+ with the payments only flow:

  1. Create a payment id and enable scope
  2. Generate an access token
  3. Retrieve user data with the payment id

πŸ“˜

Environments

Ensure that you use the same environment for all of your requests to TrueLayer APIs.

  • If you are in the sandbox environment, your requests should use truelayer-sandbox.com.
  • If you are in the live environment, your requests should use truelayer.com.
16001600

Starting from the PSU, How each step of the payments only integration flow is related.

Create a payment id and enable the signupplus scope

The payments only flow uses a payment id to retrieve customer data for signup. Ensure that the signupplus scope is enabled.

Integrate the Payments API v3

Before you start sending API requests to Signup+, you need to integrate with the Payments API v3.

See the Payments API v3 documentation or the payments quickstart guide for more about how to integrate.

πŸ“˜

Hosted Payment Page

If you use the hosted payment page for your payment, you need to add signup=true as a hash parameter to the URL, like in this example:

https://payment.truelayer-sandbox.com/payments#signup=true&payment_id=6755dacf-7dd8-4577-ba11-667b6aca8474&resource_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjbGllbnRfaWQiOiJwZW5ueWRldi1lNTkzOGEiLCJqdGkiOiI2NzU1ZGFjZi03ZGQ4LTQ1NzctYmExMS02NjdiNmFjYTg0YmYiOjE2MzQ2Mzk1NDQsImV4cCI6MTYzNDY0MDQ0NCwiaXNzIjoiaHR0cHM6Ly9hcGkmRldiIsImF1ZCI6Imh0dHBzOi8vYXBpLnQ3ci5kZXYifQ.vlEvoSdFv8g7t21RlXYyus01uEZlalK89P4Ii7Avl_8&return_uri=http://localhost:3000/redirect ```

Make a payment

Create a payment using the API. A payment id is returned in the 201 response if successful.

Remember to use the same environment (sandbox or live) for both your Payments and Signup+ requests.

Enable the signupplus scope

Once you have created your payments application, ensure that your client_id has the signupplus scope enabled. To do this, go to Console > Data API > Auth link builder > Product Permissions.

The signupplus scope is available by default in the sandbox environment. To use this scope in the live environment, contact Support.

You must use the same client_id for Signup+ that you use for payments.

Generate an access token

In order to use the Signup+ API, you need an access token. You can generate a token using the POST request below. Ensure you replace "your-client-id" and "your-client-secret" with the relevant keys.

export CLIENT_ID="your-client-id"
export CLIENT_SECRET="your-client-secret"

curl --location --request POST 'https://auth.truelayer.com/connect/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=client_credentials' \
--data-urlencode 'client_id=$CLIENT_ID' \
--data-urlencode 'client_secret=$CLIENT_SECRET' \
--data-urlencode 'scope=signupplus'

You can also use the Signup+ Postman collection to test API requests, including the request to generate an access token.

Get user data with the payment id

Now that you've integrated the Payments API v3, configured your scopes, and obtained an access token, you can test the Signup+ API.

  1. Create a payment using the Payments API v3, and then complete it. It should have a status of settled.
    Once the payment is settled, make a note of the payment id. This is different from the user id β€” make sure to store the right value.
  2. Send your request using your access_token as a bearer authorization header.
  3. Configure the URL below with the following changes:
    • Substitute {users-payment-id} with the id from the previous step.
    • Adjust the URL to start with either api.truelayer.com or api.truelayer-sandbox.com depending on your environment.

https://api.truelayer.com/signup-plus/payments?payment_id={users-payment-id}

Once you've configured the URL, use it to make a GET request. If your request is successful, you will receive a response like this:

{
    "title": "Mr",
    "first_name": "Joe",
    "last_name": "Blogs",
    "date_of_birth": "2000-06-20",
    "address": {
        "address_line1": "Flat 1a",
        "address_line2": "Angels Court, Foxtrot Street",
        "city": "Stockport",
        "state": "Edgeley",
        "zip": "SK3 9LQ",
        "country_code": "GB"
    },
    "account_details": {
        "sort_code": "04-01-02",
        "account_number": "41921234",
        "iban": "GB71MONZ04435141923452",
        "provider_id": "ob-monzo"
    }
}