This is a Singer tap that produces JSON-formatted data following the Singer spec for BigCommerce.
Set up a virtual environment and install this tap. See the Singer-io Getting Started Guide for help.
Create the config.json
file.
{
"client_id": "xxxxxxxxx",
"access_token": "xxxxxxxxx",
"store_hash": "xxxxxxxxx",
"start_date": "2017-01-01T00:00:00Z"
}
Run the tap in Discovery Mode to create the Catalog.
$ tap-bigcommerce --config config.json --discover > catalog.json
Select the fields you wish to sync. See Field Selection below for more information.
Run the tap in Sync Mode.
$ tap-bigcommerce --config config.json --catalog catalog.json
The config file is used to authenticate into BigCommerce. The Legacy API credentials not accepted.
start_date
is used for resources that can be filtered by
date_modified
- orders
, customers
and products
This command returns a JSON that describes the schema of each table.
$ tap-bigcommerce --config config.json --discover
To save this to catalog.json
:
$ tap-bigcommerce --config config.json --discover > catalog.json
You can tell the tap to extract specific fields by editing catalog.json
to make selections (or use the
Singer Discover
utility. You can change metadata for specific fields or tables and change
the "selected" field value to false.
"metadata": [
{
"breadcrumb": [],
"metadata": {
"table-key-properties": [
"id"
],
"forced-replication-method": "INCREMENTAL",
"selected-by-default": true,
"valid-replication-keys": [
"date_modified"
]
}
},
{
"breadcrumb": [
"properties",
"id"
],
"metadata": {
"inclusion": "automatic",
"selected": true
}
},
...
With an annotated catalog.json
, the tap can be invoked in sync mode:
$ tap-bigcommerce --config config.json --catalog catalog.json
Messages are written to standard output following the Singer specification. The resultant stream of JSON data can be consumed by a Singer target.
Use the following command to pipe the tap output into your Singer target of choice and update the state file in one go.
tap-bigcommerce --config config.json --catalog catalog.json --state state.json | target > state.json.tmp && tail -1 state.json.tmp > state.json
Copyright © 2019 Stitch