API mocks

On this page

API mocks

Test the third-party APIs your app depends on without their sandboxes, test accounts or real data. Testlie runs mocks compatible with popular APIs: point your app's SDK or HTTP client at a mock's base URL and it answers in the provider's own wire format, with its paths, field names, ids, status values, error shapes and signed webhooks. Every call and webhook is captured so your tests can assert on what your app sent.

Nothing reaches the real services: no money moves, no identity is verified and nothing is legally signed. Use test data only (see the acceptable use policy). Card numbers, passwords, secrets and tokens are masked before calls are stored, and images and files sent as base64 are replaced with their size and a hash.

Testlie is not affiliated with, endorsed by or sponsored by any of the providers listed on this page. Their names are trademarks of their owners, used here only to say which API each mock is compatible with.

Catalog

Open API mocks in the workspace to see the categories. Payment gateways have their own page under Payment gateways.

Category Providers Guide
Payment gateways Stripe, Adyen, PayPal, BlueSnap-compatible Mock payment gateways, BlueSnap-compatible
Banking Lean Technologies (open banking), Plaid-compatible Lean, Plaid-compatible
Identity verification IDWise, Onfido, Sumsub, Veriff, Persona, Jumio, Shufti Pro, Trulioo (Stripe Identity is in the Stripe mock) Identity verification (KYC)
Push & messaging OneSignal-compatible, Mandrill-compatible (Mailchimp Transactional) email OneSignal, Mandrill-compatible
Business tools Segment Tracking API, DocuSign eSignature, Airtable, NetSuite SuiteTalk REST Segment, DocuSign, Airtable, NetSuite

UAE PASS sign-in is a social login preset under Identity providers, not an API mock.

Create a mock

Pick a category, then a provider, and create a mock. Each mock gets:

Base URL https://testlie.com/mock/<slug>, used in place of the provider's API host. The slug is 14 hexadecimal characters; copy the whole URL from the mock's page, or read baseUrl (and slug) from GET /api/mocks/:id. It is not the mock's id
Test credentials The provider's own kind (API keys, tokens, client ids and secrets, signing keys), generated for this mock
Webhook URL Where your app receives the provider's events, for providers that send them (optional)
Scenarios Force outcomes, outages, slow responses and webhook problems

Admins can rotate a credential at any time; the old value stops working at once. Copy as .env copies every credential in .env format (multi-line keys are quoted with \n).

Scenarios

Scenarios work the same way for every provider:

Scenario Effect
Outcome Follow the test data (default), everything is approved or everything is rejected with the code you pick. What approved and rejected mean is described in each provider's guide (a payment is accepted, an envelope is signed, a delivery fails...). Identity verification mocks also have a manual review outcome; see outcomes for how to pick it
API failure Every call answers 429 or a server error (500; OneSignal answers 503 with Retry-After) in the provider's error format
Response latency Up to 10 seconds added to every call
Asynchronous steps How long simulated background work takes: a bank's approval, a payment's settlement, a notification's delivery. Default 2 seconds, up to an hour
Webhooks Send right away, delay (up to an hour), never send (recorded as dropped), send twice, or sign with a wrong key

Calls, objects and webhooks

A mock's page lists every API call with its request, response, status and timing, the objects it keeps (mandates, envelopes, records, captured events, deliveries...) and every webhook with its signature headers, attempts and your endpoint's answers. Webhooks that fail with a network error, 408, 429 or 5xx are retried on the webhook schedule; Send again replays one, freshly signed.

These webhooks are part of the mock and work on every plan, Free included; they do not count against any quota. The plan-gated Webhooks feature is Testlie's own event notifications (see plans and limits).

Limits

The number of mocks and of mock API calls per month depend on your plan. Calls to every mock, payment gateways included, count against one monthly pool. Over the limit, calls answer the provider's rate-limit error until the next month. Calls, webhooks and the objects a mock keeps (customers, envelopes, records...) follow the plan's retention, which is 3 days on Free, 30 on Team and 90 on Business: on Free, a record or envelope your tests created is deleted three days later. Each mock also keeps at most its newest 5,000 objects, and as many calls and webhooks as the plan's per-inbox message limit. Webhook delivery records are kept for at most 30 days.