Skip to content
PubAdHub

S2S Postback API

Platform API

The S2S Postback API accepts conversion events from your affiliate / offer network. Authentication is performed by including your platform access_key in the URL path. Fire a GET or POST request to /api/postback/{access_key} with required parameters txnid, cid, edate, and payout. The endpoint returns HTTP 200 for both successful and failed postbacks — always inspect message and, when present, error_code in the JSON body.

Base URL https://statsapi.pubadhub.com
GET / POST /api/postback/{access_key}
warning

Platform API

This endpoint is for platforms / affiliate networks, not publishers. Use the platform access_key issued by your Account Manager. Do not send an AccessKey header. Publishers who receive conversion postbacks from PubAdHub should use Publisher S2S Integration instead.
lock

Authentication

Authentication is performed by including your platform access_key in the URL path. No AccessKey request header is required for this endpoint. Contact your PubAdHub Account Manager to obtain your platform access_key and the complete postback URL. Each platform receives a unique key — do not reuse a key across platforms.

Query Parameters

Send parameters as query-string values (GET) or as query/form fields (POST). Required: txnid, cid, edate, payout. Optional: sales, currency, status, s2, s3, surl. Map your network macros to these names; unresolved placeholders (for example {txnid}) are treated as empty and will be rejected.

access_key
string · required REQUIRED

Location: path

Platform access key in the URL path. Issued by your PubAdHub Account Manager. Unique per platform — do not reuse across platforms.

Example: {access_key}

txnid
string · required REQUIRED

Location: query

Unique transaction or conversion ID from your platform.

Example: {txnid}

cid
string · required REQUIRED

Location: query

PubAdHub click ID from the outbound click. Prefer the 32-character MD5 click hash ({LandingClickID}) so the conversion can be matched to the original click.

Example: {LandingClickID}

edate
date / datetime / unix · required REQUIRED

Location: query

Conversion event time. Accepts YYYY-MM-DD, a datetime string, or a unix timestamp (seconds or milliseconds). Values are stored in UTC.

Example: YYYY-MM-DD

payout
number · required REQUIRED

Location: query

Commission / payout amount for the conversion.

Example: {payout}

sales
number · optional OPTIONAL

Location: query

Sale, GMV, or order amount.

Example: {sales}

currency
string · optional OPTIONAL

Location: query

Currency code (for example USD).

Example: USD

status
string · optional OPTIONAL

Location: query

Conversion status from your network (for example approved or pending).

Example: approved

s2
string · optional OPTIONAL

Location: query

Additional sub-ID / tracking value.

Example: {s2}

s3
string · optional OPTIONAL

Location: query

Additional sub-ID / tracking value.

Example: {s3}

surl
URL · optional OPTIONAL

Location: query

Event source URL or landing URL associated with the conversion.

Example: {surl}

API format

API Format
https://statsapi.pubadhub.com/api/postback/{access_key}?txnid={txnid}&cid={cid}&edate={edate}&payout={payout}&sales={sales}&s2={s2}&s3={s3}&surl={surl}&currency={currency}&status={status}

Response

HTTP 200. Inspect message to confirm success (Postback received successfully).

JSON
{
    "message": "Postback received successfully"
}

HTTP 200 with error_code 1. Field-level validation details in errors.

JSON
{
    "message": "The given data was invalid.",
    "errors": {
        "txnid": [
            "The transaction ID is required."
        ],
        "cid": [
            "The click ID is required."
        ],
        "edate": [
            "The event date is required and must be a valid date."
        ],
        "payout": [
            "The payout is required and must be a number."
        ]
    },
    "error_code": 1
}

HTTP 200 with error_code 1 when the path access_key is invalid.

JSON
{
    "message": "The given data was invalid.",
    "errors": {
        "access_key": [
            "The access key is invalid."
        ]
    },
    "error_code": 1
}

HTTP 200 with error_code 2 for processing / insert failure.

JSON
{
    "message": "something went wrong",
    "error_code": 2
}

Response fields

message string

Human-readable result. On success: Postback received successfully.

Example: Postback received successfully

error_code number (errors only)

1 = invalid access key or validation failure. 2 = processing / insert failure.

Example: 1

errors object (errors only)

Field-level validation details when error_code is 1.

Errors

Validation Failed

The given data was invalid.

JSON
{
    "message": "The given data was invalid.",
    "errors": {
        "txnid": [
            "The transaction ID is required."
        ],
        "cid": [
            "The click ID is required."
        ],
        "edate": [
            "The event date is required and must be a valid date."
        ],
        "payout": [
            "The payout is required and must be a number."
        ]
    },
    "error_code": 1
}

Invalid Access Key

The access key is invalid.

JSON
{
    "message": "The given data was invalid.",
    "errors": {
        "access_key": [
            "The access key is invalid."
        ]
    },
    "error_code": 1
}

Processing Failed

something went wrong

JSON
{
    "message": "something went wrong",
    "error_code": 2
}

Notes

info
This is a Platform API for affiliate / offer networks. Publisher AccessKey headers are not used.
info
Protocol: HTTP GET or POST → JSON response. Authentication: access_key in the URL path (no header).
info
Call GET or POST https://statsapi.pubadhub.com/api/postback/{access_key}. Replace {access_key} with the key from your Account Manager. Do not send an AccessKey header.
info
Required parameters: txnid, cid, edate, payout. Optional: sales, currency, status, s2, s3, surl.
info
Prefer a 32-character MD5 PubAdHub click hash for cid so conversions can be matched to the original click.
info
The endpoint returns HTTP 200 for both successful and failed postbacks so pixel-style or network callbacks are not dropped. Always inspect the response body — use message and, when present, error_code to determine the outcome.
info
Unresolved network macros left as placeholders (for example {txnid}) are treated as empty and will be rejected.
info
Set appropriate timeout values and implement proper error and timeout handling.
info
Integration checklist: obtain access_key and postback URL from your Account Manager; configure /api/postback/{access_key}; map macros for txnid, cid, edate, payout; map optional macros where available (sales, currency, status, s2, s3, surl); test success (Postback received successfully) and validation failure handling via error_code / errors; configure timeout and redirect settings.

Original PDF

This page is sourced from the official API PDF. The original file remains available.

S2S Postback API for Platfom.pdf

Related documentation

play_circle

Try it out

Fill the fields below, copy the generated cURL, or send a live request.

GET / POST https://statsapi.pubadhub.com/api/postback/{access_key}
cURL

        
Response Status: