SET API · Accounting
Connect QuickBooks Online or Xero
POST/v1/accounting/connections
Starts connecting QuickBooks Online or Xero. The answer is an authorizeUrl that the business's ledger owner opens and approves, once, within 30 minutes; the connection exists only after that approval. From then on, journal entries from syncFrom are posted to the ledger, each once.
Headers
Idempotency-Keystring- Any unique string, so a retry runs once. See Idempotency.
Body
provider"quickbooks" | "xero"required- The ledger to connect. Any other value answers 400
provider_invalid. syncFromstring- An ISO 8601 time: entries created from then are posted. Default: the start of SET Close's first period for a business that uses Close, otherwise now. Anything else answers 400
sync_from_invalid. currency"usd" | "eur" | "gbp"- The ledger's home currency,
usdby default. Entries in any other currency are skipped.
Notes
- Accounting connections are switched on per deployment; when off, the call answers 403
accounting_connectors_off. CheckGET /v1/capabilities(features.*). - Needs a key with the
writescope. - Accounting connections are for a business account: a platform key gets 403
accounting_merchant_only. - If the chosen ledger is not set up on the deployment yet, the call answers 503
accounting_unavailable. - Open
authorizeUrlas the business's ledger owner and approve; it works once, for 30 minutes. The ledger then sends the owner back to SET, which completes the connection. - One connection per business and mode: approving a new connection replaces the current one.
- No customer or invoice is needed to start a connection.
- The example was made with a sandbox key; the
stateinauthorizeUrlis shown as a placeholder. - This example is a recorded run of SET's own code (wallet release
e9b03447) with a sandbox key; ids and times are that run's.
Errors
403 accounting_connectors_off403 accounting_merchant_only400 provider_invalid400 sync_from_invalid400 currency_invalid503 accounting_unavailable