A reference guide to the Tapfiliate REST API.

The Tapfiliate API is based around REST (Representational State Transfer). 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 Dashboard. Your API keys can approve commissions and payouts, 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'

Note that page numbering is 1-based and that 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 Conversion

GET/conversions/{conversion_id}/

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/
Responses200

Example Response Header

Content-Type: application/json

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": "standard",
      "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"
  },
  "meta_data": {
    "foo": "bar"
  }
}

Code Example

var request = require("request");

var 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);
});

Update a Conversion

PATCH/conversions/{conversion_id}/

URI Parameters

conversion_id
required
number
Example: 1

Numeric id of the conversion to perform action with.

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/
Requestsexample 1

Example Request Header

Content-Type: application/json

Example Request

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

Example Response Header

Content-Type: application/json

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": "standard",
      "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"
  },
  "meta_data": {
    "foo": "bar"
  }
}

Code Example

var request = require("request");

var options = { method: 'PATCH',
  url: 'https://api.tapfiliate.com/1.6/conversions/{conversion_id}/',
  headers: { 'content-type': 'application/json' },
  body: { amount: 0, external_id: '<ADD STRING VALUE>', meta_data: {} },
  json: true };

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

  console.log(body);
});

Delete a Conversion

DELETE/conversions/{conversion_id}/

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/
Responses204

Example Response Header

Content-Type: application/json

Code Example

var request = require("request");

var 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/{?program_id}{?external_id}{?affiliate_id}{?pending}{?date_from}{?date_to}

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/?program_id=my-program?external_id=Di4Hjskdns93?affiliate_id=john?pending=1?date_from=2015-03-23?date_to=2015-05-28
Responses200

Example Response Header

Content-Type: application/json

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": "standard",
        "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"
    },
    "meta_data": {
      "foo": "bar"
    }
  }
]

Create a conversion

POST/conversions/{?override_max_cookie_time}

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

URI Parameters

override_max_cookie_time
optional
boolean
Default: false 

Arguments

click_id
optional
string

abc (string) - The click id. Grab this value in the callback of the ‘detectClick’ method of our JS code when the visitor lands on your website and persist it (e.g. in a cookie) for later use in this API call. More info on callbacks here: https://tapfiliate.com/knowledge-base/articles/advanced-tracking/#callbacks. Alternatively, when using the redirect tracking method, this value can be included in the url using a merge tag.

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

visitor_id
optional
string

xyz (string, optional) - Grab this value from our JS code: tap.vid

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

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

POST https://api.tapfiliate.com/1.6/conversions/?override_max_cookie_time=
Requestsexample 1

Example Request Header

Content-Type: application/json

Example Request

{
    "visitor_id": "123-abc",
    "click_id": "123-abc",
    "asset_id": "123-abc",
    "source_id": "456-def",
    "coupon": "JOHN10OFF",
    "external_id": "order0005",
    "amount": 10,
    "commission_type": "signup",
    "commissions": [{
        sub_amount: 10,
        commission_type: "newsletter"
    }],
    "meta_data": {
        "foo": "bar"
    },
    "program_group": "my-group"
}
Responses200

Example Response Header

Content-Type: application/json

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": "standard",
      "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"
  },
  "meta_data": {
    "foo": "bar"
  }
}

Add commissions to a conversion

POST/conversions/{conversion_id}/commissions/

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/
Requestsexample 1

Example Request Header

Content-Type: application/json

Example Request

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

Example Response Header

Content-Type: application/json

Example Response

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

Code Example

var request = require("request");

var 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);
});

Retrieve meta data

GET/conversions/{conversion_id}/meta-data/

URI Parameters

conversion_id
required
number
Example: 123

The id of the conversion.

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

Example Response Header

Content-Type: application/json

Example Response

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

Code Example

var request = require("request");

var 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);
});

Update (replace) meta data

PUT/conversions/{conversion_id}/meta-data/

URI Parameters

conversion_id
required
number
Example: 123

The id of the conversion.

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

Example Request Header

Content-Type: application/json

Example Request

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

Example Response Header

Content-Type: application/json

Example Response

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

Code Example

var request = require("request");

var 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);
});

Retrieve meta data by key

GET/conversions/{conversion_id}/meta-data/{key}/

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/
Responses200

Example Response Header

Content-Type: application/json

Example Response

{
    "value": "bar",
}

Code Example

var request = require("request");

var 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);
});

Set meta data by key

PUT/conversions/{conversion_id}/meta-data/{key}/

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/
Requestsexample 1

Example Request Header

Content-Type: application/json

Example Request

{
  "value": "bar"
}
Responses200

