Skip to main content

GoFood Order State

Background

As all events need to have subscribed on self serve basis, so all of the detail of order state needs to be clear so that there are no issue that is raised because of wrong subscription on the order notification or wrong handling regarding each order notification event

State of Gofood Order

State of Gofood Order

Information of each order states

  • Order Created State where the user placed order to merchants Note: not available to subscribe anymore since this is unrelated to merchants, please change your subscription to Awaiting Merchant Acceptance or Merchant Accepted
  • Awaiting Merchant Acceptance State where merchant are given options when they can reject the order or accept the order. There are 2 different time window when merchant’s are on this state
    • 1 Minute if order acceptance are Auto Accept on Timeout, after 1 minute has passed without reaction then the order will be automatically accepted
    • 3 Minute if order acceptance are Manual Acceptance, after 3 minutes has passed without reaction then the order will be automatically rejected
    • If the merchant are on Auto Accept mode, then this state won’t be happening since after order created, the state will be automatically changed to Merchant Accepted
  • Merchant Accepted State where the merchant accepted the order
    • Triggered when the merchants clicks accept button on both Auto Accept on Timeout and Manual Acceptance
    • Will be automatically triggered if merchants are on Auto Accept mode
  • Driver OTW Pickup
    • Triggered when the driver is already picking up the order and on their way to the restaurant
  • Driver Arrived
    • Triggered when the driver arrived at the restaurant
  • GoFood Order Completed
    • Triggered when the driver already completed the order, and finished on delivering the food to user
  • GoFood Order Cancelled
    • Triggered when there are cancellation orders request from user

Order Simulation (Case 1 Order Success)

  1. User order food on 1.00 PM
  2. Order Accepted on 1.01 PM
  3. Driver OTW Pickup on 1.15 PM
  4. Driver Arrived at resto on 1.20 PM
  5. Order successfully delivered to user on 1.40 PM

Order Event Notification (Case 1 Order Success)

  1. gofood.order.merchant_accepted will be sent on 1.01 PM
  2. gofood.order.driver_otw_pickup will be sent on 1.15 PM
  3. gofood.order.driver_arrived will be sent on 1.20 PM
  4. gofood.order.completed will be sent on 1.40 PM
info

Technically order_created event is not necessary for merchant, since it just signifies on when the user orders the food, but only MERCHANT_ACCEPTED that matters since this would signifies when the merchant should start on preparing the food.

Order Simulation (Case 2 Order Cancelled)

  1. User order food on 1.00 PM
  2. Order Accepted on 1.01 PM
  3. Order Cancelled on 1.08 PM

Order Event Notification (Case 2 Order Cancelled)

  1. gofood.order.merchant_accepted will be sent on 1.01 PM
  2. gofood.order.cancelled will be sent on 1.08 PM

Identifying Payment Settlement

You can use gofood.order.placed event in order to identify whether the payment was successfully paid or not. As gofood.order.completed does not mean that the payment is always successful and gofood.order.cancelled does not mean that the payment is always unsuccessful.

Order Simulation (Order Canceled but Payment Successful)

  1. User order food on 1.00 PM
  2. Order Accepted on 1.01 PM
  3. Pin Exchanged by Driver on 1.10 PM
  4. Driver cannot found customer, hence the order is cancelled in 1.22 PM

Order Event Notification (Order Canceled but Payment Successful)

  1. gofood.order.merchant_accepted will be sent on 1.01 PM
  2. gofood.order.placed will be sent on 1.10 PM
  3. gofood.order.cancelled will be sent on 1.22 PM
note

In this case, the order is canceled but the payment is successful and will be sent to merchant