Skip to content

Test environment

Every Customer of an API gets test and live keys on one address; test calls reach test records, move no money and run the Startup's latest merged Change.

Every Startup's API has two environments, test and live, on one address. A Customer's key picks between them, so its code moves from test to live by changing one variable.

Two keys, one address

Harbor Residential's developer makes a test key in the Portal and sets it as LEASELINE_API_KEY on a laptop. Production holds the live key in the same variable, and the call is the same:

Terminal
curl https://api.leaseline.app/leases -H "Authorization: Bearer $LEASELINE_API_KEY"

Every record, such as an Order or an Event, belongs to one environment and never crosses. No parameter moves a keyed call between them.

What test does differently

test runs every Verb for real, with three exceptions:

In testWhat happens instead
PaymentsTest cards charge, and no money moves
Outbound messagesReach only the Startup's own team
Outside effectsSimulated, then recorded as done

Everything else matches live: Permissions, Limits, Watches and Events. A flow that passes in test passes in live. A magic value forces an outcome, such as card 4000 0000 0000 0002, which declines.

Test runs ahead of live

test runs the Startup's latest merged Change; live runs the Version last deployed. A Customer sees a merged Change in test before it reaches live, which is how Harbor Residential tests v2 before moving its pin.

Your own test environment

Leaseline's builders use the same two environments on the builder plane. Environments covers them, and the testing guide lists every magic value.