From wix-ecom-cowork
Queries Wix orders via REST API for revenue calculation, trend analysis, and cohort analysis. Filters by date range, payment/fulfillment status, and value.
How this skill is triggered — by the user, by Claude, or both
Slash command
/wix-ecom-cowork:order-analyticsThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Complete order querying, revenue calculation, trend analysis, and cohort analysis using direct Wix REST API calls.
Complete order querying, revenue calculation, trend analysis, and cohort analysis using direct Wix REST API calls.
df7c18eb-009b-4868-9891-15e19dddbe67${API_KEY}${SITE_ID}Endpoint: POST https://www.wixapis.com/stores/v2/orders/query
API Call:
curl -X POST "https://www.wixapis.com/stores/v2/orders/query" \
-H "Authorization: ${API_KEY}" \
-H "wix-site-id: ${SITE_ID}" \
-H "Content-Type: application/json" \
-d '{
"query": {
"paging": {
"limit": 50,
"offset": 0
}
}
}'
Response:
{
"orders": [
{
"id": "order-123",
"number": "1001",
"dateCreated": "2026-02-21T10:30:00.000Z",
"paymentStatus": "PAID",
"fulfillmentStatus": "FULFILLED",
"priceSummary": {
"subtotal": "100.00",
"shipping": "10.00",
"tax": "8.50",
"discount": "15.00",
"total": "103.50"
},
"buyerInfo": {
"email": "[email protected]",
"contactId": "contact-abc123"
},
"lineItems": [
{
"productName": "Product A",
"quantity": 2,
"price": "50.00"
}
]
}
],
"metadata": {
"count": 50,
"offset": 0,
"total": 450
}
}
curl -X POST "https://www.wixapis.com/stores/v2/orders/query" \
-H "Authorization: ${API_KEY}" \
-H "wix-site-id: ${SITE_ID}" \
-H "Content-Type: application/json" \
-d '{
"query": {
"filter": "{\"dateCreated\": {\"$gte\": \"2026-02-01T00:00:00.000Z\", \"$lte\": \"2026-02-28T23:59:59.000Z\"}}",
"sort": "{\"dateCreated\": \"desc\"}",
"paging": {"limit": 100}
}
}'
curl -X POST "https://www.wixapis.com/stores/v2/orders/query" \
-H "Authorization: ${API_KEY}" \
-H "wix-site-id: ${SITE_ID}" \
-H "Content-Type: application/json" \
-d '{
"query": {
"filter": "{\"paymentStatus\": \"PAID\"}",
"sort": "{\"dateCreated\": \"desc\"}",
"paging": {"limit": 100}
}
}'
curl -X POST "https://www.wixapis.com/stores/v2/orders/query" \
-H "Authorization: ${API_KEY}" \
-H "wix-site-id: ${SITE_ID}" \
-H "Content-Type: application/json" \
-d '{
"query": {
"filter": "{\"fulfillmentStatus\": \"NOT_FULFILLED\", \"paymentStatus\": \"PAID\"}",
"sort": "{\"dateCreated\": \"asc\"}",
"paging": {"limit": 50}
}
}'
curl -X POST "https://www.wixapis.com/stores/v2/orders/query" \
-H "Authorization: ${API_KEY}" \
-H "wix-site-id: ${SITE_ID}" \
-H "Content-Type: application/json" \
-d '{
"query": {
"filter": "{\"priceSummary.total\": {\"$gte\": \"200.00\"}, \"paymentStatus\": \"PAID\"}",
"sort": "{\"priceSummary.total\": \"desc\"}",
"paging": {"limit": 50}
}
}'
Endpoint: GET https://www.wixapis.com/stores/v2/orders/{orderId}
API Call:
curl -X GET "https://www.wixapis.com/stores/v2/orders/${ORDER_ID}" \
-H "Authorization: ${API_KEY}" \
-H "wix-site-id: ${SITE_ID}" \
-H "Accept: application/json"
Response:
{
"order": {
"id": "order-123",
"number": "1001",
"dateCreated": "2026-02-21T10:30:00.000Z",
"paymentStatus": "PAID",
"fulfillmentStatus": "FULFILLED",
"priceSummary": {
"subtotal": "100.00",
"shipping": "10.00",
"tax": "8.50",
"discount": "15.00",
"total": "103.50"
},
"buyerInfo": {
"email": "[email protected]",
"contactId": "contact-abc123",
"firstName": "John",
"lastName": "Doe"
},
"shippingInfo": {
"logistics": {
"shippingDestination": {
"address": {
"addressLine": "123 Main St",
"city": "San Francisco",
"subdivision": "CA",
"postalCode": "94105",
"country": "US"
}
}
}
},
"lineItems": [
{
"id": "lineitem-001",
"productName": "Product A",
"quantity": 2,
"price": "50.00",
"lineItemPrice": "100.00",
"productId": "product-abc"
}
]
}
}
#!/bin/bash
# Get orders from last 30 days
START_DATE=$(date -u -v-30d +"%Y-%m-%dT00:00:00.000Z")
END_DATE=$(date -u +"%Y-%m-%dT23:59:59.999Z")
orders=$(curl -s -X POST "https://www.wixapis.com/stores/v2/orders/query" \
-H "Authorization: ${API_KEY}" \
-H "wix-site-id: ${SITE_ID}" \
-H "Content-Type: application/json" \
-d "{
\"query\": {
\"filter\": \"{\\\"dateCreated\\\": {\\\"\\$gte\\\": \\\"$START_DATE\\\", \\\"\\$lte\\\": \\\"$END_DATE\\\"}, \\\"paymentStatus\\\": \\\"PAID\\\"}\",
\"paging\": {\"limit\": 1000}
}
}")
# Calculate total revenue
total_revenue=$(echo "$orders" | jq '[.orders[].priceSummary.total | tonumber] | add')
order_count=$(echo "$orders" | jq '.orders | length')
avg_order_value=$(echo "$orders" | jq '[.orders[].priceSummary.total | tonumber] | add / length')
echo "30-Day Revenue Report"
echo "===================="
echo "Total Orders: $order_count"
echo "Total Revenue: \$$total_revenue"
echo "Average Order Value: \$$avg_order_value"
#!/bin/bash
# Get all paid orders
orders=$(curl -s -X POST "https://www.wixapis.com/stores/v2/orders/query" \
-H "Authorization: ${API_KEY}" \
-H "wix-site-id: ${SITE_ID}" \
-H "Content-Type: application/json" \
-d '{
"query": {
"filter": "{\"paymentStatus\": \"PAID\"}",
"paging": {"limit": 1000}
}
}')
# Extract line items and calculate revenue by product
echo "$orders" | jq -r '
[.orders[].lineItems[]] |
group_by(.productName) |
map({
product: .[0].productName,
quantity_sold: ([.[].quantity] | add),
revenue: ([.[].lineItemPrice | tonumber] | add)
}) |
sort_by(-.revenue) |
.[] |
"\(.product) | Qty: \(.quantity_sold) | Revenue: $\(.revenue)"
'
#!/bin/bash
orders=$(curl -s -X POST "https://www.wixapis.com/stores/v2/orders/query" \
-H "Authorization: ${API_KEY}" \
-H "wix-site-id: ${SITE_ID}" \
-H "Content-Type: application/json" \
-d '{
"query": {
"filter": "{\"paymentStatus\": \"PAID\"}",
"paging": {"limit": 1000}
}
}')
# Calculate discount metrics
total_discount=$(echo "$orders" | jq '[.orders[].priceSummary.discount | tonumber] | add')
orders_with_discount=$(echo "$orders" | jq '[.orders[] | select(.priceSummary.discount | tonumber > 0)] | length')
total_orders=$(echo "$orders" | jq '.orders | length')
discount_rate=$(echo "scale=2; $orders_with_discount / $total_orders * 100" | bc)
echo "Discount Impact Analysis"
echo "======================="
echo "Orders with discounts: $orders_with_discount / $total_orders ($discount_rate%)"
echo "Total discount given: \$$total_discount"
echo "Average discount per order: \$$(echo "scale=2; $total_discount / $total_orders" | bc)"
#!/bin/bash
# Get last 30 days of orders
START_DATE=$(date -u -v-30d +"%Y-%m-%dT00:00:00.000Z")
END_DATE=$(date -u +"%Y-%m-%dT23:59:59.999Z")
orders=$(curl -s -X POST "https://www.wixapis.com/stores/v2/orders/query" \
-H "Authorization: ${API_KEY}" \
-H "wix-site-id: ${SITE_ID}" \
-H "Content-Type: application/json" \
-d "{
\"query\": {
\"filter\": \"{\\\"dateCreated\\\": {\\\"\\$gte\\\": \\\"$START_DATE\\\", \\\"\\$lte\\\": \\\"$END_DATE\\\"}, \\\"paymentStatus\\\": \\\"PAID\\\"}\",
\"paging\": {\"limit\": 1000}
}
}")
# Group by date and calculate daily revenue
echo "$orders" | jq -r '
[.orders[] | {
date: (.dateCreated | split("T")[0]),
revenue: (.priceSummary.total | tonumber)
}] |
group_by(.date) |
map({
date: .[0].date,
orders: length,
revenue: ([.[].revenue] | add)
}) |
sort_by(.date) |
.[] |
"\(.date) | Orders: \(.orders) | Revenue: $\(.revenue)"
'
#!/bin/bash
# Current month
CURRENT_MONTH_START=$(date -u +"%Y-%m-01T00:00:00.000Z")
CURRENT_MONTH_END=$(date -u +"%Y-%m-%dT23:59:59.999Z")
# Previous month
PREV_MONTH_START=$(date -u -v-1m +"%Y-%m-01T00:00:00.000Z")
PREV_MONTH_END=$(date -u -v-1m +"%Y-%m-%dT23:59:59.999Z")
# Get current month orders
current=$(curl -s -X POST "https://www.wixapis.com/stores/v2/orders/query" \
-H "Authorization: ${API_KEY}" \
-H "wix-site-id: ${SITE_ID}" \
-H "Content-Type: application/json" \
-d "{
\"query\": {
\"filter\": \"{\\\"dateCreated\\\": {\\\"\\$gte\\\": \\\"$CURRENT_MONTH_START\\\", \\\"\\$lte\\\": \\\"$CURRENT_MONTH_END\\\"}, \\\"paymentStatus\\\": \\\"PAID\\\"}\",
\"paging\": {\"limit\": 1000}
}
}")
# Get previous month orders
previous=$(curl -s -X POST "https://www.wixapis.com/stores/v2/orders/query" \
-H "Authorization: ${API_KEY}" \
-H "wix-site-id: ${SITE_ID}" \
-H "Content-Type: application/json" \
-d "{
\"query\": {
\"filter\": \"{\\\"dateCreated\\\": {\\\"\\$gte\\\": \\\"$PREV_MONTH_START\\\", \\\"\\$lte\\\": \\\"$PREV_MONTH_END\\\"}, \\\"paymentStatus\\\": \\\"PAID\\\"}\",
\"paging\": {\"limit\": 1000}
}
}")
current_revenue=$(echo "$current" | jq '[.orders[].priceSummary.total | tonumber] | add // 0')
previous_revenue=$(echo "$previous" | jq '[.orders[].priceSummary.total | tonumber] | add // 0')
growth=$(echo "scale=2; ($current_revenue - $previous_revenue) / $previous_revenue * 100" | bc)
echo "Month-over-Month Growth"
echo "======================"
echo "Previous month: \$$previous_revenue"
echo "Current month: \$$current_revenue"
echo "Growth: $growth%"
#!/bin/bash
START_DATE=$(date -u -v-30d +"%Y-%m-%dT00:00:00.000Z")
END_DATE=$(date -u +"%Y-%m-%dT23:59:59.999Z")
orders=$(curl -s -X POST "https://www.wixapis.com/stores/v2/orders/query" \
-H "Authorization: ${API_KEY}" \
-H "wix-site-id: ${SITE_ID}" \
-H "Content-Type: application/json" \
-d "{
\"query\": {
\"filter\": \"{\\\"dateCreated\\\": {\\\"\\$gte\\\": \\\"$START_DATE\\\", \\\"\\$lte\\\": \\\"$END_DATE\\\"}, \\\"paymentStatus\\\": \\\"PAID\\\"}\",
\"paging\": {\"limit\": 1000}
}
}")
echo "Top 10 Best Sellers (Last 30 Days)"
echo "==================================="
echo ""
echo "$orders" | jq -r '
[.orders[].lineItems[]] |
group_by(.productName) |
map({
product: .[0].productName,
units_sold: ([.[].quantity] | add),
revenue: ([.[].lineItemPrice | tonumber] | add)
}) |
sort_by(-.units_sold) |
.[:10] |
to_entries |
.[] |
"\(.key + 1). \(.value.product) - \(.value.units_sold) units - $\(.value.revenue)"
'
#!/bin/bash
# Get all paid orders
orders=$(curl -s -X POST "https://www.wixapis.com/stores/v2/orders/query" \
-H "Authorization: ${API_KEY}" \
-H "wix-site-id: ${SITE_ID}" \
-H "Content-Type: application/json" \
-d '{
"query": {
"filter": "{\"paymentStatus\": \"PAID\"}",
"sort": "{\"dateCreated\": \"asc\"}",
"paging": {"limit": 1000}
}
}')
# Analyze customer purchase frequency
echo "$orders" | jq -r '
[.orders[] | {email: .buyerInfo.email, date: .dateCreated, total: .priceSummary.total}] |
group_by(.email) |
map({
email: .[0].email,
order_count: length,
first_order_date: .[0].date,
last_order_date: .[-1].date,
total_spent: ([.[].total | tonumber] | add)
}) |
group_by(if .order_count == 1 then "first_time" else "repeat" end) |
map({
segment: .[0] | if .order_count == 1 then "First-Time" else "Repeat" end,
customers: length,
total_revenue: ([.[].total_spent] | add),
avg_revenue_per_customer: ([.[].total_spent] | add / length)
}) |
.[] |
"\(.segment) Customers: \(.customers) | Revenue: $\(.total_revenue) | Avg: $\(.avg_revenue_per_customer)"
'
#!/bin/bash
orders=$(curl -s -X POST "https://www.wixapis.com/stores/v2/orders/query" \
-H "Authorization: ${API_KEY}" \
-H "wix-site-id: ${SITE_ID}" \
-H "Content-Type: application/json" \
-d '{
"query": {
"filter": "{\"paymentStatus\": \"PAID\"}",
"paging": {"limit": 1000}
}
}')
echo "Top 20 Customers by Lifetime Value"
echo "==================================="
echo ""
echo "$orders" | jq -r '
[.orders[] | {email: .buyerInfo.email, total: (.priceSummary.total | tonumber)}] |
group_by(.email) |
map({
email: .[0].email,
order_count: length,
total_spent: ([.[].total] | add)
}) |
sort_by(-.total_spent) |
.[:20] |
to_entries |
.[] |
"\(.key + 1). \(.value.email) - \(.value.order_count) orders - $\(.value.total_spent)"
'
#!/bin/bash
orders=$(curl -s -X POST "https://www.wixapis.com/stores/v2/orders/query" \
-H "Authorization: ${API_KEY}" \
-H "wix-site-id: ${SITE_ID}" \
-H "Content-Type: application/json" \
-d '{
"query": {
"filter": "{\"paymentStatus\": \"PAID\"}",
"paging": {"limit": 1000}
}
}')
echo "Purchase Frequency Distribution"
echo "==============================="
echo ""
echo "$orders" | jq -r '
[.orders[] | .buyerInfo.email] |
group_by(.) |
map(length) |
group_by(.) |
map({
orders: .[0],
customers: length
}) |
sort_by(.orders) |
.[] |
"\(.orders) order(s): \(.customers) customers"
'
#!/bin/bash
# Get fulfilled orders from last 30 days
START_DATE=$(date -u -v-30d +"%Y-%m-%dT00:00:00.000Z")
orders=$(curl -s -X POST "https://www.wixapis.com/stores/v2/orders/query" \
-H "Authorization: ${API_KEY}" \
-H "wix-site-id: ${SITE_ID}" \
-H "Content-Type: application/json" \
-d "{
\"query\": {
\"filter\": \"{\\\"fulfillmentStatus\\\": \\\"FULFILLED\\\", \\\"dateCreated\\\": {\\\"\\$gte\\\": \\\"$START_DATE\\\"}}\",
\"paging\": {\"limit\": 1000}
}
}")
# Note: This requires fulfillment timestamp data
echo "Fulfillment Performance"
echo "======================"
echo "Total fulfilled orders: $(echo "$orders" | jq '.orders | length')"
#!/bin/bash
pending=$(curl -s -X POST "https://www.wixapis.com/stores/v2/orders/query" \
-H "Authorization: ${API_KEY}" \
-H "wix-site-id: ${SITE_ID}" \
-H "Content-Type: application/json" \
-d '{
"query": {
"filter": "{\"fulfillmentStatus\": \"NOT_FULFILLED\", \"paymentStatus\": \"PAID\"}",
"sort": "{\"dateCreated\": \"asc\"}",
"paging": {"limit": 100}
}
}')
count=$(echo "$pending" | jq '.orders | length')
echo "⚠️ PENDING FULFILLMENT: $count orders"
echo ""
echo "$pending" | jq -r '.orders[] | "Order #\(.number) - \(.dateCreated | split("T")[0]) - $\(.priceSummary.total)"'
#!/bin/bash
orders=$(curl -s -X POST "https://www.wixapis.com/stores/v2/orders/query" \
-H "Authorization: ${API_KEY}" \
-H "wix-site-id: ${SITE_ID}" \
-H "Content-Type: application/json" \
-d '{
"query": {
"filter": "{\"paymentStatus\": \"PAID\"}",
"paging": {"limit": 1000}
}
}')
echo "AOV by Customer Type"
echo "===================="
echo ""
echo "$orders" | jq -r '
[.orders[] | {email: .buyerInfo.email, total: (.priceSummary.total | tonumber)}] |
group_by(.email) |
map({
email: .[0].email,
order_count: length,
total_spent: ([.[].total] | add),
avg_order_value: ([.[].total] | add / length),
segment: (if length == 1 then "First-Time" elif length <= 3 then "Occasional" else "Loyal" end)
}) |
group_by(.segment) |
map({
segment: .[0].segment,
customers: length,
avg_order_value: ([.[].avg_order_value] | add / length)
}) |
.[] |
"\(.segment): \(.customers) customers | AOV: $\(.avg_order_value)"
'
npx claudepluginhub wix/wix-ecom-cowork --plugin wix-ecom-coworkCalculates business metrics like total revenue, CLV, conversion rates, and cross-channel analytics from Wix eCommerce, Events, and Bookings APIs using bash and jq.
Read-only: parses each order's landing site and referrer URL to break down orders, revenue, and AOV by traffic source — direct, organic, paid, social, email, or referral domain.
Generates a weekly WooCommerce store performance review with revenue, orders, customers, products, attribution, refunds, and prioritised next actions.