warning1. HTTP Status Codes
Standard API Error Responses
FuturePayNG uses conventional HTTP response codes to indicate the success or failure of an API request:
| Status Code | Meaning | Cause / Recommended Action |
|---|---|---|
| 400 Bad Request | Validation Error | Required parameter missing or invalid JSON. |
| 401 / 403 Forbidden | Authentication Failed | Invalid or revoked X-FuturePay-Api-Key header. |
| 404 Not Found | Resource Missing | Invoice reference does not exist on this merchant account. |
| 409 Conflict | Duplicate Reference | An invoice with this orderReference already exists. |
| 5xx Server Error | Temporary Outage | Internal network error. It is safe to retry with exponential backoff. |
schema2. Error Response Schema
JSON Error Payload Structure
Sample 400 Bad Request PayloadJSON Error
Sample 409 Conflict (Duplicate Order Reference)JSON Error
science3. Sandbox Testing Scenarios
Staging Environment Testing Values
Simulate Paid Invoice
Use any amount ending in .00 or trigger payment confirmation via the interactive web checkout simulator.
Simulate Abandoned/Expired
Leave invoice pending until expired or trigger POST /cancel.
Simulate Full Refund
Execute POST /refund on any paid test invoice reference.
fact_check4. Production Go-Live Checklist
Interactive Launch Readiness Tracker
Verify each critical milestone before switching your traffic to the production rail:
check
Store API Keys in Environment VariablesEnsure FUTUREPAY_API_KEY and FUTUREPAY_WEBHOOK_SECRET are kept out of source control (.env ignored in .gitignore).
check
Enforce HTTPS on Webhook URLWebhook receivers must accept incoming connections over valid SSL/TLS certificates.
Implement Constant-Time HMAC Signature CheckUse hash_equals() or crypto.timingSafeEqual() against X-FuturePay-Signature.
Display Invoice Expiration TimeDisplay the expiration date and time from paymentData.expires_at on the web checkout.
Handle Order IdempotencyPrevent duplicate order fulfillment by verifying if the order is already marked 'paid' in your database.
Test Sandbox ScenariosTrigger test payments, cancellations, and full refunds before going live.