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/v1 on 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_… (or X-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"
Settings > API keys

Scopes

A key carries one or more scopes. Every endpoint needs one of them.

Scopes
ScopeAllows
accounting.queues.readList bills in review, statements awaiting approval, held charges, bank exceptions, sync failures
accounting.bills.approveSet the charge target on a vendor bill and post it, or void it
accounting.statements.approveApprove statements for disbursement, or void a draft
accounting.owner-charges.releasePost a held charge regardless of reserve, or void it
accounting.bank.reconcileMatch, categorise or exclude unmatched bank lines
accounting.sync.retryPut failed QuickBooks journal exports back on the queue

Core API endpoints

The accounting endpoints, under /api/agent/v1

Core API endpoints
CategoryMethodEndpoint
QueuesGET/api/agent/v1/accounting/queues
BillsGET/api/agent/v1/accounting/bills
BillsPOST/api/agent/v1/accounting/bills/:id/approve
BillsPOST/api/agent/v1/accounting/bills/:id/void
StatementsGET/api/agent/v1/accounting/statements
StatementsPOST/api/agent/v1/accounting/statements/:id/approve
StatementsPOST/api/agent/v1/accounting/statements/:id/void
Held chargesGET/api/agent/v1/accounting/held-charges
Held chargesPOST/api/agent/v1/accounting/held-charges/:id/release
Held chargesPOST/api/agent/v1/accounting/held-charges/:id/void
Bank exceptionsGET/api/agent/v1/accounting/bank-exceptions
Bank exceptionsGET, POST/api/agent/v1/accounting/bank-exceptions/:id
Sync failuresGET/api/agent/v1/accounting/sync-failures
Sync failuresPOST/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" }
    }
  }
}
Settings > Webhooks
Webhook events
EventWhen it is sent
booking.createdA booking was made: by staff, an owner stay, the guest portal, the booking site, or imported from a channel.
booking.updatedA booking’s dates, guest count, status (confirmed, checked in, checked out, no-show), home or price changed.
booking.cancelledA booking was cancelled by staff, the guest, the owner or the channel.
payment.receivedMoney for a booking arrived: a card payment settled, or staff recorded an offline payment.
payment.refundedA refund on a booking payment was issued. status PENDING means it is owed and will be paid by hand.
guest.message.receivedA guest wrote in: a guest portal message or a text message (SMS).
What data carries
Eventsdata
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.receivedmessage: id, conversationId, bookingId, propertyId, channel (portal or sms), receivedAt; guest { id, name }.
webhook.testwebhook { 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-Event names the event; StaySuite-Delivery is 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