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.

Create a 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.
A referred customer is a customer who is referred by a referring customer.

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

Request example

{
  "id": "customer_123",
  "key": "ref_123",
  "name": "Alice",
  "surname": "Brown",
  "email": "alice.brown@partnero.com"
}
{
  "id": "customer_456",
  "key": "ref_456",
  "name": "Bob",
  "surname": "Green",
  "email": "bob.green@partnero.com",
  "referring_customer": {
    "id": "customer_123"
  }
}

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.

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.
surnamestringoptionalAdds a surname 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.
referring_customerobject[]noUse this when you are creating a referred customer.
referring_customer.idstringyes *Identifies a referring client. Must provide either referring_customer.id or referring_customer.key.
referring_customer.keystringyes *Identifies a referring client. Must provide either referring_customer.id or referring_customer.key.
metadataobject[]no
metadata.date_of_birthstringnoDate of birth of the customer. Format: YYYY-MM-DD.

Response

{
    "data": {
        "email": "alice.brown@partnero.com",
        "created_at": "2025-05-09T17:42:13.000000Z",
        "updated_at": "2025-05-09T17:42:13.000000Z",
        "name": "Alice",
        "id": "customer_123",
        "surname": "Brown",
        "tos": true,
        "approved": true,
        "status": "active",
        "custom_fields": [],
        "referring_customer": null,
        "referrals_count": 0,
        "metadata": {
            "date_of_birth": null
        },
        "referral_link": "https://partnero.com?ref=ref_123",
        "referral_links": [
            "https://partnero.com?ref=ref_123"
        ]
    },
    "status": 1
}
{
    "data": {
        "email": "bob.green@partnero.com",
        "created_at": "2025-05-09T17:44:15.000000Z",
        "updated_at": "2025-05-09T17:44:15.000000Z",
        "name": "Bob",
        "id": "customer_456",
        "surname": "Green",
        "tos": true,
        "approved": true,
        "status": "active",
        "custom_fields": [],
        "referring_customer": {
            "email": "alice.brown@partnero.com",
            "created_at": "2025-05-09T17:42:13.000000Z",
            "updated_at": "2025-05-09T17:42:13.000000Z",
            "name": "Alice",
            "id": "customer_123",
            "surname": "Brown",
            "tos": true,
            "approved": true,
            "status": "active",
            "custom_fields": [],
            "referring_customer": null,
            "referrals_count": 1,
            "metadata": {
                "date_of_birth": null
            }
        },
        "referrals_count": 0,
        "metadata": {
            "date_of_birth": null
        },
        "referral_link": "https://partnero.com?ref=ref_456",
        "referral_links": [
            "https://partnero.com?ref=ref_456"
        ]
    },
    "status": 1
}
Response Code: 200 OK
Content-Type: application/json

Fetch a customer

Get the details about specific customer.

GET https://api.partnero.com/v1/customers/{id}

Request example

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

Request parameters

ParametersTypeRequiredDetails
idstringyes *Must provide unique customer identifier.

Response example

{
    "data": {
        "email": "alice.brown@partnero.com",
        "created_at": "2025-05-09T17:42:13.000000Z",
        "updated_at": "2025-05-09T17:42:13.000000Z",
        "name": "Alice",
        "id": "customer_123",
        "surname": "Brown",
        "tos": true,
        "approved": true,
        "status": "active",
        "custom_fields": [],
        "referring_customer": null,
        "referrals_count": 1,
        "metadata": {
            "date_of_birth": null
        },
        "referral_link": "https://partnero.com?ref=ref_123",
        "referral_links": [
            "https://partnero.com?ref=ref_123"
        ]
    },
    "status": 1
}

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

Response

{
    "data": [
        {
            "email": "alice.brown@partnero.com",
            "created_at": "2025-05-09T17:42:13.000000Z",
            "updated_at": "2025-05-09T17:42:13.000000Z",
            "id": "customer_123",
            "name": "Alice",
            "surname": "Brown",
            "approved": true,
            "status": "active",
            "custom_fields": []
        },
        {
            "email": "bob.green@partnero.com",
            "created_at": "2025-05-09T17:44:15.000000Z",
            "updated_at": "2025-05-09T17:44:15.000000Z",
            "id": "customer_456",
            "name": "Bob",
            "surname": "Green",
            "approved": true,
            "status": "active",
            "custom_fields": []
        }
    ],
    "links": {
        "first": "https://api.partnero.com/v1/customers?page=1",
        "last": null,
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "path": "https://api.partnero.com/v1/customers",
        "per_page": 10,
        "to": 2
    },
    "status": 1
}
Response Code: 200 OK
Content-Type: application/json

Search for a customer

Search customers by custom data.

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

Request example

GET https://api.partnero.com/v1/customers:search?email=alice.brown@partnero.com

Request parameters

ParametersTypeRequiredDetails
idstringoptional *Unique customer identifier.
keystringoptional *Public customer identification.
emailstringoptional *Email of the customer.

Response

{
    "data": [
        {
            "email": "alice.brown@partnero.com",
            "created_at": "2025-05-09T17:42:13.000000Z",
            "updated_at": "2025-05-09T17:42:13.000000Z",
            "id": "customer_123",
            "name": "Alice",
            "surname": "Brown",
            "approved": true,
            "status": "active",
            "custom_fields": []
        }
    ],
    "links": {
        "first": "https://api.partnero.com/v1/customers:search?page=1",
        "last": null,
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "path": "https://api.partnero.com/v1/customers:search",
        "per_page": 10,
        "to": 1
    },
    "status": 1
}
Response Code: 200 OK
Content-Type: application/json

Get customer's referrals

Get all refereed customers who are referred by a customer.

GET https://api.partnero.com/v1/customers/{id}/referrals

Request example

GET https://api.partnero.com/v1/customers/customer_123/referrals

Request parameters

ParametersTypeRequiredDetails
idstringyes *Must provide unique customer identifier.

Response example

{
    "data": [
        {
            "email": "bob.green@partnero.com",
            "created_at": "2025-05-09T17:44:15.000000Z",
            "updated_at": "2025-05-09T17:44:15.000000Z",
            "id": "customer_456",
            "name": "Bob",
            "surname": "Green",
            "approved": true,
            "status": "active",
            "custom_fields": []
        },
        ...
    ],
    "status": 1
}
Response Code: 200 OK
Content-Type: application/json

Get customer transactions

Get all transactions made by a referred customer.

GET https://api.partnero.com/v1/customers/{id}/transactions

Request example

GET https://api.partnero.com/v1/customers/customer_456/transactions

Request parameters

ParametersTypeRequiredDetails
idstringyesMust provide unique customer identifier.
limitintegernoA limit on the number of items to be returned. Limits can range between 10 and 100, and the default is 10.

Response

{
    "data": [
        {
            "key": "transaction_456_1",
            "action": "sale",
            "amount": 99.99,
            "customer": "customer_123",
            "referred_customer": "customer_456",
            "credit": false,
            "is_currency": false,
            "amount_units": null,
            "created_at": "2025-05-12T15:43:55.000000Z",
            "deleted_at": null,
            "rewards": []
        },
        ...
    ],
    "status": 1
}
Response Code: 200 OK
Content-Type: application/json

Get customer stats

Get main stats of the customer.

GET https://api.partnero.com/v1/customers/{id}/stats

Request example

GET https://api.partnero.com/v1/customers/customer_123/stats

Request parameters

ParametersTypeRequiredDetails
idstringyes *Must provide unique customer identifier.

Response

