Server-side influencer tracking API

Report orders to Yonto from your own backend: the order reaches us without a browser, so consent prompts and ad blockers can't stop it, and a click kept against a signed-in customer survives a change of device.

How do I track influencer sales from my own backend?#

Browser tracking loses shoppers in predictable ways: they refuse cookies, run an ad blocker, or click an influencer's link on their phone and buy on a laptop. Your backend sees every order regardless, which makes it the most complete place to report from. Crediting one of those orders to a creator's click still needs the click id: you keep it against the customer, so it survives a change of device once they sign in.

Building influencer tracking yourself means storing each click, matching orders to it, handling coupons, refunds and currencies, and producing a report someone outside engineering can read. UTM parameters solve the first step and none of the rest.

With Yonto's server-side API, your backend keeps the click id from the tracked link and posts the order when it is paid, with a secret API key. Coupon-only orders count too: when a shopper uses an influencer's code without clicking, your code reports the order against that influencer's campaign. Yonto does the rest of the creator attribution — each influencer's sales against their fee. The endpoint is v0, and not yet a stable public contract.

Track influencer sales from your own backend with Yonto
One tracked link per influencer, and each one's sales set against what you paid them.
Start free

How it works from your own backend#

Yonto credits each sale to the individual influencer who drove it — creator attribution. From your own backend, there are two ways it reaches us, and the server-side api does most of the work:

Server-side API — primary on this platform
Your backend reports the order to our API with a secret key. The most reliable path, and the most work.
Discount code
The shopper types the creator's code at checkout. Credited where the order reaches us with its codes — from Shopify, or from your own server — and then it survives a refused cookie. A browser-only setup cannot see it.

Setting it up#

Every campaign has its own tracking code. The snippets below use YOUR_TRACKING_CODE as a placeholder — copy the real ones from the campaign's Setup screen, which fills them in for you.

Conversions are reported from: Your order-processing code.

  1. 1
    Create an API key
    Settings → API keys. The secret is shown once and stored only as a hash, so if you lose it you create another rather than recovering it.
  2. 2
    Capture the click id
    The tracked link lands on your site with ?ref=<click_id>. Persist it with the session or the cart so it is still available when the order is placed.
  3. 3
    POST the conversion when the order is paid
    From your backend, never from the browser — the key must not reach a page.
    bash
    curl -X POST https://yontosales.com/api/v0/conversions \
      -H 'Authorization: Bearer yonto_sk_your_key' \
      -H 'Content-Type: application/json' \
      -d '{
        "tracking_code": "YOUR_TRACKING_CODE",
        "order_id": "ORDER-1234",
        "order_value": 49.90,
        "currency": "GBP",
        "click_id": "the ref you captured"
      }'
  4. 4
    POST each refund
    Name the sale by the order_id it was reported with. Without an amount, the refund is whatever of the sale is left. See the server API reference for every response.
    bash
    curl -X POST https://yontosales.com/api/v0/conversions \
      -H 'Authorization: Bearer yonto_sk_your_key' \
      -H 'Content-Type: application/json' \
      -d '{
        "kind": "refund",
        "order_id": "ORDER-1234",
        "refund_id": "REFUND-5678",
        "amount": 20.00
      }'

What this can and cannot see#

Attribution is never complete, on any platform. You are about to pay a creator on the strength of these numbers, so here is exactly what is behind them from your own backend.

Counted
  • Every order your backend knows about. It reaches us without a browser, so nothing in the shopper's browser can stop it.
  • A purchase on another device from the click, when the shopper signs in: you keep the click id against their account, not in a browser.
  • Orders your server reports — including ones that used the creator's discount code, whatever the shopper's cookie settings.
  • Refunds, if you report them.
Not counted
  • Any order your own code does not tell us about. This path is exactly as complete as your integration.
  • Clicks you failed to persist — if ?ref is dropped at the session boundary, the sale is credited only if your own code matches its coupon to the campaign.

This is why every figure Yonto reports is described as a confident floor rather than a total. The sales in the right-hand column happened; we simply cannot prove the creator caused them, and we would rather undercount than invent.

Worth knowing#

  • This endpoint is v0. It is not yet a stable public contract. We tell the people using it before it changes, except where a security or legal fix can't wait.

Making it more accurate#

  • Ask the influencer to lead with the discount code. From your own backend it is credited even when a shopper refuses cookies, and it converts better anyway.
  • Report refunds. Server-side API does not tell us when you refund an order. A refunded sale stays counted until your server reports the refund through the server API, naming the order id the sale was sent with.
  • Use one discount code per campaign. Codes are matched before click ids, and a code shared across campaigns resolves to whichever matches first.