How to connect Ebay to API2Cart?
To connect your eBay account to API2Cart, send cart.create request using POST method (!) from your API2Cart account. This request should contain the following parameters:
- api_key = YOUR_API_KEY
- cart_id = EBay
- verify = true
- ebay_environment = production
How to get parameters marked in red above:
Go to the eBay developers program page https://developer.ebay.com/my/auth/
Log in to your account or register one. After the successful authentication, you will land on Application Keys page, which looks like this:
On the screenshot above we’ve highlighted the keys needed to connect your eBay account to API2Cart: ebay_client_id and ebay_client_secret.
Go to the User Tokens page: https://developer.ebay.com/my/auth.
To get RuName, go to User Tokens tab-> Get a Token from eBay via Your Application -> press Add eBay Redirect URL - there will appear a setting page -> tick the box under OAuth Enabled -> get your parameter RuName (eBay Redirect URL name).
On the same page (User Tokens) set up Sign-in settings.
1) 2) Switch on OAuth:
3) Your auth accepted URL - here specify a URL link on which you’ll get the code, which is a very important parameter.
4) Save settings.
Click the link in the field: Your branded eBay Sandbox Sign In (OAuth) - copy this big URL link and paste it into the address bar. There you will see the following page:
Sign in to your account, then go to page Grant application access to Token Name: press Agree, then you will be redirected to the page you’ve specified in the field Your auth accepted URL. On that page you will receive data in the following format:
And the last step, use “code” to get refresh_token. You can do this via POSTMAN.
Send POST request to this link https://api.ebay.com/identity/v1/oauth2/token, specify in Body parameters grant_type, code and redirect_uri, like we did on the screenshot below. Make sure "code" parameter value is not url encoded before passing it as a request parameter
On the Authorization tab choose Type: Basic Auth, and in fields Username and Password paste you client_id and client_secret, as we did in the screenshot below.
Each eBay site maps to a unique eBay global ID. You can get it from
- ebay_client_secret - Cart ID
If you don't set this parameter, it will be 0 (US) by default.
After you press Send, eBay will give you access_token and refresh_token, which are necessary for connecting your eBay account to API2Cart.
The instruction above is based on official eBay documentation:
Posted in: Getting Started