why this payload is giving me an Error:422 "error": "Inserting 'Address' record raised at least one error. Please review the errors.; CountryID: 'Country' cannot be empty.",
{
"Status": {"value": "Active"},
"EmployeeID": {"value": "CRIC123789"},
"EmployeeName": {"value": "Doe, Jane"},
"FinancialSettings":
{
"APAccount": {"value": "ACCOUNT123"},
"APSubaccount": {"value": "000000"},
"ExpenseAccount": {"value": "ACCOUNT456"},
"PaymentMethod": {"value": "CHECK"},
"PrepaymentSubaccount": {"value": "000000"},
"SalesAccount": {"value": "ACCOUNT789"},
"TaxZone": {}
},
"EmployeeSettings":
{
"BranchID": {"value": "CRIC012345"},
"Calendar": {"value": "NEWCAL1234"},
"CurrencyID": {"value": "USD"},
"CurrencyRateTypeID": {"value": "SPOT"},
"DepartmentID": {"value": "1"},
"EmployeeClass": {"value": "EMPCLASSNE"}
},
"ContactInfo":
{
"LastName": {"value": "Doe"}
},
"Address":
{
"CountryID":{"value":"India"}
}
}
Hi laura,
thanks for replying back..
i’ve resolved my issue and the problem was
in APi’s
it is considering the “country” as the abbrebviation(IN) and not the “countryID”
and also the object “Address” is a sub-object of “ContactInfo” whereas i was considering it as a different object itself
Here is the Correct Payload.. You can have a look at it
Acumatica create Employee payload:
{
"Status": {"value": "Active"},
"EmployeeID": {"value": "CRIC123789"},
"EmployeeName": {"value": "Doe, Jane"},
"FinancialSettings":
{
"APAccount": {"value": "ACCOUNT123"},
"APSubaccount": {"value": "000000"},
"ExpenseAccount": {"value": "ACCOUNT456"},
"PaymentMethod": {"value": "CHECK"},
"PrepaymentSubaccount": {"value": "000000"},
"SalesAccount": {"value": "ACCOUNT789"},
"TaxZone": {}
},
"EmployeeSettings":
{
"BranchID": {"value": "CRIC012345"},
"Calendar": {"value": "NEWCAL1234"},
"CurrencyID": {"value": "USD"},
"CurrencyRateTypeID": {"value": "SPOT"},
"DepartmentID": {"value": "1"},
"EmployeeClass": {"value": "EMPCLASSNE"}
},
"ContactInfo":
{
"LastName": {"value": "Doe"},
"Address":
{
"Country":{"value":"IN"}
}
}
}
Thank you
Hello, I am not a developer but I know when I manually choose a country in Acumatica, I need to use the official 2-digit abbreviation for the country, not the full name. Did you try IN , not ‘India’?
Thank you for sharing your solution with the community
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.