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.
POST https://api.partnero.com/v1/customers
Request example
{
"partner": {
"key": "PARTNER_KEY"
},
"key": "CUSTOMER_KEY",
"email": "customer@partnero.com",
"name": "Partnero",
"surname": "Customer"
}
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": "PARTNER_KEY"
},
"key": "CUSTOMER_KEY",
"email": "customer@partnero.com",
"name": "Partnero",
"surname": "Customer"
}'
Request parameters
Parameters | Type | Required | Details |
---|---|---|---|
partner | object[] | yes | |
partner.key | string | yes | Must provide the partner's key to whom you are willing to create a customer. |
key | string | yes | The main identification of the customer. Can be anything, but we recommend using an account ID of your application. Must be unique. |
email | string | optional | Must be a unique email address. |
name | string | optional | Adds a name for the customer. |
surname | string | optional | Adds a surname for the customer. |
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
Request example
{
"key": "CUSTOMER_KEY"
}
curl --location --request GET 'https://api.partnero.com/v1/customers' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer YOUR_API_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
"key": "CUSTOMER_KEY"
}'
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
{
"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
Update a customer
Update an existing customer.
PUT https://api.partnero.com/v1/customers
Request example
{
"key": "CUSTOMER_KEY",
"update": {
"name": "Partner",
"surname": "Partnero"
}
}
curl --location --request PUT 'https://api.partnero.com/v1/customers' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer YOUR_API_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
"key": "CUSTOMER_KEY",
"update": {
"name": "New 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
Request example
{
"key": "CUSTOMER_KEY"
}
curl --location --request DELETE 'https://api.partnero.com/v1/customers' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer YOUR_API_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
"key": "CUSTOMER_KEY"
}'
<?php
$client = new Client();
$headers = [
'Accept' => 'application/json',
'Authorization' => 'Bearer YOUR_API_TOKEN',
'Content-Type' => 'application/json',
];
$body = '{
"key": "CUSTOMER_KEY"
}';
$request = new Request('DELETE', 'https://api.partnero.com/v1/customers', $headers, $body);
$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