SafePays API V2
Complete reference for the SafePays API V2 endpoints
Overview
The SafePays API V2 provides RESTful endpoints for managing customers and processing invoices. All endpoints require authentication using your API key passed in the request body or query parameters.
Base URL
https://app.safepays.com/Available Endpoints
Customer Management
Create customers and retrieve customer details with paid invoices
Invoice Management
Create invoices and check payment status
RTP Payouts
Save customer bank accounts and send instant RTP / FedNow payouts
Webhooks
Receive real-time payment notifications
Quick Reference
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/v2/customer | Create a new customer |
| GET | /api/v2/customer/\{customer_id\} | Get customer details and paid invoices |
| POST | /api/v2/invoice | Create a new invoice |
| GET | /api/v2/invoice/\{invoice_id\} | Check invoice status |
| GET | /api/v2/customer/\{customer_id\}/bank-accounts | List customer bank accounts |
| POST | /api/v2/customer/\{customer_id\}/bank-account | Add a customer bank account |
| POST | /api/v2/customer/\{customer_id\}/payout | Send an RTP / FedNow payout |
Request Format
All POST requests must include:
Content-Type: application/jsonheader- Valid JSON body with
api_keyfield
All GET requests pass the api_key as a query parameter.
Response Format
All responses return JSON with appropriate HTTP status codes.
Success Response
{
"status": "success",
"message": "Operation completed successfully",
"data": {}
}Error Response
{
"error": "Error message description"
}HTTP Status Codes
| Status Code | Description |
|---|---|
| 200 | Success - Request completed successfully |
| 201 | Created - Resource created successfully |
| 400 | Bad Request - Invalid parameters or missing fields |
| 401 | Unauthorized - Invalid or missing API key |
| 404 | Not Found - Resource not found |
| 409 | Conflict - Resource already exists |
| 500 | Internal Server Error - Server error |
Data Types
Currencies
Supported currency codes:
USD- US Dollar
Default currency is USD.
Dates
- Date:
YYYY-MM-DD(e.g.,2024-12-31) - DateTime:
YYYY-MM-DD HH:MM:SS(e.g.,2024-12-31 23:59:59)
IDs
All resource IDs are UUIDs (v4):
550e8400-e29b-41d4-a716-446655440000Notes
- API Key — Required for all endpoints. Keep it secure and never expose it in client-side code.
- Email Validation — Email addresses are validated using standard email regex patterns.
- Webhook URLs — Must be valid HTTP/HTTPS URLs.
- Due Dates — Must be in
YYYY-MM-DDformat. Defaults to 90 days from creation date if not provided. - Invoice Items — When creating an invoice with items, the total amount is automatically calculated. You can also provide a simple
amountfield for invoices without line items.
Support
For API support, please contact support@safepays.com or visit the dashboard at https://app.safepays.com.