Skip to main content

Order Acceptance

note

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

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)

Sample Response
{
"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 statusNotification EventsDescription
Created.gofood.order.createdGet notified when a new order is created.
Awaiting Merchant Acceptancegofood.order.awaiting_merchant_acceptanceGet 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 Acceptedgofood.order.merchant_acceptedGet notified when an order is accepted
Cancelledgofood.order.cancelledGet notified when an order is cancelled
Completedgofood.order.completedGet notified when an order is completed
Catalog Menu Mapping Updatedgofood.catalog.menu_mapping_updatedGet notified when update menu process is completed
Order Placedgofood.order.placedGet notififed when pin already exchanged with driver and payment will be sent
Driver Pickupgofood.order.driver_otw_pickupGet notified when a driver is being assigned to the specific order and otw to outlet
Driver Arrivedgofood.order.driver_arrivedGet notified when a driver is arrived to the outlet

See detailed available notification events and error response on API Reference

Sample Order Notification Payload

Sample Response
{
"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
note

Please note that only Auto Accept available for Partners

Order Acceptance Types

Auto AcceptManual AcceptanceAuto Accept on Timeout
Order State Lifecycle
What is it?Order automatically accepted when a customer place order
  • Accept or reject order when customer place order
  • After 3 minutes, order gets timed out and cancelled.
Auto-accept the order after 60 seconds instead of time-out
HowIn 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 webhooks

In 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"
  • Accept CTA accepts the order
  • Reject CTA cancels the order

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 webhooks

In 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"
  • Accept CTA accepts the order
  • Reject CTA cancels the order
  • If the order is manually accepted within 60 seconds, we are good and we can dispatch the driver.
  • If the order is not manually accepted or rejected within 60 seconds, we auto-accept the order
API flow
  1. When customer place order, system will trigger gofood.order.awaiting_merchant_acceptance
  2. Hit accept or reject order - see this reference
  3. Post-acceptance, system will trigger gofood.order.merchant_accepted
  4. Use this notification to show merchants that order has been accepted.
  5. Upon rejection (or ignorance > 3min), system will trigger gofood.order.cancelled
  6. Use this notification to show merchants that order has been cancelled
  7. When order is completed, system will trigger gofood.order.completed
  8. Use this notification to show merchants that order has been completed
  1. When customer place order, system will trigger gofood.order.awaiting_merchant_acceptance
  2. Upon acceptance (or ignorance for 60s), system will trigger gofood.order.merchant_accepted
  3. Use this notification to show merchants that order has been accepted.
  4. When order is completed, system will trigger gofood.order.completed
  5. Use this notification to show merchants that order has been completed

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

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)

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

Order FAQ

NoQuestionsAnswers
1When 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.
2Does the price on order payload is including tax calculation?Yes - the price is always tax inclusive
3Does 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)
4Can I subscribe to more than 1 order notification?Yes
5What happens to order with driver change?We'll send you notification with same order id on this situation.