Example Response Header

Content-Type: application/json

Example Response

{
    "value": "bar",
}

Code Example

var request = require("request");

var 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);
});

Delete meta data by key

DELETE/conversions/{conversion_id}/meta-data/{key}/

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/
Responses204

Example Response Header

Content-Type: application/json

Code Example

var request = require("request");

var 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}/

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/
Responses200

Example Response Header

Content-Type: application/json

Example Response

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

Code Example

var request = require("request");

var 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);
});

Update a commission

PATCH/commissions/{commission_id}/

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/
Requestsexample 1

Example Request Header

Content-Type: application/json

Example Request

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

Example Response Header

Content-Type: application/json

Example Response

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

Code Example

var request = require("request");

var 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);
});

List all commissions

GET/commissions/{?affiliate_id}{?status}{?paid}

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/?affiliate_id=john?status=approved?paid=1
Responses200

Example Response Header

Content-Type: application/json

Example Response

[
  {
    "id": 1,
    "amount": 60,
    "approved": false,
    "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/

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/
Responses200

Example Response Header

Content-Type: application/json

Example Response

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

Code Example

var request = require("request");

var 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);
});

Disapprove a commission

DELETE/commissions/{commission_id}/approved/

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/
Responses200

Example Response Header

Content-Type: application/json

Example Response

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

Code Example

var request = require("request");

var 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);
});

Retrieve an affiliate

GET/affiliates/{affiliate_id}/

URI Parameters

affiliate_id
required
string
Example: johndoe

The id of the affiliate.

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

Example Response Header

Content-Type: application/json

Example Response

{
  "id": "johndoe",
  "firstname": "John",
  "lastname": "Doe",
  "email": "john@doe.com",
  "password": "password1234",
  "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"
}

Code Example

var request = require("request");

var 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);
});

List all affiliates

GET/affiliates/{?click_id}{?source_id}{?email}

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

GET https://api.tapfiliate.com/1.6/affiliates/?click_id=123-abc?source_id=123-abc?email=john@doe.com
Responses200

Example Response Header

Content-Type: application/json

Example Response

[
    {
        "id": "johndoe",
        "firstname": "John",
        "lastname": "Doe",
        "email": "john@doe.com",
        "password": "password1234",
        "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/

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

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

Example Request Header

Content-Type: application/json

Example Request

{
  "firstname": "John",
  "lastname": "Doe",
  "email": "john@doe.com",
  "password": "password1234",
  "company": {
    "name": "Tapfiliate"
  }
}
Responses200

Example Response Header

Content-Type: application/json

Example Response

{
  "id": "johndoe",
  "firstname": "John",
  "lastname": "Doe",
  "email": "john@doe.com",
  "password": "password1234",
  "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"
}

Code Example

var request = require("request");

var 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>' } },
  json: true };

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

  console.log(body);
});

Retrieve note

GET/affiliates/{affiliate_id}/meta-data/{id}/

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/meta-data/1/
Responses200

Example Response Header

Content-Type: application/json

Example Response

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

Code Example

var request = require("request");

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

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

  console.log(body);
});

Update note

PUT/affiliates/{affiliate_id}/meta-data/{id}/

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/meta-data/1/
Requestsexample 1

Example Request Header

Content-Type: application/json

Example Request

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

Example Response Header

Content-Type: application/json

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",
    }
}

Code Example

var request = require("request");

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

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

  console.log(body);
});

Delete note

DELETE/affiliates/{affiliate_id}/meta-data/{id}/

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/meta-data/1/
Responses204

Example Response Header

Content-Type: application/json

Code Example

var request = require("request");

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

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

  console.log(body);
});

List notes

GET/affiliates/{affiliate_id}/notes/

URI Parameters

affiliate_id
required
string
Example: johndoe

The id of the affiliate.

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

Example Response Header

Content-Type: application/json

Example Response

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

Code Example

var request = require("request");

var 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);
});

Create note

POST/affiliates/{affiliate_id}/notes/

URI Parameters

affiliate_id
required
string
Example: johndoe

The id of the affiliate.

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

Example Request Header

Content-Type: application/json

Example Request

{
  "message": "Great guy!"
}
Responses200

Example Response Header

Content-Type: application/json

Example Response

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

Code Example

var request = require("request");

var 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);
});

Retrieve meta data

GET/affiliates/{affiliate_id}/meta-data/

URI Parameters

affiliate_id
required
string
Example: johndoe

The id of the affiliate.

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

Example Response Header

Content-Type: application/json

Example Response

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

Code Example

var request = require("request");

var 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);
});

Update (replace) meta data

