CRM v1
This API is Live and ready to use in production.
The CRM API is used by restaurant operators to obtain full customer, reservation, membership, and other related data from the TableCheck system.
Target Audience
The CRM API gives access to sensitive customer information, and therefore should only be used by:
Restaurant franchises who wish to access their customer data, e.g. for marketing purposes
Restaurant-designated third-party systems such as CRM (Customer Relationship Manager), CDP (Customer Data Platform), PMS (Property Management System), and loyalty programs
The CRM API is not intended for use by third-party booking sites, concierges, travel portals, etc. who should not have access to sensitive customer information.
Endpoint
The CRM allows the implementer to modify data.
https://api.tablecheck.com/api/crm/v1/...
Interactive API console
https://api.tablecheck.com/api/crm/v1/docs
Refer to Using the API Console for help.
The CRM API reservations endpoint technically allows you to create and update reservations, however, this is primarily intended for importing past reservations for a customer. If you would like to enable your customers to book, please consider using the Booking API instead.
Rate Limits
Data Types
The CRM API provides access to the following data types:
Shops | Lists the Shops (restaurant outlets) which can be accessed. | |
Reservations | Lists Reservations across all Shops, including the Customer data for the reservation. | |
Customers | Lists Customers across all Shops. Also includes Membership data. | |
Create and modify Customers. | ||
Memberships | Lists Customers' loyalty program Memberships | |
MembershipPrograms | Lists loyalty programs and membership tiers (gold, platinum, etc.) for each program. |
Integration Examples
Create a new Customer
POST /ts_api/crm/v1/customers
{
parent_shop_id: '5ed64e279551e80639a4da51',
franchise_id: '5ed64e249551e80639a4d995',
first_name: 'First name',
last_name: 'Last name',
company_name: 'Company name',
phones: ['88002000600'],
emails: ['sample@email.com'],
images: [
{
"image_upload_url": "https://i.pravatar.cc/300"
}
]
}
Modify an existing Customer
PUT /ts_api/crm/v1/customers/5ed64e2c9551e80639a4dcac
{
first_name: 'New Name'
}
Delete a Customer
DELETE /ts_api/crm/v1/customers/5ed64e2c9551e80639a4dcac
Search for Customers
Use the POST /customer_search
endpoint to find customers. Refer to the API docs for a full list of supported search parameters.
POST /ts_api/crm/v1/customer_search
Body:
{
"first_name": "Jim",
"has_email": true,
"phone": "+1206",
"allow_marketing": true
}
Use POST /customer_search
rather than GET /customers
to search for customer data. GET /customers
allows a maximum of 1,000 results per page and up to 10 pages, so in total it can return only a maximum of 10,000 results.
Bulk Exporting Customer Data
Use the POST /customer_search
endpoint for bulk data exports, including downloading your entire customer database.
POST /ts_api/crm/v1/customer_search
Response:
{
"customers": [{ ... }, { ... }]
"pagination": {
"scroll_id": "FGluY2x1Z...aGxWaGh6MzAzUQ==",
"total_results": 1653033
}
}
The endpoint will return 200 results at once. To fetch the next page of results, use the pagination.scroll_id
value from the response in the POST
request body as follows:
POST /ts_api/crm/v1/customer_search
Body:
{ scroll_id: "FGluY2x1Z...aGxWaGh6MzAzUQ==" }
The response to this request will include a new pagination.scroll_id
value. Use this new value in your next query in a loop until there are no more results returned. The scroll_id
value will expire if not used within 5 minutes. When using the scroll_id
parameter, it is not necessary to retransmit your search parameter parameters from the original request.
Receiving Notifications when Data Changes
Please refer to the Sync API for instructions on how to receive notifications when data objects (including Customers, etc.) are changed on the TableCheck side.
Modifying Customer Phone Numbers and Email Addresses
The Customer
object contains several nested objects, includes phones
, emails
, addresses
, events
(birthday, anniversary, etc.), and socials
(SNS accounts).
The Customer
response object (e.g. GET /crm/v1/customers/{id}
) returns phones
and emails
as an array of strings, and additionally has phone_objects
and email_objects
which represent the full objects. Note the two formats represent the same underlying content. Phones must be in E.164 format.
GET /crm/v1/customers
customers: [{
...
phones: ['+12061112222', '+14253334444'],
phone_objects: [{ id: '5f50c31e12e344000695f8b7', number: '+12061112222' },
{ id: '5f50c31e12e344000695f8b8', number: '+14253334444' }],
emails: ['foo@bar.com', 'baz@qux.com']
email_objects: [{ id: '5f50c31e12e344000695f8b9', email: 'foo@bar.com' },
{ id: '5f50c31e12e344000695f8ba', email: 'baz@qux.com' }],
}]
To modify nested objects via PUT /crm/v1/customers/{id}
, you may reference them by their object IDs. Use the _destroy: true
attribute to delete a nested object.
PUT /crm/v1/customers/{id}
{
phones: [{ id: '5f5...8b7', number: '+818044445555' }, // modify the phone
{ id: '5f5...8b8', _destroy: true }], // remove the phone
emails: [{ id: '5f5...8b9', email: 'me@test.com' }, // modify the email
{ id: '5f5...8ba', _destroy: true }], // remove the email
}
Alternatively, you may transmit phones
and emails
as an array of string. By default, any phones / emails
you set in this manner will be appended to the existing phones
/ emails
of the Customer. To overwrite existing, use the overwrite_phones: true
and overwrite_emails: true
parameters.
PUT /crm/v1/customers/{id}
{
phones: ['+818044445555'],
overwrite_phones: true, // overwrite any existing phones
emails: ['me@test.com'],
overwrite_emails: true, // overwrite any existing emails
}
The overwrite_phones
, overwrite_emails
, overwrite_addresses
, etc. parameters can also be combined with the object-based format above.
Merging Customer Records
It is possible to merge Customer
objects using the merge_customer_ids
parameter:
PUT /crm/v1/customers/{id}
{
merge_customer_ids: ['5c035f1e12e344000695f8b7']
}
Here the Customer identified by {id}
in the URL path is the primary ("victor") and remains post-merge. The Customers listed in merge_customer_ids
are secondary ("victims") and are destroyed after merging. All associated objects (e.g., Reservations, Memberships, Images) from the secondary Customers transfer to the primary Customer. This transfer happens asynchronously; it may take several minutes for all associated objects to correctly reflect the new customer ID.
Merging does not automatically combine individual data fields like first_name
, last_name
, emails
, and phones
. You must manually resolve conflicts and set these fields on the subject Customer, which may be done in the same API call. For example, to merge a Customer and update the subject Customer’s first_name
and phones
, structure your API call as follows:
PUT /crm/v1/customers/{id}
{
first_name: 'James',
phones: ['+818044445555'],
overwrite_phones: true,
merge_customer_ids: ['5c035f1e12e344000695f8b7']
}
Lastly, in the Customer response, you may refer to the merged_customer_ids
field to reconcile which other Customers have been historically merged into the subject Customer. Since the other Customers will have already been destroyed, it will not actually be possible to query them using the IDs.
Uploading Customer Images on Customer Creation
You can upload images during customer creation. We accept image urls in the request via the image_upload_url
key.
The image must already be uploaded to a URL before it can be uploaded into TableCheck (it cannot be uploaded as a file).
You are allowed to upload multiple images at once.
There is no limit to the number of images you may upload.
The maximum file size is 20 GB.
The following image MIME types are allowed
image/jpg
image/jpeg
image/png
image/gif
image/bmp
image/heic
image/tiff
image/webp
image/svg+xml
Images are uploaded asynchronously and may take some time. The response will contain a null
url value until the image is successfully uploaded.
POST /crm/v1/customers
{
parent_shop_id: '5ed64e279551e80639a4da51',
franchise_id: '5ed64e249551e80639a4d995',
first_name: 'First name',
last_name: 'Last name',
company_name: 'Company name',
images: [
{
"image_upload_url": "https://i.pravatar.cc/300"
},
{
"image_upload_url": "https://i.pravatar.cc/400"
}
]
}
Response
{
"images": [
{
"id": "65e6659335288119eadde814",
"url": null,
"content_type": "image/jpeg",
"dimensions": null,
"fingerprint": "9c2657ce7e26bd1a12b3f8f721e7b3de",
"image_variants": [],
"tags": [],
"created_at": "2024-03-05T00:21:40.978Z"
},
{
"id": "65e6659235288119eadde813",
"url": null,
"content_type": "image/jpeg",
"dimensions": null,
"fingerprint": "7348ad7721a3be5de1fa0891e0941b9f",
"image_variants": [],
"tags": [],
"created_at": "2024-03-05T00:21:38.869Z"
},
]
}
Upon successful upload the images will contain the url
and image_variants
{
"images": [
{
"id": "65e6659235288119eadde813",
"url": "https://cdn.tablecheck.com/xl/72a84a29.jpg?1709598098",
"content_type": "image/jpeg",
"dimensions": [
300,
300
],
"fingerprint": "7348ad7721a3be5de1fa0891e0941b9f",
"image_variants": [
{
"url": "https://cdn.tablecheck.com/original/72a84a29?1709598098",
"variant": "original",
"content_type": "image/jpeg",
"dimensions": [
300,
300
]
},
{
"url": "https://cdn.tablecheck.com/xl/72a84a29.jpg?1709598098",
"variant": "large",
"content_type": "image/jpeg",
"dimensions": [
300,
300
]
},
{
"url": "https://cdn.tablecheck.com/lg/72a84a29.jpg?1709598098",
"variant": "medium",
"content_type": "image/jpeg",
"dimensions": [
300,
300
]
},
{
"url": "https://cdn.tablecheck.com/sm/72a84a29.jpg?1709598098",
"variant": "small",
"content_type": "image/jpeg",
"dimensions": [
256,
256
]
}
],
"tags": [],
"created_at": "2024-03-05T00:21:38.869Z"
},
{
"id": "65e6659335288119eadde814",
"url": "https://cdn.tablecheck.com/xl/918cc2b1.jpg?1709598101",
"content_type": "image/jpeg",
"dimensions": [
200,
200
],
"fingerprint": "9c2657ce7e26bd1a12b3f8f721e7b3de",
"image_variants": [
{
"url": "https://cdn.tablecheck.com/original/918cc2b1?1709598101",
"variant": "original",
"content_type": "image/jpeg",
"dimensions": [
200,
200
]
},
{
"url": "https://cdn.tablecheck.com/xl/918cc2b1.jpg?1709598101",
"variant": "large",
"content_type": "image/jpeg",
"dimensions": [
200,
200
]
},
{
"url": "https://cdn.tablecheck.com/lg/918cc2b1.jpg?1709598101",
"variant": "medium",
"content_type": "image/jpeg",
"dimensions": [
200,
200
]
},
{
"url": "https://cdn.tablecheck.com/sm/918cc2b1.jpg?1709598101",
"variant": "small",
"content_type": "image/jpeg",
"dimensions": [
256,
256
]
}
],
"tags": [],
"created_at": "2024-03-05T00:21:40.978Z"
}
],
}
Uploading and Deleting Customer Images on Customer Update
You can upload or delete images while updating a customer.
To delete an image apply the id
of the image and _destroy
key with a Boolean value of true.
You may also upload or destroy multiple images at the same time.
Updating an existing image is not permitted. You will receive a user error when attempting to do so.
Delete an existing image and upload a new one instead.
PUT /crm/v1/customers/{id}
{
images: [
{
id: '5ed54e67ee21e50539a4da53', // destroy an existing image
_destroy: true
},
{
"image_upload_url": "https://i.pravatar.cc/300". // upload a new image
},
],
}
For further inquiries and assistance, please contact api@tablecheck.com