Error when trying to post a multiple PO Receipt using sage web API

Hello Guys,

I'm having an issue when trying to post a multiple Purchase Orders receipt, the error I'm getting is:

{
"error": {
"code": "RecordDuplicate",
"message": {
"lang": "en-US",
"value": "This is not a multiple purchase order receipt."
}
}
}

The receipt header param MultiplePurchaseOrders (as shown below) is set to true; probably I need to add some mandatory params in order to post the receipt but I cannot figure out which ones I missed, hope you guys can help me out.

Thanks!

The POST body params:

{
"Vendor": "XIDAME",
"MultiplePurchaseOrders": true,
"PurchaseOrders": 2,
"ReceiptLine2s": [
{
"ItemNumber": "0-002-92-00198",
"Location": "10",
"QuantityReceived": 12.93,
"UnitOfMeasure": "SQYD",
"PurchaseOrderSequenceKey": 29653959,
"PurchaseOrderLineSequence": 29653900,
"UnitCost": 5.03,
"PurchaseOrderNumber": "PO59927"
},
{
"ItemNumber": "0-002-14-00100",
"Location": "10",
"QuantityReceived": 76.06,
"UnitOfMeasure": "SQYD",
"PurchaseOrderSequenceKey": 29673773,
"PurchaseOrderLineSequence": 29673731,
"UnitCost": 5.09,
"PurchaseOrderNumber": "PO59957"
}
],
"ReceiptVendor2s": [
{
"Vendor": "FRECON",
"AutotaxcalculationOnsave": true,
"Amount": 87.81,
"ReceiptAdditionalCost3s": [
{
"AdditionalCost": "F",
"Amount": 75.000,
"ProrationMethod": "3",
"ReprorationMethod": "2",
"Description": "THC"
},
{
"AdditionalCost": "F",
"Amount": 12.81,
"ProrationMethod": "3",
"ReprorationMethod": "2",
"Description": "Freights USD"
}
]
}
],
"ReceiptPurchaseOrders": [
{
"PurchaseOrderSequenceKey": 29653959,
"PurchaseOrderNumber": "PO59927",
"StoredInDatabaseTable": true
},
{
"PurchaseOrderSequenceKey": 29673773,
"PurchaseOrderNumber": "PO59957",
"StoredInDatabaseTable": true
}
]
}

  • Hey,

    I would suggest making sure that a multiple PO receipt exists in the database and then using the GET of the POReceipts endpoint with the filter being MultiplePurchaseOrders eq (true) to then view the payload. This should assist in comparing what field might not being set correctly.

    I will check with our QA dept to see if they have any scripts they used in testing that might have this configuration.

  • Hi John, thanks for your quick answer.

    I did a test as you recommended bu it didn't work. It will be very helpful if you can get the script with this configuration.

    Thanks in advance!

  • I just got a confirmation from our QA folks that this configuration is not supported. The reason is that the UI has a manual step (pressing the Receive button), which invokes another process. So, it is not as simple as something in the payload as other tables are involved. I will add this as an enhancement request to our backlog for the Web API. 

    I'm sorry we are not able to support this functionality at this time.

  • That would be a very good enhancement.

    I also noticed that receipts cannot be associated with Purchase Orders (just one PO no multiples), for example if I want to post a receipt of an item that was ordered on an specific PO, the receipt is posted (only if the ReceiptPurchaseOrders param is not include in the body request) but the receipt header and line do not specify from which PO and the PO line is not updated with the received amount.

    Probably it is because of the same UI's manual step.

    Regards,

  •   We are trying to post PO Receipts using the Sage 300 API and I have encountered the same problem as with regards to the association between the PO and the PO Receipt. If I include PO details like the the PurchaseOrderNumber, PurchaseOrderSequenceKey and the PurchaseOrderLineSequence when I post a PO Receipt using the API, these details are not saved , and are not set in the return JSON.

    In fact, when I do not include any PO details in the PO Receipt the receipt saves regardless, so it seems like the PO details are not used at all. This seems strange, as I cannot imagine one wanting to create a PO Receipt via the API without associating it with a PO?

    Is this a known issue or is there possibly something wrong with the specific installation I am working with? Do you have any tips for resolving this issue?

    Thanks in advance.