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.

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

ParametersTypeRequiredDetails
keystringyesThe 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.
emailstringoptionalMust be a unique email address.
namestringoptionalA name for the customer.
partnerobject[]yesPartner data.
partner.keystringyesMust provide the partner's key to whom you are willing to create a customer. Should be populated with *UNIQUE_PARTNER_KEY.
partner.idstringoptionalAlternatively, Partner ID can be used instead of key.
partner.emailstringoptionalAlternatively, Partner email address can be used instead of key.
optionsobject[]optionalAdditional parameters.
options.referral_urlstringoptionalOption 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

ParametersTypeRequiredDetails
keystringyes

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

ParametersTypeRequiredDetails
keystringoptional
emailstringoptional

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

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/(: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

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

Response

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