Any payment provider, credit partners from your server

Your server reports each signup and sale with your program API key, and Affitor finds the partner who referred the customer and writes the commission.

View as Markdown

What you need

If you take payments with Stripe Checkout or Stripe subscriptions, Sell on Stripe needs no sale calls. With Stripe connected and your server reporting too, send each payment one way only: the same purchase sent both ways can count twice.

Steps

  1. Add the tracker to your site

    It records the click when a visitor arrives through a partner link, and keeps the click id in the affitor_click_id cookie on your domain.

    Guide
  2. Get your program API key

    Program settings › Developers › API keys, where an owner selects Generate. Keep the key on your server, never in the browser.

    Guide
  3. Report the signup

    When the customer signs up, your server sends POST /api/v1/track/lead with the click_id from the cookie and your customer_key. Affitor saves the key on the customer of that click.

    Guide
  4. Report each sale

    After each payment, your server sends POST /api/v1/track/sale with the customer_key (or the click_id, for a buyer who never signed up), amount_cents and a unique transaction_id. A transaction_id sent again is answered 409 and not counted twice.

    Guide
  5. Report refunds

    When you refund a payment, send its transaction_id to POST /api/v1/track/refund, and Affitor reverses the commission. A partial refund reduces a commission already approved and cancels one still pending (in its hold period, not yet approved).

    Guide
  6. Send a test sale

    Program settings › Payments › Send a test sale shows a call to run from your server. Put your own transaction_id in it, or leave it out: an id that was already used gets 409 and records nothing. With "livemode": false it records a test sale and no commission, and the Server API card reads Received.

    Guide

Share feedback

Tell us what is missing or unclear on “Any payment provider, credit partners from your server”.

Last updated Oct 17, 2026