Running an affiliate program should not turn into a second technical project. The requirements are usually short: know where an order came from, pay a rate you can explain, put your own brand on the page affiliates see, and get all of it live without a sprint. This post goes through each part and then shows the actual request you need to send.

Tracking that is right, not just present

Two events matter. A click tells you a visitor arrived through an affiliate link, which is what your affiliate stats are built from. A conversion tells you an order completed, which is what commission is calculated from. Afflixo records the click with IP, user agent, and referrer, and it validates the conversion against the merchant in the URL before it accepts one.

The part that quietly matters is deduplication. Payment webhooks retry, and a retry that creates a second conversion means you pay twice for one sale. Afflixo deduplicates on the order id inside your program, so sending the same order id again returns the conversion that already exists rather than creating another. You do not need to send anything extra to get that behaviour; you just need order ids that are unique in your own system.

Commission rules you can explain to an affiliate

Three settings cover almost every program:

  • A percentage of the order.
  • A fixed amount per sale.
  • A rate on one affiliate, for the partner you negotiated with separately.

You set a default for the program and override it where you need to. Where both exist, the rate on the affiliate wins. Scope is separate from rate: first order only, first N orders, or a time window.

A recruitment page you can change without a developer

The page affiliates land on is usually the first thing they see of you, and it dates quickly: the offer changes, the rate changes, the screenshot gets old. If changing a headline means a ticket for a developer, the page stops being updated.

So the promotion page is edited in a visual editor. Text, images, headings, buttons, FAQ entries, and colours, with optional custom CSS if somebody on your team wants it. What you see in the editor is what the live page shows, and there is no deployment step in between.

Affiliates and payouts in one place

You need to see who is in the program and how they are doing, approve or reject the people applying, and know what you owe. Afflixo puts affiliates, conversions, commission, and payout requests in the merchant dashboard, all scoped to your own program.

It stops short of moving money. An affiliate requests a withdrawal, you approve it, and you pay them the way you already pay people. The commission is then marked as settled so it cannot be approved twice. That is a deliberate limit, not a missing feature: it keeps you in control of when money leaves.

The integration

Your merchant slug identifies you on the tracking endpoints, so there is no API key to manage. Take it from your dashboard.

When an order completes and you know it came from an affiliate, call this once from your backend:

POST /api/<merchantSlug>/track/conversion
Content-Type: application/json

{
  "orderId": "ORD-12345",
  "amount": 99.00,
  "currency": "USD",
  "affiliateCode": "ABC123"
}
  • orderId is your own order id. It is what deduplication keys on, so it has to be unique on your side.
  • amount is the figure commission is calculated from, which does not have to be the order total if you pay on a subtotal.
  • affiliateCode is optional if the visitor already has the affiliate_ref cookie, which the referral link sets. You can also send it in the x-affiliate-code header. If none of the three is present the request is rejected, because there is nobody to credit.

The response carries the calculated commission and its status. That is the whole required integration.

Click reporting is optional and looks like this:

POST /api/<merchantSlug>/track/click
Content-Type: application/json

{ "affiliateCode": "ABC123" }

Skipping it costs you click statistics and nothing else; commission still works.

Where this fits and where it does not

If you need multi-tier commissions, a custom domain per merchant, automatic payouts through PayPal or Stripe, or currencies other than USD, Afflixo does not do those today. If what you need is the list above, the integration is one endpoint and you can read the exact spec in the developer docs.