Stand-ins for the outside world.
Every project that talks to a payment gateway, an identity check, an email provider, a DNS provider, a messaging service or a model API needs something to talk to in a test. This is that something โ one implementation, shared, instead of a copy in every repository.
The mocks there are
| Mock | What it stands in for | Port |
|---|---|---|
stripe | The card payments โ PaymentIntents, refunds, the webhook | 4001 |
paystack | The card payments (Nigeria) | 4005 |
interswitch | The card payments (Nigeria, Interswitch) | 4006 |
flutterwave | The card payments (Nigeria, Flutterwave) | 4010 |
monnify | The bank rails (Nigeria) โ reserved virtual accounts | 4011 |
paypal | The card and digital payments (PayPal Orders API v2) | 4028 |
square | The card payments (Square Payments API) | 4029 |
adyen | The global payments (Adyen Payments API v68) | 4030 |
shippo | The shipping labels and tracking (Shippo) | 4031 |
easypost | The shipping labels and tracking (EasyPost) | 4032 |
fedex | The shipping labels and tracking (FedEx) | 4033 |
ups | The shipping labels and tracking (UPS) | 4034 |
dhl | The shipping labels and tracking (DHL) | 4035 |
amazon-sp-api | The selling partner API (Amazon SP-API) | 4036 |
shopify | The e-commerce platform (Shopify Admin API) | 4037 |
ebay | The marketplace (eBay Sell API) | 4038 |
etsy | The handmade marketplace (Etsy Open API) | 4039 |
walmart | The marketplace (Walmart Marketplace API) | 4040 |
sendgrid | The email API (SendGrid Web API v3) | 4041 |
mailchimp | The email marketing (Mailchimp Marketing API) | 4042 |
klaviyo | The email marketing (Klaviyo API) | 4043 |
postmark | The transactional email (Postmark API) | 4044 |
hubspot | The CRM (HubSpot API) | 4045 |
salesforce | The CRM (Salesforce REST API) | 4046 |
pipedrive | The CRM (Pipedrive API) | 4047 |
attio | The CRM (Attio API) | 4048 |
quickbooks | The accounting (QuickBooks Online API) | 4049 |
netsuite | The accounting (NetSuite SuiteTalk API) | 4050 |
sage | The accounting (Sage Intacct API) | 4051 |
cin7 | The ERP/Inventory (Cin7 API) | 4052 |
dear | The ERP/Inventory (DEAR Systems API) | 4053 |
tradegecko | The ERP/Inventory (TradeGecko API) | 4054 |
katana | The ERP/Inventory (Katana MRP API) | 4055 |
avalara | The tax calculation (Avalara AvaTax API) | 4056 |
taxjar | The tax calculation (TaxJar API) | 4057 |
vertex | The tax calculation (Vertex Cloud API) | 4058 |
square-terminal | The POS terminal (Square Terminal API) | 4059 |
clover | The POS (Clover API) | 4060 |
toast | The POS (Toast API) | 4061 |
lightspeed | The POS (Lightspeed Retail API) | 4062 |
segment | The analytics (Segment API) | 4063 |
mixpanel | The analytics (Mixpanel API) | 4064 |
amplitude | The analytics (Amplitude API) | 4065 |
rudderstack | The analytics (RudderStack API) | 4066 |
rabbitmq | The message broker (RabbitMQ HTTP API) | 4067 |
kafka | The event streaming (Kafka REST Proxy API) | 4068 |
sqs | The message queue (AWS SQS API) | 4069 |
pubsub | The message queue (Google Cloud Pub/Sub API) | 4070 |
redis-streams | The message streams (Redis Streams API) | 4071 |
postgres | The relational database (PostgreSQL REST API) | 4072 |
mysql | The relational database (MySQL REST API) | 4073 |
mongodb | The document database (MongoDB REST API) | 4074 |
redis | The key-value store (Redis REST API) | 4075 |
dynamodb | The NoSQL database (AWS DynamoDB API) | 4076 |
firestore | The document database (Google Cloud Firestore API) | 4077 |
youverify | The identity checks | 4007 |
smileid | The identity checks (Nigeria, Smile ID) โ BVN, NIN, licences | 4013 |
identitypass | The identity checks (Nigeria) โ people and businesses | 4014 |
twilio | The SMS | 4009 |
termii | The SMS (Nigeria, Termii) | 4012 |
onesignal | The push notifications | 4008 |
whatsapp | The WhatsApp messages (Cloud API) | 4015 |
fcm | The push notifications (Firebase) | 4016 |
resend | The email โ sending domains, the DNS records, sending | 4002 |
xero | The accounting โ tokens, connections, invoices | 4003 |
cloudflare | The DNS โ zones, records | 4004 |
openai | The model calls โ OpenAI and Anthropic shapes | 4017 |
s3 | The buckets and the objects (S3) | 4018 |
facebook | The social network โ pages, posts, comments, insights | 4019 |
instagram | The photo sharing โ media, comments, insights | 4020 |
x | The short messages โ tweets, users, followers | 4021 |
bluesky | The open protocol โ the AT Protocol | 4022 |
telegram | The channels and the bots | 4023 |
reddit | The communities โ posts, comments, subreddits | 4024 |
linkedin | The professional network โ posts, organisations, OAuth | 4025 |
tiktok | The short video โ publishing, queries, comments | 4026 |
youtube | The video library โ videos, channels, search | 4027 |
Every endpoint every mock serves is listed in the routes, which is generated from the code. Every route is checked against the provider's own published specification, so a route that has drifted fails the build.
Using it
In a test
import { startMock } from '@bytesickle/api-mock-services'
const stripe = await startMock('stripe')
process.env.NUXT_STRIPE_API_BASE = `${stripe.url}/v1`
// ... the test ...
expect(stripe.last().path).toBe('/v1/refunds')
await stripe.close()
As a container
docker run --rm -p 4001:4001 api-mock-services stripe
# one image, one process, as many mocks as you like
docker run --rm -p 4001:4001 -p 4005:4005 api-mock-services stripe paystack
As a whole stack
docker compose -f examples/docker-compose.yml --profile payments up -d
docker compose -f examples/docker-compose.yml --profile identity up -d
docker compose -f examples/docker-compose.yml --profile all up -d
From another language
The mocks answer over HTTP, so anything can use them. Point the application at the URL and carry on โ there is nothing to install.
Where to go next
Overview
Why the project exists, what it replaces, and the three ways to use it.
Architecture
The engine, the browser layer, the footprint budget, and the decisions deliberately not taken.
CI gates
Running the mocks inside the CI kit, so a test run never leaves a container behind.
Offline testing
Pointing an application at the mocks, and driving the failure paths worth testing.
Community
Who uses it, what has been said about it, and how to help.
Support the project
The mocks are maintained in the open, and that takes time.
There is no paid tier and nothing is gated: the package stays MIT, and every mock in it stays free. If sponsoring is not your thing, a star, an issue report, or a pull request that fixes something is worth just as much.