{
    "data": {
        "customer": {
            "email": "alice.brown@partnero.com",
            "created_at": "2025-05-09T17:42:13.000000Z",
            "updated_at": "2025-05-09T17:42:13.000000Z",
            "name": "Alice",
            "id": "customer_123",
            "surname": "Brown",
            "tos": true,
            "approved": true,
            "status": "active",
            "custom_fields": [],
            "referring_customer": null,
            "referrals_count": 1,
            "metadata": {
                "date_of_birth": null
            },
            "referral_link": "https://partnero.com?ref=ref_123",
            "referral_links": [
                "https://partnero.com?ref=ref_123"
            ]
        },
        "referrals": {
            "clicks": 0,
            "signups": 1,
            "revenue": [],
            "sales_count": 0,
            "paid_accounts": 0
        },
        "ref_links": [
            {
                "url": "https://partnero.com?ref=ref_123",
                "default": true,
                "clicks": "0",
                "signups": "0",
                "click_to_signup_conversion": 0,
                "social_shares": [
                    {
                        "social": "facebook",
                        "link": "https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fpartnero.com%3Fref%3Dref_123"
                    },
                    {
                        "social": "twitter",
                        "link": "https://twitter.com/intent/tweet?text=I%27ve+partnered+up+with+Api+Test+001+since+I%27ve+been+really+enjoying+using+the+product.+Click+the+link+to+find+out+more%21+%23affiliatepartner+https%3A%2F%2Fpartnero.com%3Fref%3Dref_123"
                    },
                    {
                        "social": "linkedin",
                        "link": "https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fpartnero.com%3Fref%3Dref_123"
                    }
                ]
            }
        ]
    },
    "status": 1
}
Response Code: 200 OK
Content-Type: application/json

Update a customer

Update an existing customer.

PUT https://api.partnero.com/v1/customers/{id}

Request example

PUT https://api.partnero.com/v1/customers/customer_123
{
  "update": {
    "name": "Alice updated",
    "surname": "Brown updated"
  }
}

Request parameters

ParametersTypeRequiredDetails
idstringyes *Must provide either id or key of the customer if id is not provided in URL.
keystringyes *Must provide either id or key of the customer if id is not provided in URL.
updateobject[]optional
update.keystringoptionalUpdates public customer identification.
update.namestringoptionalUpdates/adds a name of the customer.
update.surnamestringoptionalUpdates/adds a surname of the customer.
update.emailstringoptionalUpdates/adds an email of the customer.
update.metadataobject[]optional
update.metadata.date_of_birthstringnoDate of birth of the customer. Format: YYYY-MM-DD.

Response

{
    "data": {
        "email": "alice.brown@partnero.com",
        "created_at": "2025-05-09T17:42:13.000000Z",
        "updated_at": "2025-05-12T09:41:03.000000Z",
        "name": "Alice updated",
        "id": "customer_123",
        "surname": "Brown updated",
        "tos": true,
        "approved": true,
        "status": "active",
        "custom_fields": [],
        "referring_customer": null,
        "referrals_count": 1,
        "metadata": {
            "date_of_birth": null
        },
        "referral_link": "https://partnero.com?ref=ref_123",
        "referral_links": [
            "https://partnero.com?ref=ref_123"
        ]
    },
    "status": 1
}
Response Code: 200 OK
Content-Type: application/json

Archive a customer

Archive an existing customer.

POST https://api.partnero.com/v1/customers/{id}/archive

Request example

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

Request parameters

ParametersTypeRequiredDetails
idstringyes*Must provide unique customer identifier

Response

{
  "status": 1
}
Response Code: 200 OK
Content-Type: application/json

Revoke archived customer

Revoke archived customer.

POST https://api.partnero.com/v1/customers/{id}/revoke-archive

Request example

POST https://api.partnero.com/v1/customers/customer_123/revoke-archive

Request parameters

ParametersTypeRequiredDetails
idstringyes*Must provide unique customer identifier

Response

{
  "status": 1
}
Response Code: 200 OK
Content-Type: application/json

Delete a customer

Delete an existing customer.

DELETE https://api.partnero.com/v1/customers/{id}

Request example

DELETE https://api.partnero.com/v1/customers/customer_123

Request parameters

ParametersTypeRequiredDetails
idstringyes*Must provide unique customer identifier if id is not provided in URL.

Response

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