Last active
April 23, 2024 09:02
-
-
Save sburlot/627d931c15e2ce84b98dbd0d8cbbf696 to your computer and use it in GitHub Desktop.
Get number of yesterday sales from WooCommerce
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# you'll need jq installed | |
# and keys for WooCommerce API access | |
# | |
# Stephan Burlot coriolis.ch Apr 2024 | |
# | |
# this works on MacOSX | |
curl -s "https://example.ch/wp-json/wc/v3/orders?\ | |
consumer_key=ck_CONSUMER_KEY&\ | |
consumer_secret=cs_SECRET_KEY&\ | |
after=$(date -v-1d '+%Y-%m-%dT00:00:00')" | \ | |
jq '. | length' | |
# Ubuntu: | |
curl -s "https://example.ch/wp-json/wc/v3/orders?\ | |
consumer_key=ck_CONSUMER_KEY&\ | |
consumer_secret=cs_SECRET_KEY&\ | |
after=$(date --date='yesterday' '+%Y-%m-%dT00:00:00')" | \ | |
jq '. | length' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment