A reference guide to the Tapfiliate REST API.

The Tapfiliate API is based around REST. Our API has predictable, resource-oriented URLs, and uses HTTP response codes to indicate API errors. We use built-in HTTP features, like HTTP authentication and HTTP verbs, which are understood by off-the-shelf HTTP clients. We support cross-origin resource sharing, allowing you to interact securely with our API from a client-side web application (though you should never expose your secret API key in any public website’s client-side code). JSON is returned by all API responses, including errors. We keep our customers up to date on new changes on the Tapfiliate API through our changelog.

Version

The current version of the API is V1.6. A changelog from 1.5 can be found here: https://tapfiliate.com/blog/new-api-version-v1-6-released/

Authentication

Authentication with the Tapfiliate API is achieved by sending your Api-Key along in the header of every request:

Api-Key: “YOUR_API_KEY”

You can find and manage your Api Key in your account settings. Your API keys can approve commissions, so be sure to keep them secret! You should not share your API key anywhere where other people can see them (frontend javascript code, public repo’s, blogs et cetera).

All of your API requests must be made over HTTPS. Plain HTTP calls will fail. API requests without authentication will also fail.

Pagination

Requests that return multiple items will be paginated to 25 items by default. You can specify further pages with the ?page parameter.

$ curl 'https://api.tapfiliate.com/1.6/conversions/?page=2'

Page numbering is 1-based. Omitting the ?page parameter will return the first page.

The pagination info is included in the Link header.

Link: <https://api.tapfiliate.com/1.6/conversions/?page=3>; rel="next",
  <https://api.tapfiliate.com/1.6/conversions/?page=51>; rel="last"

Linebreak is included for readability.

The possible rel values are:

NameDescription
nextShows the URL of the immediate next page of results.
lastShows the URL of the last page of results.
firstShows the URL of the first page of results.
prevShows the URL of the immediate previous page of results.

Misc

  • Note that we do output NULL properties as of V1.3

Retrieve a Customer

GET/customers/{id}/
Response:200

URI Parameters

id
required
string
Example: cu_eXampl3

The Tapfiliate generated id of the Customer to perform action with.

GET https://api.tapfiliate.com/1.6/customers/cu_eXampl3/

Code Example

const request = require("request");