PUT/affiliates/{affiliate_id}/meta-data/

URI Parameters

affiliate_id
required
string
Example: johndoe

The id of the affiliate.

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

Example Request Header

Content-Type: application/json

Example Request

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

Example Response Header

Content-Type: application/json

Example Response

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

Code Example

var request = require("request");

var 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);
});

Retrieve meta data by key

GET/affiliates/{affiliate_id}/meta-data/{key}/

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/
Responses200

Example Response Header

Content-Type: application/json

Example Response

{
    "value": "My value",
}

Code Example

var request = require("request");

var 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);
});

Set meta data by key

PUT/affiliates/{affiliate_id}/meta-data/{key}/

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/
Requestsexample 1

Example Request Header

Content-Type: application/json

Example Request

{
  "value": "bar"
}
Responses200

Example Response Header

Content-Type: application/json

Example Response

{
  "value": "bar"
}

Code Example

var request = require("request");

var 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);
});

Delete meta data by key

DELETE/affiliates/{affiliate_id}/meta-data/{key}/

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/
Responses204

Example Response Header

Content-Type: application/json

Code Example

var request = require("request");

var 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);
});

Set payout method

PUT/affiliates/{affiliate_id}/payout-methods/{payout_method_id}/

The body of the request should contain the appropriate data for the payout method you are setting. De 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/
Requestsexample 1

Example Request Header

Content-Type: application/json

Example Request

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

Example Response Header

Content-Type: application/json

Example Response

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

Code Example

var request = require("request");

var 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);
});

Set parent

POST/affiliates/{child_affiliate_id}/parent/

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/
Requestsexample 1

Example Request Header

Content-Type: application/json

Example Request

{
  "affiliate_id": "janedoe"
}
Responses200

Example Response Header

Content-Type: application/json

Example Response

{
  "id": "johndoe",
  "firstname": "John",
  "lastname": "Doe",
  "email": "john@doe.com",
  "password": "password1234",
  "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"
}

Code Example

var request = require("request");

var 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);
});

Remove parent

DELETE/affiliates/{child_affiliate_id}/parent/

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/
Responses204

Example Response Header

Content-Type: application/json

Code Example

var request = require("request");

var 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);
});

List affiliate's payouts

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

Example Response Header

Content-Type: application/json

Example Response

[
  {
    "id": 2,
    "created_at": "2016-05-24T14:23:41+0000",
    "affiliate": {
      "id": "billmurray",
      "firstname": "Bill",
      "lastname": "Murray",
      "payout_methods": [
        {
          "title": "Paypal",
          "id": "paypal",
          "details": {
            "paypal_address": "bill@murray.com"
          },
          "primary": true
        }
      ]
    },
    "amount": 21.6,
    "paid": true
  }
]

Retrieve a Program

GET/programs/{program_id}/

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/
Responses200

Example Response

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

Code Example

var request = require("request");

var 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);
});

List all programs

GET/programs/?{&asset_id}

URI Parameters

asset_id
optional
string
Example: 123-abc

An asset id

GET https://api.tapfiliate.com/1.6/programs/?&asset_id=123-abc
Responses200

Example Response Header

Content-Type: application/json

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/

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.

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

Example Request Header

Content-Type: application/json
Responses200

Example Response Header

Content-Type: application/json

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
  }
]

Code Example

var request = require("request");

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

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

  console.log(body);
});

Add an affiliate to a program

POST/programs/{program_id}/affiliates/

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

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/
Requestsexample 1

Example Request Header

Content-Type: application/json

Example Request

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

Example Response Header

Content-Type: application/json

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
}

Code Example

var request = require("request");

var 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>' },
     approved: false,
     coupon: '<ADD STRING VALUE>' },
  json: true };

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

  console.log(body);
});

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}/

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/
Responses200

Example Response Header

Content-Type: application/json

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
}

Code Example

var request = require("request");

var 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);
});

Update an affiliate in a program

PUT/programs/{program_id}/affiliates/{affiliate_id}/

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

PUT https://api.tapfiliate.com/1.6/programs/my-program/affiliates/johndoe/
Requestsexample 1

Example Request Header

Content-Type: application/json

Example Request

{
  "coupon": "JOHN20OFF"
}
Responses200

Example Response Header

Content-Type: application/json

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
}

Code Example

var request = require("request");

var options = { method: 'PUT',
  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);
});

Approve an affiliate

PUT/programs/{program_id}/affiliates/{affiliate_id}/approved/

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/
Responses200

Example Response Header

Content-Type: application/json

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
}

Code Example

var request = require("request");

var 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);
});

Disapprove an affiliate

