I have been using the developer organization for the dev environment fine and have also got a separate live project using the Xero php SDK API absolutely fine, but when I am trying to use the same code on the production site which needs to go live, I am getting the horrid generic Error 500 when creating a quote:
prod.ERROR: XeroAPI\XeroPHP\ApiException: [500] Server error:
PUT https://api.xero.com/api.xro/2.0/Quotes?summarizeErrors=true
resulted in a500 Internal Server Error
response: {"Title":"An error occurred","Detail":"An error occurred in Xero. Check the API Status page http://status.developer.xero (truncated...)
I have been checking that everything is correct with what I am sending, and it is working perfectly in the dev environment. The only difference is the Customer ID which is a real customer in the live account. Could this be the problem? Is there a setting within the Xero account which is blocking the ability to create quotes via the API for customers?
I have no issues initiating or refreshing the tokens. What can I try next?
Here is the request body from the log history in development.xero (sensitive guids modified):
{
"Quotes": [
{
"Reference": "J-1000 Walt Disney Corp",
"Terms": "Estimate is valid for 30 days and is subject to sight of copy/artwork. Delivery and VAT are excluded unless stated. Author’s corrections, changes to artwork and additional proofs are subject to a £100/hour charge. The cost of materials may be subject to change without notice. All orders accepted are subject to our terms and conditions, which are available on request. If you would like to proceed with this order, please simply click accept quote. Please provide a purchase order number or order reference if possible. Work will commence upon receipt of this signed quotation. Please also ensure that the contact details above are correct for the purpose of invoicing. All invoices are subject to UK VAT at the current rate unless a valid exemption certificate is provided.",
"Contact": {
"ContactID": "e4c9026f-6d07-4375-a18**************",
"HasAttachments": false,
"HasValidationErrors": false
},
"LineItems": [
{
"Description": "2000 qty of GGC1 with Data",
"Quantity": 1,
"UnitAmount": "789.5000",
"AccountCode": "200",
"TaxType": "INPUT2"
}
],
"Date": "2024-08-28T08:21:41+00:00",
"Title": "Walt Disney Corp Gift Cards",
"Summary": "Further to your recent enquiry concerning the production and supply of the below, we have pleasure in confirming our estimated costs, the full details are as follows.\nFrom print-ready artwork and data supplied, auto-generate PDF proof for approval. Upon approval, digitally print CR80 gift cards both sides of 660μm Invercote Duo FSC Mix Credit - INT-COC-807273-GGC paperboard. Apply variable data and or mag stripe: HRN/variable barcode/unique PIN. Pack in 500s by kind.",
"BrandingThemeID": "249eba45-dac2-4ff0-a51***********"
}
]
}
Does the live account have account code 200 in their chart of accounts?