Updating Recvd Qty in a PO

frosty8467
frosty8467 Member Posts: 6 Novice Member Novice Member

I am trying to Update a Purchase order via the API when Is end this XML
<?xml version="1.0" encoding="utf-8"?><?qbxml version="6.0"?><QBXML>
<QBXMLMsgsRq onError="stopOnError">
<PurchaseOrderModRq>
<PurchaseOrderMod>
<TxnID useMacro="MACROTYPE">467E53-1730759675</TxnID>
<EditSequence>1730759890</EditSequence>
<VendorRef>
<ListID>80002A46-1318620869</ListID>
</VendorRef>
<TxnDate>2024-11-04</TxnDate>
<RefNumber>MFRECTST261</RefNumber>
<ShipAddress>
<Addr1>Affordable Granite Benchtops (Int) Ltd</Addr1>
<Addr2>34 Portage Road</Addr2>
<Addr3>New Lynn</Addr3>
</ShipAddress>
<TermsRef>
<FullName>60 Days - EOM</FullName>
</TermsRef>
<DueDate>2024-11-12</DueDate>
<ExpectedDate>2024-11-12</ExpectedDate>
<IsToBePrinted>true</IsToBePrinted>
<IsToBeEmailed>false</IsToBeEmailed>
<PurchaseOrderLineMod>
<TxnLineID useMacro="MACROTYPE">467E55-1730759675</TxnLineID>
<ItemRef>
<ListID>800000-1203471897</ListID>
</ItemRef>
<Desc>Matt Test 2</Desc>
<Quantity>2</Quantity>
<Amount>99.00</Amount>
<IsManuallyClosed>true</IsManuallyClosed>
<ReceivedQuantity>2</ReceivedQuantity>
<Other1>10814</Other1>
</PurchaseOrderLineMod>
</PurchaseOrderMod>
</PurchaseOrderModRq>
</QBXMLMsgsRq>
</QBXML>

The APi returns a Bad Request Error. If I remove this part

<ReceivedQuantity>2</ReceivedQuantity>

The XML works but I need to update the Recvd Qty

What Am i missing?

Thanks in Advance
Matt

Answers

  • PhuongDo
    PhuongDo Reckon Developer Partner Posts: 320 Reckon Legend Reckon Legend

    Hi Matt,

    QB XML is very strict about the tag order, in this case, your ReceivedQuantity needs to be declared/placed before IsManuallyClosed. Then you should be alright :)

    Thanks,

    Phuong


    Phuong Do / Reckon Developer Partner

    phuong@cactussoftware.com.au


  • frosty8467
    frosty8467 Member Posts: 6 Novice Member Novice Member

    Phuong

    Thanks for the reply but that didn't work I still get Bad Request, This is the new xml I am sending
    <?xml version="1.0" encoding="utf-8"?><?qbxml version="6.0"?><QBXML>
    <QBXMLMsgsRq onError="stopOnError">
    <PurchaseOrderModRq>
    <PurchaseOrderMod>
    <TxnID useMacro="MACROTYPE">467E53-1730759675</TxnID>
    <EditSequence>1730759890</EditSequence>
    <VendorRef>
    <ListID>80002A46-1318620869</ListID>
    </VendorRef>
    <TxnDate>2024-11-04</TxnDate>
    <RefNumber>MFRECTST261</RefNumber>
    <ShipAddress>
    <Addr1>Affordable Granite Benchtops (Int) Ltd</Addr1>
    <Addr2>34 Portage Road</Addr2>
    <Addr3>New Lynn</Addr3>
    </ShipAddress>
    <TermsRef>
    <FullName>60 Days - EOM</FullName>
    </TermsRef>
    <DueDate>2024-11-12</DueDate>
    <ExpectedDate>2024-11-12</ExpectedDate>
    <IsToBePrinted>true</IsToBePrinted>
    <IsToBeEmailed>false</IsToBeEmailed>
    <PurchaseOrderLineMod>
    <TxnLineID useMacro="MACROTYPE">467E55-1730759675</TxnLineID>
    <ItemRef>
    <ListID>800000-1203471897</ListID>
    </ItemRef>
    <Desc>Matt Test 2</Desc>
    <Quantity>2</Quantity>
    <Amount>99.00</Amount>
    <ReceivedQuantity>2</ReceivedQuantity>
    <IsManuallyClosed>true</IsManuallyClosed>
    <Other1>10814</Other1>
    </PurchaseOrderLineMod>
    </PurchaseOrderMod>
    </PurchaseOrderModRq>
    </QBXMLMsgsRq>
    </QBXML>

  • Tanvi_kataria
    Tanvi_kataria Reckon Staff Posts: 349 Reckon Staff

    Morning @frosty8467

    As @PhuongDo mentioned "QB XML is very strict about the tag order". I would suggest you check the XMLops at IDN Unified OSR (Onscreen Reference).

    This will give the code along with the related response. Please select the SDK Version - 6.0 and Format qbXML when looking for the XMLops.

    I hope this helps. Please reach out if you have any concerns/issues. Thank you!

    Regards

    Tanvi

  • frosty8467
    frosty8467 Member Posts: 6 Novice Member Novice Member

    Tanvi,

    I am using this but I can't see where the <ReceivedQuantity>2</ReceivedQuantity> goes in the Add part of the XML I can see that it is in the ret part. Is there another Table I should be adding to to affect this field?

    Thanks

    Matt

  • frosty8467
    frosty8467 Member Posts: 6 Novice Member Novice Member

    I am assuming that the ret part of the call is what is returned?