Push Notification

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
Hosthttps://public-mini-app-merchants.gopayapi.com
Http MethodPOST

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:

PropertyData typeRequiredDescription
template_namestringYesThe name of the template that is registered in GoPay
template_parametersobjectYesThe object which contains notification parameters such as title, description, etc

Response:

PropertyData typeDescription
successbooleanIt will be true if API call is successful and false in case of failure
errorobjectThis object will be non-null only in case of failures
error.codestringThe error code
error.descriptionstringThe 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"
  }
}