SafePays API

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

Quick Reference

MethodEndpointDescription
POST/api/v2/customerCreate a new customer
GET/api/v2/customer/\{customer_id\}Get customer details and paid invoices
POST/api/v2/invoiceCreate a new invoice
GET/api/v2/invoice/\{invoice_id\}Check invoice status
GET/api/v2/customer/\{customer_id\}/bank-accountsList customer bank accounts
POST/api/v2/customer/\{customer_id\}/bank-accountAdd a customer bank account
POST/api/v2/customer/\{customer_id\}/payoutSend an RTP / FedNow payout

Request Format

All POST requests must include:

  • Content-Type: application/json header
  • Valid JSON body with api_key field

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 CodeDescription
200Success - Request completed successfully
201Created - Resource created successfully
400Bad Request - Invalid parameters or missing fields
401Unauthorized - Invalid or missing API key
404Not Found - Resource not found
409Conflict - Resource already exists
500Internal 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-446655440000

Notes

  1. API Key — Required for all endpoints. Keep it secure and never expose it in client-side code.
  2. Email Validation — Email addresses are validated using standard email regex patterns.
  3. Webhook URLs — Must be valid HTTP/HTTPS URLs.
  4. Due Dates — Must be in YYYY-MM-DD format. Defaults to 90 days from creation date if not provided.
  5. Invoice Items — When creating an invoice with items, the total amount is automatically calculated. You can also provide a simple amount field for invoices without line items.

Support

For API support, please contact support@safepays.com or visit the dashboard at https://app.safepays.com.

On this page