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

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.

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

ParametersTypeRequiredDetails
partnerobject[]yes
partner.keystringyesMust provide the partner's key to whom you are willing to create a customer.
keystringyesThe main identification of the customer. Can be anything, but we recommend using an account ID of your application. Must be unique.
emailstringoptionalMust be a unique email address.
namestringoptionalAdds a name for the customer.
surnamestringoptionalAdds 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

ParametersTypeRequiredDetails
keystringyes *Must provide either key or email.
emailstringyes *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

ParametersTypeRequiredDetails
keystringyes *Must provide either key or email of the customer.
emailstringyes *Must provide either email or key of the customer.
updateobject[]optional
update.namestringoptionalUpdates/adds a name of the customer.
update.surnamestringoptionalUpdates/adds a surname of the customer.
update.emailstringoptionalUpdates/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

ParametersTypeRequiredDetails
keystringyes *Must provide either key or email.
emailstringyes *Must provide either email or key.

Response

{
  "status": 1
}
Response Code: 200 OK