CRM Integration
This provides a guide for developers who are planning to implement an API integration between the PepperHQ platform and a 3rd Party CRM system to support:
- Synchronising customer data (for a merchant)
- Synchronising customer loyalty awards (for a merchant)
- Creating awards and granting awards to customers
- Managing user segments
- Sending App notifications
Endpoints
Pepper Endpoints are at
| Host | Description |
|---|---|
| https://api.pepperhq.com | Customer, Awards and Location resources |
| https://order.pepperhq.com | Order resources |
| https://content.pepperhq.com | App CMS resources |
| https://menu.pepperhq.com | Menu resources |
UAT endpoints are also available with the prefix beta- in front of each host. For example: https://beta-api.pepperhq.com
Authentication
CRM Integrators should use the auth-token authentication scheme. Please contact support@pepperhq.com to request a token for a merchant. You will need to use a separate token for each merchant.
In addition, calls for each merchant need to be identified via an x-application-id code for that merchant. This will also be provided to you by Pepper.
Example:
GET https://api.pepperhq.com/users
Authorization: Token <token-provided-by-pepper>
x-application-id: <merchant-code>
Accept: application/json
Accept-Encoding: gzip, deflate
200 OK
{ ... }
Versioning
The Pepper API endpoints are continuously evolving, so we support endpoint api versions in a custom header x-api-version. The api version required for each endpoint will be detailed in the API reference.
Endpoints are forward compatible with new versions, so it is safe to use the highest api version you support across all endpoints within 1 host. So if one endpoint has version 8 as the highest version, and another has version 4, you call both with version 8. You do not need to call each endpoint with a different api version unless you specifically wish to downgrade the call.
Example:
GET https://api.pepperhq.com/users
Authorization: Token <token-provided-by-pepper>
x-application-id: <merchant-code>
Accept: application/json
Accept-Encoding: gzip, deflate
x-api-version: 8
200 OK
{ ... }
Version Deprecation
In order to provide ongoing improvements, Pepper has a policy of deprecating old endpoint versions and then removing them.
You will receive a deprecation notice of an endpoint version at least 3 months in advance of its scheduled removal.
Paging
All calls that return a collection of resources enforce paging to prevent responses that are too large.
A collection response will return a page field. If the nextKey value is populated, then use it as the startKey in the next request for the next page in the response.
For example: 1st call
GET https://api.pepperhq.com/users?limit=100include=credentials
Authorization: Token <token-provided-by-pepper>
x-application-id: <merchant-code>
x-api-version: 8
Accept: application/json
Accept-Encoding: gzip, deflate
200 OK
{
"items": [
{
...
}
],
"page": {
"limit": 100,
"count": 100,
"startKey": "xxxxxxxx",
"nextKey": "yyyyyyy"
}
}
Next paged call:
GET https://api.pepperhq.com/users?limit=100include=credentials&startKey=yyyyyyy
Authorization: Token <token-provided-by-pepper>
x-application-id: <merchant-code>
x-api-version: 8
200 OK
{
"items": [
{
...
}
],
"page": {
"limit": 100,
"count": 100,
"startKey": "yyyyyyy",
"nextKey": "zzzzzzz"
}
}