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.

REST API
JSON Responses
Rate Limited
Webhooks

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/v1
All API requests should be made to this base URL

Authentication

API Key Authentication

The PayChase AI API uses Bearer token authentication. Include your API key in the Authorization header.

Header Format

Authorization: Bearer YOUR_API_KEY

Getting Your API Key

Sign up for an account and navigate to Settings → API Keys to generate your authentication token.

Example Request

curl -X GET \
https://api.paychase.ai/v1/invoices \
-H "Authorization: Bearer pk_live_..." \
-H "Content-Type: application/json"

API Endpoints

Invoices

Manage invoices and track payment status

GET
/api/invoices

List all invoices

POST
/api/invoices

Create a new invoice

GET
/api/invoices/{id}

Get invoice by ID

PUT
/api/invoices/{id}

Update invoice

Email Templates

Manage email templates for follow-up sequences

GET
/api/email-templates

List all email templates

POST
/api/email-templates

Create new email template

Follow-ups

Manage automated follow-up sequences

GET
/api/follow-ups

List all follow-up sequences

POST
/api/follow-ups

Create follow-up sequence

AI Services

AI-powered email generation and optimization

POST
/api/ai/generate-email

Generate AI-powered email content

Analytics

Payment and performance analytics

GET
/api/analytics

Get 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

400

Bad Request

Invalid request parameters or malformed JSON

401

Unauthorized

Invalid or missing API key

403

Forbidden

Insufficient permissions for this action

404

Not Found

Resource not found

429

Rate Limited

Too many requests, please slow down

500

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:

X-RateLimit-Limit: 60
X-RateLimit-Remaining: 45
X-RateLimit-Reset: 1640995200

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 created
invoice.updatedTriggered when an invoice is updated
invoice.paidTriggered when an invoice is marked as paid
email.sentTriggered when a follow-up email is sent
email.openedTriggered when a recipient opens an email
email.clickedTriggered when a recipient clicks a link in the email

Webhook 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

npm install paychase-ai

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

pip install paychase-ai

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