Skip to content

fix(bankfeeds)!: Describe V2 partial failures so apps can branch on error.type - #856

Open
illanonline wants to merge 1 commit into
XeroAPI:masterfrom
illanonline:FWFEED-44954-v2-partial-failure-contract
Open

illanonline wants to merge 1 commit into
XeroAPI:masterfrom
illanonline:FWFEED-44954-v2-partial-failure-contract

Conversation

@illanonline

@illanonline illanonline commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Updates xero_bankfeeds_v2.yaml (Bank Feeds 2.0) so that partners can branch on error.type to handle a partial failure, without parsing title or detail.

BREAKING CHANGE

This is a breaking change for Bank Feeds 2.0 (Beta) partners who match on the old partial-failure error.type values, and the commit is marked with ! and a BREAKING CHANGE: footer. 2.0 is pre-GA, so the rename is made now rather than after release.

Old type New type
partial-failure-account-created-but-not-connected partial-failure-new-account-creation
partial-failure-migration-can-be-reattempted partial-failure-previous-connection-deletion
partial-failure-connection-created-but-not-recorded partial-failure-connection-creation
partial-failure-delete-can-be-reattempted partial-failure-connection-deletion
REJECTED internal-error with an account-may-exist hint in detail partial-failure-new-account-existence-not-confirmed (new)

Also breaking for generated clients: the error of an item in a 2.0 bulk write response no longer has a status property (the item's statusCode is the number), so it uses a new ItemError schema. The type enum changes accordingly: the four old values are removed and partial-failure-new-account-existence-not-confirmed is added.

Partner-facing change

  • Three recovery actions keyed on error.type:
    • partial-failure-new-account-creation: don't resend. Connect error.accountId with ExistingAccount.
    • partial-failure-new-account-existence-not-confirmed (new, NewAccount): the account may have been created and its id is unknown. Check whether an account named error.accountName exists. Connect it with ExistingAccount if it does, otherwise resend the NewAccount item. If the app involves its user, it can send them back to account selection instead.
    • Any other partial-failure-* type: resend the same item.
  • One 409 rule for create recoveries: feed-already-connected-in-current-organisation on the recovery request for the three create types means the earlier attempt was recorded.
  • Optional subtype (diagnostics only), and accountId, accountName and connectionId as fields on the error.
  • A REJECTED item means nothing was written, or Xero confirmed that nothing took effect. A 4xx item is corrected before it is sent again; a 500 item can be resent as it is.
  • Item-level internal-error and too-many-requests (REJECTED, 500), and the 207 Multi-Status wording.

Based on the up-to-date master (the earlier Bank Feeds V2 spec PR #849 is merged). No manifest.json change is needed. semantic-release will bump the version for the breaking marker.

@illanonline
illanonline force-pushed the FWFEED-44954-v2-partial-failure-contract branch from a88104c to b473683 Compare October 20, 2026 06:34
@illanonline illanonline changed the title fix(bankfeeds): [FWFEED-44954] Sync V2 partial-failure contract fix(bankfeeds): Describe V2 partial failures so apps can branch on error.type Oct 20, 2026
@illanonline
illanonline marked this pull request as ready for review October 23, 2026 02:13
@illanonline
illanonline force-pushed the FWFEED-44954-v2-partial-failure-contract branch from d463e0f to fc82f6f Compare October 23, 2026 02:19
@illanonline illanonline changed the title fix(bankfeeds): Describe V2 partial failures so apps can branch on error.type fix(bankfeeds)!: Describe V2 partial failures so apps can branch on error.type Oct 23, 2026
@illanonline
illanonline force-pushed the FWFEED-44954-v2-partial-failure-contract branch from fc82f6f to ea57a25 Compare October 23, 2026 02:23
Comment thread xero_bankfeeds_v2.yaml Outdated
openapi: 3.0.0
info:
version: 19.1.0
version: 2.0.0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be left as-is, it is updated by the release automation.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, that was a sync overwrite. info.version is back to 19.1.0 (the same as master) in dc5f186, and our sync script now leaves the target's version alone so it can't happen again. The same push also names oo-many-requests alongside internal-error as a REJECTED item with a 500 in the descriptions.

…rror.type

- Replace the four partial-failure types with five that each fix one recovery action: partial-failure-new-account-creation, partial-failure-new-account-existence-not-confirmed, partial-failure-previous-connection-deletion, partial-failure-connection-creation and partial-failure-connection-deletion
- Add optional subtype, and accountId, accountName and connectionId on the error, so apps don't need to read title or detail
- Item errors have no status property; the item's statusCode is the number (new ItemError schema)
- A REJECTED item means nothing was written, or Xero confirmed that nothing took effect; the 409 recovery rule applies to the three create types
- Describe item-level internal-error (REJECTED, 500) and the 207 Multi-Status response

BREAKING CHANGE: Bank Feeds 2.0 (Beta) partial-failure error types are renamed and a fifth is
added. partial-failure-account-created-but-not-connected is now
partial-failure-new-account-creation, partial-failure-migration-can-be-reattempted is now
partial-failure-previous-connection-deletion,
partial-failure-connection-created-but-not-recorded is now partial-failure-connection-creation,
and partial-failure-delete-can-be-reattempted is now partial-failure-connection-deletion. A
NewAccount item that used to come back as a REJECTED internal-error with an account-may-exist
hint is now partial-failure-new-account-existence-not-confirmed. The error of an item in a 2.0
bulk write response no longer has a status property; use the item's statusCode. Apps that match
on the old type values must update them. Bank Feeds 2.0 is pre-GA.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@illanonline
illanonline force-pushed the FWFEED-44954-v2-partial-failure-contract branch from ea57a25 to dc5f186 Compare October 27, 2026 02:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants