This method explains how merchants can send push notifications to users in the GoPay app using this API. This API currently supports sending only one notification at a time. The user for push notification will be identified from the Authorization token.
Note
To enable the Push Notification API for non-marketing purposes, please request a submission form. Include the title and description, and our team will respond with the appropriate template name for merchant use.
Path | /v1/mini-apps/notifications/push |
---|---|
Host | https://public-mini-app-merchants.gopayapi.com |
Http Method | POST |
Request Headers:
Property | Data type | Required | Description |
---|---|---|---|
Debug-Id | string | No | This is an identifier that is used for debugging purposes |
Request-Id | string | Yes | This is an identifier that is used for maintaining idempotency |
Authorization | string | Yes | Bearer Authorization header This is the token you would receive in the apply token API |
Request Body:
Property | Data type | Required | Description |
---|---|---|---|
template_name | string | Yes | The name of the template that is registered in GoPay |
template_parameters | object | Yes | The object which contains notification parameters such as title, description, etc |
Response:
Property | Data type | Description |
---|---|---|
success | boolean | It will be true if API call is successful and false in case of failure |
error | object | This object will be non-null only in case of failures |
error.code | string | The error code |
error.description | string | The description of the error |
Sample Request:
{
"template_name": "HK_PDS_NOTIFY",
"template_parameters": {
"amount": "100000",
"currency": "IDR"
}
}
Sample Response:
Success Response:
{
"success": true
}
Error Response: With appropriate HTTP status codes. Only 5xx would be retriable
{
"success": false,
"error": {
"description": "User not found"
}
}