wealthsimple-trade icon indicating copy to clipboard operation
wealthsimple-trade copied to clipboard

Listing orders

Open vlad-pisanov opened this issue 5 years ago • 3 comments
trafficstars

First, thanks for making this API available! 🎉

I found that the only endpoint that didn't work for me was:

GET https://trade-service.wealthsimple.com/orders

which returned {"error"=>"Record not found"}

It seems this endpoint now requires an account_id parameter, like so:

GET https://trade-service.wealthsimple.com/orders?account_id=<ACCOUNT-ID>

(maybe it's not needed if you have a single account, but if you have multiple accounts, this parameter appears to be mandatory)

vlad-pisanov avatar Jun 07 '20 07:06 vlad-pisanov

It appears that the endpoint will return results for the non-registered account, when the account_id parameter is omitted.

In effect,

GET https://trade-service.wealthsimple.com/orders

is equivalent to:

GET https://trade-service.wealthsimple.com/orders?account_id=<NON-REGISTERED-ACCOUNT-ID>

@vlad-pisanov Do you have a non-registered account?

phuzybuny avatar Jun 24 '20 04:06 phuzybuny

@phuzybuny interesting find! I Both of my accounts are registered. That would explain it.

vlad-pisanov avatar Jun 24 '20 11:06 vlad-pisanov

@vlad-pisanov Thanks for confirming.

Looks like the documentation can be updated to clarify the behaviour.

phuzybuny avatar Jun 24 '20 22:06 phuzybuny