SwiftBooksProAPI

SwiftBooksPro API v1

A REST API for reading invoices, bills, customers and other accounting data from SwiftBooksPro — and for bulk-exporting it into another system. JSON in, JSON out. Bearer-token auth. Plan-tied rate limits.

Quickstart

Three steps to your first API call:

  1. Generate a key at Settings → API Access.
  2. Copy the key (shown once at creation).
  3. Send it as a Bearer token in the Authorization header.
# Fetch your organisation profile + active plan
curl "https://www.swiftbookspro.co.uk/api/v1/me" \
     -H "Authorization: Bearer sbp_live_••••••••••••••"
# Returns:
{
  "data": {
    "organization": { "id": 42, "name": "Acme Ltd", "currency": "GBP" },
    "api_key":      { "prefix": "sbp_live_aBc4", "scopes": ["read:*"] },
    "plan":         { "slug": "basic", "requests_per_minute": 300 }
  },
  "meta": { "request_id": "req_a1b2c3d4e5f6g7h8", "timestamp": "2026-06-03T14:23:00Z" }
}

Authentication

Every endpoint under /api/v1 requires a Bearer token. Keys are issued per organisation from your Settings → API Access page.

Authorization: Bearer sbp_live_aBc4d5E6f7G8h9I0j1K2l3M4n5O6p7

Keys come in two flavours:

The full key is shown once. Only its SHA-256 hash is stored server-side. If you lose it, revoke it and issue a new one — there is no "show key" recovery flow.

Base URL & Versioning

https://www.swiftbookspro.co.uk/api/v1

The version is encoded in the URL. Breaking changes will ship as /api/v2 alongside /api/v1, with a 12-month deprecation window. Backwards-compatible additions (new endpoints, optional fields) happen inline and are listed in the changelog.

Rate limits & subscription plans

Every request counts towards four concurrent windows — per-minute, per-hour, per-day and per-month — on your plan. The most-constrained window wins. Limits live in the database so super-admins can tune them per deployment.

Plan/ min/ hour/ day/ monthBurstKeys / orgExport rows
Free601 0005 00050 0001021 000
Basic3005 00025 000250 0002555 000
Premium1 20030 000200 0002 000 0001001025 000
Enterprise6 000200 0002 000 00020 000 00050050250 000

Every response carries headers describing the tightest active window:

X-RateLimit-Window:    minute
X-RateLimit-Limit:     300
X-RateLimit-Remaining: 287
X-RateLimit-Reset:     1717423200   # unix timestamp

If you exceed a limit, you get HTTP 429 Too Many Requests with a Retry-After header (seconds) and a JSON body explaining which window tripped:

{
  "error": {
    "code": "rate_limit_exceeded",
    "message": "Rate limit exceeded — minutely quota of 60 requests reached.",
    "details": {
      "window": "minute", "limit": 60, "used": 60,
      "retry_after": 23, "plan": "free"
    }
  }
}
Tip: always honour X-RateLimit-Remaining before firing concurrent calls. The burst_size column on each plan lets you spike briefly above per-minute (up to burst) without 429s, but per-hour still catches sustained abuse.

Scopes

Scopes are verb:resource pairs. A request must satisfy the scope on both the API key AND the plan:

ScopeGrants
read:customersList + read customers
write:customersCreate, update, soft-delete customers
read:invoicesList + read invoices (incl. line items)
read:billsList + read bills
read:expensesList + read expenses
read:paymentsList payments received + payments made
read:vendorsList + read vendors
read:productsList + read products / services
read:vatList + read filed VAT returns
export:*Use any bulk-export endpoint for migration
read:* / write:* / export:* / *:*Wildcards across all resources

Errors

Every error follows the same envelope:

{ "error": { "code": "<stable_code>", "message": "<human text>", "details": { ... } } }
HTTPCodeWhen
400bad_requestMalformed body / missing required field.
401unauthorizedMissing, malformed, revoked or expired key.
403forbiddenKey/plan lacks the required scope; or org is suspended.
404not_foundResource doesn't exist in your tenant.
413export_too_largeBulk export above your plan's row cap.
429rate_limit_exceededWindow full — see Retry-After header.
500internal_errorBug on our side. Include the request_id from the response when reporting.

Pagination

List endpoints accept ?page (default 1) and ?per_page (default 25, max 100). Responses include a meta.pagination block:

"pagination": {
  "page": 2, "per_page": 25,
  "total": 143, "total_pages": 6, "has_more": true
}

Endpoint reference

Meta

GET/api/v1/healthno auth
Uptime + DB probe.
GET/api/v1/meany
Caller's org, active key & resolved plan.
GET/api/v1/rate-limitany
Live counters for the four windows.
GET/api/v1/scopesany
Granted scopes (key ∩ plan).

Customers

GET/api/v1/customersread:customers
Paginated list. Query: search, status, page, per_page.
GET/api/v1/customers/{id}read:customers
POST/api/v1/customerswrite:customers
Required: display_name. Optional: email, phone, address fields, currency, tax_number, …
PATCH/api/v1/customers/{id}write:customers
DELETE/api/v1/customers/{id}write:customers
Soft-delete (sets status to inactive).

Vendors

GET/api/v1/vendorsread:vendors
GET/api/v1/vendors/{id}read:vendors

Products / services

GET/api/v1/productsread:products
Query: search, type (product|service).
GET/api/v1/products/{id}read:products

Invoices

GET/api/v1/invoicesread:invoices
Query: status, customer_id, from, to (YYYY-MM-DD).
GET/api/v1/invoices/{id}read:invoices
Header + line items.

Bills

GET/api/v1/billsread:bills
GET/api/v1/bills/{id}read:bills

Expenses

GET/api/v1/expensesread:expenses
GET/api/v1/expenses/{id}read:expenses

Payments

GET/api/v1/paymentsread:payments
Combined feed of received + made.
GET/api/v1/payments/receivedread:payments
GET/api/v1/payments/maderead:payments

VAT returns

GET/api/v1/vat-returnsread:vat
GET/api/v1/vat-returns/{id}read:vat

Bulk export (migration)

For one-shot migrations into another system. Streams CSV row-by-row; JSON returns the entire result set. The plan's max_export_rows caps each call — narrow with from/to/status filters or upgrade your plan.

GET/api/v1/export/{resource}/{format}export:<resource>
resource ∈ customers, vendors, products, invoices, bills, expenses, payments-received, payments-made, vat-returns. format ∈ json, csv.
# Stream every invoice in 2025 as CSV
curl "https://www.swiftbookspro.co.uk/api/v1/export/invoices/csv?from=2025-01-01&to=2025-12-31" \
     -H "Authorization: Bearer sbp_live_••••••••" \
     -o invoices_2025.csv

Changelog

DateChange
2026-06-03v1 launch — read endpoints for 8 resources, write for customers, bulk export for migrations, 4 plan tiers.