About webhook ​
Access scope
Multiple access scopes needed — refer to each endpoint for access scope requirements.
Genstore provides webhook subscriptions to help developers receive platform event notifications. Applications can receive these events by subscribing to specific webhook topics. Genstore offers a set of REST APIs for managing webhook subscriptions, including registration, deletion, updating, and querying.
Core Features
- Register webhooks and callback URLs
- Delete webhook subscriptions
- Update webhook subscriptions
- Query webhook lists and details
- Get webhook subscription count
WARNING
-
Webhook notifications do not guarantee the order of events.
-
After 8 consecutive failures, the system will cease attempts to send notifications, which may result in data loss.
Use Cases
- Order Data Sync: When applications need real-time order data from a store, they can subscribe to the
orders/create
topic to receive new order data instantly. - Customer Data Sync: When applications need real-time customer data from a store, they can subscribe to the
customers/create
topic to receive new member data instantly.
Endpoints
POST
/api/202412/app/webhooks: Create webhook
PUT
/api/202412/app/webhooks/{webhookId}: Update webhook
DELETE
/api/202412/app/webhooks/{webhookId}: Delete webhook
GET
/api/202412/app/webhooks: Get webhook list
GET
/api/202412/app/webhooks/{webhookId}: Get webhook details
GET
/api/202412/app/webhooks/count: Get webhook count
Webhook Object ​
Create and manage webhook subscription.
Properties ​
{
"webhook": {
"address": "https://apple.com/uninstall",
"createTime": "2024-10-25T11:06:48+08:00",
"topic": "blazeTest/event1",
"updateTime": "2024-10-31T10:55:12+08:00",
"id": "123456"
}
}
POST
Create webhook ​
Create a new webhook subscription by specifying both an address and a topic.
Access scope
Requires ANY of the following access scopes: write_apps
Endpoint
POST
/api/202412/app/webhooks
Request Params
Response Data
curl -X POST \
https://{shop}.genmystore.com/api/202412/app/webhooks" \
-H "X-Genstore-Access-Token: {access_token}" \
-H "Content-Type: application/json" \
-d '{
"webhook":{
"address":"blazeTest/event1",
"topic":"https://apple.com/uninstall"
}
}'
HTTP/1.1 200 OK
{
"webhook": {
"address": "https://apple.com/uninstall",
"createTime": "2024-10-25T11:06:48+08:00",
"topic": "blazeTest/event1",
"updateTime": "2024-10-31T10:55:12+08:00",
"id": "123456"
}
}
PUT
Update webhook ​
Update a webhook subscription's topic or address URIs.
Access scope
Requires ANY of the following access scopes: write_apps
Endpoint
PUT
/api/202412/app/webhooks/{webhookId}
Request Params
Response Data
curl -X PUT \
https://{shop}.genmystore.com/api/202412/app/webhooks/{webhookId}" \
-H "X-Genstore-Access-Token: {access_token}" \
-H "Content-Type: application/json" \
-d '{
"webhookId":"123456",
"webhook":{
"address":"https://apple.com/uninstall",
"id":"123456"
}
}'
HTTP/1.1 200 OK
{
"webhook": {
"address": "https://apple.com/unins...",
"createTime": "2024-10-25T11:06:48+08:00",
"topic": "blazeTest/event1",
"updateTime": "2024-10-31T10:55:12+08:00",
"id": "123456"
}
}
DELETE
Delete webhook ​
Delete a webhook subscription.
Access scope
Requires ANY of the following access scopes: write_apps
Endpoint
DELETE
/api/202412/app/webhooks/{webhookId}
Request Params
Response Data
curl -X DELETE \
https://{shop}.genmystore.com/api/202412/app/webhooks/{webhookId}" \
-H "X-Genstore-Access-Token: {access_token}" \
HTTP/1.1 200 OK
{}
GET
Get webhook list ​
Retrieves a list of webhooks.
Access scope
Requires ANY of the following access scopes: write_apps
read_apps
Endpoint
GET
/api/202412/app/webhooks
Request Params
Response Data
curl -X GET \
https://{shop}.genmystore.com/api/202412/app/webhooks" \
-H "X-Genstore-Access-Token: {access_token}" \
HTTP/1.1 200 OK
{
"webhooks": [
{
"address": "https://apple.com/uninstall",
"createTime": "2024-10-25T11:06:48+08:00",
"topic": "blazeTest/event1",
"updateTime": "2024-10-31T10:55:12+08:00",
"id": "123456"
}
]
}
GET
Get webhook details ​
Retrieve a single webhook subscription. The properties desired in the result can be specified.
Access scope
Requires ANY of the following access scopes: write_apps
read_apps
Endpoint
GET
/api/202412/app/webhooks/{webhookId}
Request Params
Response Data
curl -X GET \
https://{shop}.genmystore.com/api/202412/app/webhooks/{webhookId}" \
-H "X-Genstore-Access-Token: {access_token}" \
HTTP/1.1 200 OK
{
"webhook": {
"address": "https://apple.com/uninstall",
"createTime": "2024-10-25T11:06:48+08:00",
"topic": "blazeTest/event1",
"updateTime": "2024-10-31T10:55:12+08:00",
"id": "123456"
}
}
GET
Get webhook count ​
Retrieve a count of existing webhook subscriptions. The results can be filtered by address or by topic.
Access scope
Requires ANY of the following access scopes: write_apps
read_apps
Endpoint
GET
/api/202412/app/webhooks/count
Request Params
Response Data
curl -X GET \
https://{shop}.genmystore.com/api/202412/app/webhooks/count" \
-H "X-Genstore-Access-Token: {access_token}" \
HTTP/1.1 200 OK
{
"count": "21"
}
About webhook
Access scope
Multiple access scopes needed — refer to each endpoint for access scope requirements.
Genstore provides webhook subscriptions to help developers receive platform event notifications. Applications can receive these events by subscribing to specific webhook topics. Genstore offers a set of REST APIs for managing webhook subscriptions, including registration, deletion, updating, and querying.
Core Features
- Register webhooks and callback URLs
- Delete webhook subscriptions
- Update webhook subscriptions
- Query webhook lists and details
- Get webhook subscription count
WARNING
Webhook notifications do not guarantee the order of events.
After 8 consecutive failures, the system will cease attempts to send notifications, which may result in data loss.
Use Cases
- Order Data Sync: When applications need real-time order data from a store, they can subscribe to the
orders/create
topic to receive new order data instantly. - Customer Data Sync: When applications need real-time customer data from a store, they can subscribe to the
customers/create
topic to receive new member data instantly.
Webhook Object
Create and manage webhook subscription.
Properties
POST
Create webhook
Create a new webhook subscription by specifying both an address and a topic.
Access scope
Requires ANY of the following access scopes: write_apps
Endpoint
POST
/api/202412/app/webhooks
PUT
Update webhook
Update a webhook subscription's topic or address URIs.
Access scope
Requires ANY of the following access scopes: write_apps
Endpoint
PUT
/api/202412/app/webhooks/{webhookId}
DELETE
Delete webhook
Delete a webhook subscription.
Access scope
Requires ANY of the following access scopes: write_apps
Endpoint
DELETE
/api/202412/app/webhooks/{webhookId}
GET
Get webhook list
Retrieves a list of webhooks.
Access scope
Requires ANY of the following access scopes: write_apps
read_apps
Endpoint
GET
/api/202412/app/webhooks
GET
Get webhook details
Retrieve a single webhook subscription. The properties desired in the result can be specified.
Access scope
Requires ANY of the following access scopes: write_apps
read_apps
Endpoint
GET
/api/202412/app/webhooks/{webhookId}
GET
Get webhook count
Retrieve a count of existing webhook subscriptions. The results can be filtered by address or by topic.
Access scope
Requires ANY of the following access scopes: write_apps
read_apps
Endpoint
GET
/api/202412/app/webhooks/count