Testing your integration
Use Lean's Sandbox to test API requests, customer journeys and webhook handling before going live.
Test the complete flow—from the first request through to the outcome your application shows the customer. Include unsuccessful journeys, delayed updates and recovery from failures.
Before you start
Complete your application configuration and authentication setup. You should have:
- Access to your Sandbox application in the Lean Dashboard.
- Your app token and client secret.
- Access to the products you are testing.
- Registered redirect URLs for customer journeys.
- A webhook endpoint subscribed to the required events.
Authenticate your integration →
1. Configure Sandbox
Use the following settings for UAE Sandbox testing.
| Setting | Value |
|---|---|
| API base URL | https://sandbox.leantech.me |
| OAuth token endpoint | https://auth.sandbox.leantech.me/oauth2/token |
| Link SDK configuration | sandbox: true |
Sandbox API requests do not require client certificates.
Use the credentials and resource IDs associated with your Sandbox application. Keep them separate from your Production configuration.
Use synthetic data only. Do not submit real customer names, identity numbers, account details or other personal information to Sandbox.
2. Create your test users
A test user controls the simulated bank experience. A Lean Customer is the resource your application creates through the API to represent a user in your system.
In the Lean Dashboard, select your Sandbox application and open Development → Test users.
Create a test user and configure the data and payment flows you want to test. Use the test user's credentials when completing the corresponding bank journey in the Link SDK.
Create different test users to cover the scenarios your integration needs to handle. Record each configuration and expected outcome so you can repeat your tests.
Prepare the setup for your product
Alongside your test-user configuration, prepare the resources and product access required for your flow.
| Product | Test setup |
|---|---|
| Data & Insights | A test user configured for your data scenario and a Lean Customer, with the permissions required for the insights you plan to retrieve. |
| One-time payments | A test user configured for your payment scenario, a Lean Customer and a configured payment destination. |
| Account on File payments | A test user configured for your payment scenario, a Lean Customer and the destination and customer information required for the consent. |
| Payouts | Payouts access and the supported SME mock-bank setup for your connected business account and authorisation flow. |
| Refunds | Payments, Reconciliation and Payouts access, plus an eligible reconciled test payment. |
| Account Verification | The synthetic account and identity inputs provided for the country and scenario you are testing. |
Use the test configuration and inputs supported by each product. The configurable data and payment flows do not replace the separate setup required for Payouts, Refunds or Account Verification.
3. Complete a successful journey
Follow the relevant product guide to build the flow, then verify the outcome across your frontend, backend and stored records.
| Product | Journey to test | What to verify |
|---|---|---|
| Data & Insights | Connect a bank, complete consent and retrieve the required insights when the information is ready. | Your application distinguishes a successful connection from readiness to retrieve insights and handles incomplete information. |
| One-time payments | Create a Payment Intent, complete the customer journey and track the resulting payment. | The payment is associated with the correct customer and business transaction. Your application confirms the outcome through APIs and webhooks. |
| Account on File payments | Create and authorise a consent, then initiate a payment within its limits. | Consent authorisation and payment execution are tracked separately. Test immediate payment and multiple beneficiaries if your integration uses them. |
| Reconciliation | Track a test payment through reconciliation using the supported Sandbox setup. | Your application distinguishes payment initiation from confirmation of incoming funds. |
| Payouts | Prepare a beneficiary and submit a payout through your configured authorisation flow. | The beneficiary is ready before submission, and your application continues tracking the payout beyond initial acceptance. |
| Refunds | Create a full or partial refund against an eligible reconciled payment and complete any required approval. | The refund is associated with the original payment and tracked separately from it. |
| Account Verification | Submit the supplied test account and identity details. | Your application interprets the verification result, including match information where returned, rather than relying on HTTP success alone. |
For journeys that return the customer from their bank, test both success and failure redirects and the Link SDK's captureRedirect handling.
4. Test unsuccessful and interrupted journeys
Use supported mock-bank scenarios where available. Where Sandbox does not provide a trigger, simulate the response or event in your own test harness to verify your application's handling.
Application-level simulations test your code; they do not confirm the bank's behaviour.
| Scenario | Expected application behaviour |
|---|---|
| The customer cancels or leaves the journey | Offer a clear way to continue or restart without marking the operation as successful. |
| Bank authentication or authorisation fails | Show an appropriate outcome and preserve enough context to retry the journey safely. |
| An access token expires | Obtain a replacement token where needed. Avoid repeated authentication failures or duplicate operations. |
| A consent is rejected, expires, is revoked or becomes unusable | Stop relying on that consent and guide the customer through the appropriate next step. |
| A payment exceeds the consent's limits | Handle the rejection without repeatedly submitting the same request. |
| A connection succeeds but information retrieval fails or is incomplete | Avoid presenting missing information as a complete financial picture. |
| A payment or payout remains pending | Show a pending outcome and continue tracking it. Do not treat a delay as success or failure. |
| A refund cannot proceed | Preserve the original payment record and explain the refund outcome separately. |
| Account Verification returns no match, a partial match or an error | Apply your decision rules for the returned outcome instead of treating all unsuccessful verification results alike. |
Test retries safely
Simulate a network timeout after your application submits a request.
Confirm that your retry strategy follows the endpoint's documented behaviour. Where idempotency is supported, test that retrying the same operation does not create another payment or payout.
Do not assume every endpoint supports the same idempotency header or retry rules.
5. Test webhook delivery and recovery
Confirm that your application can receive, verify, store and process the events required by your product.
Test these cases:
- Successful delivery: the signature validates and the event updates the correct resource.
- Repeated delivery: processing the same event again does not repeat a business action.
- Endpoint failure: your application recovers after temporarily failing to accept a webhook.
- Processing failure: a background job can retry after the webhook has already been acknowledged.
- Delayed updates: an older event does not overwrite newer state.
- Invalid signature: the request is rejected.
- Missed events: your recovery process identifies and handles events that were not processed.
You can resend webhooks from the Lean Dashboard to test redelivery after fixing your handler. Use the Events API to investigate and recover missing events across a time window.
6. Get help with testing
If a scenario does not behave as documented, contact Lean Support with the request time, environment, relevant resource IDs and any available correlation ID.
Do not include client secrets, access tokens, webhook secrets or bank login credentials.
Before going live
Confirm that:
- Each product flow works from initiation through to its expected outcome.
- Your application handles cancellation, failure and pending states.
- Redirects and webhook updates work independently.
- Retries and repeated events do not create duplicate business actions.
- Your team can investigate and recover failed processing.
- Production product access, credentials, destinations and connected accounts are configured.
- Production redirect URLs and webhook subscriptions are configured.
- Your application uses Production endpoints and
sandbox: false.
Sandbox testing validates your integration against the supported simulations. Bank availability, authentication journeys and processing times can differ in Production.
Updated about 1 hour ago
