Skip to content

Instantly share code, notes, and snippets.

@sburlot
Created April 23, 2024 08:13
Show Gist options
  • Save sburlot/497ca6208153bddd10fca62b03f8534d to your computer and use it in GitHub Desktop.
Save sburlot/497ca6208153bddd10fca62b03f8534d to your computer and use it in GitHub Desktop.
Get number of today sales from WooCommerce
# you'll need jq installed
# and keys for WooCommerce API access
#
# Stephan Burlot coriolis.ch Apr 2024
#
curl -s "https://example.ch/wp-json/wc/v3/orders?\
consumer_key=ck_CONSUMER_KEY&\
consumer_secret=cs_SECRET_KEY&\
after=$(date '+%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