In our application we are creating Purchase Order Receipts and they had been working fine, but we had not used this function for 6 months or so and are using it again.
We are getting this error
GuzzleHttp\Exception\ClientException: Client error: `PUT https://prestigesalonproducts.acumatica.com/entity/ORDIO/20.200.001/PurchaseReceipt` resulted in a `422 Unprocessable Entity` response: {"id":"15468762-cac9-ee11-65424-12a215648465216","rowNumber":1,"note":null,"error":"'POAccrualAcctID' cannot be empty.;
Here is our code
return [
'note' => $receipt->comment,
'VendorID' => ['value' => $po->vendor_id],
'PostPeriod' => ['value' => now()->format('mY')],
'Details' => collect($receipt->products)->map(function ($product, $key) use ($po) {
return [
'InventoryID' => ['value' => $product->inventory_id],
'ReceiptQty' => ['value' => $product->qty],
'POOrderNbr' => ['value' => $po->ref_number],
'POOrderType' => ['value' => 'Normal'],
];
})->values()->toArray(),
I don’t see where the variable POAccrualAcctID is part of the API I did find AccuralAccount
and tried adding
'Account' => ['AccrualAccount' => ['value' => '2222']],
or
'Account' => ['POAccrualAcctID' => ['value' => '2222']],
Thank you very much for your help