Overview
Mockpay is a payments API for integration testing. It mirrors Stripe's resource shapes. It never moves money. Every account is test mode.
Base URL
https://api.mockpay.net/v1The /v1 namespace is key-gated. Payment intents, refunds, disputes, customers, prices, subscriptions, webhooks, events, and test helpers are live. More resources arrive by milestone.
Official Stripe SDK
The official stripe package on npm points at Mockpay with constructor config alone — no code changes. The same options exist in every official Stripe SDK.
import Stripe from "stripe";
// Hosted Mockpay
const stripe = new Stripe("mock_sk_...", {
host: "api.mockpay.net",
});
// Local development
const stripe = new Stripe("mock_sk_...", {
host: "localhost",
port: 8035,
protocol: "http",
});
const intent = await stripe.paymentIntents.create({
amount: 640,
currency: "usd",
});Typed errors map through: declines raise StripeCardError with card_declined, missing resources raise StripeInvalidRequestError, and stripe.webhooks.constructEvent verifies Mockpay's Stripe-Signature header unchanged.
Resource model
- Resources carry Stripe-style ids:
pi_(payment intent),cus_(customer),pm_(payment method),evt_(event). - Requests are form-encoded or JSON. Responses are JSON objects with an
idand anobjecttype. - Test data expires 365 days after creation. Accounts, keys, and webhook endpoint configuration never expire.
Status
Payment intents run end to end: create, confirm, capture, cancel, list, decline simulation. Refunds settle synchronously; disputes open through the pm_card_createDispute token and resolve through evidence. Webhooks deliver signed events to your endpoint or to a Mockpay-hosted catcher. Subscriptions activate immediately with periods computed from the price interval. Test helpers add programmatic chargebacks and test clocks under /v1/test_helpers. Unreleased resources answer 404 invalid_request_error naming the unrecognized URL. Errors ride the Stripe shape: { "error": { "type", "code", "message" } }.