Author: Drew Banin ([email protected])
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:
- Install
git clone [email protected]:fishtown-analytics/tap-ebay.git
cd tap-ebay
pip install .
- 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.
Read the documentation
- Obtain credentials to both Seller and Developer account.
- Go to eBay's Application Keys and note
Cert ID (Client Secret)
. - Sign in using Developer username and password.
- Go to the specified authorization url (see below) in your browser.
- Sign in using Seller username and password.
- Grant access by clicking Agree.
- After being redirected, copy the value of query param
code
. - Execute:
./get-refresh-token.sh
providing your credentials as arguments - 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!
- 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
- Run the application to generate a catalog.
tap-ebay -c config.json --discover > catalog.json
- 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.
- Run it!
tap-ebay -c config.json --catalog catalog.json
Copyright © 2019 Fishtown Analytics