Skip to main content
Answer

AP Bill Payment REST API

  • September 9, 2024
  • 5 replies
  • 404 views

Forum|alt.badge.img

I’m trying to create AP Bill Payment by REST API
I found that I can do it with “Check”, but it doesn’t work for me - may somebody have experiance with AP Payments and can say what I’m doing wrong.
One of my API requests:
 

PUT http://***/entity/Default/20.200.001/Check HTTP/1.1
Accept: application/json
User-Agent: OpenAPI-Generator/1.0.0/csharp
Content-Type: application/json

{"ApplicationDate":{"value":"2024-09-08T00:00:00"},"CashAccount":{"value":"10011"},"Description":{"value":"Test"},"Details":[{"AmountPaid":{"value":15.0},"DocType":{"value":"Bill"},"ReferenceNbr":{"value":"TEST002"}}],"PaymentAmount":{"value":15.0},"PaymentMethod":{"value":"CHECK"},"PaymentRef":{"value":"Test001"},"Type":{"value":"Payment"},"Vendor":{"value":"V100"}}

All my attemts finish with an error like: “exceptionMessage=The system failed to commit the Adjustments row.”

Best answer by Dmitrii Naumov

@AndrewMuzalov 

If you have ‘Pay by line’ turned on for the invoice, you need DocLineNbr to be filled in the payment detail.

Please see the example below.

{
"Vendor": {
"value": "AAVENDOR"
},
"PaymentMethod": {
"value": "CHECK"
},
"CashAccount": {
"value": "10200"
},
"Description": {
"value": "Test"
},
"Details": [
{
"AmountPaid": {
"value": 5.0
},
"DocType": {
"value": "Bill"
},
"ReferenceNbr": {
"value": "005379"
},

"DocLineNbr": {
"value": "1"
}
}
],
"PaymentAmount": {
"value": 5.0
},
"PaymentRef": {
"value": "Test002"
},
"Type": {
"value": "Payment"
}
}

 

 

5 replies

Dmitrii Naumov
Acumatica Moderator
Forum|alt.badge.img+7
  • Acumatica Moderator
  • September 9, 2024

@AndrewMuzalov Do you already have the Bill #TEST002 in the system when you are trying to insert a payment for it? Is it also in “Released”/”Open” status at the moment of Payment creation?

 

 

 


Forum|alt.badge.img
  • Author
  • Jr Varsity III
  • September 9, 2024

@AndrewMuzalov Do you already have the Bill #TEST002 in the system when you are trying to insert a payment for it? Is it also in “Released”/”Open” status at the moment of Payment creation?

 

 

 

Yes. It is already added to Acumatica and with “Open” status. I can add payment to it manually from Acumatica UI.
Here the screenshot with my test bill:

Now it is more complicated, because invoicece with multiple lines. From Acumatica UI I can add payment to every line, and use particual amount

And an additioanl screenshot from fidler with data what I’m trying to send. Here I added row number like on UI



This screenshot with manual creation from ACE to second line 15$ for line with 90$

 


Forum|alt.badge.img
  • Author
  • Jr Varsity III
  • September 10, 2024

Any ideas how I can import AP Payments to Acumatica. May I should use another web endpoit for it?


Dmitrii Naumov
Acumatica Moderator
Forum|alt.badge.img+7
  • Acumatica Moderator
  • Answer
  • September 10, 2024

@AndrewMuzalov 

If you have ‘Pay by line’ turned on for the invoice, you need DocLineNbr to be filled in the payment detail.

Please see the example below.

{
"Vendor": {
"value": "AAVENDOR"
},
"PaymentMethod": {
"value": "CHECK"
},
"CashAccount": {
"value": "10200"
},
"Description": {
"value": "Test"
},
"Details": [
{
"AmountPaid": {
"value": 5.0
},
"DocType": {
"value": "Bill"
},
"ReferenceNbr": {
"value": "005379"
},

"DocLineNbr": {
"value": "1"
}
}
],
"PaymentAmount": {
"value": 5.0
},
"PaymentRef": {
"value": "Test002"
},
"Type": {
"value": "Payment"
}
}

 

 


Forum|alt.badge.img
  • Author
  • Jr Varsity III
  • September 11, 2024

Than

@AndrewMuzalov

If you have ‘Pay by line’ turned on for the invoice, you need DocLineNbr to be filled in the payment detail.

Please see the example below.

{
"Vendor": {
"value": "AAVENDOR"
},
"PaymentMethod": {
"value": "CHECK"
},
"CashAccount": {
"value": "10200"
},
"Description": {
"value": "Test"
},
"Details": [
{
"AmountPaid": {
"value": 5.0
},
"DocType": {
"value": "Bill"
},
"ReferenceNbr": {
"value": "005379"
},

"DocLineNbr": {
"value": "1"
}
}
],
"PaymentAmount": {
"value": 5.0
},
"PaymentRef": {
"value": "Test002"
},
"Type": {
"value": "Payment"
}
}

 

 

Thanks! It works - this field was missed in my API, I extended it - and it works!