Skip to main content

General

This type of subscription will create a subscription which listens to any outlets which are already authorized by partner.

The methods available in Notification Subscriptions are listed in the table given below.

HTTP MethodEndpointDescription
POST/integrations/partner/v1/notification-subscriptionsIt is used to subscribe to a specific event notification.
GET/integrations/partner/v1/notification-subscriptionsIt is used to get the list of subscriptions.
GET/integrations/partner/v1/notification-subscriptions/{notification_id}It is used to get details of a subscription.
PUT/integrations/partner/v1/notification-subscriptions/{notification_id}It is used to edit the notification subscription.
DELETE/integrations/partner/v1/notification-subscriptions/{notification_id}It is used to delete a subscription.

Create Notification Subscription

You can subscribe to specific events you are interested in.

After the subscription is created, when a specific event occurs, HTTP request is made to the URL specified in the notification.

POST /integrations/partner/v1/notification-subscriptions

Sample Request

curl -X POST https://api.partner-sandbox.gobiz.co.id/integrations/partner/v1/notification-subscriptions \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer {access-token}' \
-d $'
{
"event": "gofood.order.driver_arrived",
"url": "https://sample-endpoint.com/notifications",
"active": true
}
'

Request Parameters

JSON AttributeDescriptionTypeRequired
eventType of event notification to subscribe.StringRequired
urlURL at which notification is to be received.String(URI)Required
activeStatus of the subscription. The default value is true.
Note: If false, notification is not sent.
BooleanOptional

Sample Response - 201 Success

{
"success": true,
"data": {
"subscription": {
"id": "96f614f6-745e-47f5-ad68-c0c8e9ba8dc8",
"event": "gofood.order.driver_arrived",
"url": "https://sample-endpoint.com/notifications",
"active": true,
"created_at": "2019-08-24T14:15:22Z"
}
}
}

Response Parameters - 201 Success

JSON AttributeDescriptionType
successStatus of the request. Value true indicates successful submission of the request.Boolean
dataDetails of the subscription.Object
» subscriptionSubscription object.Object
note
  • To perform this operation, you must be authenticated using go_auth_client_credentials(partner:outlet:read) or go_auth_client_credentials(payment:transaction:read).
  • For list of available events, refer Events List.
  • For handling the notifications, refer Receiving Notifications.
  • Possible error responses are 401, 404, 406, and 415. Please refer Error Glossary.

Get Notification Subscriptions

By using this method, you can view the list of subscriptions.

GET /integrations/partner/v1/notification-subscriptions

Sample Request

curl -X GET https://api.partner-sandbox.gobiz.co.id/integrations/partner/v1/notification-subscriptions \
-H 'Authorization: Bearer {access-token}'

Sample Response - 200 Success

{
"success": true,
"data": {
"subscriptions": [
{
"id": "96f614f6-745e-47f5-ad68-c0c8e9ba8dc8",
"event": "gofood.order.driver_arrived",
"url": "https://sample-endpoint.com/notifications",
"active": true,
"created_at": "2019-08-24T14:15:22Z"
}
]
}
}

Response Parameters - 200 Success

JSON AttributeDescriptionType
successStatus of the request. Value true indicates successful submission of the request.Boolean
dataDetails of the subscription.Object
» subscriptionsArray of Subscription object.Array(Object)
note
  • To perform this operation, you must be authenticated using go_auth_client_credentials(partner:outlet:read) or go_auth_client_credentials(payment:transaction:read).
  • For list of available events, refer Events List.
  • For handling the notifications, refer Receiving Notifications.
  • Possible error responses are 401, 404, 406, and 415. Please refer Error Glossary.

Get Notification Subscription Detail

By using this method, you can get the detailed information about a subscription.

GET /integrations/partner/v1/notification-subscriptions/{notification_id}

Sample Request

curl -X GET https://api.partner-sandbox.gobiz.co.id/integrations/partner/v1/notification-subscriptions/{notification_id} \
-H 'Authorization: Bearer {access-token}'

Path Parameters

NameDescriptionTypeRequired
notification_idID of the notification.StringRequired

Sample Response - 200 Success

{
"success": true,
"data": {
"subscription": {
"id": "96f614f6-745e-47f5-ad68-c0c8e9ba8dc8",
"event": "gofood.order.driver_arrived",
"url": "https://sample-endpoint.com/notifications",
"active": true,
"created_at": "2019-08-24T14:15:22Z"
}
}
}

Response Parameters - 200 Success

JSON AttributeDescriptionType
successStatus of the request. Value true indicates successful submission of the request.Boolean
dataDetails of the subscription.Object
» subscriptionSubscription object.Object
note
  • To perform this operation, you must be authenticated using go_auth_client_credentials(partner:outlet:read) or go_auth_client_credentials(payment:transaction:read).
  • For list of available events, refer Events List.
  • For handling the notifications, refer Receiving Notifications.
  • Possible error responses are 401, 404, 406, and 415. Please refer Error Glossary.

Update Notification Subscription

By using this method, you can edit the existing notification subscription. You can change the status of subscription and URL using this method.

PUT /integrations/partner/v1/notification-subscriptions/{notification_id}

Sample Request

curl -X PUT https://api.partner-sandbox.gobiz.co.id/integrations/partner/v1/notification-subscriptions/{notification_id} \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer {access-token}' \
-d $'
{
"event": "gofood.order.driver_arrived",
"url": "https://sample-endpoint.com/notifications",
"active": true
}
'

Path Parameters

NameDescriptionTypeRequired
notification_idID of the notification.StringRequired

Request Parameters

JSON AttributeDescriptionTypeRequired
eventType of event notification to subscribe.StringOptional
urlURL at which notification is to be received.String(URI)Optional
activeStatus of the subscription. The default value is true.
Note: If false, the subscription is deactivated.
BooleanOptional

Sample Response - 200 Success

{
"success": true,
"data": {
"subscription": {
"id": "96f614f6-745e-47f5-ad68-c0c8e9ba8dc8",
"event": "gofood.order.driver_arrived",
"url": "https://sample-endpoint.com/notifications",
"active": true,
"created_at": "2019-08-24T14:15:22Z"
}
}
}

Response Parameters - 200 Success

JSON AttributeDescriptionType
successStatus of the request. Value true indicates successful submission of the request.Boolean
dataDetails of the subscription.Object
» subscriptionSubscription object.Object
note
  • To perform this operation, you must be authenticated using go_auth_client_credentials(partner:outlet:read) or go_auth_client_credentials(payment:transaction:read).
  • For list of available events, refer Events List.
  • For handling the notifications, refer Receiving Notifications.
  • Possible error responses are 401, 404, 406, and 415. Please refer Error Glossary.

Delete Notification Subscription

By using this method, you can delete a subscription.

DELETE /integrations/partner/v1/notification-subscriptions/{notification_id}

Sample Request

curl -X DELETE https://api.partner-sandbox.gobiz.co.id/integrations/partner/v1/notification-subscriptions/{notification_id} \
-H 'Authorization: Bearer {access-token}'

Path Parameters

NameDescriptionTypeRequired
notification_idID of the notification.StringRequired

Sample Response - 200 Success

{
"success": true,
"data": {}
}

Response Parameters - 200 Success

JSON AttributeDescriptionType
successStatus of the request. Value true indicates successful submission of the request.Boolean
data-Object
note

To perform this operation, you must be authenticated using go_auth_client_credentials(partner:outlet:read) or go_auth_client_credentials(payment:transaction:read).