0
votes

While trying to Create the Payment at Payments and application screen,facing the below issue

"exceptionMessage": "PX.Data.PXRowPersistingException: Error: 'OrigDocAmt' cannot be empty.\r\n at PX.Data.PXDefaultAttribute.RowPersisting(PXCache sender, PXRowPersistingEventArgs e)\r\n at PX.Data.PXCache.OnRowPersisting(Object item, PXDBOperation operation)\r\n at PX.Data.PXCache1.PersistInserted(Object row, Boolean bypassInterceptor)\r\n at PX.Data.PXCache1.Persist(PXDBOperation operation)\r\n at PX.Data.PXGraph.Persist(Type cacheType, PXDBOperation operation)\r\n at PX.Data.PXGraph.Persist()\r\n at PX.Objects.AR.ARPaymentEntry.Persist() in C:\Bld\AC-FULL2018R24-JOB1\sources\WebSites\Pure\PX.Objects\AR\ARPaymentEntry.cs:line 2458\r\n at PX.Data.PXSave1.<Handler>d__2.MoveNext()\r\n at PX.Data.PXAction1.d__32.MoveNext()\r\n at PX.Data.PXAction`1.d__32.MoveNext()\r\n at PX.Api.SyImportProcessor.SyStep.a(Object A_0, PXFilterRow[] A_1, PXFilterRow[] A_2)\r\n at PX.Api.SyImportProcessor.ExportTableHelper.ExportTable()\nPayment.CashAccount: 'Cash Account' cannot be empty.\nPayment.CustomerID: Error: 'Customer' cannot be empty.\nPayment.PaymentMethod: 'Payment Method' cannot be empty.",

{
"Type" : { "Value":"Payment" },
"CustomerID" : { "Value":"10101010"},
"PaymentMethod" : { "Value":"CHECK"},
"PaymentRef" : { "Value": "123456789" },
"PaymentAmount" : { "Value": "250" },
"Branch" : {"Value":"PRODWHOLE"} --->Financial  setting tab

}

1
I Have tried with Contract based api through dotnet code it is working fine.When trying with the rest API in Postman facing the above issue.Praveen Pola

1 Answers

1
votes

the thing is REST API is case sensitive, so you need to use lowercase "value" keyword:

{
"Type" : { "value":"Payment" },
"CustomerID" : { "value":"ABARTENDE"},
"PaymentMethod" : { "value":"CHECK"},
"PaymentRef" : { "value": "123456789" },
"PaymentAmount" : { "value": "250" },
"Branch" : {"value":"PRODWHOLE"} 
}

By the way, please note that starting from 2019r1 version of Acumatica ERP, you can send Sales Order with Payments in a single call:

Put: {{sitename}}/entity/Default/18.200.001/SalesOrder?$select=OrderNbr,CashAccount
{
"CashAccount": {
    "value": "10200"
},
"CustomerID": {
    "value": "ABARTENDE"
},
"Details": [
    {
        "BranchID": {
            "value": "HQ"
        },"InventoryID": {
            "value": "AAMACHINE"
        },
        "OrderQty": {
            "value": 1
        },
    "UnitPrice": {
            "value": 269.85
        },
    "WharehouseID": {
            "value": "WHOLESALE"
        },
    "ManualPrice": {
            "value": true
            }
    }
],
"OrderType": {
    "value": "SO"
},
"PaymentMethod": {
    "value": "CHECK"
},
  "ExternalRef": {
    "value": "9593"
},
"Payments": [
    {
        "PaymentRef": {
            "value": "SOpay123"
        },
        "AppliedToOrder": {
            "value": 269.85
        },
        "CashAccount": {
            "value": "10300"
        },
        "PaymentMethod": {
            "value": "CHECK"
        }
    }
]
}