CRM
With the API, you can retrieve and manage a brand's customer records. This section describes popular use cases.
For a full overview of CRM functionality please visit the API Reference
List customers
To list customer records, send a GET request to the /customers/
endpoint.
You can include various query parameters to filter the records you receive in the response.
For example, to list only customers from a specific tier, you can add the tier
query parameter to your request with the id of the tier. The following request returns only customer records that are assigned to tier 1.
GET /api/v2/customers/?tier=1
Host: sandbox.leaflink.com
Authorization: App 54901b614b81d25084edc7b1f2016571b96778910d7b8b0befgf8decd418d6ab
Content-Type: application/json
Visit the /customers/
endpoint reference for a full list of supported parameters.
Retrieve a customer
To retrieve an individual customer record, send a GET request to /customers/{id}/
, where {id}
is the id for the customer you wish to retrieve
The following request returns the customer with id 3242.
GET /api/v2/customers/3242/
Host: sandbox.leaflink.com
Authorization: App 54901b614b81d25084edc7b1f2016571b96778910d7b8b0befgf8decd418d6ab
Content-Type: application/json
Create a customer
Customer records are created automatically when a company interacts with your brand on the LeafLink marketplace. However, you can also create customer records manually.
To create a customer, send a POST request to the /customers/
endpoint with the customer's details in the body of request.
For the full set of field descriptions, please visit the Create a customer
reference
Update a customer
To update an existing customer, send a PATCH request to /customers/{id}/
, where {id}
is the id for the customer you wish to update, with the fields you wish to update in the body of request.
For the full set of available fields and their definitions, please visit the Update a customer
reference
The following request updates the zipcode for a customer record with id 369484
.
/**
PATCH /api/v2/customers/369484/
Host: sandbox.leaflink.com
Authorization: Token MY_API_KEY
Content-Type: application/json
*/
{
"zipcode": "80022"
}