DELETE/programs/{program_id}/affiliates/{affiliate_id}/approved/

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/
Responses200

Example Response Header

Content-Type: application/json

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
}

Code Example

var request = require("request");

var 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);
});

Retrieve a Payout

GET/payouts/{payout_id}/

URI Parameters

payout_id
required
string

The id of the payout.

GET https://api.tapfiliate.com/1.6/payouts/payout_id/
Responses200

Example Response Header

Content-Type: application/json

Example Response

{
  "id": 2,
  "created_at": "2016-05-24T14:23:41+0000",
  "affiliate": {
    "id": "billmurray",
    "firstname": "Bill",
    "lastname": "Murray",
    "payout_methods": [
      {
        "title": "Paypal",
        "id": "paypal",
        "details": {
          "paypal_address": "bill@murray.com"
        },
        "primary": true
      }
    ]
  },
  "amount": 21.6,
  "paid": true
}

Code Example

var request = require("request");

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

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

  console.log(body);
});

List all Payouts

GET/payouts/{?status}

URI Parameters

status
optional
string
Example: paid

The status of the payout. Valid options are: paid | unpaid

GET https://api.tapfiliate.com/1.6/payouts/?status=paid
Responses200

Example Response Header

Content-Type: application/json

Example Response

[
  {
    "id": 2,
    "created_at": "2016-05-24T14:23:41+0000",
    "affiliate": {
      "id": "billmurray",
      "firstname": "Bill",
      "lastname": "Murray",
      "payout_methods": [
        {
          "title": "Paypal",
          "id": "paypal",
          "details": {
            "paypal_address": "bill@murray.com"
          },
          "primary": null
        }
      ]
    },
    "amount": 21.6,
    "paid": false
  }
]

Generate Payouts

POST/payouts/

Arguments

up_to
optional
string

05-31 (date, optional) … An optional up to date

POST https://api.tapfiliate.com/1.6/payouts/
Requestsexample 1

Example Request Header

Content-Type: application/json

Example Request

{
  "up_to": "2016"
}
Responses200

Example Response Header

Content-Type: application/json

Example Response

[
  {
    "id": 2,
    "created_at": "2016-05-24T14:23:41+0000",
    "affiliate": {
      "id": "billmurray",
      "firstname": "Bill",
      "lastname": "Murray",
      "payout_methods": [
        {
          "title": "Paypal",
          "id": "paypal",
          "details": {
            "paypal_address": "bill@murray.com"
          },
          "primary": null
        }
      ]
    },
    "amount": 21.6,
    "paid": false
  }
]

Code Example

var request = require("request");

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

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

  console.log(body);
});

Mark a payout as paid or as unpaid

Mark a Payout as paid

PUT/payouts/{payout_id}/paid/

URI Parameters

payout_id
required
number
Example: 1

Numeric id of the payout.

PUT https://api.tapfiliate.com/1.6/payouts/1/paid/
Responses200

Example Response Header

Content-Type: application/json

Example Response

{
  "id": 2,
  "created_at": "2016-05-24T14:23:41+0000",
  "affiliate": {
    "id": "billmurray",
    "firstname": "Bill",
    "lastname": "Murray",
    "payout_methods": [
      {
        "title": "Paypal",
        "id": "paypal",
        "details": {
          "paypal_address": "bill@murray.com"
        },
        "primary": null
      }
    ]
  },
  "amount": 21.6,
  "paid": false
}

Code Example

var request = require("request");

var options = { method: 'PUT',
  url: 'https://api.tapfiliate.com/1.6/payouts/{payout_id}/paid/',
  headers: { 'content-type': 'application/json' } };

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

  console.log(body);
});

Mark a Payout as unpaid

DELETE/payouts/{payout_id}/paid/

URI Parameters

payout_id
required
number
Example: 1

Numeric id of the payout.

DELETE https://api.tapfiliate.com/1.6/payouts/1/paid/
Responses200

Example Response Header

Content-Type: application/json

Example Response

{
  "id": 2,
  "created_at": "2016-05-24T14:23:41+0000",
  "affiliate": {
    "id": "billmurray",
    "firstname": "Bill",
    "lastname": "Murray",
    "payout_methods": [
      {
        "title": "Paypal",
        "id": "paypal",
        "details": {
          "paypal_address": "bill@murray.com"
        },
        "primary": null
      }
    ]
  },
  "amount": 21.6,
  "paid": false
}

Code Example

var request = require("request");

var options = { method: 'DELETE',
  url: 'https://api.tapfiliate.com/1.6/payouts/{payout_id}/paid/',
  headers: { 'content-type': 'application/json' } };

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

  console.log(body);
});