BUILD WITH ADTRADE

Your partnerships. Your integration.

Fetch advertisers and campaigns, create tracking links and register purchases from your own integration.

Manage API keys
HTTP · JSON · API v1
Base URL https://adtrade.io
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.

HTTP headers
Authorization: Bearer $ADTRADE_API_KEY
Accept: application/json

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.

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 / typeDescription
pageintegerOptional / conditionalPage 1–1,000,000. Default: 1.
per_pageintegerOptional / conditional1–100 rows. Default: 50. Request subsequent pages until all total rows have been read.
marketstringOptional / conditionalTwo-letter market code, such as SE. Specify the market for partnerships covering multiple markets.
searchstringOptional / conditionalSearch advertiser names. Maximum 100 characters.
channel_codestringOptional / conditionalYour channel’s public code. Returns links per market when the partnership allows tracking.
Example · cURL
curl --get "https://adtrade.io/api/v1/advertisers?market=SE&page=1&per_page=50" \
  --header "Authorization: Bearer $ADTRADE_API_KEY" \
  --header "Accept: application/json"
200 · Example response · excerpt
{
    "rows": [
        {
            "id": 4,
            "advertiser_code": "100",
            "name": "Example Store",
            "status": "active",
            "approval_status": "approved",
            "website_url": "https://shop.example.com",
            "tracking_url": null,
            "links": []
        }
    ],
    "total": 1,
    "page": 1,
    "per_page": 50
}

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 / typeDescription
pageintegerOptional / conditionalPage 1–1,000,000. Default: 1.
per_pageintegerOptional / conditional1–100 rows. Default: 50. Request subsequent pages until all total rows have been read.
marketstringOptional / conditionalTwo-letter market code, such as SE. Specify the market for partnerships covering multiple markets.
Example · cURL
curl --get "https://adtrade.io/api/v1/campaigns?market=SE&page=1&per_page=50" \
  --header "Authorization: Bearer $ADTRADE_API_KEY" \
  --header "Accept: application/json"
200 · Example response · excerpt
{
    "rows": [
        {
            "id": "12",
            "advertiser_id": "4",
            "advertiser_name": "Example Store",
            "description": "10% discount",
            "discount_code": "EXAMPLE10",
            "markets": [
                "SE"
            ],
            "tracking_links": [
                {
                    "channel_code": "1234567",
                    "channel_name": "Example Channel",
                    "market": "SE",
                    "url": "https://adtrade.io/t?a=100&c=1234567&m=SE&campaign=12&voucher=EXAMPLE10"
                }
            ]
        }
    ],
    "total": 1,
    "page": 1,
    "per_page": 50
}

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 / typeDescription
eventstringRequiredProgram event name, such as Purchase. Maximum 100 characters.
advertiserCodestringRequiredPublic advertiser code (3–8 digits for events), not the internal database ID.
channelCodestringRequiredPublic publisher channel code (6–8 digits for events), not the internal database ID.
orderReferencestringOptional / conditionalRequired for Purchase. A stable, unique order reference per advertiser, maximum 150 characters. Reuse on retries.
amountstringOptional / conditionalRequired 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 / conditionalRequired for Purchase. Three letters, such as SEK. Must match the commission rule.
marketstringOptional / conditionalTwo-letter market code, such as SE. Specify the market for partnerships covering multiple markets.
clickIdstringOptional / conditionalclickId from the landing URL, maximum 100 characters. Must belong to the same channel and advertiser.
clickRefstringOptional / conditionalOptional custom click reference, maximum 255 characters. Do not send personal data.
occurredAtintegerOptional / conditionalUnix timestamp in seconds. Default: receipt time. At most 7 days in the past or 5 minutes in the future.
voucherstringOptional / conditionalOptional discount code, maximum 2,000 characters.
Example · cURL
curl --request POST "https://adtrade.io/t" \
  --header "Authorization: Bearer $ADTRADE_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
    "event": "Purchase", "advertiserCode": "100",
    "channelCode": "1234567", "market": "SE",
    "clickId": "CLICK_ID_FROM_LANDING_URL",
    "orderReference": "EXAMPLE-1001",
    "amount": "200.00", "currency": "SEK"
  }'
202 · Example response · excerpt
{
    "status": "accepted",
    "queued": true,
    "receiptId": "00000000-0000-4000-8000-000000000001",
    "event": "Purchase"
}
200 · Example response · excerpt
{
    "success": true,
    "eventId": 101,
    "event": "Purchase",
    "recognized": true,
    "conversion": true,
    "duplicate": false,
    "transaction": {
        "id": 1001,
        "status": "pending",
        "orderReference": "EXAMPLE-1001",
        "amount": "200.00",
        "commissionAmount": "16.00",
        "currency": "SEK"
    }
}

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 / typeDescription
astringRequiredPublic advertiser code (3–8 digits for events), not the internal database ID.
cstringRequiredPublic publisher channel code (6–8 digits for events), not the internal database ID.
mstringOptional / conditionalTwo-letter market code, such as SE. Specify the market for partnerships covering multiple markets.
rstringOptional / conditionalOptional custom click reference, maximum 255 characters. Do not send personal data.
Example · URL
https://adtrade.io/t?a=100&c=1234567&m=SE&r=article-123
302 · Example response · excerpt
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.