Advertiser API Documentation

The API allow the advertiser to do common things like list and handle transactions. In order to use the API, you must first logon to your account and generate a private API-key.

You can find a list of available resources below with an example of the output. All output is provided as JSON. If you have any questions regarding the API, feel free to contact api@adrecord.com.

Changelog

  • 2018-10-08 - Adds filter for tags in transactions endpoint.
  • 2018-10-01 - Init.

Introduction

The API-key can be sent as both a GET or POST variable, as well as a HTTP-header named APIKEY, like this:

GET /v1/transactions HTTP/1.1
Host: apiadv.adrecord.com
Apikey: <your secret API-key>

HTTP/1.1 200 Found
...

Base URL

The base url for all API endpoints is https://apiadv.adrecord.com

Notes

  • Encoding: Strings passed to the API should be UTF-8 encoded.
  • Date format: All dates are in ISO 8601.

Headers

  • apiKey: string to authenticate.

Inputs

The API only supports JSON. So instead of XML, HTTP POST parameters, or other serialization formats, POST and PATCH requests require a valid JSON object for the body.

Errors

Code Description
200 OK Successful request.
400 Bad request The server cannot process the request due to an apparent client error.
401 Unauthorized The request requires authentication.
404 Not Found The requested resource could not be found.
409 Conflict The request could not be processed because of conflict in the current state of the resource.
429 Too Many Requests You have sent too many requests in a given amount of time.
500 Internal Server Error Unexpected behavior on the server level.

Example message for 409:

{
    "status": "error",
    "message": "Wrong status format. Set status to either \"rejected\" or \"approved\"."
}

If you’re seeing a 5xx error, that likely means there’s an error on Adrecord’s side, and you can contact our support team at api@adrecord.com.

Throttling

To improve connections and experiences for all our users, we use some connection limits to avoid overload. Each user is permitted up to 100 request per 30 seconds, and you’ll receive an error message if you reach the limit. The reached limit will be reset after 5 minutes.

Resources

GET /v1/transactions

List your latest transactions. By default the limit is set to 10, and the result is sorted by descending date.

Filters

Parameter Type Description
limit int Limit the result from 1-100.
status string A comma-separated list of statuses: pending, approved, rejected, invoiced, paid-invoice, paid-affiliate.
tag int A comma-separated list of tag id-numbers.
sort string Sort the result, asc or desc
from string ISO 8601 date, urlencoded
to string ISO 8601 date, urlencoded
cursor int next transactionID, used for pagination.

Result

{
    "current": 752749,
    "next": 344733,
    "data": [
        {
            "transactionID": 752749,
            "channelID": 235,
            "commID": 13,
            "orderID": "#213765r23167-2",
            "orderValue": 100,
            "commission": 15,
            "transactionFee": 7.5,
            "currency": "SEK",
            "couponCode": null,
            "datetime": "2018-10-20T00:00:00+02:00",
            "status": "Invoice Paid",
            "eai": null,
            "orderComment": null
        },
        {
            "transactionID": 744879,
            "channelID": 235,
            "commID": 13,
            "orderID": "762383274653764",
            "orderValue": 2567,
            "commission": 2053.6,
            "transactionFee": 410.72,
            "currency": "USD",
            "couponCode": "FREESHIPPING",
            "datetime": "2018-10-15T00:00:00+02:00",
            "status": "Paid to affiliate",
            "eai": null,
            "orderComment": null
        },
        {
            "transactionID": 344732,
            "channelID": 18546,
            "commID": 1255,
            "orderID": "44321234z2",
            "orderValue": 100,
            "commission": 15,
            "transactionFee": 0,
            "currency": "EUR",
            "couponCode": null,
            "datetime": "2018-02-19T19:28:15+01:00",
            "status": "Paid to affiliate",
            "eai": "44321234z2",
            "orderComment": null
        }
    ]
}

GET /v1/transactions/:orderid

Get a specific transaction.

Input parameters

  • orderID: string

Result

{
    "transactionID": 783004,
    "channelID": 235,
    "commID": 123,
    "orderID": "123test",
    "orderValue": 10000,
    "commission": 1500,
    "transactionFee": 450,
    "currency": "SEK",
    "couponCode": null,
    "datetime": "2018-11-14T13:44:38+01:00",
    "status": "Pending",
    "eai": null,
    "orderComment": null
}

PATCH /v1/transactions/:orderid

Update a specific transaction. You are only able to update transactions with status Pending. If your are updating the orderValue an new commission and transaction fee will be calculated. A history of transaction changes will also be logged.

Input parameters

  • orderID: string
  • status: string rejected, approved
  • orderValue: number (in the same currency as the original transaction)
  • eai: string/empty string
  • orderComment: string/empty string

Example input

Approve the transaction:

{
	"orderID": "123test",
    "status": "approved"
}

Change orderValue:

{
	"orderID": "123test",
    "orderValue": 500
}

Result

Will return the updated transaction object.

{
    "transactionID": 783004,
    "channelID": 235,
    "commID": 123,
    "orderID": "123test",
    "orderValue": 500,
    "commission": 50,
    "transactionFee": 15,
    "currency": "SEK",
    "couponCode": null,
    "datetime": "2018-11-14T13:44:38+01:00",
    "status": "Approved",
    "eai": null,
    "orderComment": null
}