question

natpro_uk avatar image
0 Likes"
natpro_uk asked ·

Setting up a client for getOrders API

Hi,


I am trying to programmatically reconcile our inventory database. My plan is to programmatically collect the order fulfilment details from eBay and update the inventory in our database. So, I came across getOrders API (https://developer.ebay.com/api-docs/sell/fulfillment/resources/order/methods/getOrders) which seems to solve my problem.


However, this API requires an access token created with the authorization code grant flow. The problem is, the authorization code grant flow requires a user to give consent via a webpage. This is not possible if we are to fetch the order details programmatically.


eBay docuemnt points to https://github.com/eBay/ebay-oauth-python-client. But this client relies on a human user to hit the consent button. Alternately, it uses selenium to navigate through consent page, but this won't work given that consent page is capthca enabled!


I am happy to live with 'sell.fulfillment.readonly', but even this scope requires token created with authorization code grant.

Has anyone been able to set up a client for getOrders API and able to make calls programmatically?

If obtaining an access token requires human involvement, what is the point of API and automation?

getordersoauth2getorders-ebay-apioauthauthorization code grant
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

· Write an Answer
sagar_developersupport avatar image
0 Likes"
sagar_developersupport answered ·

Hi @natpro_uk,

For security, a User access token is short-lived. However, a Refresh token is long-lived and you can use it to renew a User access token after the token expires. The benefit is that you don't need to get the account-owner's consent each time you need to renew their User access token.

Ref:- https://developer.ebay.com/api-docs/static/oauth-refresh-token-request.html

Best regards ,
eBay Developer Support

10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.