Skip to main content
Solved

REST API: how can I change a card for an existing payment?


Forum|alt.badge.img+2

I have a customer who made a payment using a credit and wants to change to a different card (different payment method already associated with his account).  How can I modify the payment to reflect this?  I tried the following PUT method URL in Postman:

https://sandbox.com/AcumaticaERP/entity/Default/22.200.001/Payment

Here’s the body I passed:

{

        "Type":{"value":"Payment"},

        "ReferenceNbr": { "value": "183610" },

        "PaymentMethod": {"value": "CC MASTCRD"},

        "NewCard": { "value": false },

        "CardAccountNbr": {"value": "Mastcrd:****-****-****-4203"}

}

I don’t get an error but, unfortunately, Postman just returns the existing Payment with no card change applied.

Best answer by Dmitrii Naumov

@bpgraves  for the CardAccountNbr field you need the “id” of the payment method. 

So it should look like that:

{
    "id": "f6dfbed1-3611-ef11-8c5b-ee3e36cd4d36",
    "CardAccountNbr": {
        "value": 2365
    },
    "CashAccount": {
        "value": "10600"
    },
    "PaymentMethod": {
        "value": "CC"
    },
    "ProcessingCenterID": {
        "value": "ACUPAY"
    },
    "ReferenceNbr": {
        "value": "005098"
    },
    "Type": {
        "value": "Payment"
    }
}

And of course, the payment needs to be editable, e.g. not released

View original
Did this topic help you find an answer to your question?

5 replies

Dmitrii Naumov
Acumatica Moderator
Forum|alt.badge.img+7
  • Acumatica Moderator
  • 651 replies
  • Answer
  • May 13, 2024

@bpgraves  for the CardAccountNbr field you need the “id” of the payment method. 

So it should look like that:

{
    "id": "f6dfbed1-3611-ef11-8c5b-ee3e36cd4d36",
    "CardAccountNbr": {
        "value": 2365
    },
    "CashAccount": {
        "value": "10600"
    },
    "PaymentMethod": {
        "value": "CC"
    },
    "ProcessingCenterID": {
        "value": "ACUPAY"
    },
    "ReferenceNbr": {
        "value": "005098"
    },
    "Type": {
        "value": "Payment"
    }
}

And of course, the payment needs to be editable, e.g. not released


Forum|alt.badge.img+2
  • Author
  • Semi-Pro I
  • 66 replies
  • May 13, 2024
Dmitrii Naumov wrote:

@bpgraves  for the CardAccountNbr field you need the “id” of the payment method. 

So it should look like that:

{
    "id": "f6dfbed1-3611-ef11-8c5b-ee3e36cd4d36",
    "CardAccountNbr": {
        "value": 2365
    },
    "CashAccount": {
        "value": "10600"
    },
    "PaymentMethod": {
        "value": "CC"
    },
    "ProcessingCenterID": {
        "value": "ACUPAY"
    },
    "ReferenceNbr": {
        "value": "005098"
    },
    "Type": {
        "value": "Payment"
    }
}

And of course, the payment needs to be editable, e.g. not released

I’m not sure what you mean by the “id” of the payment method.  Are you referring to the Payment ReferenceNbr?  If not, how to do I obtain this integer?  Also, the ProcessingCenterID is empty when I get the Payment using:

https://sandbox.com/AcumaticaERP/entity/Default/22.200.001/Payment/Payment/598089


Dmitrii Naumov
Acumatica Moderator
Forum|alt.badge.img+7
  • Acumatica Moderator
  • 651 replies
  • May 13, 2024

@bpgraves the ID is what you get in the InstanceID field from Get: {{sitename}}/entity/default/23.200.001/CustomerPaymentMethod

 

Unfortunately it’s not visible anywhere in UI. Not sure about the ProcessingCenterID though. Generally if you set the Payment Method and the CardNbr, the ProcessingCenter is going to be filled automatically. 

 

 


Forum|alt.badge.img+2
  • Author
  • Semi-Pro I
  • 66 replies
  • May 13, 2024
Dmitrii Naumov wrote:

@bpgraves the ID is what you get in the InstanceID field from Get: {{sitename}}/entity/default/23.200.001/CustomerPaymentMethod

 

Unfortunately it’s not visible anywhere in UI. Not sure about the ProcessingCenterID though. Generally if you set the Payment Method and the CardNbr, the ProcessingCenter is going to be filled automatically. 

 

 

Thanks…almost there.  For the ProcessingCenterID, are you referring to the ProcCenterID from the CustomerPaymentMethod?


Dmitrii Naumov
Acumatica Moderator
Forum|alt.badge.img+7
  • Acumatica Moderator
  • 651 replies
  • May 13, 2024

@bpgraves yes, but normally you do not need to set it explicitly. 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings