This is a Singer tap that produces JSON-formatted data following the Singer spec.
This tap:
- Pulls raw data from WooCommerce
- Extracts the following resources:
- Outputs the schema for each resource
- Incrementally pulls data based on the input state
Usage:
- Create Config file from sample-config.json
{
"url":"https://example.com/",
"consumer_key":"ck_woocommerce",
"consumer_secret":"cs_woocommerce",
"start_date":"ISO8601-Date-String"
}
- the consumer key and consumer secret will be needed to be generated from within woocommerce settings > api > api keys
- start date will determine how far back in your order history the tap will go
- this is only relevant for the initial run, progress afterwards will be bookmarked
- Discover
$tap-woocommerce --config config.json --discover >> catalog.json
- Run the above to discover the data points the tap supports for each of Woocommerce's endpoints (currently only List-Orders)
If you have your own schema definition, specify the directory that stores orders.json, customers.json, subscriptions.json and etc:
$tap-woocommerce --config config.json --discover >> catalog.json --schemas_path /path/to
- Select Streams
{
"schema": {
"properties": {...},
"type": "object",
"selected": true
},
"stream": "orders",
"tap_stream_id": "orders"
}
- Add
"selected":true
within the schema object to select the stream
4.Run the tap
By default, the items there were created between start_date and end_date are synced.
$tap-woocommerce --config config.json --catalog catalog.json
5.Run to sync modified items only
Sync only the items that were modified between start_date and end_date. This requires WooCommerce v1 API available.
$tap-woocommerce --config config.json --catalog catalog.json --modified_items_only true
6.Run with Stitch Target
- Install target
pip install target-stitch
- Create Config
{
"client_id" : your_stitch_id,
"token" : "your_stitch_token"
}
- Run tap with target
tap-woocommerce --config config.json --catalog catalog.json | target-stitch --config target-config.json
Copyright © 2019 Anelen Co., LLC