Docs
Integrations

Connector contract

The contract every accounting connector meets, covering its capability profile, mappings and limitations, error codes and retries, unknown outcomes, versions and the conformance fixtures.

Preview· P9For developers and accountants

This is a published preview. Names and fields may still change before general availability; changes will be listed in the changelog.

Every accounting connector on the integration directory is built to one contract. It decides what a connector must say about itself, how Agoo's codes are translated into the provider's, what happens when something fails, and what a connector must pass before it's called supported. This page explains it, so you know what to expect from a connection and how to read what it reports.

The contract is version 1.0. It's in preview: it may still gain fields before the first connector is released, and anything that changes how it behaves would be a new major version (see Versions).

The capability profile

Each connector publishes a profile for each provider edition. Agoo reads the profile and assumes nothing beyond it.

PartWhat it says
Idempotent createWhether the provider folds or refuses a second create with the same reference
Lookup by referenceWhether the provider can find a document again by Agoo's durable reference
Conditional updateWhether an update carries the provider's version and fails if the document moved since it was read
Inquiry after a timeoutWhether the connector can tell, after an answer was lost, if a write took effect
Webhooks or pollingHow changes at the provider reach Agoo: signed notices, a list of changes since a point, or both
Objects and directionsEach object it carries (invoice, credit note, bill, payment, journal, contact, item, account, tax code, project), whether from Agoo, from the provider or both, which operations (create, update, correct, archive) and which optional fields
Currencies and dimensionsWhether it takes documents in a currency other than the book's own, and which dimensions it can carry
Rate limitsThe provider's published limits, which Agoo stays inside, per company
CoverageThe editions and countries it has been checked against, exactly as the directory shows them
VersionsThe contract version it was built against, and the provider API versions it uses and has been tested with

Mappings

Before anything is sent, the organisation maps its own codes to the provider's, for each connected company:

  • accounts, and the control accounts the books post to on their own (receivables, payables, withholding, foreign exchange gains and losses);
  • tax codes, by rule version;
  • currencies, contacts, projects, items and dimension values;
  • document numbers: whether the provider keeps Agoo's number or numbers the document itself, with Agoo keeping both.

Each document is checked against the mapping and the profile first, and you see the result before it's sent.

Tax rule versions

A tax code is mapped per rule version. When a rate or rule changes, you map the new version to the provider's new code, and every document raised under the old version keeps its old version and its old code, including a credit note against it later. A document is never moved to the latest rule by default, and a rule version with no mapping stops the document with a clear message.

Limitations, never silent drops

Something the provider can't hold is handled one of two ways, and never left out without a word:

Kind of fieldWhat happens
Changes nothing in the amounts or the tax: a memo, a project, a dimension, Agoo's numberSent without it, and shown as a limitation naming the field and why. Agoo keeps the value
Would change an amount or the tax: withholding, a foreign currencyNot sent. The document is refused with the reason, because the provider's copy would be wrong
A mapping that's missingNot sent. Every missing mapping is listed, and nothing goes to a fallback or "suspense" account

Errors and retries

Every failure has one of eight codes, and each code has a retry class that decides what happens next.

CodeMeaningRetry classWhat happens
auth_revokedThe provider no longer accepts the connectionafter_reconnectWork pauses until someone connects the account again
rate_limitedThe provider asked Agoo to slow downafter_delaySent again after the time the provider asked for
conflictThe document changed at the provider, or the reference is already used for anotherfix_and_retryShown as an exception with both versions; never last write wins
validationThe document can't be sent as it is, or the provider refused its contentfix_and_retryShown with the reason; some refusals are permanent (never)
locked_periodThe provider's period for the document's date is closedfix_and_retryRecorded as a correction in an open period, never backdated
not_foundThe document, or something it points to (a deleted contact), isn't therefix_and_retryShown naming what's missing, so it can be mapped again
unknown_outcomeThe request may have taken effect and the answer was lostinquire_firstAgoo asks the provider before doing anything else (below)
provider_downThe provider is failing or unreachable, and the request didn't reach itafter_delaySent again with a growing, randomised delay

Only after_delay allows the same request to be sent again unchanged. An error a connector can't place is treated as an unknown outcome, the safe reading.

Unknown outcomes: ask first

A timeout or a dropped connection after a write can't tell Agoo whether the provider made the document. Sending it again could post the same invoice twice, so Agoo never does:

The intent is recorded first

Before any call, Agoo records what it's about to do, with the document's durable reference and a fingerprint of its content.

The answer is lost

The operation is marked unknown, not failed and not done.

Agoo asks the provider

By the durable reference where the provider can look it up, or by a bounded comparison of what the provider holds. The answer is applied (the document is there, and it's this one), not applied (it's safe to send) or unknown.

Only then does anything happen

Applied: Agoo records the provider's document. Not applied: it's sent again. Unknown: a person links the actual document at the provider, or it stays an open exception. A provider without duplicate protection never gets a blind retry.

A document at the provider under the same reference but with different content is never taken as this one: it's an exception for a person to decide.

Versions

VersionRule
Contract (now 1.0)A minor version only adds. A connector built for another major version, or a newer minor one than Agoo runs, isn't used
Provider APIEach connector names the provider API version it uses and the range it has been tested with. Outside that range, it isn't used until it passes again

Conformance fixtures

A connector is labelled supported for an edition only once it passes every fixture against that edition. A fixture for something the profile doesn't claim either expects an honest refusal (a validation error, with nothing created) or is reported as skipped, and the report says which.

FixtureWhat it proves
ProfileThe profile is complete and compatible: coverage, rate limits, versions; an object it doesn't carry is refused
Create, update, correct and archiveThe same reference twice makes one document; a stale update is refused; a correction leaves the original's history
Partial paymentPart payments add up, the status follows, and an overpayment is refused
CreditA credit note corrects the right document, and one for more than is outstanding is refused
WithholdingWithholding is carried as withholding, or the document is refused, never sent without it
Foreign currencyThe currency and rate are kept, or the document is refused on a single-currency edition
Locked periodA document in a closed period is refused, nothing is created, and it goes in an open one
Deleted contactA document to a deleted contact is refused naming the contact, and nothing is created
Rate limitThe provider's wait is honoured, then the document goes
Timeout and unknown outcomeA lost answer is never retried blindly; the inquiry finds the document that was made, or confirms none was
ReconnectAfter access is revoked, nothing is sent; reconnecting to a different company is refused
Changed tax mappingOld documents and their corrections keep the old rule version's code; an unmapped version is refused
LimitationsEvery field the provider can't hold is named as a limitation
Changes and webhooksChanges since a point arrive once, and an unsigned webhook is refused

The results are kept as the evidence behind each connector's label on the directory.

  • Integration directory: each connector's status, coverage and support.
  • Webhooks and the change feed: how your own systems hear about Agoo's books.
  • Errors: the REST API's own error codes, which are separate from these.

On this page