XeroAPI / xero-php-oauth2

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

Examples for using the SDK doesn't match #212

Closed ishan-biztech closed 3 years ago

ishan-biztech commented 3 years ago

Currently there is no consistency on how to use/call the API via this SDK. It differs from place to place, somewhere in example(like Github Home page, API Documentation) it uses package methods(setName, setFirstName, setLastName, etc.) and in other place(like github docs folder, etc) it says to directly pass json({ ... "Name": "John Doe" ... }).

Is there any recommendation from Xero team on what method to use and will be supported? Currently I haven't found any recommendation or proper comments that says which method(directly pass JSON payload or use package methods) to use.

SidneyAllen commented 3 years ago

@ishan-biztech - I've updated the readme to improve the visibility of the new SDK documentation we started to rollout.

We have runnable code examples for all Accounting API endpoints here https://xeroapi.github.io/xero-php-oauth2/docs/v2/accounting/index.html

ishan-biztech commented 3 years ago

Okay, thanks for your prompt response @SidneyAllen. So I assume that you guys recommend using SDK methods over using json payload directly.

SidneyAllen commented 3 years ago

Good question @ishan-biztech - the PHP SDK does not support raw JSON payloads and expects objects to be populated and passed into methods for serialization into JSON.