Connecting and sending

Connect Stater to Xero, QuickBooks Online, MYOB or Business Central with your own app, and how automatic sending and retries work.

On this page

Connecting#

Stater ships no keys for any of these services. You register your own app with each provider and paste its client ID and secret into Setup › Connection. The secret is sealed with STATER_SECRET_KEY (see Secrets), so set that first.

Redirect URI. Setup shows it with a Copy button:

<STATER_PUBLIC_URL>/api/v1/accounting/oauth/<xero|qbo|myob|bc>/callback

Add it to your app exactly as shown. It has no query string. Connecting needs STATER_PUBLIC_URL to be an https address; Xero, Microsoft and (per its own example) MYOB also take http://localhost while testing, but never http://127.0.0.1, and QuickBooks takes only https and no IP addresses. Open Stater at its public address to connect: "Open Stater at https://stater.example.com to connect, so Xero can send you back."

Only an owner, signed in in a browser, can add, change, connect, test or disconnect a connection. Changing the client ID, tenant or environment needs the secret typed again and clears the tokens.

Xero#

  1. In the Xero developer portal (developer.xero.com), create an app that uses the authorisation code flow (the "Auth Code" grant type, for web server apps). Xero's custom connections are only for organisations in Australia, New Zealand, the UK and the US, so Stater does not use them.
  2. Add the redirect URI. Create a client secret.
  3. In Setup, choose Xero, paste the client ID and secret, and press "Save and connect Xero". Sign in to Xero and allow access; if you have several organisations, choose the one Stater sends to.

Stater asks for offline_access accounting.manualjournals accounting.invoices accounting.contacts accounting.settings. Xero's free Starter app plan allows 1,000 calls a day per organisation and 60 a minute; Stater stops sending for the day when fewer than 50 calls are left. Refresh tokens last 60 days, so a connection that can't refresh for that long needs connecting again (Today warns 7 days ahead).

QuickBooks Online#

  1. In the Intuit developer portal (developer.intuit.com), create an app with the com.intuit.quickbooks.accounting scope. Development (sandbox) and production keys are separate, each with its own redirect URI list: add the redirect URI to the one you use.
  2. In Setup, choose QuickBooks Online, the region (United States or Other countries) and, for development keys, "Sandbox company". Paste the client ID and secret and press "Save and connect QuickBooks".

Intuit's partner programme is described as open to partners in the US, UK, Australia and Canada; whether an owner elsewhere can get production keys for their own app is not confirmed. Refresh tokens last 100 days, renewed with use. Stater stays under 400 calls a minute and 8 a second (QuickBooks allows 500 and 10).

MYOB (Experimental)#

MYOB direct sync stays Experimental, and hidden unless "Show experimental options" is on, until the endpoints for listing accounts, tax codes and contacts are confirmed (not confirmed yet, item 4). Without them Stater can't offer MYOB's accounts to map, so MYOB files are the supported route.

  1. Apply for API access through MYOB's developer site. MYOB creates a login and a sandbox company file. Approval criteria and cost are not published, and MYOB may ask you to apply before it gives you a key.
  2. In my.MYOB, on the Developer tab, use Register App with a name and the redirect URI to get the key (client ID) and secret.
  3. In Setup, paste them. Enter company file credentials only if MYOB asks for company file sign-in.

Stater asks for sme-general-ledger sme-purchases sme-sales sme-contacts-supplier sme-contacts-customer sme-company-settings. MYOB removed the old CompanyFile scope on 1 September 2026. MYOB has no idempotency, so a journal whose arrival Stater can't confirm becomes "Check MYOB for journal S3F2K. Mark as sent, or send again." and is never resent by itself. MYOB can't be revoked from Stater: after disconnecting, remove Stater from your MYOB app list too.

Dynamics 365 Business Central#

