Set up a store affiliate program
Connect a Shopify, WooCommerce or BigCommerce store in one API call: webhooks, tracking script, product catalog and a starter rate card.
If you sell products through Shopify, WooCommerce or BigCommerce, one call connects the store to a program. You use your own store credentials: Referalli has no app keys of its own and never needs a platform app install.
A listed Shopify App Store app (one-click install) would need a Shopify Partner account and Referalli app credentials. That is not available yet, so the steps below use a token you create in your own store.
1. Create a token in your store
- Shopify
In the Shopify admin, open Settings, Apps and sales channels, Develop apps and create an app. Grant these Admin API scopes:
read_orders,read_productsandwrite_script_tags. Install it, then copy the Admin API access token (shpat_…) and the app's client secret, which signs the webhooks. - WooCommerce
In WooCommerce, Settings, Advanced, REST API add a key with Read/Write permission. Copy the consumer key (
ck_…) and consumer secret (cs_…). The store must be served overhttps://. - BigCommerce
In Settings, API, Store-level API accounts create an account with Orders read-only, Products read-only, Content modify and Information and settings read-only. Copy the API token. The store hash is the part of the API path after
stores/.
2. Make the call
Create the program first (or use an existing one), then call store setup with an API key:
curl -X POST https://referalli.com/v1/programs/$PROGRAM_ID/store-setup \
-H "Authorization: Bearer $REFERALLI_KEY" -H "Content-Type: application/json" \
-d '{
"provider": "shopify",
"shop": "your-store.myshopify.com",
"credentials": { "accessToken": "shpat_…", "apiSecret": "…" }
}'For WooCommerce send "shop": "https://your-store.com" with consumerKey and consumerSecret. For BigCommerce send the store hash as shop with apiToken. Your credentials are used for this call only (BigCommerce's token is kept, sealed, so orders can be read).
The call is safe to repeat. It reuses the connection and webhooks, finds the script already added, refreshes the catalog and never replaces an existing commission rule.
3. Read the checklist
The answer lists each step with ok and a detail. GET /v1/programs/{id}/store-setup shows the same list from the current state.
Step | What it did |
|---|---|
| Created or reused the store's billing connection for this program. |
| Registered the order and refund webhooks, so paid orders become commissions and refunds reverse them. |
| Added |
| Pulled your products so partners can search them and get product links. |
| Published a starter rate card as a draft. |
A step with ok: false never stops the others. It says what to fix, usually a missing token scope. Fix it and call again.
4. Review the rate card
The general_retail preset is a draft: it accrues nothing and is hidden from partners until you publish it. It pays 8% on apparel and beauty, 5% on home and toys, 4.5% on books, 3% on electronics, 2.5% on computers, 2% on grocery and 4% on any other category, holds commissions 30 days, and excludes gift cards. Items other than the linked product earn no indirect rate.
Edit the rates to fit your margins, then publish them without draft:
curl -X PUT https://referalli.com/v1/programs/$PROGRAM_ID/commission-rule \
-H "Authorization: Bearer $REFERALLI_KEY" -H "Content-Type: application/json" \
-d '{ "config": { "base": { "kind": "percent", "bps": 400 }, "holdDays": 30,
"rateCard": { "rates": { "apparel": 800, "electronics": 300 }, "defaultBps": 400, "exclude": ["gift_cards"] } } }'Pass "rateCardPreset": "none" in step 2 to skip the preset. If the program already has a rule, setup leaves it alone. See commission rules for every field.