A checkout, an order history or a back office screen needs payment data long before a payment integration is in place. The payments template gives you a small, generic payments API behind a real URL: payments with amounts and statuses, and refunds. It is an example shape for building and testing your own code, not a copy of any provider's API.
What you get
The template creates a project with the base path /payments-api and 4 endpoints. Each endpoint has one ready response, so the API answers as soon as the project exists.
| Method | Path | What it answers |
|---|---|---|
GET |
/payments |
200 with six generated payments. |
POST |
/payments |
201 with amount, currency and description from the request body, a generated id and the status pending. |
GET |
/payments/:id |
200 with one payment. The id is the one from the path. |
POST |
/payments/:id/refunds |
201 with a refund for the payment in the path, using amount and reason from the request body. |
Amounts are integers in minor units (cents). A payment has id, amount, currency, status, description and createdAt; the single payment adds a customer with name and email. In the list, currency is EUR, USD or GBP and status is succeeded, pending, failed or refunded. A refund has id, paymentId, amount, currency, status (refunded), reason and createdAt. Generated ids are random UUIDs.
Sample response
$ curl -s -X POST $URL/payments-api/payments \
-H "Content-Type: application/json" \
-d '{"amount":4900,"currency":"eur","description":"Order 2207"}'
{
"id": "9d2c4b7e-1f3a-4c8d-b6e5-0a7f3c2d1e9b",
"amount": 4900,
"currency": "EUR",
"status": "pending",
"description": "Order 2207",
"createdAt": "2026-11-15T09:12:44Z"
}
amount, currency (returned in upper case) and description come from your request. The id and createdAt are generated on every call. Without a body, the mock answers with 2599, EUR and Order 1042.
How to start
- Sign up at
https://app.mockhop.com/register. The quickstart explains the account and the address of your organization. - Open Projects and select Start from a template.
- Choose Example payments API and select Use template.
Then call the mock. Replace acme with your organization's address. Your mocks answer from outside once you've confirmed your email address.
$ URL=https://acme.mockhop.cloud
$ curl -s $URL/payments-api/payments
$ curl -s -X POST $URL/payments-api/payments/1042/refunds \
-H "Content-Type: application/json" \
-d '{"amount":1500}'
The first call returns six payments. The second answers 201 with a refund of 1500 for payment 1042 and the reason requested_by_customer.
What to do next
- Change the responses. Open an endpoint and edit the status code, headers and body of its response, or add more responses with matching rules.
- Add error cases and delays. For example a
402for a declined payment, a422for a missing amount, or a timeout to see whether your client retries safely. See Simulate API errors, timeouts and rate limits. - Use scenarios for flows. For example a payment that is
pendingon the first call andsucceededon the next. Mock polling and multi-step flows shows the pattern. See Scenarios; scenarios are included from the Pro plan. - Export the project. Under Import/Export you can download the project as an OpenAPI 3.0 file.
Good to know
- No money moves. The template is a generic example: it is not connected to any payment provider, not affiliated with one, and it follows no provider's API.
- Responses are generated per request and the mock keeps no state. A payment you create is not in the list, and a refund does not change the payment:
GET /payments/:idreturns a random status ofsucceeded,pendingorfailedon every call. - Nothing is validated. A refund can be higher than the payment, and the refund
currencyis alwaysEUR. - The template needs no card or account data, so don't send real payment data to a mock.
- The template creates a new project, and no other project in your organization may use the base path
/payments-api. The Free plan includes one project. - You can change or delete the project and each of its endpoints at any time.
New to Mockhop? Start with the quickstart. Plans: pricing.