The default is an app-only connection (client credentials), which needs no licensed user and no refresh token:

  1. In Microsoft Entra, register an app and create a client secret.
  2. Add the Application permission API.ReadWrite.All on Dynamics 365 Business Central, and grant admin consent.
  3. In Business Central, open the Microsoft Entra Applications page, choose New, enter the client ID, set State to Enabled and assign permission sets (Microsoft suggests D365 AUTOMATION; SUPER can't be assigned to an application).
  4. In Setup, choose Business Central and "App only", and enter the tenant ID (a GUID or your domain name), the environment name (for example production or sandbox), the client ID and the secret. Press "Save and connect", then choose the company.
  5. Choose the journal batch Stater posts into. Use a batch only Stater uses: posting a batch posts every line in it, so Stater refuses to post a batch holding lines it did not add.

"Sign in as a user" instead uses the delegated permission Financials.ReadWrite.All, the redirect URI (https, or http://localhost with any port) and a licensed user.

Bills and invoices go as purchase and sales invoices and are posted (never "post and send", so Business Central emails nobody). Stater stays under 4,000 requests per 5 minutes, one at a time; one call may take up to STATER_ACCOUNTING_HTTP_TIMEOUT. Disconnecting can't revoke an app-only connection: remove the app in Entra if you no longer want it.

How sending works#

  • The sync job runs every STATER_ACCOUNTING_SYNC_EVERY on one server at a time. It sends ready days oldest first, then bills, then invoices, within each provider's limits. "Send due days now" queues everything due and starts it at once; "Send this day" sends one day even with automatic sending off.
  • Tokens of every connected organisation are kept fresh, whether automatic sending is on or not.
  • A provider error is retried after 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours and 6 hours, then waits for "Send again" (Today: "3 days didn't send to Xero").
  • If Business Central refuses to post a journal after its lines were added (a date outside the allowed posting dates, say), those lines stay in the batch. Stater then stops sending journals and says which reference holds the batch, until you post or delete its lines in Business Central.
  • Every send carries a key that stays the same only when Stater does not know whether the last attempt arrived, so a retry can't post twice where the provider de-duplicates (Xero's Idempotency-Key, QuickBooks' requestid). Before sending again after an unknown outcome, Stater looks the journal up by its reference. Where it can't (MYOB, Business Central, and QuickBooks after a short replay window), the day waits for you: "Check {software}: Stater can't tell whether journal {ref} arrived. Mark as sent, or send again."
  • If the provider stops accepting the connection, it shows "Xero no longer accepts Stater's connection. Connect again to carry on sending.", Today raises it, and one alert is sent.
  • Money › Accounting › Log lists what was sent, refreshed and refused, kept for STATER_ACCOUNTING_LOG_KEEP_DAYS. It never holds tokens or response bodies.

References are ASCII and the same every time: ST<store id in base 36>-<YYMMDD> for a journal, for example ST1-261120 for store 1 on 20 Nov 2026 (with -C<n> for corrections, n in base 36) and ST-<invoice ref> for a document, or a short S<id> where a package allows fewer characters (QuickBooks Online 21, Business Central 20, Sage 50 30; MYOB always). Narrations read Stater <ref> daily summary <date>. Neither ever holds a store or customer name.

Security notes#

  • Client secrets, refresh and access tokens and MYOB company file passwords are sealed in the secrets table (accounting.<id>.client_secret, .refresh_token, .access_token, .company_file_password). They never appear in responses, the audit log, webhooks, the sync log or the server log. Disconnecting deletes them.
  • Connecting starts with a POST from the web app; the state is single use, lasts 10 minutes and is tied to the owner who started it, the connection and a cookie. A callback for a removed connection, a changed client ID or another organisation is refused and audited as accounting.refused.
  • Stater calls only the providers' own hosts, never private addresses.
  • Reverse proxies: the provider sends the one-time authorisation code in the callback's query string. Drop query strings from access logs for /api/v1/accounting/oauth/.
  • Security events (accounting.connection, accounting.authorise, accounting.connect, accounting.disconnect, accounting.refused, accounting.revoked) reach SIEM forwarding like every other security event.