API problems with Item_Update and Invoice Tax

Hi,

I am producing a PHP class for use with the Quickfile API. I will be making this available to the community when done.

I have come across a number of aspects which appear to be discrepancies with the schemas, but equally as I am not an expert in the use of XML it may be operator error………

  1. Invoice_Create and the Tax element. Following the schema I expect to be able to put Tax1 into an ItemLine:

This is the relevant part of the XML:

          <ItemDescription>Strange Foods</ItemDescription>
          <ItemNominalCode>4000</ItemNominalCode>
          <UnitCost>200</UnitCost>
          <Qty>4</Qty>
          <Tax1> 
            <TaxName>VAT</TaxName>
            <TaxPercentage>20</TaxPercentage>
          </Tax1>
         </ItemLine>
          </ItemLines>
          </InvoiceLines>
        </InvoiceData>
        </Body></Invoice_Create>

I get an error: 32The element ‘ItemLine’ in namespace ‘http://www.QuickFile.co.uk’ has invalid child element ‘Tax1’ in namespace 'http://www.QuickFile.co.uk

Any ideas why? Looks fine to me.

  1. I have successfully implemented functions for Item_Create, Client_Create, and Client_Update. But Item_Update is a problem: I get Unknown method (item_update) Is anyone successfully using this method? I see the documentation for Client_Create says that it can be used as an update function, so maybe that is the way to go.

If these are not Quickfile API problems, then wise words of advice or troubleshooting guidance appreciated.

Thanks in advance.

Martin

Hi Martin,

I’m not 100% sure about Item_Update, but I know that Invoice_Update also uses the creation method with an ID to update an existing record. The only thing I can suggest is try it :wink:

Tax1 appears to be after Qty in your code above, but the schema has it the other way around. Can you try changing it and see if that works? Same with UnitCost, that should come after Tax1 too.

[Edit]
In relation to Item_Update, I don’t think this function was ever implemented. You can however use Item_Create:

I have also just tested this with the following:

<Item_Create  xmlns="http://www.QuickFile.co.uk"  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  xsi:schemaLocation="http://www.QuickFile.co.uk http://www.quickfile.co.uk/WebServices/API/Schemas/invoices/Item_Create.xsd">
  <Header>
    <MessageType>Request</MessageType> 
    <SubmissionNumber>0001</SubmissionNumber>
    <Authentication>
      <AccNumber>6131xxxxxxx</AccNumber>
      <MD5Value>xxxxxxxxxxxx</MD5Value>
       <ApplicationID>xxxxxxxxx-xxxxxxxxxxxx-xxxxx</ApplicationID>
    </Authentication>
  </Header>
  <Body>
      <ItemDetails>
          <ItemID>xxxxxxx</ItemID>
          <ItemName>Test</ItemName>    
          <ItemDescription>Example Item</ItemDescription>
          <UnitCost>250.00</UnitCost>          
          <ItemType>ITEM</ItemType>
          <VatRate>20.00</VatRate>
          <NominalCode>4000</NominalCode>         
      </ItemDetails>
  </Body>
</Item_Create>

Returns:

        <Item_Create>
          <Header>
            <MessageType>Response</MessageType>
            <SubmissionNumber>0001</SubmissionNumber>
          </Header>
          <Body>
            <Response>Item record has been successfully updated.</Response>
          </Body>
        </Item_Create>````
1 Like

Thank you. I am able to update items with the approach suggested.

I hadn’t realized order of elements was significant. All working fine now.

Help much appreciated.

Kind Regards

Martin

1 Like