Got questions? Contact Us, Call Us 1-800-224-0976 or write manager@api2cart.com

How to connect Ebay to API2Cart?

To connect your eBay account to API2Cart, send

account.cart.add

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_client_id
  • ebay_client_secret
  • ebay_refresh_token
  • ebay_site_id
  • ebay_environment = production

How to get parameters marked in red above:

  • ebay_client_id - App ID
  • ebay_client_secret - Cart ID

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.
  • ebay_refresh_token

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 seller eBay 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: state:null

code:v^1.1#i^1#r^1#p^3#f^0#I^3#t^Ul41Xzg6MDM5RENGM0E3NEIxNTJDQkU5QjQxMDA2MjA5NjRBOTRfMV8xI0VeMTI4NA==

And the last step, use “code” to get refresh_token. You can do this via POSTMAN.

Send POST request to the link https://api.ebay.com/identity/v1/oauth2/token, in case you use production environment. Otherwise, if you use sandbox send a request to this link - https://api.sandbox.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.

6) ebay_site_id:

Each eBay site maps to a unique eBay global ID. You can get it from https://developer.ebay.com/devzone/merchandising/docs/concepts/siteidtoglobalid.html

If you don't set this parameter, it will be 0 (US) by default.

Congrats!

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: https://developer.ebay.com/api-docs/static/oauth-qref-auth-code-grant.html

Posted in: Getting Started