Solved

REST API Error 'CustomerID' cannot be empty

  • 30 November 2023
  • 2 replies
  • 66 views

Userlevel 2
Badge

Hello Everyone,

I'm having a recurring issue I've been facing while using the Acumatica REST API. I am attempting to delete a payment detail from a sales order, and intermittently, I receive the following error message: "'CustomerID' cannot be empty."

The sales order already exists in the system so I shouldn’t need to provide the CustomerID but even if I do I still get the error.

On top of this the error response from Acumatica contains the CustomerID populated as it should be.

Here's a general structure of my API request for reference :

{
  "OrderNbr": {
    "value": "000082"
  },
  "OrderType": {
    "value": "SO"
  },
  "Payments": [
    {
      "id": "544535ce-2f8f-ee11-991e-90ccdfb7d7ce",
      "delete": true
    }
  ]
}

 

As well as a portion of the response

{
  "id": "e6f8ec91-2b8f-ee11-991e-90ccdfb7d7ce",
  "rowNumber": 1,
  "note": {
    "value": ""
  },
  "error": "'CustomerID' cannot be empty.; CustomerID: 'CustomerID' cannot be empty.",
  ...
  "CustomerID": {
    "value": "2842011255"
  },

...

icon

Best answer by jinin 30 November 2023, 06:01

View original

2 replies

Userlevel 7
Badge +11

Hi @matthewgerdan ,

To delete the payment from the order, you should pass the ReferenceNbr instead of the sessionID.

Could you try like below?

{

    "OrderType": {

        "value": "SO"

    },

    "OrderNbr": {

        "value": "SO007470"

    },

    "Payments": [

        {

            "ReferenceNbr": {

                "value": "004480"

            },

            "DocType": {

                "value": "PMT"

            },

            "delete": true

        }

    ]

    

}

Userlevel 2
Badge

thanks @jinin that worked :) 

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved