I am trying to create a Sales Invoice with a Payment but i get the following error: "An error occurred during processing of the field CuryAdjdAmt: Nullable object must have a value.."
I am using the /Default/23.200.001/SalesInvoice endpoint and this is my request:
What am I missing or do i need to create first the Sales Invoice, then the Payment and then apply it?
{
"ReferenceNbr": {
"value": "<NEW>"
},
"CustomerID": {
"value": "ABAKERY"
},
"ExternalRef": {
"value": "801PM00000DhqGnYAJ"
},
"Type": {
"value": "Invoice"
},
"IsSpecialOrder": {
"value": false
},
"Date": {
"value": "2024-04-22"
},
"ShipToAddressLine1": {
"value": "Test"
},
"ShipToOverrideAddress": {
"value": true
},
"ShipToOverrideContact": {
"value": true
},
"ShipToCity": {
"value": "Test"
},
"ShipToCountry": {
"value": "US"
},
"ShipToPostalCode": {
"value": "42131"
},
"ShipToState": {
"value": "NY"
},
"ShipToPhone1": {
"value": "\\245454"
},
"Details": [
{
"Amount": {
"value": 500.00
},
"OrderQty": {
"value": 1
},
"UnitPrice": {
"value": 500.00
},
"SalespersonID": {
"value": "SALESPERSO"
},
"WarehouseID": {
"value": "RETAIL"
},
"InventoryID": {
"value": "APJAM08"
},
"ManualPrice": {
"value": true
},
"UOM": {
"value": "PIECE"
}
}
] ,
"ApplicationsInvoice": [
{
"AdjustmentNbr": {
"value": 1
},
"AmountPaid": {
"value": 500
},
"CashDiscountTaken": {
"value": 0.0000
},
"Currency": {
"value": "USD"
},
"Customer": {
"value": "ABAKERY"
},
"DocType": {
"value": "Payment"
},
"DocumentType": {
"value": "INV"
},
"PaymentDate": {
"value": "2025-04-28T00:00:00-04:00"
},
"PaymentRef": {
"value": "0005"
}
}
],
"TaxDetails": [
{
"TaxableAmount": {
"value": 500.0000
},
"TaxAmount": {
"value": 44.3800
},
"TaxID": {
"value": "NYSTATETAX"
},
"TaxRate": {
"value": 8.875000
},
"TaxType": {
"value": "Sales"
}
}
]
}