Customers

In the Refer-a-Friend referral program type at Partnero, customers are categorized into two main groups: referring customers and referred customers.

A referring customer is an existing user of your service/application, and willing to refer your service/application to their friends.

Referred customers are those who receive these invitations from referring customers and subsequently sign up for your service. They join as a result of the recommendation and introduction provided by their referrer.

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.
refer_statusstringnoFilter referring or referred customers. Available filters: referred non_referred

Create a referring customer

Create a new customer using your sign-up data. A referring customer refers to a regular customer who signs up without being referred by anyone else.

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

Request example

{
  "id": "CUSTOMER_ID",
  "name": "Customer",
  "email": "customer@partnero.com"
}

Request parameters

ParametersTypeRequiredDetails
idstringoptionalMain identification of the customer. Not revealed publicly.
Can be anything, but we recommend using an account ID of your application. Must be unique. If not provided will be generated randomly.
emailstringyesMust be a unique email address.
namestringoptionalAdds a name for the customer.

Additional request parameters

ParametersTypeRequiredDetails
keystringoptionalPublic customer identification. Usually it's reflected in referral URL. Must be unique. If not provided will be generated randomly.

Create a referred customer

Create a new customer with referred data (when customer is recognized as referred customer).

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

Request example

{
  "id": "CUSTOMER_ID",
  "name": "Referred customer",
  "email": "referred-customer@partnero.com",
  "referring_customer": {
    "key": "referring_key"
  }
}

Request parameters

ParametersTypeRequiredDetails
idstringoptionalMain identification of the customer.
Can be anything, but we recommend using an account ID of your application. Must be unique. If not provided will be generated randomly.
emailstringyesMust be a unique email address.
namestringoptionalAdds a name for the customer.
referring_customerobject[]no
referring_customer.keystringyes *Identifies a referring client. Must provide either referring_customer.key or referring_customer.id.

Additional request parameters

ParametersTypeRequiredDetails
keystringoptionalPublic customer identification. Usually it's reflected in referral URL. Must be unique. If not provided will be generated randomly.
referring_customerobject[]no
referring_customer.idstringyes *Must provide either referring_customer.id or referring_customer.key.

Please note: if referring_customer is not provided, customer will be created as not referred customer.

Finding referring_customer.key is straightforward, as it can be easily located in the partnero_referral cookie.

Additionally, you have two options to identify the referring customer: referring_customer.id and referring_customer.key. When provided, referring_customer.id takes priority over referring_customer.key. Therefore, if both are provided, the Partnero will search for the referring customer using referring_customer.id as the primary identifier.

Fetch a customer

Get the details about specific customer.

GET https://api.partnero.com/v1/customers/(:id)

Request parameters

ParametersTypeRequiredDetails
idstringyes *Must provide unique customer identifier.

Response example

{
  "data": {
    "email": "customer@partnero.com",
    "created_at": "2023-05-19T09:04:33.000000Z",
    "updated_at": "2023-05-19T09:04:33.000000Z",
    "name": "Customer",
    "key": "referring_customer",
    "status": "active",
    "referring_customer": null,
    "referrals_count": 1
  },
  "status": 1
}

Fetch customer's referrals

Get all refereed customers who are referred by a customer.

GET https://api.partnero.com/v1/customers/(:id)/referrals

Request parameters

ParametersTypeRequiredDetails
idstringyes *Must provide unique customer identifier.

Response example

{
  "data": [
    {
      "email": "referred-customer-3@partnero.com",
      "created_at": "2023-05-19T09:04:51.000000Z",
      "updated_at": "2023-05-19T09:04:51.000000Z",
      "key": "referred_customer_3",
      "name": "Referred customer",
      "status": "active"
    },
    {
      "email": "referred-customer-4@partnero.com",
      "created_at": "2023-05-19T09:15:05.000000Z",
      "updated_at": "2023-05-19T09:15:05.000000Z",
      "key": "referred_customer_4",
      "name": "Referred customer",
      "status": "active"
    }
  ],
  "status": 1
}

Get customer stats

Get main stats of the customer.

GET https://api.partnero.com/v1/customers/(:id)/stats

Request parameters

ParametersTypeRequiredDetails
idstringyes *Must provide unique customer identifier.

Search for a customer

Search customers by custom data.

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

Request parameters

ParametersTypeRequiredDetails
idstringoptional *Unique customer identifier.
keystringoptional *Public customer identification.

Update a customer

Update an existing customer.

PUT https://api.partnero.com/v1/customers

Request parameters

ParametersTypeRequiredDetails
idstringyes *Must provide either id or key of the customer.
keystringyes *Must provide either id or key of the customer.
updateobject[]optional
update.idstringoptionalUpdates Unique customer identifier.
update.namestringoptionalUpdates/adds a name of the customer.
update.emailstringoptionalUpdates/adds an email of the customer.

Request example

{
  "id": "CUSTOMER_ID",
  "update": {
    "name": "Partnero Customer"
  }
}

Delete a customer

Delete an existing customer.

DELETE https://api.partnero.com/v1/customers/(:id)

Response

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