Skip to main content
Solved

Unable to create Sales Invoice with Payment

  • April 28, 2025
  • 1 reply
  • 76 views

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"

                }

            }

        ]

}

Best answer by jinin

Hi ​@kora ,

I'm not sure if it's possible to create an invoice along with a payment in a single step. I tried that approach but it didn't work for me.

Instead, I went with an alternative method: first, I created the invoice, then I created a payment and applied it to that invoice. This worked as expected. You might want to try this approach and see if it works for you too.


Invoice Create:
Request: //entity/Default/24.200.001/SalesInvoice
Method : PUT
Request:

{
"ReferenceNbr": {
"value": "<NEW>"
},
"CustomerID": {
"value": "ABCSTUDIOS"
},
"ExternalRef": {
"value": "801PM00000DhqGnYAJ"
},
"Type": {
"value": "Invoice"
},
"IsSpecialOrder": {
"value": false
},
"Date": {
"value": "2024-04-29"
},
"ShipToOverrideAddress": {
"value": true
},
"ShipToOverrideContact": {
"value": true
},
"Details": [
{
"Amount": {
"value": 500.00
},
"OrderQty": {
"value": 1
},
"UnitPrice": {
"value": 500.00
},
"InventoryID": {
"value": "AACOMPUT01"
},
"ManualPrice": {
"value": true
}
}
]
}

Payment creation:
Url: Default/24.200.001/Payment
Method: PUT
Request:

{
"Type": {
"value": "PMT"
},
"CustomerID": {
"value": "ABCSTUDIOS"
},
"PaymentAmount": {
"value": 500.0000
},
"PaymentMethod": {
"value": "Cash"
},
"DocumentstoApply": [
{
"ReferenceNbr": {
"value": "AR014497"
},
"DocType": {
"value": "INV"
},
"AmountPaid": {
"value": 500
}
}
]

}

 

1 reply

jinin
Pro I
Forum|alt.badge.img+11
  • Pro I
  • Answer
  • April 29, 2025

Hi ​@kora ,

I'm not sure if it's possible to create an invoice along with a payment in a single step. I tried that approach but it didn't work for me.

Instead, I went with an alternative method: first, I created the invoice, then I created a payment and applied it to that invoice. This worked as expected. You might want to try this approach and see if it works for you too.


Invoice Create:
Request: //entity/Default/24.200.001/SalesInvoice
Method : PUT
Request:

{
"ReferenceNbr": {
"value": "<NEW>"
},
"CustomerID": {
"value": "ABCSTUDIOS"
},
"ExternalRef": {
"value": "801PM00000DhqGnYAJ"
},
"Type": {
"value": "Invoice"
},
"IsSpecialOrder": {
"value": false
},
"Date": {
"value": "2024-04-29"
},
"ShipToOverrideAddress": {
"value": true
},
"ShipToOverrideContact": {
"value": true
},
"Details": [
{
"Amount": {
"value": 500.00
},
"OrderQty": {
"value": 1
},
"UnitPrice": {
"value": 500.00
},
"InventoryID": {
"value": "AACOMPUT01"
},
"ManualPrice": {
"value": true
}
}
]
}

Payment creation:
Url: Default/24.200.001/Payment
Method: PUT
Request:

{
"Type": {
"value": "PMT"
},
"CustomerID": {
"value": "ABCSTUDIOS"
},
"PaymentAmount": {
"value": 500.0000
},
"PaymentMethod": {
"value": "Cash"
},
"DocumentstoApply": [
{
"ReferenceNbr": {
"value": "AR014497"
},
"DocType": {
"value": "INV"
},
"AmountPaid": {
"value": 500
}
}
]

}