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.
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.
| Part | What it says |
|---|---|
| Idempotent create | Whether the provider folds or refuses a second create with the same reference |
| Lookup by reference | Whether the provider can find a document again by Agoo's durable reference |
| Conditional update | Whether an update carries the provider's version and fails if the document moved since it was read |
| Inquiry after a timeout | Whether the connector can tell, after an answer was lost, if a write took effect |
| Webhooks or polling | How changes at the provider reach Agoo: signed notices, a list of changes since a point, or both |
| Objects and directions | Each 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 dimensions | Whether it takes documents in a currency other than the book's own, and which dimensions it can carry |
| Rate limits | The provider's published limits, which Agoo stays inside, per company |
| Coverage | The editions and countries it has been checked against, exactly as the directory shows them |
| Versions | The 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 field | What happens |
|---|---|
| Changes nothing in the amounts or the tax: a memo, a project, a dimension, Agoo's number | Sent 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 currency | Not sent. The document is refused with the reason, because the provider's copy would be wrong |
| A mapping that's missing | Not 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.
| Code | Meaning | Retry class | What happens |
|---|---|---|---|
auth_revoked | The provider no longer accepts the connection | after_reconnect | Work pauses until someone connects the account again |
rate_limited | The provider asked Agoo to slow down | after_delay | Sent again after the time the provider asked for |
conflict | The document changed at the provider, or the reference is already used for another | fix_and_retry | Shown as an exception with both versions; never last write wins |
validation | The document can't be sent as it is, or the provider refused its content | fix_and_retry | Shown with the reason; some refusals are permanent (never) |
locked_period | The provider's period for the document's date is closed | fix_and_retry | Recorded as a correction in an open period, never backdated |
not_found | The document, or something it points to (a deleted contact), isn't there | fix_and_retry | Shown naming what's missing, so it can be mapped again |
unknown_outcome | The request may have taken effect and the answer was lost | inquire_first | Agoo asks the provider before doing anything else (below) |
provider_down | The provider is failing or unreachable, and the request didn't reach it | after_delay | Sent 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
| Version | Rule |
|---|---|
| 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 API | Each 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.
| Fixture | What it proves |
|---|---|
| Profile | The profile is complete and compatible: coverage, rate limits, versions; an object it doesn't carry is refused |
| Create, update, correct and archive | The same reference twice makes one document; a stale update is refused; a correction leaves the original's history |
| Partial payment | Part payments add up, the status follows, and an overpayment is refused |
| Credit | A credit note corrects the right document, and one for more than is outstanding is refused |
| Withholding | Withholding is carried as withholding, or the document is refused, never sent without it |
| Foreign currency | The currency and rate are kept, or the document is refused on a single-currency edition |
| Locked period | A document in a closed period is refused, nothing is created, and it goes in an open one |
| Deleted contact | A document to a deleted contact is refused naming the contact, and nothing is created |
| Rate limit | The provider's wait is honoured, then the document goes |
| Timeout and unknown outcome | A lost answer is never retried blindly; the inquiry finds the document that was made, or confirms none was |
| Reconnect | After access is revoked, nothing is sent; reconnecting to a different company is refused |
| Changed tax mapping | Old documents and their corrections keep the old rule version's code; an unmapped version is refused |
| Limitations | Every field the provider can't hold is named as a limitation |
| Changes and webhooks | Changes 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.
Related
- 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.