API Reference
Complete reference for the PayForge REST API. All endpoints require authentication via Bearer token.
https://api.payforge.dev/api/v1API Playground
Make real API calls against the live backend directly from the docs. Click Quick Login to authenticate with the demo account, then send requests to see actual responses.
/api/v1/transactionsFetch your recent transactions. Try it now!
/api/v1/transactionsCreate a new payment transaction.
/api/v1/merchants/me/analyticsGet your merchant analytics including volume, revenue, and fraud rate.
/api/v1/fraud/statsGet aggregate fraud statistics.
Transactions
Create, capture, refund, and void payments. All POST endpoints support idempotency via the X-Idempotency-Key header.
/api/v1/transactionsCreate a new transaction. The payment will be authorized, fraud-scored, and captured automatically by the Saga orchestrator.
curl -X POST "https://api.payforge.dev/api/v1/transactions" \
-H "Authorization: Bearer pk_test_..." \
-H "Content-Type: application/json" \
-d '{
"transaction": {
"amount_cents": 5000,
"currency": "USD",
"card_last_four": "4242",
"card_brand": "visa",
"card_token": "tok_visa_4242",
"idempotency_key": "idem_abc123",
"metadata": { "order_id": "ord_123" }
}
}'/api/v1/transactionsList transactions with filtering and pagination.
Parameters
pageintegerPage number
per_pageintegerResults per page (max 100)
statusstringFilter: captured, authorized, refunded, voided, blocked, failed, settled
fromstringStart date (ISO 8601)
tostringEnd date (ISO 8601)
min_amountintegerMinimum amount in cents
max_amountintegerMaximum amount in cents
curl -X GET "https://api.payforge.dev/api/v1/transactions" \
-H "Authorization: Bearer pk_test_..." \
-H "Content-Type: application/json"/api/v1/transactions/:idGet full details of a specific transaction.
curl -X GET "https://api.payforge.dev/api/v1/transactions/:id" \
-H "Authorization: Bearer pk_test_..." \
-H "Content-Type: application/json"/api/v1/transactions/:id/captureCapture an authorized payment. Optionally specify a partial capture amount.
curl -X POST "https://api.payforge.dev/api/v1/transactions/:id/capture" \
-H "Authorization: Bearer pk_test_..." \
-H "Content-Type: application/json" \
-d '{ "amount_cents": 5000 }'/api/v1/transactions/:id/refundRefund a captured payment. Supports full and partial refunds.
curl -X POST "https://api.payforge.dev/api/v1/transactions/:id/refund" \
-H "Authorization: Bearer pk_test_..." \
-H "Content-Type: application/json" \
-d '{ "amount_cents": 2500 }'/api/v1/transactions/:id/voidVoid an authorized payment before capture.
curl -X POST "https://api.payforge.dev/api/v1/transactions/:id/void" \
-H "Authorization: Bearer pk_test_..." \
-H "Content-Type: application/json"/api/v1/transactions/:id/eventsGet the immutable event stream for a transaction. Shows every state change with timestamps.
curl -X GET "https://api.payforge.dev/api/v1/transactions/:id/events" \
-H "Authorization: Bearer pk_test_..." \
-H "Content-Type: application/json"/api/v1/transactions/:id/ledgerGet double-entry ledger entries for a transaction.
curl -X GET "https://api.payforge.dev/api/v1/transactions/:id/ledger" \
-H "Authorization: Bearer pk_test_..." \
-H "Content-Type: application/json"Merchants
Manage your merchant profile, view analytics, and check balances.
/api/v1/merchants/meGet your merchant profile and configuration.
curl -X GET "https://api.payforge.dev/api/v1/merchants/me" \
-H "Authorization: Bearer pk_test_..." \
-H "Content-Type: application/json"/api/v1/merchants/me/analyticsGet aggregate analytics for your merchant.
curl -X GET "https://api.payforge.dev/api/v1/merchants/me/analytics" \
-H "Authorization: Bearer pk_test_..." \
-H "Content-Type: application/json"/api/v1/merchants/me/balanceGet current account balances by type.
curl -X GET "https://api.payforge.dev/api/v1/merchants/me/balance" \
-H "Authorization: Bearer pk_test_..." \
-H "Content-Type: application/json"/api/v1/merchants/meUpdate your merchant settings.
curl -X PATCH "https://api.payforge.dev/api/v1/merchants/me" \
-H "Authorization: Bearer pk_test_..." \
-H "Content-Type: application/json" \
-d '{
"name": "Updated Merchant Name",
"webhook_url": "https://example.com/webhooks"
}'Fraud Intelligence
Review fraud cases, view ML-powered risk scores with SHAP explanations, and manage decisions.
/api/v1/fraud/casesList fraud cases for your merchant with filtering by status and priority.
Parameters
statusstringFilter: open, confirmed_fraud, false_positive
prioritystringFilter: low, medium, high, critical
pageintegerPage number
curl -X GET "https://api.payforge.dev/api/v1/fraud/cases" \
-H "Authorization: Bearer pk_test_..." \
-H "Content-Type: application/json"/api/v1/fraud/cases/:id/reviewSubmit a review decision for a fraud case.
curl -X POST "https://api.payforge.dev/api/v1/fraud/cases/:id/review" \
-H "Authorization: Bearer pk_test_..." \
-H "Content-Type: application/json" \
-d '{
"status": "false_positive",
"notes": "Verified with customer via phone"
}'/api/v1/fraud/statsGet aggregate fraud statistics for your merchant.
curl -X GET "https://api.payforge.dev/api/v1/fraud/stats" \
-H "Authorization: Bearer pk_test_..." \
-H "Content-Type: application/json"Webhooks
View webhook delivery history and test your endpoint.
/api/v1/webhooks/deliveriesList recent webhook delivery attempts.
curl -X GET "https://api.payforge.dev/api/v1/webhooks/deliveries" \
-H "Authorization: Bearer pk_test_..." \
-H "Content-Type: application/json"/api/v1/webhooks/statusGet webhook endpoint status and delivery success rate.
curl -X GET "https://api.payforge.dev/api/v1/webhooks/status" \
-H "Authorization: Bearer pk_test_..." \
-H "Content-Type: application/json"/api/v1/webhooks/testSend a test webhook event to your configured endpoint.
curl -X POST "https://api.payforge.dev/api/v1/webhooks/test" \
-H "Authorization: Bearer pk_test_..." \
-H "Content-Type: application/json" \
-d '{ "event_type": "payment.captured" }'API Keys
Manage API keys for programmatic authentication.
/api/v1/api_keysList all API keys for your merchant.
curl -X GET "https://api.payforge.dev/api/v1/api_keys" \
-H "Authorization: Bearer pk_test_..." \
-H "Content-Type: application/json"/api/v1/api_keysCreate a new API key. The full key value is only returned once at creation.
curl -X POST "https://api.payforge.dev/api/v1/api_keys" \
-H "Authorization: Bearer pk_test_..." \
-H "Content-Type: application/json" \
-d '{ "name": "Production Key" }'/api/v1/api_keys/:id/rotateRotate an API key. Generates a new key and revokes the old one.
curl -X POST "https://api.payforge.dev/api/v1/api_keys/:id/rotate" \
-H "Authorization: Bearer pk_test_..." \
-H "Content-Type: application/json"