Webhooks
Webhooks are used to keep remote systems in-sync for customers, products, orders and groups. You have the option to push new, updated and deleted records to a remote URL for consumption. Webhooks can be added for a specific client in the admin panel or they can be added and configured when you're developing an app.
- Webhook object & ENUMs
- Create webhook
- Retrieve webhook
- Update webhook
- Delete webhook
- List webhooks
- Webhook response body
- How bulk updates work & bulk response body
Webhook object
{
"id": "28e547bb-baf4-433b-8c35-05b6e9b0ea04",
"object": "Customer",
"action": "Update",
"url": "https://receivecustomerupdates.mymarketingengine.com",
"createdAt": "2018-05-22T18:57:01.420Z",
"updatedAt": "2018-05-22T19:13:08.231Z"
}ENUMs
The enumerated web-hook fields and their values.
| Field | Value |
|---|---|
object | - Allocation - Cart - Club - Club Package - Club Membership - Collection - Customer - Customer Address - Customer Credit Card - Coupon - Group - Product - Promotion - Order - Reservation - Tag - Transaction Email |
action | - Create - Update - Bulk Update - Delete - Send |
Create webhook
POST /web-hook
Request
{
"object": "Customer",
"action": "Create",
"url": "https://receivenewcustomer.mymarketingengine.com"
}Response
web-hook object
Retrieve webhook
GET /web-hook/{:id}
Response
web-hook object
Update webhook
PUT /web-hook/{:id}
Request
{
"object": "Customer",
"action": "Delete",
"url": "https://receivedeletedcustomers.mymarketingengine.com"
}Response
web-hook object
Delete webhook
DELETE /web-hook/{:id}
Response
Blank object and 204 status
List webhooks
GET /web-hook
Response
An array of web-hook objects and total count
{
"webHooks": [{
"id": "28e547bb-baf4-433b-8c35-05b6e9b0ea04",
"object": "Customer",
"action": "Delete",
"url": "https://receivedeletedcustomers.mymarketingengine.com",
"createdAt": "2018-05-22T18:57:01.420Z",
"updatedAt": "2018-05-22T19:14:57.640Z"
}, {
"id": "8335dc92-1d12-4a42-af6d-4cea607d1b1d",
"object": "Customer",
"action": "Create",
"url": "https://receivecreatedcustomers.mymarketingengine.com",
"createdAt": "2018-05-22T19:16:16.172Z",
"updatedAt": "2018-05-22T19:16:16.172Z"
}, {
"id": "bd5f4986-a17c-4bfe-bba2-2fcc063c84bd",
"object": "Customer",
"action": "Update",
"url": "https://receiveupdatedcustomers.mymarketingengine.com",
"createdAt": "2018-05-22T19:16:29.285Z",
"updatedAt": "2018-05-22T19:16:29.285Z"
}],
"total": 3
}Webhook response body
{
"object": "Customer",
"action": "Create",
"payload": { entire customer object },
"user": "[email protected]",
"tenantId": "example-tenant"
}How bulk updates work
For actions in Commerce7 that add tags in bulk to customers, orders, club memberships or reservations, rather than notify you 1,000s of times when 1,000s of records are updated, we will notify you one time of a bulk update, and send you a callback URL to get the list of updated records.
If you are using the 'tag' properties on orders, customers, reservations, or club memberships for your integration, you will need to add a bulk update web-hook to ensure you receive these tag updates.
The response provides a callback URL that you can use to call the Commerce7 APIs to retrieve all the records updated, 50 per request using cursor pagination.
Webhook bulk update response body
{
"object": "Customer",
"action": "Bulk Update",
"payload": {
"callbackUrl": "https://api.commerce7.com/v1/customer?tagId=b098a8e0-bf54-4f04-ba96-3ef386221fda&cursor=start"
},
"user": "[email protected]",
"tenantId": "example-tenant"
}Failed webhooks
If your webhook fails and the errors persist over 48 hours, it will be disabled. Once a webhook is disabled, it cannot be enabled again and will need to be recreated.
Updated over 1 year ago
