Signup+ sandbox

Learn how to test different scenarios using our sandbox environment.

Test Signup+ in sandbox

Learn how to test different scenarios using our sandbox environment.

📘

Using the sandbox environment

To ensure you make requests to the sandbox environment, use the sandbox base URL before any requests. This is:

https://api.truelayer-sandbox.com/

Test the payments only flow

Before you can test the Signup+ payments flow in sandbox, you must have a payment with a status of settled. After that, you can use the payment id to make a request to the Signup+ /signup-plus/payments endpoint.

Create a payment

See our documentation about how to create a payment. Additionally, our payments quickstart guide and Insomnia collection for Payments V3 may be useful.

The first step is to create a payment in the sandbox environment. When you do so, note the following:

  • The provider_id must be mock-payments-gb-redirect.
  • The payment_method must have the type bank_transfer.
  • The beneficiary must have the type merchant_account (Signup+ doesn’t support open-loop payments).
  • The value of amount_in_minor affects the response the /signup-plus/payments endpoint returns. There’s more information below.
  • It is advised to use the signupplus scope when authenticating the payment, so that you can use the same token with the /signup-plus/payments endpoint later.

The sandbox payment authorisation flow redirects you to a mock UI provider where you authorize the payments. After authorisation, the payment usually settles within a few seconds. After this, you should have a payment_id with a status of settled available to use. It is recommended to wait for the payment_settled webhook.

If needed, you can call the /payments/{id} endpoint to check the current status of the payment.

Test different payments flow responses

You can adjust the value of the payment's amount (amount_in_minor field) in your sandbox payment to test different scenarios with Signup+:

AmountSignup+ response
Less than 100Success: identity data found
Between 100 and 250 (inclusive)Error: joint accounts not supported
Greater than 250Error: user data not found

📘

Amount in minor notation

Make sure to convert the above amounts in minor notation when invoking our Payments API.
For example, an amount of 250 is 25000 in minor notation.

Make a payments request to Signup+

At this point, you should have a payment id for a settled payment, which was authorised with the signupplus scope enabled.

This means you can make a GET request to the /signup-plus/payments endpoint.

The Signup+ API reference and Insomnia collection can help you make this request.

Test the data flow

Before you test the Signup+ data and payments flow, you must have one or more accounts already linked to a bearer token. After that, you can use the account_id to make a request to the /signup-plus/accounts endpoint.

The first step is to generate an authorization link in the sandbox environment. When you do so, note the following:

  • The response_type should be code.
  • The provider_id should be mock.
  • the scope list should include signupplus.
  • Ensure you have access to the redirect_uri you provide (this is set in Console).

Then, after opening the above authorization link into a browser you should enter some test credentials. Using john/doe will return 3 accounts, 1 for each scenario.

AccountScenario
25226660Success: identity data found
18917060Error: joint accounts not supported
00002724Error: user data not found

After you successfully authorise the account connection, you're redirected to your redirect_uri, which displays a code query parameter to grab.

Make a data request to Signup+

With the code you received in the previous step, you can make a request to the /signup-plus/accounts endpoint either with or without providing the account_id query parameter.

Test the variable recurring payments flow

Before you test the Signup+ recurring payments flow, you need an authorised mandate. After that, you can use the mandate id to make a request to the /signup-plus/mandates endpoint.

Create a variable recurring payment mandate

See our documentation about how to create a mandate. Additionally, our Insomnia collection for Payments V3 may be useful.

The first step is to create a mandate in the sandbox environment. When you do so, note the following:

  • The provider_id must be ob-natwest-vrp-sandbox.
  • The mandate.type must be sweeping.
  • the beneficiary have the type merchant_account (Signup+ doesn't support open-loop payments).
  • the value of constraints.maximum_individual_amount affects the response the /signup-plus/mandates endpoint returns. There's more information below.
  • It is advised to use the signupplus scope when authenticating the mandate, so that you can use the same token with the /signup-plus/mandates endpoint later.

Test different variable recurring payments flow responses

You can adjust the value of the constraints.maximum_individual_amount in your sandbox payment (regardless of currency) to test different scenarios with Signup+:

AmountScenario
Less than 1000Success: identity data found
Between 1000 and 2500 (inclusive)Error: joint accounts not supported
Greater than 2500Error: user data not found

📘

Amount in minor notation

Make sure to convert the above amounts in minor notation when invoking our Payments API.
For example, an amount of 1000 is 100000 in minor notation.

Make a variable recurring payments request to Signup+

At this point, you should have a mandate id for a mandate with a status of authorized, which was authorised with the signupplus scope enabled. It is recommended to wait for the mandate_authorized webhook.

This means you can make a GET request to the /signup-plus/mandates endpoint.

The Signup+ API reference and Insomnia collection can help you make this request.