Author Topic: orderid in secondary market listing api  (Read 1687 times)

mikedev10

  • Newbie
  • *
  • Posts: 37
    • View Profile
    • Email
orderid in secondary market listing api
« on: January 02, 2019, 02:25:22 AM »
this api looks neat, since i can get new orders in the last x minutes

but

no order id...  which means you can't actually place a buy order with it, right?

liquidp2p_dev

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: orderid in secondary market listing api
« Reply #1 on: January 02, 2019, 11:50:31 AM »
You can buy using this endpoint:

api/investor/v1/secondarymarket/accounts/{accountId}/orders

The only required parameters are noteId, price, orderType, and expirationDate.

I'm attaching the full documentation in case you don't have access.

mikedev10

  • Newbie
  • *
  • Posts: 37
    • View Profile
    • Email
Re: orderid in secondary market listing api
« Reply #2 on: January 02, 2019, 04:33:29 PM »
hmm, my json object orders is {[{"noteId":154355428,"price":9.69,"orderType":"BUY","expirationDate":"2019-01-09"}]}

my header is
lc_json_json_headers = {'Content-Type': 'application/json', 'Accept': 'application/json', 'Authorization':LC_API_AUTH}

and my call is
response = requests.post('https://api.lendingclub.com/api/investor/'+LC_VERSION+'/secondarymarket/accounts/'+LC_ACCT_ID+'/orders',
            headers=lc_json_json_headers, data=orders)

i feel like this all looks pretty good but am getting a 500 internal server error.  am i botching something up?

actually...  as i'm writing this post while playing with it, i took out the { } i manually put around my json object input, so now orders is
[{"noteId":154355428,"price":9.69,"orderType":"BUY","expirationDate":"2019-01-09"}]
and it is perfectly happy

the old/other api does not seem to mind them (and i thought i needed them/it was good json to have them) whereas this api does not seem to want them.  what is the proper practice for json?

AllardBrain

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: orderid in secondary market listing api
« Reply #3 on: July 04, 2019, 11:46:09 PM »
@mikedev10 THANK YOU so much for sharing your code snippet. 6 months after your last post, this was massively helpful for me. I was trying to pass the note info as parameters instead of using the json=data argument. Thanks to you, I was able to figure it out and just made my first successful buy on FolioFN. Much appreciated!

jldeutch

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: orderid in secondary market listing api
« Reply #4 on: September 08, 2019, 07:48:28 PM »
Yes THANK YOU very much!
This was immensely helpful. I can't say the same about Folio's documentation.......