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.
Link Header
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:
| Name | Description |
|---|---|
| next | Shows the URL of the immediate next page of results. |
| last | Shows the URL of the last page of results. |
| first | Shows the URL of the first page of results. |
| prev | Shows 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: 1Numeric
idof the conversion to perform action with.
Example Response Header
Content-Type: application/jsonExample 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: 1Numeric
idof the conversion to perform action with.
Arguments
- amount
optional numberThe new amount for the commission
- external_id
optional stringA 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 objectMeta data for this resource
Child Arguments
Example Request Header
Content-Type: application/jsonExample Request
{
"amount": 17.95,
"external_id": "ORD123",
"meta_data": {
"foo": "bar"
}
}Example Response Header
Content-Type: application/jsonExample 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: 1Numeric
idof the conversion to perform action with.
Example Response Header
Content-Type: application/jsonCode 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-programThe program Id
- external_id
optional string
Example: Di4Hjskdns93The 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: johnThe affiliate Id
- pending
optional bool
Example: 1Only show conversions that have pending commissions
- date_from
optional string
Example: 2015-03-23Date From
- date_to
optional string
Example: 2015-05-28Date To
Example Response Header
Content-Type: application/jsonExample 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 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
URI Parameters
- override_max_cookie_time
optional boolean
Default: false
Arguments
- referral_code
optional stringAn affiliate’s referral code. This corresponds to the value of
ref=in their referral link.- click_id
optional stringabc (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
redirecttracking method, this value can be included in the url using a merge tag.- coupon
optional stringA coupon code to track the conversion by
- asset_id
optional stringabc (string, optional) - The asset id
- source_id
optional stringdef (string, optional) - The source id
- external_id
optional stringA 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 numberThe conversion amount
- commission_type
optional stringIf no commission type is supplied, the programs default commission type is used
- commissions
optional arrayWill override “amount” and “commission_type” if set
- meta_data
optional objectMeta data for this resource
Child Arguments
- program_group
optional stringThe program group id
Example Request Header
Content-Type: application/jsonExample 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"
}
Example Response Header
Content-Type: application/jsonExample 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: 1Numeric
idof the conversion to add the commission(s) to.
Arguments
- conversion_sub_amount
required numberThe amount on which the commission should be calculated using the supplied, or the program’s default commission type
- commission_type
optional stringIf no commission type is supplied, the programs default commission type is used
- comment
optional stringA comment for this commission. The comment will be visible to the affiliate
Example Request Header
Content-Type: application/jsonExample Request
{
"conversion_sub_amount": 20.5,
"commission_type": "mycommissiontype",
"comment": "Awesome!"
}Example Response Header
Content-Type: application/jsonExample 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: 123The
idof the conversion.
Example Response Header
Content-Type: application/jsonExample 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: 123The
idof the conversion.
Example Request Header
Content-Type: application/jsonExample Request
{
"foo": "bar",
"baz": "qux"
}Example Response Header
Content-Type: application/jsonExample 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: 123The
idof the conversion.- key
required string
Example: fooThe meta data
key.
Example Response Header
Content-Type: application/jsonExample 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: 123The
idof the conversion.- key
required string
Example: fooThe meta data
key.
Example Request Header
Content-Type: application/jsonExample Request
{
"value": "bar"
}Example Response Header
Content-Type: application/jsonExample 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: 123The
idof the conversion.- key
required string
Example: fooThe meta data
key.
Example Response Header
Content-Type: application/jsonCode 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: 1Numeric
idof the commission to perform action with.
Example Response Header
Content-Type: application/jsonExample 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: 1Numeric
idof the commission to perform action with.
Arguments
- amount
required numberThe new amount for the commission
- comment
optional stringA comment for this commission. The comment will be visible to the affiliate
Example Request Header
Content-Type: application/jsonExample Request
{
"amount": 30.55,
"comment": "\"foo bar\""
}Example Response Header
Content-Type: application/jsonExample 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: johnThe affiliate Id
- status
optional string
Example: approvedAn optional approval status to filter by. Valid values are:
approved|disapproved|pending- paid
optional bool
Example: 1Only show commissions that are paid out. Valid values are:
1|0
Example Response Header
Content-Type: application/jsonExample 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"
}
]Commission approval
Aprove or disapprove a commission
Approve a commission
PUT/commissions/{commission_id}/approved/URI Parameters
- commission_id
required number
Example: 1Numeric
idof the commission to perform action with.
Example Response Header
Content-Type: application/jsonExample 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: 1Numeric
idof the commission to perform action with.
Example Response Header
Content-Type: application/jsonExample 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: johndoeThe
idof the affiliate.
Example Response Header
Content-Type: application/jsonExample 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-abcA click id
- source_id
optional string
Example: 123-abcA source id
- email
optional string
Example: john@doe.comAn email address
Example Response Header
Content-Type: application/jsonExample 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 stringThe affiliate’s firstname
- lastname
required stringThe affiliate’s lastname
- email
required stringThe affiliate’s email
- password
optional stringThe password for the new account. If no password is given, one is generated and passed in the response
- company
optional objectThe affiliate’s company data
Child Arguments
- name
optional stringThe company’s name
- name
Example Request Header
Content-Type: application/jsonExample Request
{
"firstname": "John",
"lastname": "Doe",
"email": "john@doe.com",
"password": "password1234",
"company": {
"name": "Tapfiliate"
}
}Example Response Header
Content-Type: application/jsonExample 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);
});
Example Response Header
Content-Type: application/jsonCode Example
var request = require("request");
var options = { method: 'DELETE',
url: 'https://api.tapfiliate.com/1.6/affiliates/' };
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: johndoeThe
idof the affiliate.- id
required int
Example: 1The
idof the note.
Example Response Header
Content-Type: application/jsonExample 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: johndoeThe
idof the affiliate.- id
required int
Example: 1The
idof the note.
Example Request Header
Content-Type: application/jsonExample Request
{
"message": "Not so great guy!"
}Example Response Header
Content-Type: application/jsonExample 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: johndoeThe
idof the affiliate.- id
required int
Example: 1The
idof the note.
Example Response Header
Content-Type: application/jsonCode 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: johndoeThe
idof the affiliate.
Example Response Header
Content-Type: application/jsonExample 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: johndoeThe
idof the affiliate.
Example Request Header
Content-Type: application/jsonExample Request
{
"message": "Great guy!"
}Example Response Header
Content-Type: application/jsonExample 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: johndoeThe
idof the affiliate.
Example Response Header
Content-Type: application/jsonExample 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: johndoeThe
idof the affiliate.
Example Request Header
Content-Type: application/jsonExample Request
{
"foo": "bar",
"baz": "qux"
}Example Response Header
Content-Type: application/jsonExample 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: johndoeThe
idof the affiliate.- key
required string
Example: fooThe meta data
key.
Example Response Header
Content-Type: application/jsonExample 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: johndoeThe
idof the affiliate.- key
required string
Example: fooThe meta data
key.
Example Request Header
Content-Type: application/jsonExample Request
{
"value": "bar"
}Example Response Header
Content-Type: application/jsonExample 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: johndoeThe
idof the affiliate.- key
required string
Example: fooThe meta data
key.
Example Response Header
Content-Type: application/jsonCode 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: johndoeThe
idof the affiliate- payout_method_id
required string
Example: paypalThe
idof the payout method
Example Request Header
Content-Type: application/jsonExample Request
{
"paypal_address": "john@doe.com"
}Example Response Header
Content-Type: application/jsonExample 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: johndoeThe
idof the affiliate whoms parent is being set.
Arguments
- affiliate_id
required string
Example Request Header
Content-Type: application/jsonExample Request
{
"affiliate_id": "janedoe"
}Example Response Header
Content-Type: application/jsonExample 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: johndoeThe
idof the affiliate whoms parent is being set.
Example Response Header
Content-Type: application/jsonCode 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);
});
Example Response Header
Content-Type: application/jsonExample 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-programThe
idof the Program. This id can be found as part of the url when viewing the program on the platform.
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-abcAn asset id
Example Response Header
Content-Type: application/jsonExample 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-programThe
idof the Program to add the affiliate too. This id can be found as part of the url when viewing the program on the platform.
Example Request Header
Content-Type: application/jsonExample Response Header
Content-Type: application/jsonExample 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-programThe
idof 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 objectChild Arguments
- id
required stringThe
ìdof the affiliate
- id
- approved
optional booleanAn optional approval status. Valid values are:
true(Approved, default) |false(Disapproved) |null(Pending)- coupon
optional stringAn optional coupon for this affiliate
Example Request Header
Content-Type: application/jsonExample Request
{
"affiliate": {
"id": "billmurray"
},
"approved": false,
"coupon": "JOHN10OFF"
}Example Response Header
Content-Type: application/jsonExample 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);
});
Affiliate in program
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-programThe
idof the Program.- affiliate_id
required string
Example: johndoeThe
idof the affiliate.
Example Response Header
Content-Type: application/jsonExample 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-programThe
idof the Program.- affiliate_id
required string
Example: johndoeThe
idof the affiliate.
Arguments
- coupon
required stringThe affiliate’s coupon code for this program
Example Request Header
Content-Type: application/jsonExample Request
{
"coupon": "JOHN20OFF"
}Example Response Header
Content-Type: application/jsonExample 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-programThe
idof 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-affiliateThe
idof the affiliate to approve.
Example Response Header
Content-Type: application/jsonExample 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-programThe
idof 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-affiliateThe
idof the affiliate to approve.
Example Response Header
Content-Type: application/jsonExample 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);
});
Example Response Header
Content-Type: application/jsonExample 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: paidThe status of the payout. Valid options are: paid | unpaid
Example Response Header
Content-Type: application/jsonExample 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 string05-31 (date, optional) … An optional up to date
Example Request Header
Content-Type: application/jsonExample Request
{
"up_to": "2016"
}Example Response Header
Content-Type: application/jsonExample 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);
});
Payout paid status
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: 1Numeric
idof the payout.
Example Response Header
Content-Type: application/jsonExample 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": true
}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: 1Numeric
idof the payout.
Example Response Header
Content-Type: application/jsonExample 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);
});