S2S Postback API
Platform APIThe 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.
https://statsapi.pubadhub.com
/api/postback/{access_key}
Platform API
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
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
Location: query
Unique transaction or conversion ID from your platform.
Example: {txnid}
cid
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
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
Location: query
Commission / payout amount for the conversion.
Example: {payout}
sales
Location: query
Sale, GMV, or order amount.
Example: {sales}
currency
Location: query
Currency code (for example USD).
Example: USD
status
Location: query
Conversion status from your network (for example approved or pending).
Example: approved
s2
Location: query
Additional sub-ID / tracking value.
Example: {s2}
s3
Location: query
Additional sub-ID / tracking value.
Example: {s3}
surl
Location: query
Event source URL or landing URL associated with the conversion.
Example: {surl}
| Name | Type | Required | Location | Description | Example |
|---|---|---|---|---|---|
| access_key | string · required | REQUIRED | path | Platform access key in the URL path. Issued by your PubAdHub Account Manager. Unique per platform — do not reuse across platforms. | {access_key} |
| txnid | string · required | REQUIRED | query | Unique transaction or conversion ID from your platform. | {txnid} |
| cid | string · required | REQUIRED | 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. | {LandingClickID} |
| edate | date / datetime / unix · required | REQUIRED | query | Conversion event time. Accepts YYYY-MM-DD, a datetime string, or a unix timestamp (seconds or milliseconds). Values are stored in UTC. | YYYY-MM-DD |
| payout | number · required | REQUIRED | query | Commission / payout amount for the conversion. | {payout} |
| sales | number · optional | OPTIONAL | query | Sale, GMV, or order amount. | {sales} |
| currency | string · optional | OPTIONAL | query | Currency code (for example USD). | USD |
| status | string · optional | OPTIONAL | query | Conversion status from your network (for example approved or pending). | approved |
| s2 | string · optional | OPTIONAL | query | Additional sub-ID / tracking value. | {s2} |
| s3 | string · optional | OPTIONAL | query | Additional sub-ID / tracking value. | {s3} |
| surl | URL · optional | OPTIONAL | query | Event source URL or landing URL associated with the conversion. | {surl} |
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}¤cy={currency}&status={status}
Response
HTTP 200. Inspect message to confirm success (Postback received successfully).
{
"message": "Postback received successfully"
}
HTTP 200 with error_code 1. Field-level validation details in errors.
{
"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.
{
"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.
{
"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.
| Name | Type | Description | Example |
|---|---|---|---|
| message | string | Human-readable result. On success: Postback received successfully. | Postback received successfully |
| error_code | number (errors only) | 1 = invalid access key or validation failure. 2 = processing / insert failure. | 1 |
| errors | object (errors only) | Field-level validation details when error_code is 1. |
Errors
Validation Failed
The given data was invalid.
{
"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.
{
"message": "The given data was invalid.",
"errors": {
"access_key": [
"The access key is invalid."
]
},
"error_code": 1
}
Processing Failed
something went wrong
{
"message": "something went wrong",
"error_code": 2
}
Notes
Original PDF
This page is sourced from the official API PDF. The original file remains available.
S2S Postback API for Platfom.pdf
Related documentation
Publisher S2S Integration
Receive conversion credits and cancellations from PubAdHub on an HTTP GET URL you host. Query parameters carry txnid, cid, payout, status, and edate.
https://publisher.example.com/s2s/postback
S2S Postback Response
JSON body returned by GET or POST /api/postback/{access_key}. HTTP status is 200 for both success and documented failures — inspect message and, when present, error_code.
Open arrow_forwardThe given data was invalid.
Platform S2S Postback validation failure (`error_code` 1) when required fields are missing or invalid.
Open arrow_forwardThe access key is invalid.
Platform S2S Postback validation failure (`error_code` 1) when the path `access_key` is invalid.
Open arrow_forwardsomething went wrong
Platform S2S Postback processing / insert failure (`error_code` 2).
Open arrow_forward