Skip to content

singer-io/tap-ebay

 
 

Repository files navigation

tap-ebay

Author: Drew Banin (drew@fishtownanalytics.com)

This is a Singer tap that produces JSON-formatted data following the Singer spec.

It:

  • Generates a catalog of available order data from the Ebay fulfillment API
  • Extracts the following resources:

Quick Start

  1. Install
git clone git@github.com:fishtown-analytics/tap-ebay.git
cd tap-ebay
pip install .
  1. Authentication

This tap calls the fulfillment API which requires a User access token.

In order to retrieve a User access token the service needs to:

  • use a refresh token (long-lived) and exchange it for an access token (short-lived)

This likely requires two Ebay accounts:

  • A seller account which owns the sales data,
  • A developer account which is used for applications to access the sales data.

In order to create a refresh token:

  • Seller account needs to grant permission to Developer account to use the API,
  • Developer account needs to exchange the authorization code for a refresh token.

Generating a refresh token

Read the documentation

  1. Obtain credentials to both Seller and Developer account.
  2. Go to eBay's Application Keys and note Cert ID (Client Secret).
  3. Sign in using Developer username and password.
  4. Go to the specified authorization url (see below) in your browser.
  5. Sign in using Seller username and password.
  6. Grant access by clicking Agree.
  7. After being redirected, copy the value of query param code.
  8. Execute: ./get-refresh-token.sh providing your credentials as arguments
  9. Copy refresh_token from the response and store it with the job configuration.

Example authorization url

https://auth.ebay.com/oauth2/authorize?client_id=<client_id>
    &response_type=code
    &redirect_uri=<redirect_uri>
    &scope=https://api.ebay.com/oauth/api_scope/sell.fulfillment.readonly

Note: It is critical that the scope provided in the config.json file matches the scope requested from this authorization url!

  1. Create the config file.

There is a template you can use at config.json.example, just copy it to config.json in the repo root and insert your credentials

  1. Run the application to generate a catalog.
tap-ebay -c config.json --discover > catalog.json
  1. Select the tables you'd like to replicate

Step 4 generates a a file called catalog.json that specifies all the available endpoints and fields. You'll need to open the file and select the ones you'd like to replicate. See the Singer guide on Catalog Format for more information on how tables are selected.

  1. Run it!
tap-ebay -c config.json --catalog catalog.json

Copyright © 2019 Stitch

About

Singer.io tap for Ebay fulfillments

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 93.8%
  • Shell 6.2%