GET /api/v1/advertisersGET /api/v1/campaignsPOST /t
01 / Get started
Authentication
Create an API key under API keys in the portal. Select only the permissions your integration needs. The key is shown once and belongs to the account where it was created.
Keep the key on your server. Send it in the Authorization header over HTTPS, never in a link or public JavaScript. The examples read the ADTRADE_API_KEY environment variable.
Examples use this environment. Use keys, channel codes and advertiser codes from the same environment. All example values are fictional; submitting a purchase can create a real transaction.
This reference covers external integrations. The internal portal API uses a separate sign-in. A permission listed in key management does not necessarily have a corresponding external endpoint.
No endpoints match your selection.
GET/api/v1/advertisersPublisher & advertiser
Fetch advertisers
Read advertiser profiles and markets. Publishers can retrieve links for their own channel with an approved partnership.
Permission advertisers:read
Parameters
In the URL query string
Parameter / type
Description
pageintegerOptional / conditional
Page 1–1,000,000. Default: 1.
per_pageintegerOptional / conditional
1–100 rows. Default: 50. Request subsequent pages until all total rows have been read.
marketstringOptional / conditional
Two-letter market code, such as SE. Specify the market for partnerships covering multiple markets.
searchstringOptional / conditional
Search advertiser names. Maximum 100 characters.
channel_codestringOptional / conditional
Your channel’s public code. Returns links per market when the partnership allows tracking.
The response contains rows, total, page and per_page. Check status and approval_status; the list can include inactive or unapproved advertisers. channel_code requires a publisher key and an owned channel. Use the public code, not the internal channel_id.
Use tracking_url when tracking_available is true in links. Otherwise url may be an ordinary store address without attribution. Each market has its own link. A single market can also populate tracking_url on the advertiser row.
GET/api/v1/campaignsPublisher & advertiser
Fetch campaigns
Retrieve current offers and discount codes, with tracking links for eligible publisher channels.
Permission campaigns:read
Parameters
In the URL query string
Parameter / type
Description
pageintegerOptional / conditional
Page 1–1,000,000. Default: 1.
per_pageintegerOptional / conditional
1–100 rows. Default: 50. Request subsequent pages until all total rows have been read.
marketstringOptional / conditional
Two-letter market code, such as SE. Specify the market for partnerships covering multiple markets.
Only active campaigns within their validity period are shown; dates follow Swedish time. Exclusive campaigns depend on account access. Publisher responses include tracking_links, which can be empty. Advertiser responses do not include this field. Reuse the returned links and their campaign parameters.
POST/tAdvertiser
Register purchases and events
Send an event from the advertiser’s server using an advertiser key. The key must belong to the advertiser specified in the request.
Permission transactions:write
Parameters
JSON request body
Parameter / type
Description
eventstringRequired
Program event name, such as Purchase. Maximum 100 characters.
advertiserCodestringRequired
Public advertiser code (3–8 digits for events), not the internal database ID.
channelCodestringRequired
Public publisher channel code (6–8 digits for events), not the internal database ID.
orderReferencestringOptional / conditional
Required for Purchase. A stable, unique order reference per advertiser, maximum 150 characters. Reuse on retries.
amountstringOptional / conditional
Required for Purchase. Non-negative decimal string with a dot and at most two decimal places, such as 200.00. Follow the program’s order value rules.
currencystringOptional / conditional
Required for Purchase. Three letters, such as SEK. Must match the commission rule.
marketstringOptional / conditional
Two-letter market code, such as SE. Specify the market for partnerships covering multiple markets.
clickIdstringOptional / conditional
clickId from the landing URL, maximum 100 characters. Must belong to the same channel and advertiser.
clickRefstringOptional / conditional
Optional custom click reference, maximum 255 characters. Do not send personal data.
occurredAtintegerOptional / conditional
Unix timestamp in seconds. Default: receipt time. At most 7 days in the past or 5 minutes in the future.
Purchase requires orderReference, amount and currency. The channel, market, program, attribution and commission rules determine whether a transaction is created. Other event names must match the program configuration. clickId is optional in the protocol; send the value from the landing URL to link the purchase to a registered click.
200 means processing has completed; check recognized, conversion and duplicate. 202 only confirms receipt in a durable queue. receiptId is a receipt ID, not a transaction ID or a promise of commission. There is no public lookup endpoint for this ID; check the event and transaction logs in the portal.
After an uncertain network outcome or 503, retry with the same purchase data and orderReference. The same order reference for an advertiser protects against duplicate financial transactions, but additional event records can be logged. Treat 202 as received; do not resend just because the transaction is not yet visible.
GET/tPublisher
Tracking link & redirect
Send visitors to the advertiser through Adtrade. Prefer the tracking_url returned by the API or portal.
No API key · public tracking link
Parameters
In the URL query string
Parameter / type
Description
astringRequired
Public advertiser code (3–8 digits for events), not the internal database ID.
cstringRequired
Public publisher channel code (6–8 digits for events), not the internal database ID.
mstringOptional / conditional
Two-letter market code, such as SE. Specify the market for partnerships covering multiple markets.
rstringOptional / conditional
Optional custom click reference, maximum 255 characters. Do not send personal data.
HTTP/1.1 302 Found
Location: https://shop.example.com/?advertiserCode=100&channelCode=1234567&market=SE&clickId=...
Opened by the visitor’s browser without an API key. A valid partnership normally returns 302 to the advertiser’s landing page with clickId and tracking information. An invalid link may display a fallback page instead. A visit is not a purchase and does not guarantee commission. Follow the program terms and consent settings.
HTTP / JSON
Responses & errors
JSON responses are returned directly without a data envelope. Treat amounts as decimal strings. Read the response fields; a successful HTTP status does not always mean commission was created.
200
Processed. For purchases, also check conversion and duplicate.
202
Received in a queue. Business validation is pending.
302
Visitor redirected to the advertiser.
400
Invalid parameter or JSON.
401
Missing, invalid or expired API key.
403
Insufficient permission, wrong account type or unavailable account.
404
Resource not found within the account’s access.
413
Request body too large. /t allows at most 64 KiB.
422
Business rules prevent processing.
429
Too many requests. Follow Retry-After.
503
Temporarily unavailable or queue delivery unconfirmed.
429 · JSON
HTTP/1.1 429 Too Many Requests
Retry-After: 5
Content-Type: application/json
{
"error": "rate_limit_exceeded",
"retry_after": 5
}
Limits apply to API keys and IP addresses and may be adjusted by operations. On 429 or 503, follow Retry-After when present, use increasing delays and avoid parallel retries. Keep the same order reference when resending a purchase.