The StaySuite accounting API
A key-authenticated REST API for accounting workflows: bills, statements, held charges, bank exceptions and sync failures. Connect your own tool or bookkeeping agent to it.
Get your API key
Call the accounting API directly with your API key. No SDK required.
- Base path:
/api/agent/v1on your StaySuite address. - An account admin creates a key in StaySuite at Settings > API keys. It is shown once.
- Send it as
Authorization: Bearer sk_…(orX-API-Key). Cookies are never accepted. - Each key works on one company and belongs to it, not to the person who created it. It stops only when it is revoked or the company is closed.
- Rate limit: 30, 60, 120 requests per minute, set per key. Over the limit you get 429 with Retry-After: 60.
- A missing, invalid, revoked or expired key gets 401; a key without the scope gets 403.
curl https://staysuite.io/api/agent/v1/accounting/queues \
-H "Authorization: Bearer $STAYSUITE_API_KEY"Scopes
A key carries one or more scopes. Every endpoint needs one of them.
| Scope | Allows |
|---|---|
| accounting.queues.read | List bills in review, statements awaiting approval, held charges, bank exceptions, sync failures |
| accounting.bills.approve | Set the charge target on a vendor bill and post it, or void it |
| accounting.statements.approve | Approve statements for disbursement, or void a draft |
| accounting.owner-charges.release | Post a held charge regardless of reserve, or void it |
| accounting.bank.reconcile | Match, categorise or exclude unmatched bank lines |
| accounting.sync.retry | Put failed QuickBooks journal exports back on the queue |
Core API endpoints
The accounting endpoints, under /api/agent/v1
| Category | Method | Endpoint |
|---|---|---|
| Queues | GET | /api/agent/v1/accounting/queues |
| Bills | GET | /api/agent/v1/accounting/bills |
| Bills | POST | /api/agent/v1/accounting/bills/:id/approve |
| Bills | POST | /api/agent/v1/accounting/bills/:id/void |
| Statements | GET | /api/agent/v1/accounting/statements |
| Statements | POST | /api/agent/v1/accounting/statements/:id/approve |
| Statements | POST | /api/agent/v1/accounting/statements/:id/void |
| Held charges | GET | /api/agent/v1/accounting/held-charges |
| Held charges | POST | /api/agent/v1/accounting/held-charges/:id/release |
| Held charges | POST | /api/agent/v1/accounting/held-charges/:id/void |
| Bank exceptions | GET | /api/agent/v1/accounting/bank-exceptions |
| Bank exceptions | GET, POST | /api/agent/v1/accounting/bank-exceptions/:id |
| Sync failures | GET | /api/agent/v1/accounting/sync-failures |
| Sync failures | POST | /api/agent/v1/accounting/sync-failures/retry |
Webhooks
StaySuite can POST a company's booking, payment and guest-message events to your own HTTPS endpoint, signed, as they happen.
- An account admin sets a webhook up in StaySuite at Settings > Webhooks: an endpoint URL, one company, and the events it wants. Its signing secret is shown once.
- The URL must be HTTPS on a public address. Redirects are not followed.
- Answer any 2xx within 10 seconds. Anything else is retried after 1 minute, 5 minutes, 30 minutes, 2 hours and 12 hours, then marked failed. Deliveries leave within about a minute of the event.
- Every delivery has its own StaySuite-Delivery id. A delivery can arrive more than once, so ignore an id you have already handled. The event id (id in the body) stays the same when an admin redelivers it.
- No card or bank details are ever sent. Guest details are limited to the name and email on booking events and the name on message events; never a phone number, an address or the message text.
- Pausing a webhook holds its queued deliveries; archiving it stops them. Rotating the secret takes effect at once.
POST /your/endpoint
Content-Type: application/json
StaySuite-Signature: t=1793448000,v1=5f2b…
StaySuite-Event: booking.created
StaySuite-Delivery: 0b6c1f0e-…
{
"id": "evt_8f14e45fceea167a5a36dedd4bea2543",
"type": "booking.created",
"createdAt": "2026-10-28T14:00:00.000Z",
"companyId": "…",
"data": {
"booking": {
"id": "…", "bookingNumber": "BK-1793448000", "status": "CONFIRMED",
"source": "airbnb", "externalReference": "HM123", "propertyId": "…", "unitId": null,
"checkInDate": "2026-11-01T00:00:00.000Z", "checkOutDate": "2026-11-04T00:00:00.000Z",
"guests": 2, "totalAmount": "450.00",
"guest": { "id": "…", "name": "Ada Guest", "email": "ada@example.com" }
}
}
}| Event | When it is sent |
|---|---|
| booking.created | A booking was made: by staff, an owner stay, the guest portal, the booking site, or imported from a channel. |
| booking.updated | A booking’s dates, guest count, status (confirmed, checked in, checked out, no-show), home or price changed. |
| booking.cancelled | A booking was cancelled by staff, the guest, the owner or the channel. |
| payment.received | Money for a booking arrived: a card payment settled, or staff recorded an offline payment. |
| payment.refunded | A refund on a booking payment was issued. status PENDING means it is owed and will be paid by hand. |
| guest.message.received | A guest wrote in: a guest portal message or a text message (SMS). |
| Events | data |
|---|---|
| booking.* | booking: id, bookingNumber, status, source, externalReference, propertyId, unitId, checkInDate, checkOutDate, guests, totalAmount, guest { id, name, email }. booking.updated and booking.cancelled add changes { field: { from, to } }. |
| payment.* | payment: id, bookingId, type, status, amount, currency, method, gateway, refundForPaymentId, processedAt. |
| guest.message.received | message: id, conversationId, bookingId, propertyId, channel (portal or sms), receivedAt; guest { id, name }. |
| webhook.test | webhook { id, name }, message. Sent by Send test event only. |
Verify a webhook signature
Every delivery is signed with the webhook's secret, so you can tell it came from StaySuite and was not changed.
StaySuite-Signature: t=<unix seconds>,v1=<hex>- v1 is HMAC-SHA256, keyed with your signing secret, over
t + "." + the raw request body. - Recompute it over the exact bytes you received, compare in constant time, and reject a timestamp more than five minutes old.
StaySuite-Eventnames the event;StaySuite-Deliveryis the delivery id.
import crypto from 'node:crypto';
// rawBody: the exact bytes you received, before any JSON parsing.
function verify(rawBody, header, secret) {
const parts = Object.fromEntries(header.split(',').map((p) => p.split('=')));
const t = Number(parts.t);
if (!t || Math.abs(Date.now() / 1000 - t) > 300) return false; // replay window
const expected = crypto
.createHmac('sha256', secret)
.update(`${t}.${rawBody}`)
.digest('hex');
const got = Buffer.from(parts.v1 ?? '', 'hex');
const want = Buffer.from(expected, 'hex');
return got.length === want.length && crypto.timingSafeEqual(got, want);
}Ready to start building?
Get an API key once you're a StaySuite customer