Skip to content
NextProxyNextProxyDocs

Traffic CDKs and affiliate commission

Turning traffic allowance into transferable redemption codes, and how affiliate commission is earned, frozen and withdrawn.

Two features related to distributing traffic and earning revenue: CDKs transfer allowance to someone else, and the affiliate programme pays commission on referrals.

Traffic CDKs

A CDK is a transferable traffic voucher. Generating one debits your traffic pool; redeeming it credits the recipient's.

Parameters

The face value of a single CDK.

Unredeemed after the validity period, it expires.

The rate limit on the redemption endpoint. Exceeding it returns 429.

Generating

POST/api/v1/proxy/traffic-cdks
shell
curl -X POST 'https://api.example.com/api/v1/proxy/traffic-cdks' \
  -H 'Authorization: Bearer at_YOUR_ACCESS_TOKEN' \
  -H 'Origin: https://console.example.com' \
  -H 'Content-Type: application/json' \
  -d '{"trafficBytes": 10737418240, "validDays": 7}'

10737418240 is 10 GB.

Revealing the plaintext

GET/api/v1/proxy/traffic-cdks/:id/secret

The CDK's plaintext value is fetched separately. The list endpoint doesn't return it, keeping it out of logs and caches.

Redeeming

POST/api/v1/proxy/traffic-cdks/redeem
shell
curl -X POST 'https://api.example.com/api/v1/proxy/traffic-cdks/redeem' \
  -H 'Authorization: Bearer at_YOUR_ACCESS_TOKEN' \
  -H 'Origin: https://console.example.com' \
  -H 'Content-Type: application/json' \
  -d '{"code":"CDK_CODE_HERE"}'

Voiding

POST/api/v1/proxy/traffic-cdks/:id/cancel

An unredeemed CDK can be voided, returning the allowance to your pool.

List and metrics

GET/api/v1/proxy/traffic-cdks
GET/api/v1/proxy/traffic-cdks/metrics

When to use a CDK

Good fit

  • Reselling traffic to downstream customers
  • Handing allowance to team members without provisioning sub-accounts
  • Promotional rewards and trial grants

Poor fit

  • Allocating allowance internally — sub-accounts with trafficLimitBytes are more direct and give you separate usage statistics

Affiliate commission

How it works

Get your referral code

Every user has a unique referral code and a matching /r/:code link.

GET/api/v1/affiliate
PUT/api/v1/affiliate/code

Clicks are aggregated by UTC calendar day.

The referred user makes a purchase

Commission is generated. The rate comes from platform settings.

Commission unfreezes

Commission starts in frozen and becomes available after the freeze period, which defaults to 7 days.

There is also a reversed state — commission is clawed back when the referred user gets a refund.

Withdraw or convert to wallet

Two destinations, covered below.

Where commission can go

Into the wallet (usable directly for buying traffic):

POST/api/v1/affiliate/convert

Withdrawn as USDT:

POST/api/v1/affiliate/withdrawals

Three chains are supported: TRC20 / ERC20 / BEP20.

shell
curl -X POST 'https://api.example.com/api/v1/affiliate/withdrawals' \
  -H 'Authorization: Bearer at_YOUR_ACCESS_TOKEN' \
  -H 'Origin: https://console.example.com' \
  -H 'Content-Type: application/json' \
  -d '{"amountMinor": 5000, "network": "TRC20", "address": "YOUR_USDT_ADDRESS"}'

Withdrawal state transitions:

text
pending → approved → paid
pending → rejected
GET/api/v1/affiliate/withdrawals

Default parameters

ItemDefault
Minimum withdrawal1000 (minor currency units)
Commission freeze period7 days
Feature toggleOff by default
Commission rate0 by default

Validating a referral code

A public endpoint, used by the registration page to check validity:

GET/api/v1/affiliate/referrals/:code

Click counting (public, no Origin check):

POST/api/v1/affiliate/referrals/:code/visits

Currency units

Wallet and commission amounts are expressed in minor currency units, denominated in USD. So 5000 means 50.00 dollars.

Don't use floating point for money in your code; work in integer cents.

Wallet

GET/api/v1/wallet

Returns two groups of balances:

FieldMeaning
availableMinorAvailable amount (minor units)
reservedMinorReserved amount (order in progress)
trafficRemainBytesTraffic bytes remaining
trafficTotalBytesLifetime traffic bytes purchased

The money ledger records available and reserved values after every change, which makes reconciliation straightforward.

Did this page solve your problem?