決済
決済。固定の決済データに加え、作成時の Idempotency-Key のデモ(再送、ボディが違えば 422、処理中なら 409)と返金。末尾 0002 のカードは常に拒否されます。
あなたのアカウントでこれらのエンドポイントが使えます。各エンドポイントのページの Try it でリクエストを送れます。
- GET
https://api.testingapis.com/api/PaymentsList payments with filtering, search, sorting and paginationList payments with filtering, search, sorting and pagination. - POST
https://api.testingapis.com/api/PaymentsCreate a paymentCreate a payment. Requires an Idempotency-Key header. - GET
https://api.testingapis.com/api/Payments/{id}Get a payment by IDGet a payment by ID. - POST
https://api.testingapis.com/api/Payments/{id}/refundRefund a succeeded paymentRefund a succeeded payment.
リクエストの例
List payments with filtering, search, sorting and pagination. 完全なリファレンスと Send ボタン(英語).
cURL
curl -X GET "https://api.testingapis.com/api/Payments?limit=2"レスポンス · 200 OK
[
{
"id": 1,
"userId": 101,
"orderId": 1,
"amount": 249.99,
"currency": "USD",
"method": "card",
"status": "succeeded",
"description": "Order #1 — headphones",
"cardLast4": "4242",
"createdAt": "2025-07-01T10:15:00Z",
… (3 more lines)サインインして詳細を見る
これらのエンドポイントのパラメータ、リクエストとレスポンスの例、ライブの Try it パネルは、サインインしたメンバー向けです。アカウントは無料で、数秒で作成できます。