Sandbox and Live

How LendAPI's two environments work, how to choose between them, and how to test safely before going live.

Every LendAPI tenant has two environments: Sandbox, for building and testing new products, decision trees, pricing engines and integrations with fake applicants, and Production (also called live), for real applicants and real lending decisions. The two environments keep their data separately, so an application created in Sandbox never shows up in Production, and the reverse is also true. In the dashboard you switch environments with a selector. In the API, your key decides the environment.

Key concepts

  • Sandbox: the test environment. The dashboard header turns orange while you are in it.
  • Production / Live: the live environment. The dashboard labels it Production. API keys for it start with live_.
  • Test key: an API key that starts with test_. All requests made with it use Sandbox.
  • Live key: an API key that starts with live_. All requests made with it use Production.
  • Sync Sandbox: a dashboard action that copies your Production configuration into Sandbox.

How it works

Choose an environment

The environment selector sits in the top bar, next to the notification bell. Choose Sandbox or Production. The page reloads in the selected environment, and a confirmation appears ("Sandbox turned on" or "Live Mode"). While you are in Sandbox, the top bar has an orange tint so you always know where you are.

Everything you do in the dashboard applies to the environment that is currently selected. That includes viewing applications and creating API keys or webhooks.

For example, this request creates a Sandbox application because it uses a test key:

curl -X POST https://app.lendapi.com/api/v1/application/ \
  -H "Authorization: Bearer test_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "first_name": "Jane",
    "last_name": "Doe",
    "email": "[email protected]",
    "product_id": 101
  }'

The response includes a redirect_url for the applicant. Links for Sandbox applications open the application in Sandbox mode. See Create application for the full request schema.

📘

Keys belong to one environment

A key is created in the environment you are in when you create it. A test key only works against Sandbox data, and a live key only works against Production data. There is no setting that switches a key between environments.

What is separate and what is shared

ItemSeparate per environment?Notes
Applications, applicants and their dataYesSandbox applications never appear in Production.
API keysYesCreate test keys in Sandbox and live keys in Production.
WebhooksYesEach environment has its own webhook settings. Sandbox events go to the webhook configured in Sandbox.
Products, variables, decision trees, pricing engines, outcomes, templates, document libraryYesEach environment has its own copy. Use Sync Sandbox to copy Production's configuration into Sandbox.
Integration (provider) settingsYesConfigure the credentials for each environment, for example a provider's test credentials in Sandbox.
Your usersShared sign-inUsers sign in once and switch environments with the selector.

Work with both environments

Sync Sandbox with Production

Sync Sandbox copies your Production configuration into Sandbox so you can test against the same setup your applicants see. It does not copy applications or applicant data.

It copies:

  • Decision outcomes and variables
  • Decision trees
  • Pricing engines and offers
  • Products
  • Document library and document groups
  • Email templates
  • Global settings and workspace configuration, such as custom stages

To run it:

  1. Open the profile menu in the top-right corner and select Settings.
  2. Open the Configuration tab.
  3. In the Sync Environments section, click Sync Sandbox.
🚧

Sandbox items can be replaced

Sync Sandbox copies from Production into Sandbox and can replace items in Sandbox with their Production versions. Note any Sandbox-only changes you want to keep before you sync.

Test safely

Sandbox is isolated from Production data, but Sandbox activity can still reach systems outside LendAPI.

  • Webhooks fire in Sandbox. If a webhook is active in Sandbox, Sandbox events are sent to its URL. Point Sandbox webhooks at a test endpoint, not your production systems.
  • Use fake applicant details. Use made-up names, example.com email addresses you control, and test phone numbers such as 555-0100. Never copy real applicant data into Sandbox.
  • Use provider test credentials. Configure integrations in Sandbox with each provider's test or sandbox credentials, so test applications don't call a provider's live service.
  • Check the environment before you act. Look for the orange header and the Sandbox label before you create, edit or delete anything.
  • Keep keys separate in your code. Store test and live keys in separate configuration, and make sure your production deployment can only read the live key.

Go live

  1. Build and test your product, decision trees and pricing engines in Sandbox.
  2. Make sure the same configuration exists in Production. Sync Sandbox only copies from Production to Sandbox, so set up the final version of each item in Production as well.
  3. Switch the dashboard to Production and create a live API key.
  4. Configure your Production webhook and integrations with live credentials.
  5. Replace the test_ key in your production systems with the live_ key.
  6. Submit a small number of real applications and check the results before opening to all traffic.

Permissions

Sync Sandbox is on the Configuration tab of the Settings module, and creating keys and webhooks is on the API and Webhook tabs. Each needs edit access to that tab. Which environments a user can open is set by their Access value. See Roles and Permissions.

Related guides


Did this page help you?