Skip to main content

Author Topic: orderid in secondary market listing api

m
  • Posts: 14
orderid in secondary market listing api
OP: January 02, 2019, 12:00:00 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?
  • IP logged

l
  • Posts: 6
orderid in secondary market listing api
#1: December 31, 1969, 07:00:00 PM
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.
  • IP logged

T
  • Posts: 6588
orderid in secondary market listing api
#2: December 31, 1969, 07:00:00 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?
  • IP logged

A
  • Posts: 1
orderid in secondary market listing api
#3: December 31, 1969, 07:00:00 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!
  • IP logged

j
  • Posts: 1
orderid in secondary market listing api
#4: December 31, 1969, 07:00:00 PM
Yes THANK YOU very much!
This was immensely helpful. I can't say the same about Folio's documentation.......
  • IP logged