Author Topic: Assign a note to a portfolio via API  (Read 1625 times)

hdsouza

  • Jr. Member
  • **
  • Posts: 50
    • View Profile
Assign a note to a portfolio via API
« on: October 23, 2018, 07:13:45 PM »
Hi,

I need to be able to programmatically assign a note to a portfolio.
I have looked through the API resource  (https://www.lendingclub.com/developers) and do not see a way  to assign/move notes.

Any ideas?
Thanks
Hil

panther02912

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: Assign a note to a portfolio via API
« Reply #1 on: October 24, 2018, 11:27:39 AM »
You can assign notes to a portfolio ID when posting an order.  For example:

[{'loanId': 606, 'portfolioId': '124', 'requestedAmount': 25.0}, {'loanId': 607, 'portfolioId': '124', 'requestedAmount': 25.0}]

I don't see a way to programmatically move held notes to another portfolio either.  Have you asked LC support if they have an undocumented API feature since portfolio reassignment is possible with their web site?

hdsouza

  • Jr. Member
  • **
  • Posts: 50
    • View Profile
Re: Assign a note to a portfolio via API
« Reply #2 on: October 24, 2018, 05:00:22 PM »
Thanks Panther. I will ask support and update accordingly

Fred93

  • Hero Member
  • *****
  • Posts: 2164
    • View Profile
Re: Assign a note to a portfolio via API
« Reply #3 on: October 25, 2018, 10:36:29 AM »
The web site doesn't use the same API.  I have never heard of any way to set portfolio via the API.

You can use the undocumented interface used by the web site, but it requires you to do a "login" as the user does on the web site, and exchange cookies to validate that you're the fellow who logged in, and to handle the login getting timed out, and so forth.  I used to do all this nonsense when the API was less capable and there were things I needed to do that the API did not provide.  Was a PITA because they would make tiny changes to the web site that would break my code fairly regularly, and LC discouraged it ... but didn't force me to stop, because I think they understood that the API was lacking important features.  I no longer use any of the undocumented web stuff, because I no longer need to.

hdsouza

  • Jr. Member
  • **
  • Posts: 50
    • View Profile
Re: Assign a note to a portfolio via API
« Reply #4 on: October 25, 2018, 04:20:33 PM »
Thanks Fred.
I just heard back from Support
----------------------------------------------
Unfortunately, we do not currently have an option to move Notes into portfolios via the API. I am sure that you saw the pages regarding creating a portfolio via our documentation pages however, we do not have the option to move the Notes.

I will make sure to bring up your feedback regarding this feature to my leadership team.
----------------------------------------------

There is another way:
 https://github.com/jgillick/LendingClub/blob/master/lendingclub/__init__.py although it does need python.  Look for assign_to_portfolio

From the history it looks like we may have problems installing it on a windows platform too.

hdsouza

  • Jr. Member
  • **
  • Posts: 50
    • View Profile
Re: Assign a note to a portfolio via API
« Reply #5 on: February 06, 2019, 06:08:19 PM »
I managed to get the python script to work.
If anyone is interested here is the code.
I have tested it and it works on windows 10, command line.

The script works in Python version 2.7 which is slated to have an End Of Life date as 2020.
So if anyone is interested in carrying out the upgrade to version 3 would be nice.

Code: [Select]
lc_login = 'your_email'
lc_pass = 'xxxxxxxxxxxx'

import os
import requests
import argparse
import sys
import glob
import lendingclub

lc = lendingclub.LendingClub(email= lc_login, password= lc_pass)
lc.authenticate()

portfolio_name = '12_Test'
loan_id = 111111111
order_id = 11111111
lc.assign_to_portfolio(portfolio_name, loan_id, order_id)
« Last Edit: February 06, 2019, 06:13:35 PM by hdsouza »