Skip to main content

Outlet specific

This type of subscription will create a subscription which listens to a specific outlet. This is useful for partner to do piloting integrations.

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

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

Create Outlet Notification Subscription

You can subscribe to specific events you are interested in for a specific outlet.

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

POST /integrations/partner/outlets/{outlet_id}/v1/notification-subscriptions

Sample Request

Sample Request
curl -X POST https://api.partner-sandbox.gobiz.co.id/integrations/partner/outlets/{outlet_id}/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
}
'

Path Parameters

NameDescriptionTypeRequired
outlet_idID of the outlet for which you want to create a notification subscription.StringRequired

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 Parameter - 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 Outlet Notification Subscriptions

By using this method, you can view a list of subscriptions of a specific outlet.

GET /integrations/partner/outlets/{outlet_id}/v1/notification-subscriptions

Sample Request

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

Path Parameters

NameDescriptionTypeRequired
outlet_idID of the outlet for which you want to view the list of subscriptions.StringRequired

Sample Request - 200 Success

Sample Response
{
"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 Outlet Notification Subscription Detail

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

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

Sample Request

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

Path Parameters

NameDescriptionTypeRequired
outlet_idID of the outlet for which you want to view the details of a subscription.StringRequired
notification_idID of the notification.StringRequired

Sample Response - 200 Success

Sample Response
{
"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 Outlet Notification Subscription

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

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

Sample Request

Sample Request
curl -X PUT https://api.partner-sandbox.gobiz.co.id/integrations/partner/outlets/{outlet_id}/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
outlet_idID of the outlet for which you want to update the subscription.StringRequired
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

Sample Response
{
"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 Parameter - 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 Outlet Notification Subscription

By using this method, you can delete a subscription for an outlet.

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

Sample Request

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

Path Parameters

NameDescriptionTypeRequired
outlet_idID of the outlet for which you want to delete a subscription.StringRequired
notification_idID of the notification.StringRequired

Sample Response - 200 Success

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

Response - 200 Success

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

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