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

Create quotes not working and giving a 500 Internal Server Error without any detail of what is wrong! #343

Closed MuhammadUmair98 closed 5 months ago

MuhammadUmair98 commented 5 months ago

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

Describe the bug I am trying to create a quote on xero as soon as user creates a quote on my application. I have the accounting.transaction scope set as well and the similar thing for invoice is working successfully. I am attaching my xero quote instance as well. xero_quotes_instance

The above instance is stored in a variable called $xero_quote and this is how i call the xero_api

 $config = Configuration::getDefaultConfiguration()->setAccessToken( {{ TOKEN_HERE  }} );
            $api_instance = new AccountingApi(
                new Client(),
                $config
            );
            $quotes = new \XeroAPI\XeroPHP\Models\Accounting\Quotes();
            $arr_quotes = [];
            array_push($arr_quotes, $xero_quote);
            $quotes->setQuotes($arr_quotes);
             $api_instance->updateOrCreateQuotes($xero_auth_detail->tenants[0]['Id'], $quotes, $quote->id);

And this is the error that i get: xero_quote_error

github-actions[bot] commented 5 months ago

PETOSS-385

github-actions[bot] commented 5 months ago

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

Sallyhornet commented 5 months ago

This is an API validation issue rather than an issue with the SDK.

You will get an error 500 if any data in the request is not correct, for example the account code seems to be 000 in the request. If account code 000 does not exist in the Xero organisation you will see the error.

If you still need help, please can you contact Xero Support using this form , giving details of your client id, the Xero tenant name and/or id and the time, date and timezone of the most recent error.