Order Acceptance
Order acceptance will automatically changed to Auto Accept upon linking your outlet.
When a GoFood consumer places an order in GoFood, the system will trigger notifications which then you can subscribe onto via webhooks.
Subscribe to order notification event
In order to get the orders flowing to your system, you will need to subscribe to notification event. You are allowed to subscribe to multiple events (depending on your needs). When you're subscribing to an event (subscription is created) then a specific event occurs, an HTTP request is made to the URL specified in the notification.
Create a subscription
This is the step to register your webhook URL, where we'll send notification to
Endpoint = 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://<your-api-host>/<your-webhook-endpoint>",
"active": true
}
'
Sample Response (200)
{
"success": true,
"data": {
"subscription": {
"id": "96f614f6-745e-47f5-ad68-c0c8e9ba8dc8",
"event": "gofood.order.driver_arrived",
"url": "https://<your-api-host>/<your-webhook-endpoint>",
"active": true,
"created_at": "2019-08-24T14:15:22Z"
}
}
}
Notification Subscription Events
You can subscribe to one (or more) notification events depending on your need. Here are quick summary of each notification events.
| Order status | Notification Events | Description |
|---|---|---|
| Created. | gofood.order.created | Get notified when a new order is created. |
| Awaiting Merchant Acceptance | gofood.order.awaiting_merchant_acceptance | Get notified when an order is waiting for merchant acceptance (accept/reject) ; this is mandatory event if you're using Manual Acceptance / Auto Accept on Timeout |
| Merchant Accepted | gofood.order.merchant_accepted | Get notified when an order is accepted |
| Cancelled | gofood.order.cancelled | Get notified when an order is cancelled |
| Completed | gofood.order.completed | Get notified when an order is completed |
| Catalog Menu Mapping Updated | gofood.catalog.menu_mapping_updated | Get notified when update menu process is completed |
| Order Placed | gofood.order.placed | Get notififed when pin already exchanged with driver and payment will be sent |
| Driver Pickup | gofood.order.driver_otw_pickup | Get notified when a driver is being assigned to the specific order and otw to outlet |
| Driver Arrived | gofood.order.driver_arrived | Get notified when a driver is arrived to the outlet |
See detailed available notification events and error response on API Reference
Sample Order Notification Payload
{
"header": {
"version": 1,
"timestamp": "2019-11-04T14:15:02.557+07:00",
"event_name": "gofood.order.driver_otw_pickup",
"event_id": "ca5c865a-0a36-3c39-9b88-348f97c1ff61"
},
"body": {
"service_type": "gofood",
"outlet": {
"id": "M008272",
"external_outlet_id": "1"
},
"customer": {
"id": "F3109D097E3235C9100CE7D1FCD92C10",
"name": "Jane Doe"
},
"order": {
"status": "DRIVER_OTW_PICKUP",
"pin": "8832",
"order_total": 200000,
"order_number": "F-175674194",
"order_items": [
{
"quantity": 1,
"price": 2.0e4,
"notes": "",
"name": "Iced Coffee Jelly Float",
"id": "fe6178cb-fdf5-4c42-bc95-ac6b32e576a8",
"external_id": "123",
"variants": [
{
"id": "7bbfaec2-a33d-4278-a200-ee6d9c862f6a",
"name": "Less Sugar",
"external_id": "variant-123"
},
{
"id": "58bfb0db-8542-45a8-96c8-77cd7140b452",
"name": "Less Ice",
"external_id": "variant-345"
}
]
}
],
"currency": "IDR",
"takeaway_charges": 0.0,
"created_at": "2019-11-04T14:15:00.277+07:00",
"applied_promotions": [
{
"scope": "cart",
"detail": {
"redeemed_amount": 35000,
"merchant_budget_share_percentage": 25
}
},
{
"scope": "delivery",
"detail": {
"redeemed_amount": 9000,
"merchant_budget_share_percentage": 0
}
},
{
"scope": "sku",
"detail": {
"item": {
"id": "65717e66-3792-4053-ae10-e34be0784dcb",
"external_id": "MPR526277763"
},
"id": "019acaee-144d-483b-b1fa-c4fced5efc37"
}
}
],
"cancellation_detail": {
"reason": ""
},
"scheduled_flag": {
"is_catering": true,
"schedule_delivery_time_start": "2019-11-05T14:15:22.557+07:00",
"schedule_delivery_time_end": "2019-11-05T14:45:22.557+07:00"
}
},
"driver": {
"name": "John Doe"
}
}
}
Managing Order Acceptance
GoFood currently offers 3 types of order acceptance
- Auto Accept
- Manual Acceptance
- Auto accept on timeout
Please note that only Auto Accept available for Partners
Order Acceptance Types
| Auto Accept | Manual Acceptance | Auto Accept on Timeout | |
|---|---|---|---|
| Order State Lifecycle | |||
| What is it? | Order automatically accepted when a customer place order |
| Auto-accept the order after 60 seconds instead of time-out |
| How | In auto-accept flow, order is automatically accepted and driver is dispatched after 10s | note If you're using Manual Acceptance, please subscribe to gofood.order.awaiting_merchant_acceptance webhooksIn manual flow, merchant can manually accept or reject the order. When the new order is placed, on merchant app the order keeps ringing continuously and merchant has two CTAs - "Reject" or "Accept"
When the order is ignored until 3 minutes, it gets timed-out and status changes to cancelled. | note If you're using Auto Accept on Timeout flow, please subscribe to gofood.order.awaiting_merchant_acceptance webhooksIn the auto-accept on timeout flow, we provide merchants with 60 seconds timer to manually accept or reject the order. When the new order is placed, on merchant app the order keeps ringing continuously and merchant has two CTAs - "Reject" or "Accept"
|
| API flow |
|
|
Mark Food Ready (MFR)
Mark Food Ready is an endpoint that you'll need to hit whenever you're completing preparing the Food. it applies to both Delivery or Pickup. It helps driver/consumer to get more accurate timing to pickup the Food.
Endpoint = PUT /integrations/gofood/outlets/:outlet_id/v1/orders/:order_type/:order_number/food-prepared
order_type can be either delivery or pickup
Sample Request
curl -X PUT https://api.partner-sandbox.gobiz.co.id/integrations/gofood/outlets/{outlet_id}/v1/orders/{order_type}/{order_number}/food-prepared \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer {access-token}' \
-d $'
{
"country_code" : "ID"
}
'
order_type can be either delivery or pickup
Sample Response (200)
{
"success": true,
"data": {}
}
Order FAQ
| No | Questions | Answers |
|---|---|---|
| 1 | When I already use API Integration, do I still need to use GoBiz App? | As you integrated, orders will flow directly to your POS system. Then it will reduce dependency to you to use GoBiz App. However, we recommend you to keep GoBiz app as backup solution. |
| 2 | Does the price on order payload is including tax calculation? | Yes - the price is always tax inclusive |
| 3 | Does the price on order payload is including promo price? | No - there's promo/discount amount on order payload (see applied_promotions that separated from order_total) |
| 4 | Can I subscribe to more than 1 order notification? | Yes |
| 5 | What happens to order with driver change? | We'll send you notification with same order id on this situation. |