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 Method | Endpoint | Description |
---|---|---|
POST | /integrations/partner/outlets/{outlet_id}/v1/notification-subscriptions | It is used to subscribe to a specific event notification for an outlet. |
GET | /integrations/partner/outlets/{outlet_id}/v1/notification-subscriptions | It 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
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
Name | Description | Type | Required |
---|---|---|---|
outlet_id | ID of the outlet for which you want to create a notification subscription. | String | Required |
Request Parameters
JSON Attribute | Description | Type | Required |
---|---|---|---|
event | Type of event notification to subscribe. | String | Required |
url | URL at which notification is to be received. | String(URI) | Required |
active | Status of the subscription. The default value is true .Note: If false , notification is not sent. | Boolean | Optional |
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 Attribute | Description | Type |
---|---|---|
success | Status of the request. Value true indicates successful submission of the request. | Boolean |
data | Details of the subscription. | Object |
» subscription | Subscription object. | Object |
- To perform this operation, you must be authenticated using
go_auth_client_credentials(partner:outlet:read)
orgo_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
, and415
. 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
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
Name | Description | Type | Required |
---|---|---|---|
outlet_id | ID of the outlet for which you want to view the list of subscriptions. | String | Required |
Sample Request - 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 Attribute | Description | Type |
---|---|---|
success | Status of the request. Value true indicates successful submission of the request. | Boolean |
data | Details of the subscription. | Object |
» subscriptions | Array of Subscription Object. | Array(Object) |
- To perform this operation, you must be authenticated using
go_auth_client_credentials(partner:outlet:read)
orgo_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
, and415
. 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
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
Name | Description | Type | Required |
---|---|---|---|
outlet_id | ID of the outlet for which you want to view the details of a subscription. | String | Required |
notification_id | ID of the notification. | String | Required |
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 Attribute | Description | Type |
---|---|---|
success | Status of the request. Value true indicates successful submission of the request. | Boolean |
data | Details of the subscription. | Object |
» subscription | Subscription Object. | Object |
- To perform this operation, you must be authenticated using
go_auth_client_credentials(partner:outlet:read)
orgo_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
, and415
. 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
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
Name | Description | Type | Required |
---|---|---|---|
outlet_id | ID of the outlet for which you want to update the subscription. | String | Required |
notification_id | ID of the notification. | String | Required |
Request Parameters
JSON Attribute | Description | Type | Required |
---|---|---|---|
event | Type of event notification to subscribe. | String | Optional |
url | URL at which notification is to be received. | String(URI) | Optional |
active | Status of the subscription. The default value is true .Note: If false , the subscription is deactivated. | Boolean | Optional |
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 Parameter - 200 Success
JSON Attribute | Description | Type |
---|---|---|
success | Status of the request. Value true indicates successful submission of the request. | Boolean |
data | Details of the subscription. | Object |
» subscription | Subscription Object. | Object |
- To perform this operation, you must be authenticated using
go_auth_client_credentials(partner:outlet:read)
orgo_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
, and415
. 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
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
Name | Description | Type | Required |
---|---|---|---|
outlet_id | ID of the outlet for which you want to delete a subscription. | String | Required |
notification_id | ID of the notification. | String | Required |
Sample Response - 200 Success
{
"success": true,
"data": {}
}
Response - 200 Success
JSON Attribute | Description | Type |
---|---|---|
success | Status of the request. Value true indicates successful submission of the request. | Boolean |
data | - | Object |
Note: To perform this operation, you must be using go_auth_client_credentials(partner:outlet:read)
or go_auth_client_credentials(payment:transaction:read)
.