Solved

API Help for Payment (AR302000) Screen

  • 2 January 2024
  • 3 replies
  • 69 views

Userlevel 5
Badge

Hi-

I'm trying to add a PUT request to my payment screen (AR302000). However, when I test it using Postman, I encounter the following error, and I'm a bit stuck on where to find the issue and fix it. Here's the error message and the JSON data. If anyone could assist me in identifying what's wrong, I'd greatly appreciate it.

Thanks a bunch!

Error:

 

JSON:

{
    "Type": {
        "value": "PMT"
    },
    "ReferenceNbr": {
        "value": "PAY0001"
    },
    "Status": {
        "value": "Balanced"
    },
    "ApplicationDate": {
        "value": "2023-12-28T00:00:00+00:00"
    },
    "PaymentRef": {
        "value": "nugsl - INTEGRATED_ATM - 2023-12-28"
    },
    "CustomerID": {
        "value": "C0001660"
    },
    "PaymentMethod": {
        "value": "ATM"
    },
    "CashAccount": {
        "value": "INTATMDSWC"
    },
    "Description": {
        "value": "API Test."
    },
    "PaymentAmount": {
        "value": 1400
    },
    "BranchID": {
        "value": "01-DSWC"
    },
    "DocumentsToApply": [
        {
            "DocLineNbr": {
                "value": "1"
            },
            "DocType": {
                "value": "INV"
            },
            "ReferenceNbr": {
                "value": "000041"
            },wn
            "AmountPaid": {
                "value": 1400

 

ACU:

 

            }
        }
    ]
}aBC

 

 

icon

Best answer by Dmitrii Naumov 2 January 2024, 17:43

View original

3 replies

Userlevel 7
Badge +5

Can you try removing the DocLineNbr element from your JSon in the DocumentsToApply array? You shouldn’t need that for adding documents and I’m wondering if including the field is making ACM try to locate a record to update vs inserting a new record.

Userlevel 7
Badge +5

Hi @StevenRatner 

  1. I don’t think you need the DocLineNbr unless you have ‘Apply by lines’ feature turned on, which I don’t think you have here. 
  2. Check if there is already not released payment that is applied to that invoice. It’s not allowed to have more than one not released payment applied to the same invoice. 
  3. I’m not sure about sending RefernceNbr for payment. You do this only in case you don’t have Auto Numbering for payments, which I think is pretty rare. So, you should remove it if you are creating a new payment and not updating an existing one. (or unless you have manual numbering for payments)
Userlevel 5
Badge

@Dmitrii Naumov - Thanks for the help!  Your suggestions worked and I was able to get the API to work correctly. Much appreciated

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