What it does
Push a custom (non-order) notification to one of your users — reminders, promos, status updates. You define an event and a template for it (EN + AR, with
{placeholder} tokens); SG renders it in the user's language and delivers. Requires custom_notifications_enabled on the mini app. Delivery is asynchronous — the response confirms the notification was queued.Body
eventRequired
Your event key (≤ 50 chars) — must have an active template. Keys starting with
order. are reserved.user_idRequired
SG user id of the recipient (one per call).
variables
Object of values that fill the
{placeholder} tokens in the template. {mini_app_name}, {user_name} and {user_first_name} are filled automatically — you can use them in your template without sending them (anything you do send here overrides them).data
Optional extra push data (e.g. a deep-link in
tap_action).Request schema
{
"event": <string, 1..50, not "order.*">, // required
"user_id": <number>, // required
"variables": <object>, // optional — fills {placeholder} tokens
"data": <object> // optional — extra push data
}Response
statusboolean
true on 202 (queued); false on an error envelope.data.queuedboolean
Confirms the notification was accepted and queued. Actual push delivery happens asynchronously.
error_code (on 4xx)string
CUSTOM_NOTIFICATIONS_NOT_ENABLED (403), TEMPLATE_NOT_FOUND (404), RESERVED_EVENT_KEY (400). Branch on this, not the human message.messagestring
Human string for logs — do not parse.
Response schema
// 202 Accepted — queued for delivery
{
"status": true,
"data": { "queued": true },
"message": "Notification queued"
}
// 403 CUSTOM_NOTIFICATIONS_NOT_ENABLED — not enabled for this mini app
// 404 TEMPLATE_NOT_FOUND — no active template for this event
// 400 RESERVED_EVENT_KEY — event starts with "order."
{
"status": false,
"error_code": "TEMPLATE_NOT_FOUND",
"message": "No active template for event \"promo_blast\""
}Try it
Base URL
https://microservices.shoppinggate.app/mini-app-core/