XeroAPI/xero-python

Concerned about mistakes inside of Xero's Python SDK Documentation

adrenaline681 opened this issue · 2 comments

Hello Xero API team,

I've been working with the Xero API recently and came across a couple of inconsistencies that I wanted to bring to your attention.

Issue 1: update_manual_journal Method

In the documentation, the update_manual_journal method requires a ManualJournals object as an argument, which itself requires an array of ManualJournal objects. However, the method's description states "Updates a specific manual journal".
This implies it should only be updating one journal at a time, which is inconsistent with the requirement for an array of journals.

Here's the code snippet from the documentation which errors out due to providing an array instead of a single journal:

manualJournals = ManualJournals(manual_journals = [manual_journal])
api_response = api_instance.update_manual_journal(xero_tenant_id, manual_journal_id, manualJournals)

Issue 2: update_or_create_manual_journals Method

The method name update_or_create_manual_journals suggests that it can handle multiple manual journals. However, the description states: "Updates or creates a single manual journal", and my testing confirms that it indeed only processes one journal at a time.

Not only that but similar to the 1st issue, the example in the documentation is wrong and errors out.

Here's the code snippet from the documentation:

manualJournals = ManualJournals(manual_journals = [manual_journal])
api_instance.update_or_create_manual_journals(xero_tenant_id, manualJournals, summarize_errors)

This can be misleading and confusing for developers. It would be great if you could clarify these inconsistencies or consider adjusting the method naming to better match the behavior described in the API documentation.

Thank you for your attention to these matters!

PETOSS-321

Thanks for raising an issue, a ticket has been created to track your request