NAV
bash javascript

Info

Welcome to the generated API reference. Get Postman Collection

Affiliates

Get list affiliate


Requires authentication

Example request:

curl -X GET -G "https://aff-api.uppromote.com/api/v1/affiliates?limit=10&page=2&status=true&email_verified=true" \
    -H "Authorization: Bearer {api_key}" \
    -H "Accept: application/json"
const url = new URL("https://aff-api.uppromote.com/api/v1/affiliates");

    let params = {
            "limit": "10",
            "page": "2",
            "status": "true",
            "email_verified": "true",
        };
    Object.keys(params).forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Authorization": "Bearer {api_key}",
    "Accept": "application/json",
    "Content-Type": "application/json",
}

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "data": [
        {
            "id": 310,
            "email": "janet.zieme@hotmail.com",
            "first_name": "Lemuel",
            "last_name": "Donnelly",
            "status": 1,
            "email_verified": 1,
            "company": null,
            "address": null,
            "country": null,
            "city": "new york",
            "state": null,
            "zipcode": null,
            "phone": null,
            "facebook": "http:\/\/facebook.com\/fasferwe",
            "youtube": "https:\/\/www.youtube.com\/watch?v=87iWAReuuCc",
            "instagram": "https:\/\/www.instagram.com\/profile",
            "twitter": null,
            "created_at_timestamp": 1594010524,
            "affiliate_link": "https:\/\/yourdomain\/home?sca_ref=310.uITkuLlOBB",
            "program_id": 19,
            "program_name": "Prof. Granville Test",
            "custom_fields": [
                {
                    "value": "PENSACO",
                    "label": "Tradingview Username",
                    "key": "uqP05lUx"
                },
                {
                    "value": "https:\/\/www.facebook.com\/profile",
                    "label": "Where will you be posting your affiliate link? Provide link here.",
                    "key": "bC39Drmj"
                }
            ],
            "coupons": [
                {
                    "id": 10,
                    "affiliate_id": 310,
                    "coupon": "QSDFDSFASD",
                    "description": "description text here",
                    "created_timestamp": 1572593495
                },
                {
                    "id": 11,
                    "affiliate_id": 310,
                    "coupon": "SDFDSFASD",
                    "description": "description text here",
                    "created_timestamp": 1572596295
                }
            ]
        },
        {
            "id": 311,
            "email": "paxton64@lehner.biz",
            "first_name": "Marshall",
            "last_name": "Bartoletti",
            "status": 0,
            "email_verified": 1,
            "company": null,
            "address": null,
            "country": null,
            "city": "new york",
            "state": null,
            "zipcode": null,
            "phone": null,
            "facebook": "http:\/\/facebook.com\/fasferwe",
            "youtube": "https:\/\/www.youtube.com\/watch?v=87iWAReuuCc",
            "instagram": "https:\/\/www.instagram.com\/profile",
            "twitter": null,
            "created_at_timestamp": 1594020991,
            "affiliate_link": "https:\/\/yourdomain?sca_ref=311.c0hkgyYK8q",
            "program_id": 19,
            "program_name": "Prof. Granville Test",
            "custom_fields": null,
            "coupons": [
                {
                    "id": 9,
                    "affiliate_id": 311,
                    "coupon": "ASDAWQSASD",
                    "description": "description text here",
                    "created_timestamp": 1572596395
                }
            ]
        },
        {
            "id": 312,
            "email": "blaze73@barrows.com",
            "first_name": "Susan",
            "last_name": "Langworth",
            "status": 1,
            "email_verified": 1,
            "company": "Goyette and Sons",
            "address": null,
            "country": "Liberia",
            "city": "new york",
            "state": null,
            "zipcode": null,
            "phone": "+1 (221) 252-7300",
            "facebook": "http:\/\/facebook.com\/fasferwe",
            "youtube": "https:\/\/www.youtube.com\/watch?v=87iWAReuuCc",
            "instagram": "https:\/\/www.instagram.com\/profile",
            "twitter": null,
            "created_at_timestamp": 1605235234,
            "affiliate_link": "https:\/\/yourdomain?sca_ref=312.pcj9KOnyzu",
            "program_id": 20,
            "program_name": "Prof. Granville Test 20",
            "custom_fields": null,
            "coupons": [
                {
                    "id": 8,
                    "affiliate_id": 312,
                    "coupon": "ASQSDFDSFASD",
                    "description": "description text here",
                    "created_timestamp": 1572596495
                }
            ]
        }
    ],
    "links": {
        "first": "https:\/\/aff-api.secomapp.com\/api\/v1\/affiliates?page=1",
        "last": "https:\/\/aff-api.secomapp.com\/api\/v1\/affiliates?page=7055",
        "prev": null,
        "next": "https:\/\/aff-api.secomapp.com\/api\/v1\/affiliates?page=2"
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 7055,
        "path": "https:\/\/aff-api.secomapp.com\/api\/v1\/affiliates",
        "per_page": "3",
        "to": 3,
        "total": 21164
    }
}

