Skip to content

Add omit_import_id parameter to webhook classes#18

Open
deanlongstaff wants to merge 2 commits intosyncforynab:masterfrom
deanlongstaff:omit-import-id-2
Open

Add omit_import_id parameter to webhook classes#18
deanlongstaff wants to merge 2 commits intosyncforynab:masterfrom
deanlongstaff:omit-import-id-2

Conversation

@deanlongstaff
Copy link

Add a new omit_import_id parameter to Monzo and Starling webhook classes to support creating user-entered transactions instead of imported transactions.

When omit_import_id: true:

  • TransactionCreator receives nil as import_id
  • YNAB API treats transaction as user-entered
  • Transaction becomes eligible for matching against future imports

This satisfies YNAB API requirements where omitted/null import_id creates user-entered transactions that can be matched against imported transactions with same amount and date (±10 days). This allows the use of the direct import feature alongside webhooks.

Changes:

  • F2ynab::Webhooks::Monzo: Added omit_import_id parameter and conditional logic
  • F2ynab::Webhooks::Starling: Added omit_import_id parameter and conditional logic
  • Both classes default to omit_import_id: false to maintain existing behaviour

Add a new `omit_import_id` parameter to Monzo and Starling webhook classes to support creating user-entered transactions instead of imported transactions.

When `omit_import_id: true`:
  - TransactionCreator receives nil as import_id
  - YNAB API treats transaction as user-entered
  - Transaction becomes eligible for matching against future imports

This satisfies YNAB API requirements where omitted/null `import_id` creates user-entered transactions that can be matched against imported transactions with same amount and date (±10 days). This allows the use of the direct import feature alongside webhooks.

Changes:
  - F2ynab::Webhooks::Monzo: Added `omit_import_id` parameter and conditional logic
  - F2ynab::Webhooks::Starling: Added `omit_import_id` parameter and conditional logic
  - Both classes default to `omit_import_id: false` to maintain existing behaviour
… when nil

If `import_id` is present but `nill` in the request payload, the transaction is created with an `import_id` of an empty string. This then causes a 409 response for subsequent transactions. Now fully omitting the property from the request when not present.
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.

1 participant