API – Update Payment Profile

Introduction

This article explains how to update payment profiles through the API, but we also have articles show how to make changes within the LoanPro UI or the Secure Payments UI.

LoanPro uses Secure Payments (formerly PCI Wallet) to securely save payment profile information. However, there are values associated with a payment profile that is saved in LoanPro. If you are a user of LoanPro and not just Secure Payments, we recommend a two-step approach to updating your payment profiles.

Step 1 - Update Secure Payments

StackBlitz Example:

Many of our articles use StackBlitz examples like this. These examples are like a window into a REST client right here in your browser. The window is divided into two sides. Developers can use info in the editor on the left side when configuring your API integration, and the right side shows a preview of a REST client. Click 'Preview' on the bottom, and you'll only see the REST client.

The entire request is set up and connected to a demo API tenant in LMS. Just scroll down and click 'send' and you should get a 200 response. If you want to get some practice with error codes, try editing the endpoint, headers, method and payload to see what responses you get.

The first step is to update the payment profile in Secure Payments. this will update the core profile information. You'll send a PUT request to one of these two endpoints, depending on whether the profile is a card or checking account:

PUT https://pciwallet.simnang.com/api/checking-account

or

PUT https://pciwallet.simnang.com/api/credit-card

The payload will include an unique token for the card or checking account, which was generated when the payment profile was first created. Secure Payments doesn't save these tokens, so if you've lost it, you'll need to Create a New Payment Profile..

Here's a sample payload:

{
"token": "QVFJREFIaStYK1ZoODFTMGFLdGNVTnhQN0RLZ2FiU3N4ekf34diDc234Difpsaf0Cd2FnYnpCdEFnRUFNR2dHQ1NxR1NJYjNEUUVIQVRBZUJnbGdoa2dCWlFNRUFTNHdFUVFNdXJIRkVjWlV6eklJVmhYSkFnR5dE5365FEEDDdfW9CLzlvY281QnhCUjJTclJrRUlLNEt3ZnUzcDRCL1haaFVjM1JIWjBJQlNGWEQxRWZkbC9CYWRhNXlJalVJRTdNdWFwOGo0ME8zME93PT0uZXlKaGJHY2lPaUpJVXpJMU5pSjkuZXlKaFpHUnlaWE56SWpvaU1qZ3hOaUJrYjNWbmJHRnpJR0pzZG1RaUxDSmhZMk52ZFc1MFgzUjVjR1VpT2lKamFHVmphMmx1WnlJc0luVndaR0YwWldRaU9qRTFNekkzTURFNU5Ea3NJbU5wZEhraU9pSk9SVmNnV1U5U1N5SXNJbUpoYm10ZmJtRnRaU0k2SWxWVElFSkJUa3NnVGtFaUxDSmpjbVZoZEdWa0lqb3hOVE15TnpBeE9UUTVMQ0p6ZEdGMFpTSTZJazVaSWl3aWVtbHdZMjlrWlNJNklqRXdNRE01TkRVNE5pSXNJbUZqWTI5MWJuUm9iMnhrWlhKZmJtRnRaU0k2SWt0aGJHbHVhMjhnVTI5d2IzVnliM1VpTENKcFpDSTZNekE0TXpBd0xDSmhaR1J5WlhOelgybGtJam8xT1RrNE1EWXNJblZ6WlhKZmFXUWlPamMxTVN3aVkyOTFiblJ5ZVNJNklsVlRRU0lzSW1OMWMzUnZiV1Z5WDJsa0lqcHVkV3hzZlEuS2Vpak1HbWxpTGh4bVlKbUFwbjZxaFd0NzlzNDYyLXdBOGFjSTJaaGU2UQ==",
"checking-account": {
"accountholder_name": "Andy Goodson",
"account_number": "123456789",
"routing_number": "123456789",
"bank_name": "FIRST BANK",
"eft_branch_number": "",
"eft_institution_number": "",
"address": "123 OAK LANE",
"city": "SCHENECTADY",
"country": "USA",
"zipcode": "1234567890",
"state": "NY",
"account_type": "checking"
}
}

Step 2 - Update LoanPro

The second step is to update the peripheral information in LoanPro. Send a PUT request to this endpoint, replacing {Customer ID} with the specific ID of the customer you're updating.

 PUT https://loanpro.simnang.com/api/public/api/1/odata.svc/Customers({Customer ID})

Here's a sample payload:

{
"id": "4",
"PaymentAccounts": {
"results": [
{
"id": 4,
"title": "Bank Account 08/15/2020",
"__id": 4,
"__update": true
}
]
},
"__update": true,
"__id": "4"
}

This will tell LoanPro to pull the latest data from Secure Payments for this payment profile.

Delete Payment Profile

If you want to delete the payment profile in LoanPro, it goes to the same endpiont:

 PUT https://loanpro.simnang.com/api/public/api/1/odata.svc/Customers({Customer ID})

The payload is nearly the same, but notice that instead of using "__update" to update the profile, we use "__destroy" to delete the profile.

{
"id": "4",
"PaymentAccounts": {
"results": [
{
"id": 4,
"title": "Bank Account 08/15/2020",
"__id": 4,
"__destroy": true
}
]
},
"__update": true,
"__id": "4"
}

Deleting a Payment Profile will permanently break the connection between the Secure Payments payment profile and the LoanPro payment profile, including deleting the token. This is not something that can be recovered. This will NOT delete the payment profile in Secure Payments.


How did we do?


Powered by HelpDocs (opens in a new tab)