Example response (400):

{
    "status": 400,
    "message": "Bad request"
}

Example response (401):

{
    "status": 401,
    "message": "Unauthenticated"
}

HTTP Request

GET api/v1/affiliates

Query Parameters

Parameter Status Description
limit optional integer Total that should be returned per API call. Maximum of 100 per call.
page optional integer The page number to return.
status optional boolean Filter the results by affiliate's status.
email_verified optional boolean Filter the results by affiliate's email verification status.

Search affiliate


Requires authentication

Example request:

curl -X GET -G "https://aff-api.uppromote.com/api/v1/affiliates/search?q=ipsa" \
    -H "Authorization: Bearer {api_key}" \
    -H "Accept: application/json"
const url = new URL("https://aff-api.uppromote.com/api/v1/affiliates/search");

    let params = {
            "q": "ipsa",
        };
    Object.keys(params).forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Authorization": "Bearer {api_key}",
    "Accept": "application/json",
    "Content-Type": "application/json",
}

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (400):

{
    "status": 400,
    "message": "Bad request"
}

Example response (401):

{
    "status": 401,
    "message": "Unauthenticated"
}

HTTP Request

GET api/v1/affiliates/search

Query Parameters

Parameter Status Description
q optional string The keyword search for. Can be the Affiliate name, affiliate email

Get an affiliate


Requires authentication

Example request:

curl -X GET -G "https://aff-api.uppromote.com/api/v1/affiliates/1" \
    -H "Authorization: Bearer {api_key}" \
    -H "Accept: application/json"
const url = new URL("https://aff-api.uppromote.com/api/v1/affiliates/1");

let headers = {
    "Authorization": "Bearer {api_key}",
    "Accept": "application/json",
    "Content-Type": "application/json",
}

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "id": 310,
    "email": "janet.zieme@hotmail.com",
    "first_name": "Lemuel",
    "last_name": "Donnelly",
    "status": 1,
    "email_verified": 1,
    "company": null,
    "address": null,
    "country": null,
    "city": "new york",
    "state": null,
    "zipcode": null,
    "phone": null,
    "facebook": "http:\/\/facebook.com\/fasferwe",
    "youtube": "https:\/\/www.youtube.com\/watch?v=87iWAReuuCc",
    "instagram": "https:\/\/www.instagram.com\/profile",
    "twitter": null,
    "created_at_timestamp": 1594010524,
    "affiliate_link": "https:\/\/yourdomain\/home?sca_ref=310.uITkuLlOBB",
    "program_id": 19,
    "program_name": "Prof. Granville Test",
    "custom_fields": [
        {
            "value": "PENSACO",
            "label": "Tradingview Username",
            "key": "uqP05lUx"
        },
        {
            "value": "https:\/\/www.facebook.com\/profile",
            "label": "Where will you be posting your affiliate link? Provide link here.",
            "key": "bC39Drmj"
        }
    ]
}

Example response (400):

{
    "status": 400,
    "message": "Bad request"
}

Example response (401):

{
    "status": 401,
    "message": "Unauthenticated"
}

Example response (404):

{
    "status": 404,
    "message": "Record not found"
}

HTTP Request

GET api/v1/affiliates/{id}

Add an affiliate

Example request:

curl -X POST "https://aff-api.uppromote.com/api/v1/affiliates" \
    -H "Authorization: Bearer {api_key}" \
    -H "Accept: application/json" \
    -H "Content-Type: application/json" \
    -d '{"email":"test@gmail.com","first_name":"Victor","last_name":"Vu","password":"eaque","program_id":10,"company":"rerum","address":"ducimus","country":"accusantium","city":"ratione","state":"illo","phone":"+843492823421","facebook":"atque","youtube":"ex","instagram":"nam","twitter":"omnis"}'
const url = new URL("https://aff-api.uppromote.com/api/v1/affiliates");

let headers = {
    "Authorization": "Bearer {api_key}",
    "Accept": "application/json",
    "Content-Type": "application/json",
}

let body = {
    "email": "test@gmail.com",
    "first_name": "Victor",
    "last_name": "Vu",
    "password": "eaque",
    "program_id": 10,
    "company": "rerum",
    "address": "ducimus",
    "country": "accusantium",
    "city": "ratione",
    "state": "illo",
    "phone": "+843492823421",
    "facebook": "atque",
    "youtube": "ex",
    "instagram": "nam",
    "twitter": "omnis"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "status": 200,
    "message": "ok",
    "affiliate_id": 1234
}

Example response (401):

