Zapier
Sprout Affiliate on Zapier sends your affiliate program's events to Google Sheets, Mailchimp, Klaviyo, Slack, and the other apps on Zapier, the moment they happen. Its actions approve and decline applications, approve and reject referral orders, add bonuses, and change an affiliate, from a Zap.
Connecting
- In Shopify, open Sprout Affiliate > Settings > Developer.
- In the API keys card, name the key Zapier, choose Read and write, and press Create API key. Copy the key now: it is shown once.
- In the Zapier card on the same page, press Connect in Zapier, sign in to Zapier, and accept the invite. Sprout Affiliate is then in your Zapier account.
- In Zapier, start a Zap, search for Sprout Affiliate, and pick a trigger or an action.
- Press Sign in, paste the key, and press Yes, Continue. The connection is named after your store.
Triggers need Read and write: turning a Zap on adds its webhook endpoint to your store. A key belongs to one store, so a second store is a second key and a second connection.
Triggers
Every trigger is instant. Sprout Affiliate posts to Zapier when the event happens, signed and retried like any webhook.
| Trigger | Runs when |
|---|---|
| New Affiliate | Someone signs up as an affiliate, or you add one. |
| Affiliate Approved | An affiliate is approved and can start earning commission. |
| New Referral Order | An order placed through an affiliate's link or discount code comes in. |
| Referral Order Approved | A referral order is approved, so its commission is owed in the next payout. |
| Referral Order Rejected | A referral order is rejected, so no commission is paid on it. |
| Payout Paid | A payout is sent or recorded as paid. It runs once for each affiliate in the payout. |
| New Bonus | An affiliate is granted a bonus. |
The fields each one carries:
- Affiliate triggers: Affiliate Ref, Name, Email, Status, Program, Program Name, Discount Code, Commission Rate, Payout Method, Payout Details on File, and Joined.
- Referral order triggers: Order ID, Order Number, Affiliate Ref, Affiliate Name, Sale, Commission, Status, Currency, and Ordered At. Referral Order Approved and Referral Order Rejected leave Sale, Commission, and Ordered At blank: they run the moment you decide, before the order is priced. Use New Referral Order for the amounts.
- Payout Paid: Payout Batch ID, Paid At, Paid Via, Affiliate Ref, Affiliate Name, Payout Method, Paid To, Amount Paid, the tax on it where one applies, Lines Paid, and Bonuses Paid.
- New Bonus: Bonus ID, Affiliate Ref, Affiliate Name, Amount, Note, and Currency.
Every trigger also carries Event, Event ID, and Event Time. While you build the Zap, the sample is a recent record from your store.
Actions
| Action | What it does |
|---|---|
| Approve Affiliate Application | Approves a pending application and emails the affiliate. Takes the Affiliate Ref. |
| Decline Affiliate Application | Declines a pending application, removes it, and emails the applicant. Takes the Affiliate Ref. |
| Approve Referral Order | Approves a pending referral order. Its commission is paid in the affiliate's next payout. Takes the Order ID from a referral order trigger, or the Shopify order number. |
| Reject Referral Order | Rejects a pending referral order, so no commission is paid on it. Takes the same Order ID. |
| Add Bonus | Grants an active affiliate a one-off bonus, paid in the next payout. Takes the Affiliate Ref, an amount in your store's currency, and an optional note. |
| Record Custom Event | Records a custom event, such as a booked call or an app signup, and the affiliate earns the amount the program pays for it. Takes the event's key, the Affiliate Ref or a click number, and your own Event ID, which is paid once ever, so a Zap that runs twice never pays twice. See Custom events. |
| Update Affiliate | Changes an active affiliate's commission rate, pauses or reactivates the affiliate, or replaces your private note. Only the fields you fill in change. |
No action starts a payout. Anything a Zap approves or adds is owed to the affiliate and paid in your next payout, including an automatic one.
Find Affiliate
Finds an affiliate by Affiliate Ref or by email address, and returns the affiliate's fields, your private note, and what the affiliate is owed: Pending Commission, Approved Commission, Paid to Date, and Unpaid Bonuses. Pending and Approved are blank when your live Shopify orders could not be read at that moment.
Zaps to start with
- New Referral Order → Google Sheets: add a row for every referral order.
- Affiliate Approved → Mailchimp or Klaviyo: add the affiliate to a list.
- Payout Paid → Slack: post who was paid and how much.
- A form tool's new response → Find Affiliate by email → Add Bonus.
- A booking or form tool's new entry that carries the affiliate's ref in a hidden field → Record Custom Event, with the entry's ID as the Event ID.
Where Zaps show in Sprout Affiliate
Turning on a Zap with a Sprout Affiliate trigger adds an endpoint to Settings > Developer > Webhooks, labeled Zapier, with its deliveries and a Replay button for any that failed. Turning the Zap off removes it. Deleting it in Settings stops that Zap's trigger until the Zap is turned off and on again.
A store has ten webhook endpoints, and each Zap with a Sprout Affiliate trigger uses one. The phone app lists them too.
Revoking the key in Settings > Developer > API keys disconnects Zapier at once and removes the endpoints its Zaps added.
Troubleshooting
- "The API is on the Professional plan". The store is below Professional. The connection works again as soon as the plan does.
- "This key is read only". Create a Read and write key and reconnect Sprout Affiliate in Zapier with it.
- "Invalid API key". The key was revoked or mistyped. Create a new one and reconnect.
- "You can have 10 endpoints". Delete an endpoint in Settings > Developer > Webhooks, or turn off a Zap you no longer use, then turn this one on again.
- A trigger never runs. Check that its endpoint is still in Settings > Developer > Webhooks. If it is not, turn the Zap off and on.
- "That order isn't on this store", or a 409 on an order. Only a pending referral order can be approved or rejected, and the Order ID has to be one from this store.