Skip to main content

Before you start: your credentials

Once we set up your account, your credentials appear in the Aeris console under Affiliate → Integration. You’ll use these five values throughout:
ValueWhat it’s for
api_keyIdentifies you. Goes in the X-Merchant-Key header on every server call. Looks like mk_ followed by 32 characters.
hmac_secretYour signing key. Shown once — copy it into your secret manager right away. We can’t recover it; if you lose it, generate a new one.
advertiser_idYour id for the tracking script (the cb('init', …) call).
s2s_endpoint_baseThe base URL for server calls, e.g. https://realry.com/api/v1/direct.
test_credentialMarks a sandbox key. Orders sent with a sandbox key run through the whole flow but never pay anyone — use it to test safely.
We give you a sandbox key first so you can test end to end, then a live key once you’re ready.

Quickstart

Three steps. Do them in order and the integration is done.
1

Add the tracking script to every page

Put this in the <head> of every page on your site:
<script async src="https://ads.realry.com/cb.js"></script>
<script>
  window.cb = window.cb || function(){(window.cb.q=window.cb.q||[]).push(arguments)};
  cb('init', 'YOUR_ADVERTISER_ID');
  cb('event', 'page_view');
</script>
On your order-confirmation page, also fire a purchase event:
<script>
  cb('event', 'purchase', {
    transaction_id: 'ORDER_ID',
    value: 49900,
    currency: 'KRW',
    items: [{ item_id: 'sku-7', price: 49900, quantity: 1 }]
  });
</script>
Single-page checkout? Add cb('config', { auto_spa_pageview: true }); once after init. To debug, add ?cb_debug=1 to any URL and watch the browser console, or run cb('status').
2

Save the click id from the creator's link

When a shopper arrives from a creator, their URL carries a cb_aev value:
https://shop.example.com/products/123?cb_aev=ABC123
That cb_aev is the click id — it’s how we know which creator to credit. The tracking script saves it automatically, but you also need to store it on the order so your server can send it back in Step 3. (Do it yourself because the browser pixel can’t always fire — but your server always can.)
3

Report the order from your server

The moment payment actually completes, have your server send a signed call. This is the call that credits the creator and settles commission:
BASE="https://realry.com/api/v1/direct"
API_KEY="mk_your_key"; SECRET="your_hmac_secret"
TS=$(date +%s)
BODY='{"merchant_order_id":"order-1","event_id":"evt-1","amount":49900,"currency":"KRW","cb_aev":"ABC123","product_name":"Silk Blouse"}'
SIG=$(printf '%s' "${TS}${BODY}" | openssl dgst -sha256 -hmac "$SECRET" | sed 's/^.* //')

curl -sS -X POST "$BASE/conversions" \\
  -H "X-Merchant-Key: $API_KEY" \\
  -H "X-Signature-Timestamp: $TS" \\
  -H "X-Signature: $SIG" \\
  -H "Content-Type: application/json" \\
  --data "$BODY"
# → {"data":{"status":"CONFIRMED","net_amount":49900,...}}
That’s the whole integration. Don’t want to build the signature by hand? Copy a ready-made helper for PHP, Node, Python, or curl from the Reference.
Test everything with your sandbox key first, then switch to the live key.