Product
Publishers
Advertisers
Networks
Help
Pause animations
Browse help topics
How-to Network

Network API and postbacks

Updated

View as Markdown

Your server pulls every offer your network can run from GET /network-api/offers, with your network key in the x-api-key header. You send each user to the offer’s trackingUrl with their ID in sub_id. When one converts, we send a GET request to your postback URL with that ID and what you earned.

See also: Run your own affiliate network

On this page

Steps

  1. Workspace settings, then API Keys, then Generate Key

    The key starts with ak_ and is shown once. Expires shows the date it stops working, 90 days after you generate it by default, so rotate before then. The line above the list, such as “Used 1 / 1 keys”, shows your limit. With a free slot, generate the new key, move your server to it, then Remove the old one. At the limit, Remove the old key first, then generate, and expect a short gap. Create, rotate and revoke API keys has the details.

  2. Fetch offers

    Shell
    curl -G "https://affiliateos.xyz/network-api/offers" \
      -d country=US -d platform=ios \
      -d page=1 -d per_page=50 \
      -H "x-api-key: $NORTHFOLD_NETWORK_KEY"

    Example for Northfold Media. The offers come back in data.offers, and paging details in data.pagination. Pages hold 50 offers unless you set per_page; keep asking for the next page while has_more_pages is true. /publisher-api/offers is the same route under its older name.

  3. Each offer’s trackingUrl already carries the offer in off_id and your network in pub_id. Leave both as they are. Replace {SUB_ID} with your user’s ID, a different value for every user, and {DEVICE_ID} with the device’s advertising ID when you have it: advertisers attribute and approve more conversions with it. Left as it is, {DEVICE_ID} is dropped and the click still works.

  4. Workspace settings, then Postback Configuration

    Paste your URL into Postback URL and choose Save Changes. Use HTTPS: every postback carries your user’s ID.

  5. Generate Webhook Secret

    Choose Generate Webhook Secret and copy it. It starts with ps_ and is shown once. From then on every postback carries a verifier: the HMAC-SHA256 of the full URL up to &verifier=, keyed with your secret. Recompute it on your server and refuse any request that doesn’t match.

  6. Check it worked

    Choose Test Postback. Your server gets a request with test=true added: log it and don’t credit anyone. A passing test proves your URL is reachable, not that live conversions are flowing. After the first real conversion, Reporting, then Flight Recorder shows its timeline through to your postback.

What each postback carries

ParameterWhenMeaning
action_idAlwaysUnique ID of this conversion
sub_idAlwaysThe user ID you put on the tracking link
offer_idAlwaysThe offer that converted
statusAlwayscompleted or reversed
payoutAlwaysWhat your network earns for this conversion, in USD
conversion_nameAlwaysThe step’s name, or the offer’s name when it has no separate steps
clicktimestampAlwaysWhen the click happened. The format varies and it can be empty, so parse it loosely.
is_offer_completeAlwaystrue when no steps are left
goal_idOffers with several stepsWhich step this was
offer_nameWhen the offer resolvesThe offer’s title. Store it: an ended offer can’t be looked up later.
user_payoutWhen the offer sets a player rewardThe player’s reward for this step, in USD
verifierWith a webhook secretThe signature above
testTests onlytrue

Offers with several steps send one postback per step, each with its own action_id and payout.

Answer every postback

  • Reply with HTTP 200.
  • Keep each action_id with its status. A repeat of a postback you already handled changes nothing; status=reversed means take back what you credited for it.
  • Credit user_payout to the player when it’s present.

The full reference, with Node and curl samples, is in the Network API docs.

Support

Still stuck? Write to us.

One address for every question: hello@affiliateos.ai. Put the details from this list in your first message so we can find the click or conversion without asking you for them again.

Put these in your message

  1. 01The email you sign in with
  2. 02Your role: publisher, advertiser or network
  3. 03The offer ID
  4. 04The click ID or action_id
  5. 05The time it happened, with your time zone
  6. 06What you expected to happen

Looking for a reward in an app? Ask that app's support. It credits your reward, so only it can see your balance.

Search help