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
/api/v1/proxy/traffic-cdkscurl -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
/api/v1/proxy/traffic-cdks/:id/secretThe CDK's plaintext value is fetched separately. The list endpoint doesn't return it, keeping it out of logs and caches.
Redeeming
/api/v1/proxy/traffic-cdks/redeemcurl -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
/api/v1/proxy/traffic-cdks/:id/cancelAn unredeemed CDK can be voided, returning the allowance to your pool.
List and metrics
/api/v1/proxy/traffic-cdks/api/v1/proxy/traffic-cdks/metricsWhen 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
trafficLimitBytesare 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.
/api/v1/affiliate/api/v1/affiliate/codeShare the link
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):
/api/v1/affiliate/convertWithdrawn as USDT:
/api/v1/affiliate/withdrawalsThree chains are supported: TRC20 / ERC20 / BEP20.
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:
pending → approved → paid
pending → rejected
/api/v1/affiliate/withdrawalsDefault parameters
| Item | Default |
|---|---|
| Minimum withdrawal | 1000 (minor currency units) |
| Commission freeze period | 7 days |
| Feature toggle | Off by default |
| Commission rate | 0 by default |
Validating a referral code
A public endpoint, used by the registration page to check validity:
/api/v1/affiliate/referrals/:codeClick counting (public, no Origin check):
/api/v1/affiliate/referrals/:code/visitsCurrency 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
/api/v1/walletReturns two groups of balances:
| Field | Meaning |
|---|---|
availableMinor | Available amount (minor units) |
reservedMinor | Reserved amount (order in progress) |
trafficRemainBytes | Traffic bytes remaining |
trafficTotalBytes | Lifetime traffic bytes purchased |
The money ledger records available and reserved values after every change, which makes reconciliation straightforward.