Every state change on a mini-app order is delivered as an outbound POST to a URL you register in the developer portal. Payload is JSON, signed with an HMAC-SHA256 over the raw body using your webhook secret.
Retries: 8 attempts with exponential backoff over ~24 hours before the delivery drops to a dead-letter queue you can inspect in the portal.
// Every request carries X-SG-Signature = sha256=<hex-hmac>
// Compare it against HMAC-SHA256(rawBody, webhookSecret).
const crypto = require('crypto');
function verify(rawBody, headerSig, secret) {
const expected = 'sha256=' + crypto
.createHmac('sha256', secret)
.update(rawBody)
.digest('hex');
return crypto.timingSafeEqual(
Buffer.from(expected),
Buffer.from(headerSig)
);
}