From wix-ecom-cowork
Assigns custom labels to Wix contacts for targeted email campaigns by querying orders API, aggregating buyer spend with jq, and filtering high-value contacts.
How this skill is triggered — by the user, by Claude, or both
Slash command
/wix-ecom-cowork:email-labelsThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Manage contact labels for email marketing when segments don't fit the criteria. Labels allow manual or programmatic tagging of contacts for campaign targeting.
Manage contact labels for email marketing when segments don't fit the criteria. Labels allow manual or programmatic tagging of contacts for campaign targeting.
df7c18eb-009b-4868-9891-15e19dddbe67${API_KEY}${SITE_ID}Labels in Wix use format: custom.label-name
Examples:
custom.itay-test1custom.high-value-customerscustom.recent-buyerscustom.vip-2024Endpoint: POST https://www.wixapis.com/contacts/v4/contacts/query
Query contacts based on criteria, then assign labels:
curl -X POST "https://www.wixapis.com/contacts/v4/contacts/query" \
-H "Authorization: ${API_KEY}" \
-H "wix-site-id: ${SITE_ID}" \
-H "Content-Type: application/json" \
-d '{
"query": {
"filter": {},
"paging": {
"limit": 100,
"offset": 0
}
}
}'
Response:
{
"contacts": [
{
"id": "contact-123",
"emailAddress": "[email protected]",
"firstName": "John",
"lastName": "Doe",
"labels": ["custom.vip", "custom.newsletter"]
}
],
"metadata": {
"count": 100,
"total": 523
}
}
Find contacts who meet USER'S criteria (spend amount and timeframe from user request):
# Get orders from last week
DAYS_AGO=7
START_DATE=$(date -u -v-${DAYS_AGO}d +"%Y-%m-%dT00:00:00.000Z" 2>/dev/null || date -u -d "${DAYS_AGO} days ago" +"%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\": \"{\\\"dateCreated\\\": {\\\"\\$gte\\\": \\\"$START_DATE\\\"}, \\\"paymentStatus\\\": \\\"PAID\\\"}\",
\"paging\": {\"limit\": 1000}
}
}")
# Aggregate by customer email, filter by spend
high_spenders=$(echo "$orders" | jq -r '
[.orders[] | {email: .buyerInfo.email, total: (.priceSummary.total | tonumber)}] |
group_by(.email) |
map({
email: .[0].email,
totalSpent: ([.[].total] | add)
}) |
map(select(.totalSpent >= 100)) |
.[].email
')
echo "Found $(echo "$high_spenders" | wc -l) high spenders"
contact_ids=()
echo "$high_spenders" | while read -r email; do
contact=$(curl -s -X POST "https://www.wixapis.com/contacts/v4/contacts/query" \
-H "Authorization: ${API_KEY}" \
-H "wix-site-id: ${SITE_ID}" \
-H "Content-Type: application/json" \
-d "{
\"query\": {
\"filter\": \"{\\\"emailAddress\\\": \\\"${email}\\\"}\"
}
}")
contact_id=$(echo "$contact" | jq -r '.contacts[0].id // empty')
if [ -n "$contact_id" ]; then
echo "$contact_id"
fi
done > /tmp/contact_ids.txt
contact_count=$(cat /tmp/contact_ids.txt | wc -l)
echo "✓ Found ${contact_count} contact IDs"
LABEL_ID="custom.high-spenders-last-week"
echo "🏷️ Assigning label '${LABEL_ID}' to ${contact_count} contacts..."
assigned=0
cat /tmp/contact_ids.txt | while read -r contact_id; do
# Update contact to add label
curl -s -X PATCH "https://www.wixapis.com/contacts/v4/contacts/${contact_id}" \
-H "Authorization: ${API_KEY}" \
-H "wix-site-id: ${SITE_ID}" \
-H "Content-Type: application/json" \
-d '{
"contact": {
"info": {
"labelKeys": {
"add": ["'"${LABEL_ID}"'"]
}
}
}
}' > /dev/null
assigned=$((assigned + 1))
echo " ✅ Contact ${assigned}/${contact_count}"
sleep 0.1
done
echo "\n✅ Labeled ${assigned} contacts with '${LABEL_ID}'"
Format: custom.descriptive-name
Good Examples:
custom.vip-customers-2024custom.abandoned-cart-last-weekcustom.spent-{amount}-plus (amount from user criteria)custom.repeat-buyerscustom.new-subscribersBad Examples:
custom.label1custom.testcustom.abcCustomers who spent ${USER_AMOUNT}+ in last ${USER_DAYS} days:
Note: USER_AMOUNT and USER_DAYS come from user's request, not hardcoded!
LABEL_ID="custom.recent-big-spenders"
MIN_SPEND=200
DAYS=14
# Query orders → filter by spend → get emails → get contact IDs → assign label
Customers who added to cart but didn't purchase:
LABEL_ID="custom.cart-abandoners-feb"
# Query cart abandonment events
# Get contact IDs
# Assign label
Customers who bought from specific category:
LABEL_ID="custom.electronics-buyers"
CATEGORY_ID="electronics-cat-id"
# Query orders with products from category
# Extract buyer emails
# Get contact IDs
# Assign label
CONTACT_ID="contact-123"
LABEL_TO_REMOVE="custom.old-label"
curl -X PATCH "https://www.wixapis.com/contacts/v4/contacts/${CONTACT_ID}" \
-H "Authorization: ${API_KEY}" \
-H "wix-site-id: ${SITE_ID}" \
-H "Content-Type: application/json" \
-d '{
"contact": {
"info": {
"labelKeys": {
"remove": ["'"${LABEL_TO_REMOVE}"'"]
}
}
}
}'
npx claudepluginhub wix/wix-ecom-cowork --plugin wix-ecom-coworkUpdates Wix email campaign recipients using segments, labels, contact IDs, or filters via the Wix Email Marketing API PATCH endpoint. Useful for dynamic audience management in campaigns.
Segments high-LTV Shopify customers by order count and lifetime spend, tags them, and exports a loyalty-ready contact list.
Automates ecommerce marketing workflows via Omnisend through Composio: create/update contacts, list with cursor pagination, get details, and update profiles.