{
    "status": 401,
    "message": "Unauthenticated."
}

HTTP Request

POST api/v1/affiliates

Body Parameters

Parameter Type Status Description
email string required The email of the affiliate.
first_name string required The first name of the affiliate.
last_name string required The last name of the affiliate.
password string required
program_id integer required program_id of the program which the affiliate belongs to
status integer optional Active: 1; Deactive: 0; Default: Active = 1
company string optional option
address string optional option
country string optional option
city string optional option
state string optional option
phone string optional option.
facebook string optional option
youtube string optional option
instagram string optional option
twitter string optional option

Authentication

APIs for Authentication

Check Api token

Example request:

curl -X POST "https://aff-api.uppromote.com/api/v1/authentication" \
    -H "Authorization: Bearer {api_key}" \
    -H "Accept: application/json"
const url = new URL("https://aff-api.uppromote.com/api/v1/authentication");

let headers = {
    "Authorization": "Bearer {api_key}",
    "Accept": "application/json",
    "Content-Type": "application/json",
}

fetch(url, {
    method: "POST",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "status": 200,
    "message": "ok"
}

Example response (401):

{
    "status": 401,
    "message": "Unauthenticated."
}

HTTP Request

POST api/v1/authentication

Coupon

APIs for Coupon

get list coupons


Requires authentication

Example request:

curl -X GET -G "https://aff-api.uppromote.com/api/v1/coupons?limit=10&page=2&coupon=AbC123&aff_id=10" \
    -H "Authorization: Bearer {api_key}" \
    -H "Accept: application/json"
const url = new URL("https://aff-api.uppromote.com/api/v1/coupons");

    let params = {
            "limit": "10",
            "page": "2",
            "coupon": "AbC123",
            "aff_id": "10",
        };
    Object.keys(params).forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Authorization": "Bearer {api_key}",
    "Accept": "application/json",
    "Content-Type": "application/json",
}

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "data": [
        {
            "id": 8,
            "affiliate_id": 311,
            "coupon": "ASDAWQSDFDSFASD",
            "description": "asdasd",
            "created_timestamp": 1572596495
        },
        {
            "id": 63,
            "affiliate_id": 21510,
            "coupon": "5CJJVZ7R",
            "description": "aa",
            "created_timestamp": 1607931147
        },
        {
            "id": 64,
            "affiliate_id": 21510,
            "coupon": "WT8RCVBO",
            "description": "aa",
            "created_timestamp": 1607931285
        },
        {
            "id": 65,
            "affiliate_id": 21510,
            "coupon": "OXAC3FVX",
            "description": null,
            "created_timestamp": 1607931361
        }
    ],
    "links": {
        "first": "https:\/\/aff-api.secomapp.com\/api\/v1\/coupons?page=1",
        "last": "https:\/\/aff-api.secomapp.com\/api\/v1\/coupons?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "path": "https:\/\/aff-api.secomapp.com\/api\/v1\/coupons",
        "per_page": 10,
        "to": 4,
        "total": 4
    }
}

Example response (400):

{
    "status": 400,
    "message": "Bad request"
}

Example response (401):

{
    "status": 401,
    "message": "Unauthenticated"
}

HTTP Request

GET api/v1/coupons

Query Parameters

Parameter Status Description
limit optional integer Total that should be returned per API call. Maximum of 100 per call.
page optional integer The page number to return.
coupon optional string Filter the results by coupon code.
aff_id optional integer Filter the results by affiliate's id.

Assign coupon

[Note] - Each affiliate can be assigned with maximum 100 coupons.

Example request:

curl -X POST "https://aff-api.uppromote.com/api/v1/coupons" \
    -H "Authorization: Bearer {api_key}" \
    -H "Accept: application/json" \
    -H "Content-Type: application/json" \
    -d '{"aff_id":9,"coupon":"nobis","description":"suscipit"}'
const url = new URL("https://aff-api.uppromote.com/api/v1/coupons");

let headers = {
    "Authorization": "Bearer {api_key}",
    "Accept": "application/json",
    "Content-Type": "application/json",
}

let body = {
    "aff_id": 9,
    "coupon": "nobis",
    "description": "suscipit"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "status": 200,
    "message": "ok"
}

Example response (401):

{
    "status": 401,
    "message": "Unauthenticated."
}

HTTP Request

POST api/v1/coupons

Body Parameters

Parameter Type Status Description
aff_id integer required The id of the affiliate.
coupon string required .
description string optional option .

Payment

APIs for payment

Mark as paid

Example request:

curl -X POST "https://aff-api.uppromote.com/api/v1/payments/mark_as_paid" \
    -H "Authorization: Bearer {api_key}" \
    -H "Accept: application/json" \
    -H "Content-Type: application/json" \
    -d '{"aff_id":9,"referral_ids":[],"note":"vel","message":"quam"}'
