Customer referral links

A referral link is a unique, trackable URL provided to customers to share with their audience.

Create a new customer referral link.

The data payload should contain two data objects, customer (with id or key or email) and link.

POST https://api.partnero.com/v1/customer_referral_links

Request example

{
    "customer": {
        "id": "customer_123"
    },
    "key": "ref_123_1"
}

Request parameters

ParametersTypeRequiredDetails
keystringyesKey will be used to generate an unique referral link. Key should be unique.
customerobject[]yesCustomer data.
customer.idstringyes if customer.key or customer.email is not provided
customer.keystringyes if customer.id or customer.email is not provided
customer.emailstringyes if customer.id or customer.key is not provided

Response

{
    "data": {
        "id": "ref_123_1",
        "key": "ref_123_1",
        "url": "https://partnero.com?ref=ref_123_1",
        "default": false,
        "is_additional": false,
        "direct_tracking": false,
        "direct_tracking_redirect": false,
        "direct_tracking_redirect_url": null
    },
    "status": 1
}
Response Code: 200 OK
Content-Type: application/json
GET https://api.partnero.com/v1/customer_referral_links/{id}

Request example

GET https://api.partnero.com/v1/customer_referral_links/ref_123_1

Request parameters

ParametersTypeRequiredDetails
idstringyesLink ID.

Response

{
    "data": {
        "id": "ref_123_1",
        "key": "ref_123_1",
        "url": "https://partnero.com?ref=ref_123_1",
        "default": false,
        "is_additional": false,
        "direct_tracking": false,
        "direct_tracking_redirect": false,
        "direct_tracking_redirect_url": null
    },
    "status": 1
}
Response Code: 200 OK
Content-Type: application/json

Get the list of links that belong to a certain customer.

GET https://api.partnero.com/v1/customers/{id}/referral_links

Request parameters

ParametersTypeRequiredDetails
limitintegernoA limit on the number of items to be returned. Limits can range between 1 and 250, and the default is 15.
pageintegernoThe default is 1.

Response

{
    "data": [
        {
            "id": "ref_123",
            "key": "ref_123",
            "url": "https://partnero.com?ref=ref_123",
            "default": true,
            "is_additional": false,
            "direct_tracking": false,
            "direct_tracking_redirect": false,
            "direct_tracking_redirect_url": null
        },
        {
            "id": "ref_123_1",
            "key": "ref_123_1",
            "url": "https://partnero.com?ref=ref_123_1",
            "default": false,
            "is_additional": false,
            "direct_tracking": false,
            "direct_tracking_redirect": false,
            "direct_tracking_redirect_url": null
        }
    ],
    "status": 1
}
Response Code: 200 OK
Content-Type: application/json

Search for links.

GET https://api.partnero.com/v1/customer_referral_links:search

Request example

GET https://api.partnero.com/v1/customer_referral_links:search?key=ref_123_1

Available search query parameters

ParametersTypeRequiredDetails
idstringoptional
keystringoptional
customerobject[]optionalCustomer data.
customer.idstringyes if customer.key or customer.email is not provided
customer.keystringyes if customer.id or customer.email is not provided
customer.emailstringyes if customer.id or customer.key is not provided

Response

{
    "data": [
        {
            "id": "ref_123_1",
            "key": "ref_123_1",
            "url": "https://partnero.com?ref=ref_123_1",
            "default": false,
            "is_additional": false,
            "direct_tracking": false,
            "direct_tracking_redirect": false,
            "direct_tracking_redirect_url": null
        }
    ],
    "links": {
        "first": "https://api.partnero.com/v1/customer_referral_links:search?page=1",
        "last": null,
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "path": "https://api.partnero.com/v1/customer_referral_links:search",
        "per_page": 10,
        "to": 1
    },
    "status": 1
}
Response Code: 200 OK
Content-Type: application/json

Update an existing link.

PUT https://api.partnero.com/v1/customer_referral_links/{id}

Request example

PUT https://api.partnero.com/v1/customer_referral_links/ref_123_1
{
  "key": "ref_123_1_2"
}

Request parameters

ParametersTypeRequiredDetails
keystringyesLink key to be updated.

Response

{
    "data": {
        "id": "ref_123_1_2",
        "key": "ref_123_1_2",
        "url": "https://partnero.com?ref=ref_123_1_2",
        "default": false,
        "is_additional": false,
        "direct_tracking": false,
        "direct_tracking_redirect": false,
        "direct_tracking_redirect_url": null
    },
    "status": 1
}
Response Code: 200 OK
Content-Type: application/json

Delete an existing link.

DELETE https://api.partnero.com/v1/customer_referral_links/{id}

Request example

DELETE https://api.partnero.com/v1/customer_referral_links/ref_123_1_2

Request parameters

ParametersTypeRequiredDetails
idstringyesLink ID.

Response

{
  "status": 1
}
Response Code: 200 OK
Content-Type: application/json