Customers
Customer is a person/company who signed up to your application using a unique affiliate link that has been shared by your affiliate program partner.
Get all customers
Get the list of customers that belong to your program.
GET https://api.partnero.com/v1/customers
Request parameters
Parameters | Type | Required | Details |
---|---|---|---|
limit | integer | no | A limit on the number of items to be returned. Limits can range between 1 and 250, and the default is 15. |
page | integer | no | The default is 1. |
Create a customer
Create a new customer with required or desired data. While creating a customer you need to create a unique key for the customer. You will be using this key to identify customers.
The data payload should contain two data objects, partner
and customer
. The most important is partner
data object.
POST https://api.partnero.com/v1/customers
Request example
{
"partner": {
"key": "UNIQUE_PARTNER_KEY"
},
"key": "CUSTOMER_KEY",
"email": "customer@partnero.com",
"name": "Partnero"
}
curl --location --request POST 'https://api.partnero.com/v1/customers' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer YOUR_API_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
"partner": {
"key": "UNIQUE_PARTNER_KEY"
},
"key": "CUSTOMER_KEY",
"email": "customer@partnero.com",
"name": "Partnero"
}'
Request parameters
Parameters | Type | Required | Details |
---|---|---|---|
key | string | yes | The main identification of the customer. Can be anything, but we recommend using an account ID or customer's email address. This will be required when creating transactions for the customer. |
email | string | optional | Must be a unique email address. |
name | string | optional | A name for the customer. |
partner | object[] | yes | Partner data. |
partner.key | string | yes | Must provide the partner's key to whom you are willing to create a customer. Should be populated with *UNIQUE_PARTNER_KEY . |
partner.id | string | optional | Alternatively, Partner ID can be used instead of key . |
partner.email | string | optional | Alternatively, Partner email address can be used instead of key . |
options | object[] | optional | Additional parameters. |
options.referral_url | string | optional | Option to pass an additional **referral URL to identify signups from different URLs when multi-links are used. |
*You have to populate partner.key
data object with UNIQUE_PARTNER_KEY
, which is saved in partnero_partner
cookie created by our universal javascript snippet or can be identified from the URL.
**The URL must be an unique referral URL which was asisgbed to a partner.
Response
{
"data": {
"key": "CUSTOMER_KEY",
"partner": "PARTNER_KEY",
"deleted": false,
"name": "Partnero",
"surname": "Customer",
"email": "customer@partnero.com",
"created_at": "2022-10-03T18:07:35.000000Z",
"updated_at": "2022-10-03T18:07:35.000000Z",
"deleted_at": null
},
"status": 1
}
Response Code: 200 OK
Fetch a customer
Get the details about a specific customer. You need to provide either an email address or a unique key of the customer.
GET https://api.partnero.com/v1/customers/(:key)
Request parameters
Parameters | Type | Required | Details |
---|---|---|---|
key | string | yes |
Response
{
"data": {
"key": "CUSTOMER_KEY",
"partner": "PARTNER_KEY",
"deleted": false,
"name": "Partnero",
"surname": "Customer",
"email": "customer@partnero.com",
"created_at": "2022-10-03T18:07:35.000000Z",
"updated_at": "2022-10-03T18:07:35.000000Z",
"deleted_at": null
},
"status": 1
}
Response Code: 200 OK
Find a customer
Search for customers.
GET https://api.partnero.com/v1/customers:search
Available search query parameters
Parameters | Type | Required | Details |
---|---|---|---|
key | string | optional | |
email | string | optional |
Get customer transactions
Get all transactions made by a customer.
GET https://api.partnero.com/v1/customers/(:key)/transactions
Update a customer
Update an existing customer.
PUT https://api.partnero.com/v1/customers/(:key)
Request example
{
"update": {
"key": "UPDATED_CUSTOMER_KEY",
"name": "Partner",
"surname": "Partnero"
}
}
curl --location --request PUT 'https://api.partnero.com/v1/customers/(:key)' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer YOUR_API_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
"update": {
"key": "UPDATED_CUSTOMER_KEY",
"name": "Partner",
"surname": "Partnero"
}
}'
Request parameters
Parameters | Type | Required | Details |
---|---|---|---|
key | string | yes * | Must provide either key or email of the customer. |
email | string | yes * | Must provide either email or key of the customer. |
update | object[] | optional | |
update.name | string | optional | Updates/adds a name of the customer. |
update.surname | string | optional | Updates/adds a surname of the customer. |
update.email | string | optional | Updates/adds an email of the customer. |
Response
{
"data": {
"key": "CUSTOMER_KEY",
"partner": "PARTNER_KEY",
"deleted": false,
"name": "New Partnero",
"surname": "Customer",
"email": "customer@partnero.com",
"created_at": "2022-10-03T18:07:35.000000Z",
"updated_at": "2022-10-03T18:22:33.000000Z",
"deleted_at": null
},
"status": 1
}
Response Code: 200 OK
Delete a customer
Delete an existing customer.
DELETE https://api.partnero.com/v1/customers/(:key)
Request example
curl --location --request DELETE 'https://api.partnero.com/v1/customers/(:key)' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer YOUR_API_TOKEN' \
--header 'Content-Type: application/json'
<?php
$client = new Client();
$headers = [
'Accept' => 'application/json',
'Authorization' => 'Bearer YOUR_API_TOKEN',
'Content-Type' => 'application/json',
];
$request = new Request('DELETE', 'https://api.partnero.com/v1/customers/(:key)', $headers);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();
Request parameters
Parameters | Type | Required | Details |
---|---|---|---|
key | string | yes * | Must provide either key or email . |
email | string | yes * | Must provide either email or key . |
Response
{
"status": 1
}
Response Code: 200 OK