Skip to content

Webhook subscriptions

Webhooks allow you to receive real-time notifications when specific events occur. This guide will introduce how to subscribe to and manage webhooks through Genstore's REST APIs or via embedded app configurations.

WARNING

In accordance with personal data protection policies, developers are required to provide a valid callback address and listen for the corresponding Webhook messages to ensure compliance with government privacy requirements.

Each app published through the Genstore App Store must subscribe to the following compliance webhook topics:

Use REST API to subscribe to webhook topics

You can easily create and manage webhook subscriptions using REST APIs. The following example demonstrates how to create a new webhook subscription for the event of order creation.

Create a webhook subscription

To create a new webhook subscription, you need to provide the destination address and the topic name you are interested in:

bash
curl -d '{"webhook":{"address":"https://appURL:topicName","topic":"orders/create"}}' \
-X POST "https://{shop}.genmystore.com/api/202412/app/webhooks" \
-H "X-Genstore-Access-Token: {access_token}" \
-H "Content-Type: application/json"

Example of a successful response:

json
HTTP/1.1 201 Created
{
  "webhook": {
    "id": 8589934859,
    "address": "https://appURL:topicName",
    "topic": "orders/create",
    "createTime": "2024-10-30T16:19:13-04:00",
    "updateTime": "2024-10-30T16:19:13-04:00",
  }
}

Manage webhook subscriptions

Below are some common REST API operations that can help you manage your webhook subscriptions:

REST APIVERSIONMETHODURI
Create webhook202412POST/app/webhooks
Delete webhook202412DEL/app/webhooks/
Update webhook202412PUT/app/webhooks/
List webhook202412GET/app/webhooks
Retrieve webhook202412GET/app/webhooks/
Count webhook202412GET/app/webhooks/count

Receiving Webhook messages

When the app receives a Webhook message, it should promptly return a 200 OK response to confirm successful receipt of the message. Any response outside the 200 range (including 3XX HTTP redirect codes) indicates the Webhook message was not successfully received, and Genstore will treat it as an error response.

Manage webhooks via embedded apps

This section will be detailed in future versions. Stay tuned.