Search code examples
intuit-partner-platformquickbooks-online

Debugging 500 Response for Create Sales Receipt Through API Explorer


I've been developing an IPP application using the PHP devkit. I've been using the XML returned from the $object->asIDSXML() method to debug my objects through the API Explorer. Within the API Explorer I have been recieving a very ambiguous error when trying to create a Sales Receipt and I'm hoping I can learn more about the scheme requirements. Is there a validation xsd file somewhere? I'm currently unable to understand why I receive the following 500 code.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <FaultInfo
xmlns="http://www.intuit.com/sb/cdm/baseexceptionmodel/xsd">
<Message>Internal Server Error</Message>
<ErrorCode>500</ErrorCode>
<Cause>SERVER</Cause> </FaultInfo>

The documentation regarding a 500 states something along the lines of :

Possible Causes: Illegal permissions. Illegal values that are not verified in the validation process. Invalid data that the business logic verified.

I know that I have proper permissions, I have authenticated with an OAuth Token that has all privileges. The later two possibilities I believe are the issue, but I don't know how to get any additional information regarding the potentially invalid or missing data. I have literally tried creating a duplicate by using the API explorer to retrieve the SalesReceipt XML and then removing the DocumentID and sending to a create POST through the API explorer at which point I receive the same error shown above.

The following is the XML post data provided to the API. As far as I can tell the xml contains all the required fields fore creating a Sales Receipt. Thanks in advance for any help.

<SalesReceipt>
        <Header>
            <TxnDate>2013-04-16-07:00</TxnDate>
            <CustomerId idDomain="QBO">78</CustomerId>
            <TotalAmt>4.00</TotalAmt>
            <ShipAddr>
                <Line1>123 Fake Ave</Line1>
                <City>Fake City</City>
                <CountrySubDivisionCode>ID</CountrySubDivisionCode>
                <PostalCode>83854</PostalCode>
            </ShipAddr>
        </Header>
        <Line>
            <Id>1</Id>
            <Desc>Face to face IT Consulting Services, providing solutions to client's IT issues.</Desc>
            <Amount>4.00</Amount>
            <Taxable>false</Taxable>
            <ItemId>17</ItemId>
            <UnitPrice>4.00</UnitPrice>
            <Qty>1</Qty>
        </Line>
    </SalesReceipt>

Solution

  • Can you please try the following

    <SalesReceipt xmlns='http://www.intuit.com/sb/cdm/v2'>
        <Header xmlns:ns3='http://www.intuit.com/sb/cdm/v2'>
            <ns3:TxnDate>2013-04-16-07:00</ns3:TxnDate>
            <ns3:CustomerId>78</ns3:CustomerId>
            <ns3:TotalAmt>4.00</ns3:TotalAmt>
                <ShipAddr>
                    <Line1>123 Fake Ave</Line1>
                    <City>Fake City</City>
                    <CountrySubDivisionCode>ID</CountrySubDivisionCode>
                    <PostalCode>83854</PostalCode>
                </ShipAddr>
        </Header>
        <Line xmlns:ns11='http://www.intuit.com/sb/cdm/v2'>
            <ns11:Id>101</ns11:Id>
            <ns11:Desc>Face to face IT Consulting Services, providing solutions to client's IT issues.</ns11:Desc>
            <ns11:Amount>4.00</ns11:Amount>
            <ns11:Taxable>false</ns11:Taxable>
            <ns11:ItemId>17</ns11:ItemId>
            <ns11:UnitPrice>4.00</ns11:UnitPrice>
            <ns11:Qty>1</ns11:Qty>
        </Line>
    </SalesReceipt>