Customers
A customer is a person who writes to your team: a buyer on a marketplace, someone who emails your inbox, or a user of your own system. Each customer belongs to one account, the integration they came through. You create customers when your own system brings people into Replyco, and you search them to open a ticket for someone or to list everything they have discussed with your team.
Fields that matter
Section titled “Fields that matter”| Field | Meaning |
|---|---|
id |
The customer’s id. Pass it as customerId when you open a ticket or list the customer’s tickets and chats. |
integrationId |
The account the customer belongs to; see Accounts. |
marketplace |
The channel, as a number: 20 for a custom integration. The API reference lists the others. |
marketCustomerId |
The customer’s own id in your system or on the marketplace. |
firstName, lastName |
The customer’s name. Replyco also keeps the two joined as the customer’s full name, which term searches. |
email, phone |
How to reach the customer. |
customerAddress |
A postal address; every part is optional. |
notes |
Notes your team keeps about the customer. Each note needs its note text. |
Creating a customer
Section titled “Creating a customer”POST /openapi/customer creates a customer and answers with it, including its new id. Send integrationId and
marketplace, and as much of the rest as you have: the more you send, the easier the customer is to find and recognise.
curl -X POST https://open-api.replyco.com/openapi/customer \ -H "Authorization: Bearer $ACCESS_TOKEN" -H "Content-Type: application/json" \ -d '{ "integrationId": "3f1c2a9e-7b4d-4e8a-9c21-5d6f0a1b2c3d", "marketplace": 20, "firstName": "Sam", "lastName": "Rivera", "email": "sam.rivera@example.com", "marketCustomerId": "portal-user-40217", "notes": [{ "note": "Prefers email over phone." }] }'Creating a customer never checks whether the same person already exists, so each call adds a new customer. Search with
term first, for example on the email address or your own customer id, and create the customer only when the search
finds nobody.
Listing and filtering
Section titled “Listing and filtering”GET /openapi/customer/paged returns one page of your company’s customers, with totalRecords, pagesCount,
currentPage and the customers in data.
| Parameter | What it does | Default | Limits |
|---|---|---|---|
term |
Only customers whose full name, first or last name, marketCustomerId, email address, phone number or marketplace name contains this text, ignoring case. |
none | — |
sort |
The field to order by. | none: an order that has no meaning | email, createdDate, customerName or marketplace; other values are rejected with 400. |
asc |
true for ascending, false for descending. |
true |
— |
page |
The page to return, from 1. | 1 | Stop at pagesCount. |
count |
Customers per page. | 10 | At most 100; a larger value is rejected with 400. |
curl "https://open-api.replyco.com/openapi/customer/paged?term=sam.rivera%40example.com&sort=createdDate&asc=false" \ -H "Authorization: Bearer $ACCESS_TOKEN"Each operation whose path ends in /paged allows one user 15 calls a minute, so search with a
precise term rather than paging through every customer (see Rate limits).
GET /openapi/customer/{id} returns one customer. An id that matches no customer is answered with 204 and no body.
With a customer’s id, GET /openapi/thread/bycontact/{customerId} lists their tickets and
GET /openapi/chat/chatsbycustomer/{customerId} their chats.
Operations
Section titled “Operations”| Method | Path | Summary | Scopes |
|---|---|---|---|
| POST | /openapi/customer |
Create a new customer | — |
| GET | /openapi/customer/paged |
Get paginated list of customers with search and filtering | — |
| GET | /openapi/customer/{id} |
Get element by id | — |
Errors
Section titled “Errors”| Status | Meaning | Returned by |
|---|---|---|
| 400 | Request validation failed (missing required fields or malformed body).; Invalid pagination parameters (e.g., page size exceeds 100) | POST /openapi/customer, GET /openapi/customer/paged |
| 401 | Missing or invalid authentication token.; User is not authenticated or authorized; Unauthorized | POST /openapi/customer, GET /openapi/customer/paged, GET /openapi/customer/{id} |
Related
Section titled “Related”- Open a ticket for a customer: create the customer, then their ticket.
- Look up a customer’s history: find a customer and list their tickets and chats.
- Connect your own system: customers of a custom integration.
- API reference: every field of
CreateCustomerRequestandCustomerModel.