Skip to content
Last updated

1. Overview

Keeta actively pushes various notifications to service provider applications via webhook, including:

  • Order
  • Store Status
  • Menu Synchronization Result

2. Configuring Webhook URL

Please choose one of the following methods:

2.1 Method 1: Official Website Configuration

  1. Log in to your developer account on Keeta's official website
  2. Navigate to Application Management
  3. Configure your webhook URL in the designated section

2.2 Method 2: API Configuration

Configure via Keeta API:

// Demo
curl -X POST 'https://open.mykeeta.com/api/open/base/callback/url/set' \
-H 'Content-Type: application/json' \
--data-raw '{
    "appId": 2061048026,
    "timestamp": "1723001797",
    "sig": "e12ae63e917752bca3fd5d0eceec42337f2338f4d9303ac30e3eb4856900b07c",
    "eventId": 1001,
    "url": "https://<vendor'\''s url>",
    "isTest": 1
}'

3. Webhook Message Definition

Field KeyTypeDescription
sigStringA string calculated according to specific rules (see Authorization Guide for details). Developers must use this signature to verify whether the request originates from Keeta, thereby guaranteeing message security and accuracy.
eventIdIntegerCode representing the message type. Please refer to the event code enumeration later in this document.
appIdlongApplication ID, unique identifier assigned by the system when the application is created.
messageIdStringUnique identifier for the message.
shopIdLongKeeta store ID
messageStringMessage content regarding orders, stores, or products. For specific definitions, refer to the API reference chapter.
timestampLongMessage push timestamp in seconds (Unix epoch time).

Message example:

// Demo
{
  "sig": "6d2581a5e71cdddc6f8770d0e84b2aa02ec72158190b39d97df2e5d5c314b7a0",
  "eventId": 1002,
  "appId": 3762772727,
  "messageId": "1930106161957212198",
  "shopId": 145541,
  "message": "{\"opTime\":1749008143025,\"orderViewId\":553440887574627,\"shopId\":145541,\"status\":30}",
  "timestamp": 1749008143
}

4. Webhook Request Protocol

  1. Webhook requests use the HTTPS protocol, employ the POST method, have a Content-Type of "application/json", and use UTF-8 encoding.

  2. Webhooks must support Keeta's heartbeat detection. During heartbeat detection, Keeta sends an empty packet. Developers must handle empty packet requests and return a success response.

  3. After processing, the response should be in JSON format. The specific format can be found in the following description:

// Webhook repsonse
{
  "code": 0,
  "message": "success"
  "data": {}
}
Field KeyTypeRequirementDescription
codeIntegerMandatoryA code value of 0 indicates successful acceptance. Any non-zero code value indicates processing failure.
messageStringOptionalSupplementary explanation of the code value.
dataObjectOptionalAdditional error details for failure scenarios.
  1. Pushed messages contain signatures. Developers must verify message signatures.

  2. All APIs provided by developers must support idempotency. In the event of a request failure or network timeout, the Keeta platform will automatically retry, typically up to 3 times with 1-minute intervals, to ensure that multiple identical requests have the same effect as a single request.

  3. How to determine if a message is a retry: Developers can filter based on order data. For example, when Keeta retries a paid order notification, developers should check whether the order ID has already been processed. If the message has been processed, it should be ignored.

5. Enumeration of Event ID (Extract)

For configuration details, refer to the 'Edit Application' in Developer Portal.

eventIdEvent Description
1001Order Placement Notification
1002Order Acceptance Notification
1003Order Completion Notification
1004Order Cancellation Notification
1005Refund Initiation Notification
1006Delivery Status Update Notification
1007Partial Refund Initiation Notification
1101Store Business Hours Change Notification
1102Store Status Change Notification
1201Batch Product Image Binding Result Notification