Clicky

  • Welcome to P2P Lending / NFT Lending Forum.
 

ETH.LOAN

News:

This was the original Lend Academy peer-to-peer lending forum, since forensically restored by deBanked and now reintroduced to eth.loan.

To restore access to your user account, email [email protected]. We apologize for errors you may experience during the recovery.

Main Menu
NEW LOANS:   | 804.eth 2.500 Ξ | remoraid.eth 0.299 Ξ | remoraid.eth 0.299 Ξ | ALL

orderid in secondary market listing api

Started by Peter, January 01, 2019, 11:00:00 PM

Previous topic - Next topic

mikedev10

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

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.

TravelingPennies

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" class="bbc_link" target="_blank">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

@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

Yes THANK YOU very much!
This was immensely helpful. I can't say the same about Folio's documentation.......

NEW LOANS:   | 804.eth 2.500 Ξ | remoraid.eth 0.299 Ξ | remoraid.eth 0.299 Ξ | ALL