PurchaseOrder_Create fails with Decimal error

I’ve written integration with QuickFile API to import customers, people, suppliers and invoices. However I cannot get Purchase Orders to work.

When using the API Sandbox area, simply using the example XML provided (by you):

<PurchaseOrder_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/PurchaseOrder_Create.xsd">
  <Header>
    <MessageType>Request</MessageType> 
    <SubmissionNumber>99000011</SubmissionNumber>
    <Authentication>
      <!-- Hidden -->
    </Authentication>
  </Header>
  <Body>
    <PurchaseOrderData> 
      <SupplierID>1039306</SupplierID> 
       <ReceiptDate>2010-09-23</ReceiptDate> 
      <Currency>GBP</Currency> 
      <InvoiceLines> 
          <ItemLine>
            <ItemNominalCode>5000</ItemNominalCode>
            <ItemDescription>Ergonomically Designed Inner Earphones with 3.5mm headphone jack</ItemDescription>
            <SubTotal>14.99</SubTotal>
           <VatRate>20.00</VatRate> 
          </ItemLine> 
      </InvoiceLines>
    </PurchaseOrderData>
  </Body>
</PurchaseOrder_Create>

and pressing “Post XML” results in:

<?xml version="1.0" encoding="utf-8"?>
<PurchaseOrder_Create>
  <Header>
    <MessageType>Response</MessageType>
    <SubmissionNumber>99000011</SubmissionNumber>
  </Header>
  <Body>
    <Errors>
      <Error>Value was either too large or too small for a Decimal.</Error>
    </Errors>
  </Body>
</PurchaseOrder_Create>

Any ideas whats going on? Are Purchase Order not supported by the API? Thanks.

Hi @Tim_McCurdy

I’ve just tested this and it seems to have worked all OK. I have however passed this to our dev team to see if they could take a closer look.

We’ll come back to you shortly.

Thanks for the fast response. It’s strange that the error is happening for me on the Sandbox like this then. Maybe it is account specific?

All I did was:

  1. Create default provided Supplier using Sandbox.
  2. Create default provided Purchase Order using Sandbox (copying the SupplierID returned by 1).
  3. Got this error.

My account has many Clients and Invoices though already from development.

Thanks for the info - I’ll certainly pass this on to our dev team

[Edit]
@Tim_McCurdy - We’ve identified an error which is based on the date of the Purchase Order. If you change it to something more recent, then this will work fine :slight_smile: