Skip to content

Powered by Grav CMS + Helios Theme

The partner's side

Partners run their own side of the program from an Affiliate tab in their customer account. They apply, copy their link, watch their earnings, choose how to be paid and fill in their tax form without writing to you. This page is for the store owner who wants to know what partners see and which emails go out.

Before you begin

  • The add-on is installed. See Affiliates.
  • Partners need a customer account to use the tab. Someone without one can apply from the public form, and approving them makes the account. A partner you added without one gets emails but no tab. See Customer accounts.

Who sees the tab

The tab is at /account/affiliate, under your store's address.

Customer What they see
Not a partner, and applications are open The application form.
Not a partner, and applications are closed Nothing. There's no tab.
Applied, and waiting A thanks note saying you'll email once you've decided. That includes a customer whose email address sent the public form before they signed in.
Turned down One short line saying the application wasn't accepted, and no form.
Active partner Everything below.
Paused partner Their history, payout settings and tax form. No link and no coupons, because those don't earn right now.
Closed partner Their history only.

Apply

There are two ways in, and they're the same form with the same questions:

  • Your website
  • Where you'll share us
  • How you'll promote us
  • Your code, which is optional
  • How you'd like to be paid, and a PayPal email if that's PayPal
  • A tick to accept the program terms, when you've set a Terms Page

Each email address can apply once. Someone who has already applied, including someone you turned down, sees where their application stands on the Affiliate tab, and the public form tells them they've already applied when they confirm.

Choosing a code

The Your code field is optional. The code goes at the end of their link, as in ?ref=yourcode, so the text under the field asks for something short that people will remember. Left empty, we make one from their name.

A moment after they stop typing, the form checks the code and says "yourcode is free." or says why not. That's only a hint, and the form checks again when it's sent. A code is turned away when someone else has it or once had it, when it has one of your Blocked Words in Codes (program.blocked_codes) in it, when the store keeps it for itself, or when it isn't made of letters, numbers and single dashes. The form comes back with every answer kept and the reason under the field. The code is never quietly changed into another one.

The live check allows 30 a minute for each visitor. Past that the hint stops, and the form still checks when it's sent. See Rate limit for the code check.

From their account

With Open Applications on, a signed-in customer sees the form on their Affiliate tab. It starts with "Applying as" and their name and email address from the account, and a Sign out link in case it isn't them. Sending it files the application against their customer straight away, with no email to confirm, because they're signed in.

Without an account

With Apply Without an Account on as well (it's on by default), anyone can apply from the public form at /affiliate/apply under your store's address, for example /shop/affiliate/apply. The Apply button on the program page goes there. Above the form, a line asks people who already have an account to sign in and apply with it, and signing in takes them to their Affiliate tab with the form filled in. Someone who's already signed in is sent straight there.

  1. They fill in their name and email address as well as the questions, and send it.
  2. The page says "Check your email" and we email them a link to confirm their address. The page says the same thing whatever the address is, so the form never tells anyone whether an address has an account with you.
  3. The link opens a page with a Confirm my application button. Opening the link doesn't change anything, because some mail scanners open every link in a message. Pressing the button files the application, and it waits on the Applications tab like any other.
  4. Nothing about an account happens until you decide. Approving makes the account: an address that already belongs to a customer gets the program added to that account, and they keep their password. Any other address becomes a new customer with no password yet, and the approval email has a link to choose one. Rejecting makes nothing, so there's never an account for someone you turned down.

The link works once, only the newest email's link works, and it expires after Set-Password Link Expires After in KahunaCart's account settings (account.invite_expiry_days). Only a scrambled copy of it is stored. Applications nobody confirms are deleted once their link expires.

The code they chose waits in the unconfirmed application. If someone else takes it before they confirm their email, confirming still works. They get a code made from their name instead, and the application in the admin says which code they asked for.

The form keeps scripts out without a captcha: a hidden field people never see, a few seconds' minimum between opening the form and sending it, and a limit of three applications an hour from one computer and to one email address. A form that trips any of these gets the same "Check your email" page and no email. To change the limit, set security.rate_limits.affiliate_apply in KahunaCart's settings, for example { limit: 5, window: 3600 }.

Switch Apply Without an Account off and the Apply button goes to the Affiliate tab, which asks people to sign in first. A store that keeps its customers as Grav user accounts instead of in the store database (account.db_identity off) has no public form at all: applying stays something a signed-in customer does.

Review applications

Applications wait on the Applications tab of KahunaCart → Affiliates. The tab shows how many are waiting, and a dashboard alert says so too. Each one says which kind it is, so you always know whether approving makes an account:

Label What it means Approving
Existing customer They applied while signed in. Makes them a partner on that customer. No new account.
Matches a customer They applied from the public form, confirmed their email, and the address belongs to one of your customers. Adds the program to that customer's account. They sign in with their usual password.
No account yet They applied from the public form and confirmed their email. Makes a customer account and emails a link to choose a password.

Click Approve… or Reject…, and write a message for the email if you like. Rejecting has a box for the reason and quick reasons under it: click one and its sentence goes into the box, where you can change it before you send. The quick reasons are yours to write in Quick Reasons for Rejecting on the Program tab of the settings. Without a message, the rejection email gives a short general reason. It always thanks them, asks them to reply to the email if something has changed, and says it doesn't change their account (or, for someone without one, that no account was made).

Replies go to the address your store's emails come from. If nobody reads that mailbox, set a Reply-To address in the Email plugin's settings, and partner emails use it.

With Approve Automatically on, everyone is active at once, and confirming the email is the approval for someone without an account. See Open applications.

Write the terms page

Make an ordinary page with your program terms and enter its route, such as /affiliate-terms, in Terms Page (program.terms_page). The form then links it and requires the tick. With no terms page the tick isn't shown.

Codes and requests for a new one

An active partner can ask for a different code, and you decide. The old code keeps working either way.

What the partner does

On the Overview page of the Affiliate tab they see "Your code is" and the code, with a Change code button that opens a form in place. It works with JavaScript off too. Every active partner has it, coupon-only partners included. They type a New code, which gets the same live check as the application form, and a reason under Why? (optional) if they like, then press Send.

Only one request waits at a time. While it does, the page says what they asked for and when, and that they'll be emailed once it's decided, and shows a Withdraw button. After withdrawing they can ask again. Their code doesn't change until you approve. The new code isn't held for them while they wait, so someone else could take it first.

What you do

A waiting request shows on the partner's page, above their details, and under Code requests on the Applications tab. It shows the change from the old code to the new one, with the reason, and the buttons Approve… and Reject…. The Applications tab's count and the attention list on Overview include these requests, and so does a dashboard alert, such as "3 partners asked for a new code". The alert's button is Open the request when one is waiting, which goes to that partner's page, and Open requests when several are, which goes to the Applications tab. You also get a message to you.

Click Approve… and a box asks you to confirm, with a switch for Also make a coupon for the new code. Then the partner has the new code, their old one keeps working, and they're emailed their new link. The email says their old code and coupons keep working.

Approving checks the code again, because it isn't held while the request waits. If someone has taken it since, or you've blocked a word that's in it, you're told and nothing changes. Reject the request, or change the code by hand. A partner who is closed or rejected can't be approved. Reject the request instead.

Also make a coupon for the new code makes a percent coupon with the new code in capitals, at the discount of the partner's first enabled percent coupon. It's on when they have one. Their old coupon isn't switched off or renamed. If a coupon with that code already exists, even one made a moment ago, the code still changes, the partner is still emailed, and you're told why no coupon was made.

Click Reject… and the box has an optional Message to the partner. Click Reject and they're emailed that their current code stays, with your message if you wrote one.

Change a code yourself

Open the partner's page and change Code in the Details panel. The old code keeps working here too, and the panel lists their Old codes, which all still credit the partner. Once the code is changed, the box Also make a coupon for the new code appears. The partner isn't emailed when you change a code yourself, so tell them. A code you type is never held to your blocked words. It must still be free, 3 to 32 characters, and made of letters, numbers and single dashes.

What an active partner sees

Page What's on it
Overview Ready to pay, Waiting, Paid to you and Earned, in each currency they have. Clicks and referred orders for the window. When the next payout comes: "Payouts go out once what's ready to pay reaches 50.00". Their code, with Change code. See Codes and requests for a new one.
Links Their link with a Copy button, and a builder that turns the address of any page on your site into a link of theirs. Only for partners tracked by link.
Coupons Their codes and the link that applies each code.
Commissions Each commission by order number and date, never the customer's name or email. Kinds are Order, Renewal, Adjustment, and Taken back after a refund. Statuses are Waiting, Ready to pay, Paid, Not paid and Refunded.
Payouts Each payout with its status: On its way, Paid, Waiting for you in PayPal, Came back or Didn't go through. A store credit bonus shows as "includes a bonus".
Payout settings Pay me by the methods you've switched on, a PayPal email, and Bank details. Bank details are stored encrypted. They're only shown masked.
Tax details Their tax form. See Tax details.
Banners and text The creatives you've added, when there are any.

Every form works as a plain page without JavaScript. The copy buttons and the link builder do more when JavaScript runs. The tab's look comes from KahunaCart's stylesheet tokens, follows light and dark, works on a phone, and is skipped when builtin_css is off. To change the markup, copy a template from templates/partials/kahunacart-affiliates/ into your theme at the same path.

Banners and text for partners

Give partners ready-made things to paste into their own sites.

  1. Open KahunaCart → Affiliates → Creatives and click Add creative.
  2. Choose the Kind: Banner, Text or Link.
  3. Enter a Name.
  4. For a banner, click Choose image… and pick an image from the site media, and write the Alternative text. For text, write the Text. For a link, enter the Address of a page worth linking to.
  5. Leave Show it to partners ticked and click Add creative.

Use the arrows to reorder. Disable hides one without deleting it. Partners copy a banner's embed code, which includes the right image address, and the text as it is. {link} in a text creative becomes the partner's own link. A link creative is turned into their referral link.

The public program page

To put a "Join our affiliate program" block on any page, with your rate, cookie window, renewals, holding period and payout terms and an Apply button, use one of these.

  • The shortcode
    • Commission 30% of each order you send us, after discounts and before tax and shipping
    • Cookie window 60 days: a visitor who buys within that time of clicking your link counts
    • When it's yours Each commission waits 30 days in case the order is refunded
    • Payouts By store credit or PayPal, once you're owed $50.00 or more. Take store credit and we add 20%.
    Apply now No account needed. If you already have one, you can sign in to apply with it.
    in a page's Markdown. It needs the Shortcode Core plugin.
  • {{ kahunacart_affiliate_program() }} in a theme template.
  • {% include 'partials/kahunacart-affiliates/program.html.twig' %} with program set, or your own copy of that partial in your theme.

The block reads your settings, so it changes when they do. It's the same for every visitor, so it's safe on a cached page. The Apply button goes to the public form while Apply Without an Account is on, with a line saying no account is needed, and to the Affiliate tab (which asks people to sign in first) while it's off. With applications closed, the block says so and has no button.

The emails

Each email is a row on the Notifications screen, where you can switch it off or point it at your own template. See Notifications and Emails. Partner emails go through your store's mailer and show on its email log. The owner messages go to whichever channels you tick for them.

Email Goes to Sent when
Confirm an affiliate application Applicant They apply from the public form, with a link to confirm their email. Nothing is filed until they press it, so switching this email off stops the public form working.
Affiliate application received Partner They apply and the program reviews applications.
Affiliate application approved Partner You approve them, or they join a program that approves everyone. It has their link and your message. After a public application it has a link to choose a password for their new account, or asks them to sign in as usual when they already had one.
Affiliate application declined Partner You turn them down. It has your message or a short general reason, asks them to reply if something has changed, and says what it means for their account.
Affiliate commission earned Partner A sale or renewal earns them a commission. Also needs Email on Each Commission (notifications.new_commission), which is off.
Affiliate payout sent Partner A payout is paid.
Affiliate payout failed Partner A payout fails or comes back. The money is back in their balance.
Affiliate payout waiting in PayPal Partner A PayPal payout is unclaimed, and again a week before PayPal returns it. The reminder has its own subject, which starts "Reminder:".
Affiliate tax form requested Partner You ask for their form again.
Affiliate tax form expiring Partner Their W-8 runs out within 60 days.
Affiliate tax form expired Partner Their W-8 has run out.
Affiliate monthly statement Partner Early each month, last month's commissions and payouts. Also needs Monthly Statements (notifications.statements), which is off.
Affiliate code changed Partner You approve a new code they asked for. It has their new link and says their old code and coupons keep working. If you made a coupon for the new code, it names it. A code you change yourself sends nothing.
Affiliate code request declined Partner You turn their request down. It says their current code stays, with your message if you wrote one.
New affiliate application You Someone applies or joins.
Affiliate payout batch finished You Every payout in a batch has an outcome, with failures counted.
Affiliate payouts due You Partners have reached the payout minimum. It says how many and how much, once a month, on the first day anyone is over it.
Affiliate payout problem You One payout fails, comes back or waits for the partner to claim it, or a PayPal batch is stuck or its outcome is unknown. High priority, with the partner's name, the amount and the reason in plain words.
Affiliate tax form received You A partner sends in a tax form. It names the partner and the form (W-9, W-8BEN or W-8BEN-E), and never anything written on it.
Affiliate commission earned You A sale or renewal earns a commission, such as "Theo earned $14.70 on order #1042". Starts switched off.
Affiliate commission taken back You A refund, a cancellation or moving an order to another partner takes commission back. Starts switched off.
Affiliate asked for a new code You A partner asks for a new code. It names the partner, the code they asked for and their reason, with a link to their page.

All are on, except the two commission messages for you, which start switched off, and the two partner emails marked above that also need their setting. The owner messages never include a partner's email address or any part of a tax ID, because they can end up in a chat room.

Messages to you

The messages for you are rows under Notifications → Store owner, and they go to whichever channels you ticked there, or to the ones you chose under New messages go to until you tick channels on a row yourself. The two commission messages start switched off because a busy program would send one for every sale. Switch them on from the same screen if you want to watch sales arrive, especially early on.

Email on Each Commission (notifications.new_commission) is a different switch. It only decides whether the partner is emailed.

The program has no payout day, so Affiliate payouts due is sent once a month by a daily check that stays quiet until somebody is over the minimum.

Two of the Affiliates alerts on the dashboard also reach your channels, with a row each on the same screen: PayPal Payouts not switched on (high) and Affiliate tax forms need attention (normal). You get one message when the alert starts showing and a "Cleared" message when it stops. Sending those two alerts, and starting the commission messages switched off, need KahunaCart 1.5.3 or later. On an earlier version the alerts stay on the dashboard and the commission messages start on, though with no channel ticked they go nowhere.

Partner emails are queued as jobs and read what is true when they go. An event that fires twice never mails the same thing twice, and a second payout to the same partner does mail.

Monthly statements

A partner with no customer account has nowhere to look at their numbers. Switch on Monthly Statements on the Notifications tab of the settings, and they get an email in the first week of each month with last month's commissions and payouts. Partners with nothing that month get nothing.