Build on EsperWorks
A REST API that lets you create invoices, sync clients, track payments, and receive real-time webhook events, from any platform or language.
Quick start
All requests require a Bearer token. Generate one in Dashboard → Developer API.
curl https://api.tryesperworks.com/api/v1/partner/ping \ -H "Authorization: Bearer ew_live_YOUR_KEY"
{
"business": { "id": 1, "name": "Acme Ltd", "currency": "GHS" },
"scopes": ["invoices:read", "invoices:write", "clients:read"]
}curl -X POST https://api.tryesperworks.com/api/v1/partner/invoices \
-H "Authorization: Bearer ew_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"client_id": 42,
"currency": "GHS",
"due_date": "2026-06-30",
"items": [
{ "description": "Web design", "quantity": 1, "unit_price": 2500 }
]
}'curl -X POST https://api.tryesperworks.com/api/v1/partner/invoices/123/send \ -H "Authorization: Bearer ew_live_YOUR_KEY"
Errors & responses
Error responses always include a message string and optionally an errors object with field-level details.
Pagination
All list endpoints are paginated. Pass ?page= and ?per_page= (max 100). The response includes:
{
"data": [ ... ],
"meta": {
"current_page": 1,
"per_page": 20,
"total": 143,
"last_page": 8
}
}Idempotency
Pass an Idempotency-Key: <uuid> header on any POST request to safely retry without creating duplicates. Keys expire after 24 hours.
curl -X POST https://api.tryesperworks.com/api/v1/partner/invoices \
-H "Authorization: Bearer ew_live_YOUR_KEY" \
-H "Idempotency-Key: 550e8400-e29b-41d4-a716-446655440000" \
-H "Content-Type: application/json" \
-d '{ ... }'Scopes
invoices:readRead invoices and payment statusinvoices:writeCreate, update, send, and delete invoicescontracts:readRead contracts and proposalscontracts:writeCreate and update contractsclients:readRead client recordsclients:writeCreate, update, and delete clientspayments:readRead payment recordspayments:writeProcess payments (initiate, simulate)expenses:readRead expensesexpenses:writeCreate and update expensesWebhooks
Set a webhook URL when creating an API key. EsperWorks will POST a signed JSON payload to your URL for each event.
invoice.createdA new invoice was createdinvoice.sentInvoice was sent to the clientinvoice.viewedInvoice was viewed by the clientinvoice.paidInvoice was fully paidpayment.receivedA payment was recordedcontract.signedBoth parties have signed a contractVerifying signatures
// Node.js example
const crypto = require('crypto');
const sig = req.headers['x-esperworks-signature'];
const expected = crypto
.createHmac('sha256', process.env.WEBHOOK_SECRET)
.update(req.rawBody)
.digest('hex');
if (sig !== expected) return res.status(401).send('Invalid signature');The raw request body must be used for signature verification, not a parsed JSON object.
Sandbox & test mode
Generate a test key (prefixed ew_test_...) from Dashboard → Developer API. Test keys behave identically to live keys but no real payments are processed and emails are suppressed.
Use POST /invoices/{id}/simulate-payment to trigger a payment webhook without going through a payment gateway; useful for testing your webhook handler end-to-end.
API Reference, 25 endpoints
/ping/business/clients/clients/{id}/clients/clients/{id}/clients/{id}/invoices/invoices/{id}/invoices/{id}/payment-status/invoices/invoices/{id}/send/invoices/{id}/invoices/{id}/invoices/{id}/initiate-payment/invoices/{id}/simulate-payment/quick-charge/contracts/contracts/{id}/contracts/payments/expenses/expenses/expenses/{id}/expenses/{id}Platform integrations
WordPress / WooCommerce
Auto-generate invoices from orders
Our free WordPress plugin connects your WooCommerce store to EsperWorks. Every completed order automatically creates a professional invoice and sends it to the customer.
Setup
Any platform
Shopify, custom apps, internal tools
Use the REST API directly from any platform that can make HTTP requests. Shopify scripts, Python scripts, internal dashboards, or mobile apps.
Pattern
Ready to integrate?
Log in to generate an API key. Keys are scoped, rotatable, and come with webhook delivery logs.
Get your API key