I am trying to create a customer but getting 422 Unprocessable Entity.
I am trying this call:
PUT @https://xxxxxxxxxxx.acumatica.com/entity/Default/20.200.001/Customer
This is my request body:
{
"CustomerID": {"value": "Cust01"},
"CustomerName": {"value": "Customer 01"},
"CustomerClass": {"value": "MISC"}
}
This is my response:
{
"id": "bd225325-d6b3-ef11-8363-12ab09909afb",
"rowNumber": 1,
"note": {
"value": ""
},
"error": "Inserting 'Location' record raised at least one error. Please review the errors.; CSalesAcctID: 'Sales Account' cannot be empty.; CSalesSubID: 'Sales Sub.' cannot be empty.; CARAccountID: Account 1050 is not a control account. Please select an account configured as a control account for AR.",
"AccountRef": {},
"AutoApplyPayments": {
"value": false
},
"BillingAddressOverride": {
"value": false
},
"BillingContactOverride": {
"value": false
},
"CreatedDateTime": {
"value": "2024-12-06T13:29:49.88+00:00"
},
"CurrencyID": {
"value": "USD"
},
"CurrencyRateType": {},
"CustomerClass": {
"value": "MISC"
},
"CustomerID": {
"value": "CUST01"
},
"CustomerName": {
"value": "Customer 01"
},
"EnableCurrencyOverride": {
"value": false
},
"EnableRateOverride": {
"value": false
},
"EnableWriteOffs": {
"value": false
},
"FOBPoint": {},
"LastModifiedDateTime": {
"value": "2024-12-06T13:29:49.88+00:00"
},
"LeadTimedays": {},
"LocationName": {
"value": "Primary Location"
},
"MultiCurrencyStatements": {
"value": false
},
"OrderPriority": {
"value": 0
},
"ParentRecord": {},
"PriceClassID": {},
"PrintInvoices": {
"value": false
},
"PrintStatements": {
"value": false
},
"ResidentialDelivery": {
"value": false
},
"SaturdayDelivery": {
"value": false
},
"SendInvoicesbyEmail": {
"value": false
},
"SendStatementsbyEmail": {
"value": false
},
"ShippingAddressOverride": {
"value": false
},
"ShippingBranch": {},
"ShippingContactOverride": {
"value": false
},
"ShippingRule": {
"value": "Cancel Remainder"
},
"ShippingTerms": {},
"ShippingZoneID": {},
"ShipVia": {},
"StatementCycleID": {
"value": "MONTHLY"
},
"StatementType": {
"value": "Open Item"
},
"Status": {
"value": "Active"
},
"TaxRegistrationID": {},
"TaxZone": {},
"Terms": {
"value": "NET 30"
},
"WarehouseID": {},
"WriteOffLimit": {
"value": 0.0
},
"custom": {},
"_links": {
"self": "/entity/Default/20.200.001/Customer/bd225325-d6b3-ef11-8363-12ab09909afb",
"files:put": "/entity/Default/20.200.001/files/PX.Objects.AR.CustomerMaint/BAccount/bd225325-d6b3-ef11-8363-12ab09909afb/{filename}"
}
}
I can see the error is:
“Inserting 'Location' record raised at least one error. Please review the errors.; CSalesAcctID: 'Sales Account' cannot be empty.; CSalesSubID: 'Sales Sub.' cannot be empty.; CARAccountID: Account 1050 is not a control account. Please select an account configured as a control account for AR”
Can someone help me understand why is this happening and how can I fix it?