const url = new URL("https://aff-api.uppromote.com/api/v1/payments/mark_as_paid");

let headers = {
    "Authorization": "Bearer {api_key}",
    "Accept": "application/json",
    "Content-Type": "application/json",
}

let body = {
    "aff_id": 9,
    "referral_ids": [],
    "note": "vel",
    "message": "quam"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "status": 200,
    "payment_id": 123
}

Example response (401):

null

Example response (422):

{
    "status": 422,
    "message": "Unprocessable Entity.",
    "errors": {
        "referral_ids": [
            "The referral ids field is required."
        ]
    }
}

HTTP Request

POST api/v1/payments/mark_as_paid

Body Parameters

Parameter Type Status Description
aff_id integer required The id of the affiliate.
referral_ids array required An array containing the referral IDs that you want to process payment for.
note string optional payment note
message string optional payment message

Referrals

get list referrals


Requires authentication

Example request:

curl -X GET -G "https://aff-api.uppromote.com/api/v1/referrals?limit=10&page=2&status=pending&aff_id=10&from_date=2021-11-08&to_date=2022-05-24" \
    -H "Authorization: Bearer {api_key}" \
    -H "Accept: application/json"
const url = new URL("https://aff-api.uppromote.com/api/v1/referrals");

    let params = {
            "limit": "10",
            "page": "2",
            "status": "pending",
            "aff_id": "10",
            "from_date": "2021-11-08",
            "to_date": "2022-05-24"
        };
    Object.keys(params).forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Authorization": "Bearer {api_key}",
    "Accept": "application/json",
    "Content-Type": "application/json",
}

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "data": [
        {
            "id": 443,
            "order_id": "2581191688282",
            "order_number": 1018,
            "affiliate_id": 310,
            "customer_id": "3491164225626",
            "quantity": 1,
            "total_sales": "48.00",
            "commission": "4.80",
            "commission_adjustment": "0.00",
            "status": "paid",
            "commission_type": "percent_of_sale",
            "commission_amount": "10.00",
            "refund_id": null,
            "tracking_type": "tracked_by_affiliate_link",
            "affiliate": {
                "id": 310,
                "email": "janet.zieme@hotmail.com",
                "first_name": "Lemuel",
                "last_name": "Donnelly"
            },
            "created_at": 1594010824
        },
        {
            "id": 446,
            "order_id": "2581330395226",
            "order_number": 1019,
            "affiliate_id": 310,
            "customer_id": "3491164225626",
            "quantity": 1,
            "total_sales": "48.00",
            "commission": "4.80",
            "commission_adjustment": "0.00",
            "status": "paid",
            "commission_type": "percent_of_sale",
            "commission_amount": "10.00",
            "refund_id": null,
            "tracking_type": "tracked_by_affiliate_link",
            "affiliate": {
                "id": 310,
                "email": "paxton64@lehner.biz",
                "first_name": "Marshall",
                "last_name": "Bartoletti"
            },
            "created_at": 1594024289
        },
        {
            "id": 450,
            "order_id": "2581330395226",
            "order_number": 1019,
            "affiliate_id": 310,
            "customer_id": "3491164225626",
            "quantity": 1,
            "total_sales": "-52.80",
            "commission": "2.72",
            "commission_adjustment": "8.00",
            "status": "paid",
            "commission_type": "percent_of_sale",
            "commission_amount": "10.00",
            "refund_id": "665574146138",
            "tracking_type": "tracked_by_affiliate_link",
            "affiliate": {
                "id": 310,
                "email": "blaze73@barrows.com",
                "first_name": "Susan",
                "last_name": "Langworth"
            },
            "created_at": 1594024528
        }
    ],
    "links": {
        "first": "https:\/\/aff-api.secomapp.com\/api\/v1\/referrals?page=1",
        "last": "https:\/\/aff-api.secomapp.com\/api\/v1\/referrals?page=6",
        "prev": null,
        "next": "https:\/\/aff-api.secomapp.com\/api\/v1\/referrals?page=2"
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 6,
        "path": "https:\/\/aff-api.secomapp.com\/api\/v1\/referrals",
        "per_page": "3",
        "to": 3,
        "total": 18
    }
}

Example response (400):

{
    "status": 400,
    "message": "Bad request"
}

Example response (401):

{
    "status": 401,
    "message": "Unauthenticated"
}

HTTP Request

GET api/v1/referrals

Query Parameters

Parameter Status Description
limit optional integer Total that should be returned per API call. Maximum of 100 per call.
page optional integer The page number to return.
status optional enum[pending,approved,paid,denied] Filter the results by referral's status.
aff_id optional integer Filter the results by affiliate's id.
from_date optional date Filter the results by referral's.
to_date optional date Filter the results by referral's.