XeroAPI / xero-php-oauth2

Xero PHP SDK for oAuth 2 generated from Xero API OpenAPI Spec 3.0
MIT License
87 stars 64 forks source link

How can i get raw data (returned from API) for each models? #332

Closed nesh-ua closed 9 months ago

nesh-ua commented 9 months ago

SDK you're using (please complete the following information):

Describe the solution you'd like I need to keep copy of data which were returned from you API in my own database. Thats why i want to get raw data from each model (contact, invoice, etc.)

github-actions[bot] commented 9 months ago

PETOSS-349

github-actions[bot] commented 9 months ago

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

Sallyhornet commented 9 months ago

Every transaction created in Xero that effects the general ledger creates an accounting journal in the background. Typically you can only see these journals in the Journal report found in the Report Centre, however they are also available via the API.

If you pull all the journals from your organisation you'll be able to build your own reports as required. To do this you would need to perform an initial process to retrieve the complete set of journals. If these were then stored locally it would only need to be a one-time process. Subsequent updates would only need to retrieve any new journals.

Each journal that is related to a transaction will have a source id and source type. You can make calls to the relevant endpoints to get more details eg the contact, the account codes used in the line items etc

You can then store the data in a relational database.

If you need more information on this, please use this form to raise a case for Xero Support.

Xero Developer Centre: Journals endpoint Journal source types