const options = { method: 'GET',
  url: 'https://api.tapfiliate.com/1.6/customers/{id}/',
  headers: { 'content-type': 'application/json' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Example Response

{
  "id": "cu_eXampl3",
  "customer_id": "USER123",
  "status": "active",
  "created_at": "2019-07-02T09:55:20+00:00",
  "click": {
    "created_at": "2015-03-03T12:39:19+0100",
    "referrer": "https://awesome-affiliate-site.com/",
    "landing_page": "https://your-site.com/landing/"
  },
  "program": {
    "id": "my-program",
    "title": "My Program",
    "currency": "USD"
  },
  "affiliate": {
    "id": "chucknorris1",
    "firstname": "Chuck",
    "lastname": "Norris"
  },
  "affiliate_meta_data": {
    "foo": "bar"
  },
  "meta_data": {
    "foo": "bar"
  },
  "warnings": null
}

Update a Customer

PATCH/customers/{id}/
Response:200

URI Parameters

id
required
string
Example: cu_eXampl3

The Tapfiliate generated id of the Customer to perform action with.

Arguments

customer_id
optional
string

The id for this customer in your system. The customer id should be unique for each customer.

meta_data
optional
object

Meta data for this resource

Child Arguments

PATCH https://api.tapfiliate.com/1.6/customers/cu_eXampl3/

Code Example

const request = require("request");

const options = { method: 'PATCH',
  url: 'https://api.tapfiliate.com/1.6/customers/{id}/',
  headers: { 'content-type': 'application/json' },
  body: { customer_id: '<ADD STRING VALUE>', meta_data: {} },
  json: true };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Example Request

{
  "customer_id": "USER456",
  "meta_data": {
    "foo": "bar"
  }
}

Example Response

{
  "id": "cu_eXampl3",
  "customer_id": "USER123",
  "status": "active",
  "created_at": "2019-07-02T09:55:20+00:00",
  "click": {
    "created_at": "2015-03-03T12:39:19+0100",
    "referrer": "https://awesome-affiliate-site.com/",
    "landing_page": "https://your-site.com/landing/"
  },
  "program": {
    "id": "my-program",
    "title": "My Program",
    "currency": "USD"
  },
  "affiliate": {
    "id": "chucknorris1",
    "firstname": "Chuck",
    "lastname": "Norris"
  },
  "affiliate_meta_data": {
    "foo": "bar"
  },
  "meta_data": {
    "foo": "bar"
  },
  "warnings": null
}

Delete a Customer

DELETE/customers/{id}/
Response:204

URI Parameters

id
required
string
Example: cu_eXampl3

The Tapfiliate generated id of the Customer to perform action with.

DELETE https://api.tapfiliate.com/1.6/customers/cu_eXampl3/

Code Example

const request = require("request");

const options = { method: 'DELETE',
  url: 'https://api.tapfiliate.com/1.6/customers/{id}/' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

List all Customers

GET/customers/
Response:200

URI Parameters

program_id
optional
string
Example: my-program

The program Id

customer_id
optional
string
Example: Di4Hjskdns93

The id for this customer in your system. The customer id should be unique for each customer.

affiliate_id
optional
string
Example: john

The affiliate Id

date_from
optional
string
Example: 2015-03-23

Date From

date_to
optional
string
Example: 2015-05-28

Date To

GET https://api.tapfiliate.com/1.6/customers/

Code Example

const request = require("request");

const options = { method: 'GET',
  url: 'https://api.tapfiliate.com/1.6/customers/',
  headers: { 'content-type': 'application/json' },
  body: '<ADD STRING VALUE>',
  json: true };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Example Response

[
  {
    "id": "cu_eXampl3",
    "customer_id": "USER123",
    "status": "active",
    "created_at": "2019-07-02T09:55:20+00:00",
    "click": {
      "created_at": "2015-03-03T12:39:19+0100",
      "referrer": "https://awesome-affiliate-site.com/",
      "landing_page": "https://your-site.com/landing/"
    },
    "program": {
      "id": "my-program",
      "title": "My Program",
      "currency": "USD"
    },
    "affiliate": {
      "id": "chucknorris1",
      "firstname": "Chuck",
      "lastname": "Norris"
    },
    "affiliate_meta_data": {
      "foo": "bar"
    },
    "meta_data": {
      "foo": "bar"
    },
    "warnings": null
  }
]

Create a Customer

POST/customers/
Response:200

You are required to use either a Tracking id, referral code, click id, coupon code, or asset_id & source_id combination. If more than one of these is sent, the precedence will be as follows (highest to lowest): Coupon, Referral Code, Click Id, Asset id + Source id, Tracking id

Please refer to our REST API integration guide for more info.

URI Parameters

override_max_cookie_time
optional
boolean
Default: false 

Arguments

referral_code
optional
string

An affiliate’s referral code. This corresponds to the value of ref= in their referral link

tracking_id
optional
string

XXX-XXXX-XXXX-XXXXX (string) - The tracking id, to be retrieved from our javascript library. Please refer to our REST API integration guide for more info.

click_id
optional
string

abc (string, optional) - The click id

coupon
optional
string

A coupon code to track the conversion by

asset_id
optional
string

abc (string, optional) - The asset id

source_id
optional
string

def (string, optional) - The source id

customer_id
required
string

The id for this customer in your system. The customer id should be unique for each customer.

status
optional
string

Determines the intial status for the customer. You can read more about statuses here. Defaults to “new” if none is passed.

user_agent
optional
string

The client’s user agent string. Used for statistics and fraud detection.

meta_data
optional
object

Meta data for this resource

Child Arguments

POST https://api.tapfiliate.com/1.6/customers/

Code Example

const request = require("request");

const options = { method: 'POST',
  url: 'https://api.tapfiliate.com/1.6/customers/',
  headers: { 'content-type': 'application/json' },
  body: 'false',
  json: true };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Example Request

{
  "referral_code": "johndoe",
  "tracking_id": "XXXXX-XXX-XXXX-XXXX-XXXXX",
  "click_id": "123-abc",
  "asset_id": "123-abc",
  "source_id": "456-def",
  "coupon": "JOHN10OFF",
  "customer_id": "USER123",
  "status": "trial",
  "meta_data": {
    "foo": "bar"
  },
  "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36"
}

Example Response

{
  "id": "cu_eXampl3",
  "customer_id": "USER123",
  "status": "active",
  "created_at": "2019-07-02T09:55:20+00:00",
  "click": {
    "created_at": "2015-03-03T12:39:19+0100",
    "referrer": "https://awesome-affiliate-site.com/",
    "landing_page": "https://your-site.com/landing/"
  },
  "program": {
    "id": "my-program",
    "title": "My Program",
    "currency": "USD"
  },
  "affiliate": {
    "id": "chucknorris1",
    "firstname": "Chuck",
    "lastname": "Norris"
  },
  "affiliate_meta_data": {
    "foo": "bar"
  },
  "meta_data": {
    "foo": "bar"
  },
  "warnings": null
}

Aprove or disapprove a commission

Cancel a customer

DELETE/customers/{id}/status/
Response:200

URI Parameters

id
required
number
Example: 1

The Tapfiliate generated id of the customer.

DELETE https://api.tapfiliate.com/1.6/customers/1/status/

Code Example

const request = require("request");

const options = { method: 'DELETE',
  url: 'https://api.tapfiliate.com/1.6/customers/{id}/status/',
  headers: { 'content-type': 'application/json' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Example Response

{
  "id": "cu_eXampl3",
  "customer_id": "USER123",
  "status": "active",
  "created_at": "2019-07-02T09:55:20+00:00",
  "click": {
    "created_at": "2015-03-03T12:39:19+0100",
    "referrer": "https://awesome-affiliate-site.com/",
    "landing_page": "https://your-site.com/landing/"
  },
  "program": {
    "id": "my-program",
    "title": "My Program",
    "currency": "USD"
  },
  "affiliate": {
    "id": "chucknorris1",
    "firstname": "Chuck",
    "lastname": "Norris"
  },
  "affiliate_meta_data": {
    "foo": "bar"
  },
  "meta_data": {
    "foo": "bar"
  },
  "warnings": null
}

Uncancel a customer

PUT/customers/{id}/status/
Response:200

The customer will jump back to the appropriate status. You can read more about status statuses here

URI Parameters

id
required
number
Example: 1

The Tapfiliate generated id of the customer.

PUT https://api.tapfiliate.com/1.6/customers/1/status/

Code Example

const request = require("request");

const options = { method: 'PUT',
  url: 'https://api.tapfiliate.com/1.6/customers/{id}/status/',
  headers: { 'content-type': 'application/json' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Example Response

{
  "id": "cu_eXampl3",
  "customer_id": "USER123",
  "status": "active",
  "created_at": "2019-07-02T09:55:20+00:00",
  "click": {
    "created_at": "2015-03-03T12:39:19+0100",
    "referrer": "https://awesome-affiliate-site.com/",
    "landing_page": "https://your-site.com/landing/"
  },
  "program": {
    "id": "my-program",
    "title": "My Program",
    "currency": "USD"
  },
  "affiliate": {
    "id": "chucknorris1",
    "firstname": "Chuck",
    "lastname": "Norris"
  },
  "affiliate_meta_data": {
    "foo": "bar"
  },
  "meta_data": {
    "foo": "bar"
  },
  "warnings": null
}

Retrieve meta data

GET/customers/{id}/meta-data/
Response:200

URI Parameters

id
required
string
Example: cu_eXampl3

The Tapfiliate generated id of the customer.

GET https://api.tapfiliate.com/1.6/customers/cu_eXampl3/meta-data/

Code Example

const request = require("request");

const options = { method: 'GET',
  url: 'https://api.tapfiliate.com/1.6/customers/{id}/meta-data/',
  headers: { 'content-type': 'application/json' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Example Response

{
  "foo": "bar",
  "meta": "data"
}

Update (replace) meta data

PUT/customers/{id}/meta-data/
Response:200

URI Parameters

id
required
string
Example: cu_eXampl3

The Tapfiliate generated id of the customer.

PUT https://api.tapfiliate.com/1.6/customers/cu_eXampl3/meta-data/

Code Example

const request = require("request");

const options = { method: 'PUT',
  url: 'https://api.tapfiliate.com/1.6/customers/{id}/meta-data/',
  headers: { 'content-type': 'application/json' },
  body: { key: '<ADD STRING VALUE>' },
  json: true };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Example Request

{
  "foo": "bar",
  "baz": "qux"
}

Example Response

{
  "foo": "bar",
  "baz": "qux"
}

Retrieve meta data by key

GET/customers/{id}/meta-data/{key}/
Response:200

URI Parameters

id
required
string
Example: cu_eXampl3

The Tapfiliate generated id of the customer.

key
required
string
Example: foo

The meta data key.

GET https://api.tapfiliate.com/1.6/customers/cu_eXampl3/meta-data/foo/

Code Example

const request = require("request");

const options = { method: 'GET',
  url: 'https://api.tapfiliate.com/1.6/customers/{id}/meta-data/{key}/' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Example Response

{
    "value": "bar",
}

Set meta data by key

PUT/customers/{id}/meta-data/{key}/
Response:200

URI Parameters

id
required
string
Example: cu_eXampl3

The Tapfiliate generated id of the customer.

key
required
string
Example: foo

The meta data key.

PUT https://api.tapfiliate.com/1.6/customers/cu_eXampl3/meta-data/foo/

Code Example

const request = require("request");

const options = { method: 'PUT',
  url: 'https://api.tapfiliate.com/1.6/customers/{id}/meta-data/{key}/',
  body: { value: '<ADD STRING VALUE>' },
  json: true };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Example Request

{
  "value": "bar"
}

Example Response

{
    "value": "bar",
}

Delete meta data by key

DELETE/customers/{id}/meta-data/{key}/
Response:204

URI Parameters

id
required
string
Example: cu_eXampl3

The Tapfiliate generated id of the customer.

key
required
string
Example: foo

The meta data key.

DELETE https://api.tapfiliate.com/1.6/customers/cu_eXampl3/meta-data/foo/

Code Example

const request = require("request");

const options = { method: 'DELETE',
  url: 'https://api.tapfiliate.com/1.6/customers/{id}/meta-data/{key}/' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Retrieve a Conversion

GET/conversions/{conversion_id}/
Response:200

URI Parameters

conversion_id
required
number
Example: 1

Numeric id of the conversion to perform action with.

GET https://api.tapfiliate.com/1.6/conversions/1/

Code Example

const request = require("request");

const options = { method: 'GET',
  url: 'https://api.tapfiliate.com/1.6/conversions/{conversion_id}/',
  headers: { 'content-type': 'application/json' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Example Response

{
  "id": 1,
  "external_id": "ORD123",
  "amount": 17.95,
  "click": {
    "created_at": "2015-03-03T12:39:19+0100",
    "referrer": "https://awesome-affiliate-site.com/",
    "landing_page": "https://your-site.com/landing/"
  },
  "commissions": [
    {
      "id": 602,
      "conversion_sub_amount": 50,
      "amount": 5,
      "commission_type": "level-2",
      "approved": false,
      "kind": "level",
      "affiliate": {
        "id": "johndoe",
        "firstname": "John",
        "lastname": "Doe"
      }
    },
    {
      "id": 582,
      "conversion_sub_amount": 100,
      "amount": 10,
      "commission_type": "standard",
      "approved": true,
      "affiliate": {
        "id": "chucknorris1",
        "firstname": "Chuck",
        "lastname": "Norris"
      },
      "kind": "regular"
    }
  ],
  "program": {
    "id": "my-program",
    "title": "My Program",
    "currency": "USD"
  },
  "affiliate": {
    "id": "chucknorris1",
    "firstname": "Chuck",
    "lastname": "Norris"
  },
  "customer": {
    "id": "cu_eXampl3",
    "customer_id": "USER123",
    "status": "active"
  },
  "affiliate_meta_data": {
    "foo": "bar"
  },
  "meta_data": {
    "foo": "bar"
  }
}

Update a Conversion

PATCH/conversions/{conversion_id}/
Response:200

URI Parameters

conversion_id
required
number
Example: 1

Numeric id of the conversion to perform action with.

recalculate_commissions
optional
bool
Example: false

Also re-calculate commissions when changing the Conversion amount

Arguments

amount
optional
number

The new amount for the commission

external_id
optional
string

A unique id for this conversion. It can be anything that is meaningful to you, like an order number, user id, email adres etc… After a conversion has taken place, you can find this id alongside the conversion on our platform.

meta_data
optional
object

Meta data for this resource

Child Arguments

PATCH https://api.tapfiliate.com/1.6/conversions/1/

Code Example

const request = require("request");

const options = { method: 'PATCH',
  url: 'https://api.tapfiliate.com/1.6/conversions/{conversion_id}/',
  headers: { 'content-type': 'application/json' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Example Request

{
  "amount": 17.95,
  "external_id": "ORD123",
  "meta_data": {
    "foo": "bar"
  }
}

Example Response

{
  "id": 1,
  "external_id": "ORD123",
  "amount": 17.95,
  "click": {
    "created_at": "2015-03-03T12:39:19+0100",
    "referrer": "https://awesome-affiliate-site.com/",
    "landing_page": "https://your-site.com/landing/"
  },
  "commissions": [
    {
      "id": 602,
      "conversion_sub_amount": 50,
      "amount": 5,
      "commission_type": "level-2",
      "approved": false,
      "kind": "level",
      "affiliate": {
        "id": "johndoe",
        "firstname": "John",
        "lastname": "Doe"
      }
    },
    {
      "id": 582,
      "conversion_sub_amount": 100,
      "amount": 10,
      "commission_type": "standard",
      "approved": true,
      "affiliate": {
        "id": "chucknorris1",
        "firstname": "Chuck",
        "lastname": "Norris"
      },
      "kind": "regular"
    }
  ],
  "program": {
    "id": "my-program",
    "title": "My Program",
    "currency": "USD"
  },
  "affiliate": {
    "id": "chucknorris1",
    "firstname": "Chuck",
    "lastname": "Norris"
  },
  "customer": {
    "id": "cu_eXampl3",
    "customer_id": "USER123",
    "status": "active"
  },
  "affiliate_meta_data": {
    "foo": "bar"
  },
  "meta_data": {
    "foo": "bar"
  }
}

Delete a Conversion

DELETE/conversions/{conversion_id}/
Response:204

URI Parameters

conversion_id
required
number
Example: 1

Numeric id of the conversion to perform action with.

DELETE https://api.tapfiliate.com/1.6/conversions/1/

Code Example

const request = require("request");

const options = { method: 'DELETE',
  url: 'https://api.tapfiliate.com/1.6/conversions/{conversion_id}/' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

List all conversions

GET/conversions/
Response:200

URI Parameters

program_id
optional
string
Example: my-program

The program Id

external_id
optional
string
Example: Di4Hjskdns93

The external Id. This is the unique id from your system or shopping cart. This id was passed when the conversions was first tracked.

affiliate_id
optional
string
Example: john

The affiliate Id

pending
optional
bool
Example: 1

Only show conversions that have pending commissions

date_from
optional
string
Example: 2015-03-23

Date From

date_to
optional
string
Example: 2015-05-28

Date To

GET https://api.tapfiliate.com/1.6/conversions/

Code Example

const request = require("request");

const options = { method: 'GET',
  url: 'https://api.tapfiliate.com/1.6/conversions/',
  headers: { 'content-type': 'application/json' },
  body: '<ADD STRING VALUE>',
  json: true };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Example Response

[
  {
    "id": 1,
    "external_id": "Di4Hjskdns93",
    "amount": 17.95,
    "click": {
      "created_at": "2015-03-03T12:39:19+0100",
      "referrer": "https://awesome-affiliate-site.com/",
      "landing_page": "https://your-site.com/landing/"
    },
    "commissions": [
      {
        "id": 602,
        "conversion_sub_amount": 50,
        "amount": 5,
        "commission_type": "level-2",
        "approved": false,
        "affiliate": {
          "id": "johndoe",
          "firstname": "John",
          "lastname": "Doe"
        },
        "kind": "level"
      },
      {
        "id": 582,
        "conversion_sub_amount": 100,
        "amount": 10,
        "commission_type": "standard",
        "approved": true,
        "affiliate": {
          "id": "chucknorris1",
          "firstname": "Chuck",
          "lastname": "Norris"
        },
        "kind": "regular"
      }
    ],
    "program": {
      "id": "my-program",
      "title": "My Program",
      "currency": "USD"
    },
    "affiliate": {
      "id": "chucknorris1",
      "firstname": "Chuck",
      "lastname": "Norris"
    },
    "customer": {
      "id": "cu_eXampl3",
      "customer_id": "USER123",
      "status": "active"
    },
    "meta_data": {
      "foo": "bar"
    }
  }
]

Create a conversion

POST/conversions/
Response:200

You are required to use either a referral code, click id, coupon code, or asset_id & source_id combination. If more than one of these is sent, the precedence will be as follows (highest to lowest): Coupon, Referral Code, Click Id, Asset id + Source id, Tracking id

URI Parameters

override_max_cookie_time
optional
boolean
Default: false 

Arguments

referral_code
optional
string

An affiliate’s referral code. This corresponds to the value of ref= in their referral link.

tracking_id
optional
string

XXX-XXXX-XXXX-XXXXX (string) - The tracking id, to be retrieved from our javascript library. Please refer to our REST API integration guide for more info.

click_id
optional
string

abc (string) - The click id.

coupon
optional
string

A coupon code to track the conversion by

currency
optional
string

The three letter ISO currency code. Override the program’s default currency for this conversion by explicitely passing a currency code.

asset_id
optional
string

abc (string, optional) - The asset id

source_id
optional
string

def (string, optional) - The source id

external_id
optional
string

A unique id for this conversion. It can be anything that is meaningful to you, like an order number, user id, email adres etc… After a conversion has taken place, you can find this id alongside the conversion on our platform. This makes it very easy to cross-reference data on our platform with your own administration. This id has to be unique for every conversion.

amount
optional
number

The conversion amount

customer_id
optional
string

The id for the current customer in your system. Depending on your program settings, this can be used for recurring / lifetime commissions. You can read more about this here

commission_type
optional
string

If no commission type is supplied, the programs default commission type is used

commissions
optional
array

Will override “amount” and “commission_type” if set

meta_data
optional
object

Meta data for this resource

Child Arguments

program_group
optional
string

The program group id

user_agent
optional
string

The client’s user agent string. Used for statistics and fraud detection.

POST https://api.tapfiliate.com/1.6/conversions/

Code Example

const request = require("request");

const options = { method: 'POST',
  url: 'https://api.tapfiliate.com/1.6/conversions/',
  headers: { 'content-type': 'application/json' },
  body: 'false',
  json: true };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Example Request

{
  "referral_code": "johndoe",
  "click_id": "123-abc",
  "asset_id": "123-abc",
  "source_id": "456-def",
  "coupon": "JOHN10OFF",
  "external_id": "order0005",
  "customer_id": "USER123",
  "amount": 10,
  "commission_type": "signup",
  "currency": "USD",
  "commissions": [
    {
      "sub_amount": 10,
      "commission_type": "newsletter"
    }
  ],
  "meta_data": {
    "foo": "bar"
  },
  "program_group": "my-group",
  "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36"
}

Example Response

{
  "id": 1,
  "external_id": "ORD123",
  "amount": 17.95,
  "click": {
    "created_at": "2015-03-03T12:39:19+0100",
    "referrer": "https://awesome-affiliate-site.com/",
    "landing_page": "https://your-site.com/landing/"
  },
  "commissions": [
    {
      "id": 602,
      "conversion_sub_amount": 50,
      "amount": 5,
      "commission_type": "level-2",
      "approved": false,
      "kind": "level",
      "affiliate": {
        "id": "johndoe",
        "firstname": "John",
        "lastname": "Doe"
      }
    },
    {
      "id": 582,
      "conversion_sub_amount": 100,
      "amount": 10,
      "commission_type": "standard",
      "approved": true,
      "affiliate": {
        "id": "chucknorris1",
        "firstname": "Chuck",
        "lastname": "Norris"
      },
      "kind": "regular"
    }
  ],
  "program": {
    "id": "my-program",
    "title": "My Program",
    "currency": "USD"
  },
  "affiliate": {
    "id": "chucknorris1",
    "firstname": "Chuck",
    "lastname": "Norris"
  },
  "customer": {
    "id": "cu_eXampl3",
    "customer_id": "USER123",
    "status": "active"
  },
  "affiliate_meta_data": {
    "foo": "bar"
  },
  "meta_data": {
    "foo": "bar"
  }
}

Add commissions to a conversion

POST/conversions/{conversion_id}/commissions/
Response:200

URI Parameters

conversion_id
required
number
Example: 1

Numeric id of the conversion to add the commission(s) to.

Arguments

conversion_sub_amount
required
number

The amount on which the commission should be calculated using the supplied, or the program’s default commission type

commission_type
optional
string

If no commission type is supplied, the programs default commission type is used

comment
optional
string

A comment for this commission. The comment will be visible to the affiliate

POST https://api.tapfiliate.com/1.6/conversions/1/commissions/

Code Example

const request = require("request");

const options = { method: 'POST',
  url: 'https://api.tapfiliate.com/1.6/conversions/{conversion_id}/commissions/',
  headers: { 'content-type': 'application/json' },
  body: 
   { conversion_sub_amount: 0,
     commission_type: '<ADD STRING VALUE>',
     comment: '<ADD STRING VALUE>' },
  json: true };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Example Request

{
  "conversion_sub_amount": 20.5,
  "commission_type": "mycommissiontype",
  "comment": "Awesome!"
}

Example Response

[
  {
    "id": 602,
    "conversion_sub_amount": 50,
    "amount": 5,
    "commission_type": "my-commission-type",
    "approved": true
  }
]

Retrieve meta data

GET/conversions/{conversion_id}/meta-data/
Response:200

URI Parameters

conversion_id
required
number
Example: 123

The id of the conversion.

GET https://api.tapfiliate.com/1.6/conversions/123/meta-data/

Code Example

const request = require("request");

const options = { method: 'GET',
  url: 'https://api.tapfiliate.com/1.6/conversions/{conversion_id}/meta-data/',
  headers: { 'content-type': 'application/json' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Example Response

{
  "foo": "bar",
  "meta": "data"
}

Update (replace) meta data

PUT/conversions/{conversion_id}/meta-data/
Response:200

URI Parameters

conversion_id
required
number
Example: 123

The id of the conversion.

PUT https://api.tapfiliate.com/1.6/conversions/123/meta-data/

Code Example

const request = require("request");

const options = { method: 'PUT',
  url: 'https://api.tapfiliate.com/1.6/conversions/{conversion_id}/meta-data/',
  headers: { 'content-type': 'application/json' },
  body: { key: '<ADD STRING VALUE>' },
  json: true };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Example Request

{
  "foo": "bar",
  "baz": "qux"
}

Example Response

{
  "foo": "bar",
  "baz": "qux"
}

Retrieve meta data by key

GET/conversions/{conversion_id}/meta-data/{key}/
Response:200

URI Parameters

conversion_id
required
number
Example: 123

The id of the conversion.

key
required
string
Example: foo

The meta data key.

GET https://api.tapfiliate.com/1.6/conversions/123/meta-data/foo/

Code Example

const request = require("request");

const options = { method: 'GET',
  url: 'https://api.tapfiliate.com/1.6/conversions/{conversion_id}/meta-data/{key}/' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Example Response

{
    "value": "bar",
}

Set meta data by key

PUT/conversions/{conversion_id}/meta-data/{key}/
Response:200

URI Parameters

conversion_id
required
number
Example: 123

The id of the conversion.

key
required
string
Example: foo

The meta data key.

PUT https://api.tapfiliate.com/1.6/conversions/123/meta-data/foo/

Code Example

const request = require("request");

const options = { method: 'PUT',
  url: 'https://api.tapfiliate.com/1.6/conversions/{conversion_id}/meta-data/{key}/',
  body: { value: '<ADD STRING VALUE>' },
  json: true };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Example Request

{
  "value": "bar"
}

Example Response

{
    "value": "bar",
}

Delete meta data by key

DELETE/conversions/{conversion_id}/meta-data/{key}/
Response:204

URI Parameters

conversion_id
required
number
Example: 123

The id of the conversion.

key
required
string
Example: foo

The meta data key.

DELETE https://api.tapfiliate.com/1.6/conversions/123/meta-data/foo/

Code Example

const request = require("request");

const options = { method: 'DELETE',
  url: 'https://api.tapfiliate.com/1.6/conversions/{conversion_id}/meta-data/{key}/' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Retrieve a commission

GET/commissions/{commission_id}/
Response:200

URI Parameters

commission_id
required
number
Example: 1

Numeric id of the commission to perform action with.

GET https://api.tapfiliate.com/1.6/commissions/1/

Code Example

const request = require("request");

const options = { method: 'GET',
  url: 'https://api.tapfiliate.com/1.6/commissions/{commission_id}/',
  headers: { 'content-type': 'application/json' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Example Response

{
  "id": 1,
  "amount": 60,
  "approved": true,
  "created_at": "2016-03-31T08:21:02+0000",
  "commission_type": "standard",
  "conversion_sub_amount": 50,
  "comment": null,
  "conversion": {
    "id": 6
  },
  "payout": {
    "id": 20
  },
  "affiliate": {
    "id": "chucknorris1",
    "firstname": "Chuck",
    "lastname": "Norris"
  },
  "kind": "regular"
}

Update a commission

PATCH/commissions/{commission_id}/
Response:200

URI Parameters

commission_id
required
number
Example: 1

Numeric id of the commission to perform action with.

Arguments

amount
required
number

The new amount for the commission

comment
optional
string

A comment for this commission. The comment will be visible to the affiliate

PATCH https://api.tapfiliate.com/1.6/commissions/1/

Code Example

const request = require("request");

const options = { method: 'PATCH',
  url: 'https://api.tapfiliate.com/1.6/commissions/{commission_id}/',
  headers: { 'content-type': 'application/json' },
  body: { amount: 0, comment: '<ADD STRING VALUE>' },
  json: true };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Example Request

{
  "amount": 30.55,
  "comment": "\"foo bar\""
}

Example Response

{
  "id": 1,
  "amount": 30.55,
  "approved": true,
  "created_at": "2016-03-31T08:21:02+0000",
  "commission_type": "standard",
  "conversion_sub_amount": 50,
  "comment": "Amount adjusted because of returned item",
  "conversion": {
    "id": 6
  },
  "payout": {
    "id": 20
  },
  "affiliate": {
    "id": "chucknorris1",
    "firstname": "Chuck",
    "lastname": "Norris"
  },
  "kind": "regular"
}

List all commissions

GET/commissions/
Response:200

URI Parameters

affiliate_id
optional
string
Example: john

The affiliate Id

status
optional
string
Example: approved

An optional approval status to filter by. Valid values are: approved | disapproved | pending

paid
optional
bool
Example: 1

Only show commissions that are paid out. Valid values are: 1 | 0

GET https://api.tapfiliate.com/1.6/commissions/

Code Example

const request = require("request");

const options = { method: 'GET',
  url: 'https://api.tapfiliate.com/1.6/commissions/',
  headers: { 'content-type': 'application/json' },
  body: '<ADD STRING VALUE>',
  json: true };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Example Response

[
  {
    "id": 1,
    "amount": 60,
    "approved": true,
    "created_at": "2016-03-31T08:21:02+0000",
    "commission_type": "standard",
    "conversion_sub_amount": 50,
    "comment": null,
    "conversion": {
      "id": 6
    },
    "payout": {
      "id": 20
    },
    "affiliate": {
      "id": "chucknorris1",
      "firstname": "Chuck",
      "lastname": "Norris"
    },
    "kind": "regular"
  },
  {
    "id": 2,
    "amount": 20,
    "approved": null,
    "created_at": "2016-04-01T04:23:02+0000",
    "commission_type": "standard",
    "conversion_sub_amount": 50,
    "comment": null,
    "conversion": {
      "id": 6
    },
    "payout": null,
    "affiliate": {
      "id": "chucknorris1",
      "firstname": "Chuck",
      "lastname": "Norris"
    },
    "kind": "regular"
  }
]

Aprove or disapprove a commission

Approve a commission

PUT/commissions/{commission_id}/approved/
Response:200

URI Parameters

commission_id
required
number
Example: 1

Numeric id of the commission to perform action with.

PUT https://api.tapfiliate.com/1.6/commissions/1/approved/

Code Example

const request = require("request");

const options = { method: 'PUT',
  url: 'https://api.tapfiliate.com/1.6/commissions/{commission_id}/approved/',
  headers: { 'content-type': 'application/json' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Example Response

{
  "id": 1,
  "amount": 60,
  "approved": true,
  "created_at": "2016-03-31T08:21:02+0000",
  "commission_type": "standard",
  "conversion_sub_amount": 50,
  "comment": null,
  "conversion": {
    "id": 6
  },
  "payout": {
    "id": 20
  },
  "affiliate": {
    "id": "chucknorris1",
    "firstname": "Chuck",
    "lastname": "Norris"
  },
  "kind": "regular"
}

Disapprove a commission

DELETE/commissions/{commission_id}/approved/
Response:200

URI Parameters

commission_id
required
number
Example: 1

Numeric id of the commission to perform action with.

DELETE https://api.tapfiliate.com/1.6/commissions/1/approved/

Code Example

const request = require("request");

const options = { method: 'DELETE',
  url: 'https://api.tapfiliate.com/1.6/commissions/{commission_id}/approved/',
  headers: { 'content-type': 'application/json' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Example Response

{
  "id": 1,
  "amount": 60,
  "approved": true,
  "created_at": "2016-03-31T08:21:02+0000",
  "commission_type": "standard",
  "conversion_sub_amount": 50,
  "comment": null,
  "conversion": {
    "id": 6
  },
  "payout": {
    "id": 20
  },
  "affiliate": {
    "id": "chucknorris1",
    "firstname": "Chuck",
    "lastname": "Norris"
  },
  "kind": "regular"
}

Retrieve an affiliate

GET/affiliates/{affiliate_id}/
Response:200

URI Parameters

affiliate_id
required
string
Example: johndoe

The id of the affiliate.

GET https://api.tapfiliate.com/1.6/affiliates/johndoe/

Code Example

const request = require("request");

const options = { method: 'GET',
  url: 'https://api.tapfiliate.com/1.6/affiliates/{affiliate_id}/',
  headers: { 'content-type': 'application/json' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Example Response

{
  "id": "johndoe",
  "firstname": "John",
  "lastname": "Doe",
  "email": "john@doe.com",
  "company": {
    "name": "Tapfiliate"
  },
  "address": {
    "address": "Rapenburgerstraat 173",
    "postal_code": "1011 VM",
    "city": "Amsterdam",
    "state": "Noord-Holland",
    "country": {
      "code": "NL",
      "name": "Netherlands"
    }
  },
  "meta_data": null,
  "parent_id": "janedoe",
  "affiliate_group_id": "ag_axCle_U0iZq6l09dQ3"
}

Delete an affiliate

DELETE/affiliates/{affiliate_id}/
Response:204

URI Parameters

affiliate_id
required
string
Example: johndoe

The id of the affiliate.

DELETE https://api.tapfiliate.com/1.6/affiliates/johndoe/

Code Example

const request = require("request");

const options = { method: 'DELETE',
  url: 'https://api.tapfiliate.com/1.6/affiliates/{affiliate_id}/' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

List all affiliates

GET/affiliates/
Response:200

URI Parameters

click_id
optional
string
Example: 123-abc

A click id

source_id
optional
string
Example: 123-abc

A source id

email
optional
string
Example: john@doe.com

An email address

referral_code
optional
string
Example: john

An affiliate’s referral code. This corresponds to the value of ref= in their referral link.

parent_id
optional
string
Example: johndoe

Retrieves children for a certain parent affiliate

affiliate_group_id
optional
string
Example: ag_DSDjd993_2iuhdwdoix

Retrieves affiliates for a certain affiliate group

GET https://api.tapfiliate.com/1.6/affiliates/

Code Example

const request = require("request");

const options = { method: 'GET',
  url: 'https://api.tapfiliate.com/1.6/affiliates/',
  body: '<ADD STRING VALUE>',
  json: true };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Example Response

[
    {
        "id": "johndoe",
        "firstname": "John",
        "lastname": "Doe",
        "email": "john@doe.com",
        "company": {
            "name": "Tapfiliate"
        },
        "address": {
            "address": "Rapenburgerstraat 173",
            "postal_code": "1011 VM",
            "city": "Amsterdam",
            "state": "Noord-Holland",
            "country": {
                "code": "NL" ,
                "name": "Netherlands"
            }
        }
        "meta_data": null,
        "parent_id": "janedoe"
    }
]

Create an affiliate

POST/affiliates/
Response:200

Arguments

firstname
required
string

The affiliate’s firstname

lastname
required
string

The affiliate’s lastname

email
required
string

The affiliate’s email

password
optional
string

The password for the new account. If no password is given, one is generated and passed in the response

company
optional
object

The affiliate’s company data

Child Arguments

name
optional
string

The company’s name

address
optional
object

The affiliate’s address

Child Arguments

address
required
string

The company’s address

postal_code
required
string

The company’s postal code

city
required
string

The company’s city

state
optional
string

Holland (string, optional) - The company’s state

country
required
object

The company’s contry data

Child Arguments

code
required
string

The country’s ISO_3166-1 code (http://en.wikipedia.org/wiki/ISO_3166-1)

POST https://api.tapfiliate.com/1.6/affiliates/

Code Example

const request = require("request");

const options = { method: 'POST',
  url: 'https://api.tapfiliate.com/1.6/affiliates/',
  headers: { 'content-type': 'application/json' },
  body: 
   { firstname: '<ADD STRING VALUE>',
     lastname: '<ADD STRING VALUE>',
     email: '<ADD STRING VALUE>',
     password: '<ADD STRING VALUE>',
     company: { name: '<ADD STRING VALUE>' },
     address: 
      { address: '<ADD STRING VALUE>',
        postal_code: '<ADD STRING VALUE>',
        city: '<ADD STRING VALUE>',
        state: '<ADD STRING VALUE>',
        country: { code: '<ADD STRING VALUE>' } } },
  json: true };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Example Request

{
  "firstname": "John",
  "lastname": "Doe",
  "email": "john@doe.com",
  "password": "password1234",
  "company": {
    "name": "Tapfiliate"
  },
  "address": {
    "address": "Rapenburgerstraat 173",
    "postal_code": "1011VM",
    "city": "Amsterdam",
    "state": "Noord",
    "country": {
      "code": "NL"
    }
  }
}

Example Response

{
  "id": "johndoe",
  "firstname": "John",
  "lastname": "Doe",
  "email": "john@doe.com",
  "company": {
    "name": "Tapfiliate"
  },
  "address": {
    "address": "Rapenburgerstraat 173",
    "postal_code": "1011 VM",
    "city": "Amsterdam",
    "state": "Noord-Holland",
    "country": {
      "code": "NL",
      "name": "Netherlands"
    }
  },
  "meta_data": null,
  "parent_id": "janedoe",
  "affiliate_group_id": "ag_axCle_U0iZq6l09dQ3"
}

Set affiliate group

PUT/affiliates/{affiliate_id}/group/
Response:

URI Parameters

affiliate_id
required
string
Example: johndoe

The id of the affiliate.

PUT https://api.tapfiliate.com/1.6/affiliates/johndoe/group/

Code Example

const request = require("request");

const options = { method: 'PUT',
  url: 'https://api.tapfiliate.com/1.6/affiliates/{affiliate_id}/group/',
  body: { group_id: '<ADD STRING VALUE>' },
  json: true };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Example Request

{
  "group_id": "ag_DSDjd993_2iuhdwdoix"
}

Remove affiliate group

DELETE/affiliates/{affiliate_id}/group/
Response:204

URI Parameters

affiliate_id
required
string
Example: johndoe

The id of the affiliate.

DELETE https://api.tapfiliate.com/1.6/affiliates/johndoe/group/

Code Example

const request = require("request");

const options = { method: 'DELETE',
  url: 'https://api.tapfiliate.com/1.6/affiliates/{affiliate_id}/group/' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Retrieve note

GET/affiliates/{affiliate_id}/notes/{id}/
Response:200

URI Parameters

affiliate_id
required
string
Example: johndoe

The id of the affiliate.

id
required
int
Example: 1

The id of the note.

GET https://api.tapfiliate.com/1.6/affiliates/johndoe/notes/1/

Code Example

const request = require("request");

const options = { method: 'GET',
  url: 'https://api.tapfiliate.com/1.6/affiliates/{affiliate_id}/notes/{id}/' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Example Response

{
    "id": 1,
    "created_at": "2017-09-12T13:34:18+0000",
    "message": "Great guy!",
    "created_by": {
        "id": "johndoe",
        "firstname": "John",
        "lastname": "Doe",
    }
}

Update note

PUT/affiliates/{affiliate_id}/notes/{id}/
Response:200

URI Parameters

affiliate_id
required
string
Example: johndoe

The id of the affiliate.

id
required
int
Example: 1

The id of the note.

PUT https://api.tapfiliate.com/1.6/affiliates/johndoe/notes/1/

Code Example

const request = require("request");

const options = { method: 'PUT',
  url: 'https://api.tapfiliate.com/1.6/affiliates/{affiliate_id}/notes/{id}/',
  body: { message: '<ADD STRING VALUE>' },
  json: true };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Example Request

{
  "message": "Not so great guy!"
}

Example Response

{
    "id": 1,
    "created_at": "2017-09-12T13:34:18+0000",
    "message": "Not so great guy!"
    "created_by": {
        "id": "johndoe",
        "firstname": "John",
        "lastname": "Doe",
    }
}

Delete note

DELETE/affiliates/{affiliate_id}/notes/{id}/
Response:204

URI Parameters

affiliate_id
required
string
Example: johndoe

The id of the affiliate.

id
required
int
Example: 1

The id of the note.

DELETE https://api.tapfiliate.com/1.6/affiliates/johndoe/notes/1/

Code Example

const request = require("request");

const options = { method: 'DELETE',
  url: 'https://api.tapfiliate.com/1.6/affiliates/{affiliate_id}/notes/{id}/' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

List notes

GET/affiliates/{affiliate_id}/notes/
Response:200

URI Parameters

affiliate_id
required
string
Example: johndoe

The id of the affiliate.

GET https://api.tapfiliate.com/1.6/affiliates/johndoe/notes/

Code Example

const request = require("request");

const options = { method: 'GET',
  url: 'https://api.tapfiliate.com/1.6/affiliates/{affiliate_id}/notes/' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Example Response

[
    {
        "id": 1,
        "created_at": "2017-09-12T13:34:18+0000",
        "message": "Great guy!",
        "created_by": {
            "id": "johndoe",
            "firstname": "John",
            "lastname": "Doe",
        }
    }
]

Create note

POST/affiliates/{affiliate_id}/notes/
Response:200

URI Parameters

affiliate_id
required
string
Example: johndoe

The id of the affiliate.

POST https://api.tapfiliate.com/1.6/affiliates/johndoe/notes/

Code Example

const request = require("request");

const options = { method: 'POST',
  url: 'https://api.tapfiliate.com/1.6/affiliates/{affiliate_id}/notes/',
  body: { message: '<ADD STRING VALUE>' },
  json: true };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Example Request

{
  "message": "Great guy!"
}

Example Response

{
    "id": 1,
    "created_at": "2017-09-12T13:34:18+0000",
    "message": "Great guy!",
    "created_by": {
        "id": "johndoe",
        "firstname": "John",
        "lastname": "Doe",
    }
}

Retrieve meta data

GET/affiliates/{affiliate_id}/meta-data/
Response:200

URI Parameters

affiliate_id
required
string
Example: johndoe

The id of the affiliate.

GET https://api.tapfiliate.com/1.6/affiliates/johndoe/meta-data/

Code Example

const request = require("request");

const options = { method: 'GET',
  url: 'https://api.tapfiliate.com/1.6/affiliates/{affiliate_id}/meta-data/',
  headers: { 'content-type': 'application/json' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Example Response

{
  "foo": "bar",
  "meta": "data"
}

Update (replace) meta data

PUT/affiliates/{affiliate_id}/meta-data/
Response:200

URI Parameters

affiliate_id
required
string
Example: johndoe

The id of the affiliate.

PUT https://api.tapfiliate.com/1.6/affiliates/johndoe/meta-data/

Code Example

const request = require("request");

const options = { method: 'PUT',
  url: 'https://api.tapfiliate.com/1.6/affiliates/{affiliate_id}/meta-data/',
  headers: { 'content-type': 'application/json' },
  body: { key: '<ADD STRING VALUE>' },
  json: true };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Example Request

{
  "foo": "bar",
  "baz": "qux"
}

Example Response

{
  "foo": "bar",
  "baz": "qux"
}

Retrieve meta data by key

GET/affiliates/{affiliate_id}/meta-data/{key}/
Response:200

URI Parameters

affiliate_id
required
string
Example: johndoe

The id of the affiliate.

key
required
string
Example: foo

The meta data key.

GET https://api.tapfiliate.com/1.6/affiliates/johndoe/meta-data/foo/

Code Example

const request = require("request");

const options = { method: 'GET',
  url: 'https://api.tapfiliate.com/1.6/affiliates/{affiliate_id}/meta-data/{key}/' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Example Response

{
    "value": "My value",
}

Set meta data by key

PUT/affiliates/{affiliate_id}/meta-data/{key}/
Response:200

URI Parameters

affiliate_id
required
string
Example: johndoe

The id of the affiliate.

key
required
string
Example: foo

The meta data key.

PUT https://api.tapfiliate.com/1.6/affiliates/johndoe/meta-data/foo/

Code Example

const request = require("request");

const options = { method: 'PUT',
  url: 'https://api.tapfiliate.com/1.6/affiliates/{affiliate_id}/meta-data/{key}/',
  headers: { 'content-type': 'application/json' },
  body: { value: '<ADD STRING VALUE>' },
  json: true };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Example Request

{
  "value": "bar"
}

Example Response

{
  "value": "bar"
}

Delete meta data by key

DELETE/affiliates/{affiliate_id}/meta-data/{key}/
Response:204

URI Parameters

affiliate_id
required
string
Example: johndoe

The id of the affiliate.

key
required
string
Example: foo

The meta data key.

DELETE https://api.tapfiliate.com/1.6/affiliates/johndoe/meta-data/foo/

Code Example

const request = require("request");

const options = { method: 'DELETE',
  url: 'https://api.tapfiliate.com/1.6/affiliates/{affiliate_id}/meta-data/{key}/' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Get payout method

GET/affiliates/{affiliate_id}/payout-methods/{payout_method_id}/
Response:200

URI Parameters

affiliate_id
required
string
Example: johndoe

The id of the affiliate

payout_method_id
required
string
Example: paypal

The id of the payout method

GET https://api.tapfiliate.com/1.6/affiliates/johndoe/payout-methods/paypal/

Code Example

const request = require("request");

const options = { method: 'GET',
  url: 'https://api.tapfiliate.com/1.6/affiliates/{affiliate_id}/payout-methods/{payout_method_id}/',
  headers: { 'content-type': 'application/json' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Example Response

[
  {
    "title": "Paypal",
    "id": "paypal",
    "details": {
      "paypal_address": "john@doe.com"
    },
    "primary": true
  }
]

Set payout method

PUT/affiliates/{affiliate_id}/payout-methods/{payout_method_id}/
Response:200

The body of the request should contain the appropriate data for the payout method you are setting. The field ids can be found by exporting payouts as .csv on the payouts page.

URI Parameters

affiliate_id
required
string
Example: johndoe

The id of the affiliate

payout_method_id
required
string
Example: paypal

The id of the payout method

PUT https://api.tapfiliate.com/1.6/affiliates/johndoe/payout-methods/paypal/

Code Example

const request = require("request");

const options = { method: 'PUT',
  url: 'https://api.tapfiliate.com/1.6/affiliates/{affiliate_id}/payout-methods/{payout_method_id}/',
  headers: { 'content-type': 'application/json' },
  body: { paypal_address: '<ADD STRING VALUE>' },
  json: true };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Example Request

{
  "paypal_address": "john@doe.com"
}

Example Response

{
  "paypal_address": "john@doe.com"
}

List payout methods

GET/affiliates/{affiliate_id}/payout-methods/
Response:200

URI Parameters

affiliate_id
required
string
Example: johndoe

The id of the affiliate

GET https://api.tapfiliate.com/1.6/affiliates/johndoe/payout-methods/

Code Example

const request = require("request");

const options = { method: 'GET',
  url: 'https://api.tapfiliate.com/1.6/affiliates/{affiliate_id}/payout-methods/',
  headers: { 'content-type': 'application/json' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Example Response

[
  {
    "title": "Paypal",
    "id": "paypal",
    "details": {
      "paypal_address": "john@doe.com"
    },
    "primary": true
  }
]

Set parent

POST/affiliates/{child_affiliate_id}/parent/
Response:200

URI Parameters

child_affiliate_id
required
string
Example: johndoe

The id of the affiliate whoms parent is being set.

Arguments

affiliate_id
required
string
POST https://api.tapfiliate.com/1.6/affiliates/johndoe/parent/

Code Example

const request = require("request");

const options = { method: 'POST',
  url: 'https://api.tapfiliate.com/1.6/affiliates/{child_affiliate_id}/parent/',
  headers: { 'content-type': 'application/json' },
  body: { affiliate_id: '<ADD STRING VALUE>' },
  json: true };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Example Request

{
  "affiliate_id": "janedoe"
}

Example Response

{
  "id": "johndoe",
  "firstname": "John",
  "lastname": "Doe",
  "email": "john@doe.com",
  "company": {
    "name": "Tapfiliate"
  },
  "address": {
    "address": "Rapenburgerstraat 173",
    "postal_code": "1011 VM",
    "city": "Amsterdam",
    "state": "Noord-Holland",
    "country": {
      "code": "NL",
      "name": "Netherlands"
    }
  },
  "meta_data": null,
  "parent_id": "janedoe"
}

Remove parent

DELETE/affiliates/{child_affiliate_id}/parent/
Response:204

URI Parameters

child_affiliate_id
required
string
Example: johndoe

The id of the affiliate whoms parent is being set.

DELETE https://api.tapfiliate.com/1.6/affiliates/johndoe/parent/

Code Example

const request = require("request");

const options = { method: 'DELETE',
  url: 'https://api.tapfiliate.com/1.6/affiliates/{child_affiliate_id}/parent/' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

The following section describes the endpoints for our new Payments system, rolled out early 2019. You can check which version of our payments system you’re on, by looking at the name of the menu item when logged in to the platform. The current system is called “Payments”, and the legacy system is called “Payouts”.

Retrieve affiliate's balances

GET/affiliates/{affiliate_id}/balances/
Response:200

URI Parameters

affiliate_id
required
string
Example: johndoe

The id of the affiliate whoms balances to retrieve.

GET https://api.tapfiliate.com/1.6/affiliates/johndoe/balances/

Code Example

const request = require("request");

const options = { method: 'GET',
  url: 'https://api.tapfiliate.com/1.6/affiliates/{affiliate_id}/balances/',
  headers: { 'content-type': 'application/json' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Example Response

{
  "USD": 20.5,
  "EUR": 10
}

The following section describes the endpoints for our new Payments system, rolled out early 2019. You can check which version of our payments system you’re on, by looking at the name of the menu item when logged in to the platform. The current system is called “Payments”, and the legacy system is called “Payouts”.

List affiliate's payments

GET/affiliates/{affiliate_id}/payments/
Response:200

URI Parameters

affiliate_id
required
string
Example: johndoe

The id of the affiliate whoms payments to list.

GET https://api.tapfiliate.com/1.6/affiliates/johndoe/payments/

Code Example

const request = require("request");

const options = { method: 'GET',
  url: 'https://api.tapfiliate.com/1.6/affiliates/{affiliate_id}/payments/',
  headers: { 'content-type': 'application/json' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Example Response

[
  {
    "id": "pa_sfHVYj-087mTvBNIPH",
    "created_at": "2019-03-29T08:36:07+00:00",
    "affiliate": {
      "id": "johndoe",
      "firstname": "John",
      "lastname": "Doe"
    },
    "amount": 20.5,
    "currency": "USD"
  }
]

Retrieve a Program

GET/programs/{program_id}/
Response:200

URI Parameters

program_id
required
string
Example: my-program

The id of the Program. This id can be found as part of the url when viewing the program on the platform.

GET https://api.tapfiliate.com/1.6/programs/my-program/

Code Example

const request = require("request");

const options = { method: 'GET',
  url: 'https://api.tapfiliate.com/1.6/programs/{program_id}/' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Example Response

{
  "id": "my-awesome-program",
  "currency": "USD",
  "title": "My awesome program",
  "cookie_time": 45,
  "default_landing_page_url": "https://my-site.com"
}

List all programs

GET/programs/
Response:200

URI Parameters

asset_id
optional
string
Example: 123-abc

An asset id

GET https://api.tapfiliate.com/1.6/programs/

Code Example

const request = require("request");

const options = { method: 'GET',
  url: 'https://api.tapfiliate.com/1.6/programs/',
  headers: { 'content-type': 'application/json' },
  body: '<ADD STRING VALUE>',
  json: true };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Example Response

[
  {
    "id": "my-awesome-program",
    "currency": "USD",
    "title": "My awesome program",
    "cookie_time": 45,
    "default_landing_page_url": "https://my-site.com"
  }
]

List all affiliates in program

GET/programs/{program_id}/affiliates/
Response:200

URI Parameters

program_id
required
string
Example: my-program

The id of the Program to add the affiliate too. This id can be found as part of the url when viewing the program on the platform.

source_id
optional
string
Example: 123-abc

A source id

email
optional
string
Example: john@doe.com

An email address

parent_id
optional
string
Example: johndoe

Retrieves children for a certain parent affiliate

affiliate_group_id
optional
string
Example: agDSDjd993

Retrieves affiliates for a certain affiliate group

GET https://api.tapfiliate.com/1.6/programs/my-program/affiliates/

Code Example

const request = require("request");

const options = { method: 'GET',
  url: 'https://api.tapfiliate.com/1.6/programs/{program_id}/affiliates/',
  body: '<ADD STRING VALUE>',
  json: true };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Example Response

        [
            {
                "firstname": "John",
                "lastname": "Doe",
                "email": "john@doe.com",
                "company": {
                    "name": "Tapfiliate"
                },
                "address": {
                    "address": "Rapenburgerstraat 173",
                    "postal_code": "1011 VM",
                    "city": "Amsterdam",
                    "state": "Noord-Holland",
                    "country": {
                        "code": "NL" ,
                        "name": "Netherlands"
                    }
                },
                "meta_data": {
                    "foo": "bar"
                },
                "parent_id": "janedoe",
                "referral_link": {
                    "link": "https://yoursite.com/?tap_a=1-123&tap_s=2-abc",
                    "asset_id": "1-123",
                    "source_id": "2-abc"
                },
                "coupon": "JOHN10OFF",
                "approved": null,
                "affiliate_group_id": "ag_axCle_U0iZq6l09dQ3",
            }
        ]

Add an affiliate to a program

POST/programs/{program_id}/affiliates/
Response:200

URI Parameters

program_id
required
string
Example: my-program

The id of the Program to add the affiliate too. This id can be found as part of the url when viewing the program on the platform.

Arguments

affiliate
required
object

Child Arguments

id
required
string

The ìd of the affiliate

approved
optional
boolean,null

An optional approval status. Valid values are: true (Approved, default) | false (Disapproved) | null (Pending)

coupon
optional
string

An optional coupon for this affiliate

POST https://api.tapfiliate.com/1.6/programs/my-program/affiliates/

Code Example

const request = require("request");

const options = { method: 'POST',
  url: 'https://api.tapfiliate.com/1.6/programs/{program_id}/affiliates/',
  headers: { 'content-type': 'application/json' },
  body: 
   { affiliate: { id: '<ADD STRING VALUE>' },
     coupon: '<ADD STRING VALUE>' },
  json: true };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Example Request

{
  "affiliate": {
    "id": "billmurray"
  },
  "approved": false,
  "coupon": "JOHN10OFF"
}

Example Response

{
  "firstname": "John",
  "lastname": "Doe",
  "email": "john@doe.com",
  "company": {
    "name": "Tapfiliate"
  },
  "address": {
    "address": "Rapenburgerstraat 173",
    "postal_code": "1011 VM",
    "city": "Amsterdam",
    "state": "Noord-Holland",
    "country": {
      "code": "NL",
      "name": "Netherlands"
    }
  },
  "meta_data": {
    "foo": "bar"
  },
  "parent_id": "janedoe",
  "referral_link": {
    "link": "https://yoursite.com/?tap_a=1-123&tap_s=2-abc",
    "asset_id": "1-123",
    "source_id": "2-abc"
  },
  "coupon": "JOHN10OFF",
  "approved": true
}

Retrieve an affiliate and their (program specific) details.

Note: Before V1.6, this endpoint would only return data for approved affiliates.

Retrieve an affiliate in a program

GET/programs/{program_id}/affiliates/{affiliate_id}/
Response:200

URI Parameters

program_id
required
string
Example: my-program

The id of the Program.

affiliate_id
required
string
Example: johndoe

The id of the affiliate.

GET https://api.tapfiliate.com/1.6/programs/my-program/affiliates/johndoe/

Code Example

const request = require("request");

const options = { method: 'GET',
  url: 'https://api.tapfiliate.com/1.6/programs/{program_id}/affiliates/{affiliate_id}/' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Example Response

{
    "firstname": "John",
    "lastname": "Doe",
    "email": "john@doe.com",
    "company": {
        "name": "Tapfiliate"
    },
    "address": {
        "address": "Rapenburgerstraat 173",
        "postal_code": "1011 VM",
        "city": "Amsterdam",
        "state": "Noord-Holland",
        "country": {
            "code": "NL" ,
            "name": "Netherlands"
        }
    },
    "meta_data": {
        "foo": "bar"
    },
    "parent_id": "janedoe"
    "referral_link": {
        "link": "https://yoursite.com/?tap_a=1-123&tap_s=2-abc",
        "asset_id": "1-123",
        "source_id": "2-abc"
    },
    "coupon": "JOHN10OFF",
    "approved": true
}

Update an affiliate in a program

PATCH/programs/{program_id}/affiliates/{affiliate_id}/
Response:200

URI Parameters

program_id
required
string
Example: my-program

The id of the Program.

affiliate_id
required
string
Example: johndoe

The id of the affiliate.

Arguments

coupon
required
string

The affiliate’s coupon code for this program

PATCH https://api.tapfiliate.com/1.6/programs/my-program/affiliates/johndoe/

Code Example

const request = require("request");

const options = { method: 'PATCH',
  url: 'https://api.tapfiliate.com/1.6/programs/{program_id}/affiliates/{affiliate_id}/',
  body: { coupon: '<ADD STRING VALUE>' },
  json: true };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Example Request

{
  "coupon": "JOHN20OFF"
}

Example Response

{
    "firstname": "John",
    "lastname": "Doe",
    "email": "john@doe.com",
    "company": {
        "name": "Tapfiliate"
    },
    "address": {
        "address": "Rapenburgerstraat 173",
        "postal_code": "1011 VM",
        "city": "Amsterdam",
        "state": "Noord-Holland",
        "country": {
            "code": "NL" ,
            "name": "Netherlands"
        }
    },
    "meta_data": {
        "foo": "bar"
    },
    "parent_id": "janedoe"
    "referral_link": {
        "link": "https://yoursite.com/?tap_a=1-123&tap_s=2-abc",
        "asset_id": "1-123",
        "source_id": "2-abc"
    },
    "coupon": "JOHN20OFF",
    "approved": true
}

Approve an affiliate

PUT/programs/{program_id}/affiliates/{affiliate_id}/approved/
Response:200

URI Parameters

program_id
required
string
Example: my-program

The id of the program to add the affiliate too. This id can be found as part of the url when viewing the program on the platform.

affiliate_id
required
string
Example: my-affiliate

The id of the affiliate to approve.

PUT https://api.tapfiliate.com/1.6/programs/my-program/affiliates/my-affiliate/approved/

Code Example

const request = require("request");

const options = { method: 'PUT',
  url: 'https://api.tapfiliate.com/1.6/programs/{program_id}/affiliates/{affiliate_id}/approved/',
  headers: { 'content-type': 'application/json' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Example Response

{
  "firstname": "John",
  "lastname": "Doe",
  "email": "john@doe.com",
  "company": {
    "name": "Tapfiliate"
  },
  "address": {
    "address": "Rapenburgerstraat 173",
    "postal_code": "1011 VM",
    "city": "Amsterdam",
    "state": "Noord-Holland",
    "country": {
      "code": "NL",
      "name": "Netherlands"
    }
  },
  "meta_data": {
    "foo": "bar"
  },
  "parent_id": "janedoe",
  "referral_link": {
    "link": "https://yoursite.com/?tap_a=1-123&tap_s=2-abc",
    "asset_id": "1-123",
    "source_id": "2-abc"
  },
  "coupon": "JOHN10OFF",
  "approved": true
}

Disapprove an affiliate

DELETE/programs/{program_id}/affiliates/{affiliate_id}/approved/
Response:200

URI Parameters

program_id
required
string
Example: my-program

The id of the program to add the affiliate too. This id can be found as part of the url when viewing the program on the platform.

affiliate_id
required
string
Example: my-affiliate

The id of the affiliate to approve.

DELETE https://api.tapfiliate.com/1.6/programs/my-program/affiliates/my-affiliate/approved/

Code Example

const request = require("request");

const options = { method: 'DELETE',
  url: 'https://api.tapfiliate.com/1.6/programs/{program_id}/affiliates/{affiliate_id}/approved/',
  headers: { 'content-type': 'application/json' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Example Response

{
  "firstname": "John",
  "lastname": "Doe",
  "email": "john@doe.com",
  "company": {
    "name": "Tapfiliate"
  },
  "address": {
    "address": "Rapenburgerstraat 173",
    "postal_code": "1011 VM",
    "city": "Amsterdam",
    "state": "Noord-Holland",
    "country": {
      "code": "NL",
      "name": "Netherlands"
    }
  },
  "meta_data": {
    "foo": "bar"
  },
  "parent_id": "janedoe",
  "referral_link": {
    "link": "https://yoursite.com/?tap_a=1-123&tap_s=2-abc",
    "asset_id": "1-123",
    "source_id": "2-abc"
  },
  "coupon": "JOHN10OFF",
  "approved": false
}

List program commission types

GET/programs/{program_id}/commission-types/
Response:200

URI Parameters

program_id
required
string
Example: my-program

The id of the Program. This id can be found as part of the url when viewing the program on the platform.

GET https://api.tapfiliate.com/1.6/programs/my-program/commission-types/

Code Example

const request = require("request");

const options = { method: 'GET',
  url: 'https://api.tapfiliate.com/1.6/programs/{program_id}/commission-types/' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Example Response

[
  {
    "title": "standard",
    "commission_form": "percentage",
    "affiliate_group_overrides": [
      {
        "commission_form": "percentage",
        "commission_value": 100,
        "affiliate_group_id": "ag_axCle_U0iZq6l09dQ3"
      }
    ],
    "identifier": "standard",
    "commission_value": 10,
    "recurrence": "once",
    "visible": true
  }
]

List program MLM levels

GET/programs/{program_id}/levels/
Response:200

URI Parameters

program_id
required
string
Example: my-program

The id of the Program. This id can be found as part of the url when viewing the program on the platform.

GET https://api.tapfiliate.com/1.6/programs/my-program/levels/

Code Example

const request = require("request");

const options = { method: 'GET',
  url: 'https://api.tapfiliate.com/1.6/programs/{program_id}/levels/' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Example Response

[
  {
    "title": "Level 2",
    "commission_form": "percentage",
    "identifier": "level-2",
    "commission_value": 10
  },
  {
    "title": "Level 3",
    "commission_form": "percentage",
    "identifier": "level-3",
    "commission_value": 5
  }
]

List program bonuses

GET/programs/{program_id}/bonuses/
Response:200

URI Parameters

program_id
required
string
Example: my-program

The id of the Program. This id can be found as part of the url when viewing the program on the platform.

GET https://api.tapfiliate.com/1.6/programs/my-program/bonuses/

Code Example

const request = require("request");

const options = { method: 'GET',
  url: 'https://api.tapfiliate.com/1.6/programs/{program_id}/bonuses/' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Example Response

[
  {
    "title": "Sales tiger incentive",
    "commission_form": "percentage",
    "identifier": "sales-tiger-incentive",
    "interval": "calmo",
    "target_type": "conversion_amount_sum",
    "active": true,
    "start_date": null,
    "end_date": null
  }
]

The following section describes the endpoints for our new Payments system, rolled out early 2019. You can check which version of our payments system you’re on, by looking at the name of the menu item when logged in to the platform. The current system is called “Payments”, and the legacy system is called “Payouts”.

List all balances

GET/balances/
Response:200

Returns a non-paginated list of all non-zero affiliate balances.

GET https://api.tapfiliate.com/1.6/balances/

Code Example

const request = require("request");

const options = { method: 'GET',
  url: 'https://api.tapfiliate.com/1.6/balances/',
  headers: { 'content-type': 'application/json' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Example Response

[
  {
    "affiliate_id": "johndoe",
    "balances": {
      "USD": 20.5,
      "EUR": 10
    }
  },
  {
    "affiliate_id": "janedoe",
    "balances": {
      "USD": 99.5
    }
  }
]

Retrieve payment

GET/payments/
Response:200
GET https://api.tapfiliate.com/1.6/payments/

Code Example

const request = require("request");

const options = { method: 'GET',
  url: 'https://api.tapfiliate.com/1.6/payments/',
  headers: { 'content-type': 'application/json' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Example Response

{
  "id": "pa_sfHVYj-087mTvBNIPH",
  "created_at": "2019-03-29T08:36:07+00:00",
  "affiliate": {
    "id": "johndoe",
    "firstname": "John",
    "lastname": "Doe"
  },
  "amount": 20.5,
  "currency": "USD"
}

Cancel payment

DELETE/payments/
Response:204

Cancels the payment and re-adds the amount to the affiliate’s balance

DELETE https://api.tapfiliate.com/1.6/payments/

List all payments

GET/payments/
Response:200
GET https://api.tapfiliate.com/1.6/payments/

Code Example

const request = require("request");

const options = { method: 'GET',
  url: 'https://api.tapfiliate.com/1.6/payments/',
  headers: { 'content-type': 'application/json' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Example Response

[
  {
    "id": "pa_sfHVYj-087mTvBNIPH",
    "created_at": "2019-03-29T08:36:07+00:00",
    "affiliate": {
      "id": "johndoe",
      "firstname": "John",
      "lastname": "Doe"
    },
    "amount": 20.5,
    "currency": "USD"
  }
]

Create a payment

POST/payments/
Response:200

Create a single payment or multiple (using an array of payments)

Arguments

affiliate_id
required
string

The affiliate id

amount
required
number

The payment amount

currency
required
string

The payment currency

POST https://api.tapfiliate.com/1.6/payments/

Code Example

const request = require("request");

const options = { method: 'POST',
  url: 'https://api.tapfiliate.com/1.6/payments/',
  body: 
   { affiliate_id: '<ADD STRING VALUE>',
     amount: 0,
     currency: '<ADD STRING VALUE>' },
  json: true };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});

Example Request

{
  "affiliate_id": "johndoe",
  "amount": 30.55,
  "currency": "USD"
}

Example Response

[
  {
    "id": "pa_sfHVYj-087mTvBNIPH",
    "created_at": "2019-03-29T08:36:07+00:00",
    "affiliate": {
      "id": "johndoe",
      "firstname": "John",
      "lastname": "Doe"
    },
    "amount": 20.5,
    "currency": "USD"
  }
]