PayChase AI API Documentation
Complete RESTful API that allows you to integrate PayChase AI's invoice automation and AI-powered email capabilities into your applications and workflows.
API Overview
The PayChase AI API is organized around REST. Our API has predictable resource-oriented URLs, accepts JSON-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.
RESTful Design
Clean, predictable URLs and standard HTTP methods (GET, POST, PUT, DELETE)
High Performance
Fast response times with intelligent caching and optimized queries
Base URL
https://api.paychase.ai/v1Authentication
API Key Authentication
The PayChase AI API uses Bearer token authentication. Include your API key in the Authorization header.
Header Format
Getting Your API Key
Sign up for an account and navigate to Settings → API Keys to generate your authentication token.
Example Request
API Endpoints
Invoices
Manage invoices and track payment status
/api/invoicesList all invoices
/api/invoicesCreate a new invoice
/api/invoices/{id}Get invoice by ID
/api/invoices/{id}Update invoice
Email Templates
Manage email templates for follow-up sequences
/api/email-templatesList all email templates
/api/email-templatesCreate new email template
Follow-ups
Manage automated follow-up sequences
/api/follow-upsList all follow-up sequences
/api/follow-upsCreate follow-up sequence
AI Services
AI-powered email generation and optimization
/api/ai/generate-emailGenerate AI-powered email content
Analytics
Payment and performance analytics
/api/analyticsGet analytics data
Code Examples
JavaScript/Node.js
Using fetch API to call PayChase AI endpoints
const apiKey = 'pk_live_...';
const baseUrl = 'https://api.paychase.ai/v1';
// Get all invoices
const response = await fetch(`${baseUrl}/invoices`, {
method: 'GET',
headers: {
'Authorization': `Bearer ${apiKey}`,
'Content-Type': 'application/json'
}
});
const invoices = await response.json();
console.log(invoices);
// Create a new invoice
const newInvoice = await fetch(`${baseUrl}/invoices`, {
method: 'POST',
headers: {
'Authorization': `Bearer ${apiKey}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
client_id: 'client_123',
amount: 1000,
due_date: '2024-02-01',
description: 'Web development services'
})
});Error Handling
Bad Request
Invalid request parameters or malformed JSON
Unauthorized
Invalid or missing API key
Forbidden
Insufficient permissions for this action
Not Found
Resource not found
Rate Limited
Too many requests, please slow down
Internal Server Error
Server error, please try again later
Error Response Format
{
"error": {
"code": "invalid_request",
"message": "The request is missing a required parameter",
"details": {
"field": "client_id",
"reason": "This field is required"
}
}
}Rate Limiting
Request Limits
API requests are limited to 60 requests per minute per API key
When you exceed the rate limit, you'll receive a 429 status code. The following headers provide information about your current rate limit status:
Best Practices
- • Implement exponential backoff for retry logic
- • Cache responses when possible
- • Use webhooks instead of polling for real-time updates
- • Batch multiple operations into single requests
- • Monitor rate limit headers in responses
Subscription Plans
Starter Plan
- 100 API calls per month
- 25 emails per day
- Basic endpoints only
Professional Plan
- 10,000 API calls per month
- 100 emails per day
- All endpoints including AI
Enterprise Plan
- Unlimited API calls
- Unlimited emails
- Custom webhooks and integrations
Webhooks
Real-time Notifications
Webhooks allow you to receive real-time notifications when events occur in your PayChase AI account
Available Events
invoice.createdTriggered when a new invoice is createdinvoice.updatedTriggered when an invoice is updatedinvoice.paidTriggered when an invoice is marked as paidemail.sentTriggered when a follow-up email is sentemail.openedTriggered when a recipient opens an emailemail.clickedTriggered when a recipient clicks a link in the emailWebhook Payload Example
{
"event": "invoice.paid",
"data": {
"id": "inv_123",
"amount": 1000,
"currency": "USD",
"client_id": "client_123",
"paid_at": "2024-01-15T10:30:00Z"
},
"timestamp": "2024-01-15T10:30:00Z",
"api_version": "v1"
}Official SDKs
JavaScript/Node.js SDK
Official JavaScript SDK for Node.js and browser environments
Installation
Usage
const PayChase = require('paychase-ai');
const client = new PayChase('pk_live_...');
// Get invoices
const invoices = await client.invoices.list();
// Create invoice
const invoice = await client.invoices.create({
client_id: 'client_123',
amount: 1000
});Python SDK
Official Python SDK with full API coverage
Installation
Usage
import paychase
client = paychase.Client('pk_live_...')
# Get invoices
invoices = client.invoices.list()
# Create invoice
invoice = client.invoices.create(
client_id='client_123',
amount=1000
)API Explorer
Try out the API endpoints directly from your browser with our interactive API explorer
Interactive API Testing
Test endpoints, view responses, and generate code snippets all in one place