Update/Cancel Order

This API is responsible for allowing partner applications to modify certain aspects of an existing order within the T-Gate platform. Partners can update the payment status, change the order status, and handle cancellations, each with specific requirements and conditions.

Payment Status

Partners have the flexibility to update the payment status of an order. The table below outlines the possible values:

Payment StatusDescription
pending_paymentThe payment for the order has not yet been completed.
paidThe payment for the order has been successfully completed.
💰

Payment Status

Partners can update the payment status to reflect the current state of payment without restrictions.

Order Status

The order status can be updated under specific conditions and service_types

StatusDescriptionValid TransitionsValid Service Types
in_routeIndicates that the order is with the delivery person and is on its wayready → in_routedelivery
doneIndicates that the order has been successfully delivered.in_route → donedelivery
cancelledIndicates that the order has been cancelled. This status can be updated for any service_type, but a cancellation reason must be provided.AnyAny
🚧

Valid Transitions

Order statuses follow a sequential flow that is validated before confirming an update. For example, to update an order status to in_route, it must be ready first. Similarly, to update it to done, the status must be in_route beforehand. Attempting to skip transitions or revert to a previous status will result in an invalid transition error, causing the update to fail.

🚧

Valid Service Types

Each order status can only be updated for a specific set of service types. For example, in_route and done statuses can only be updated by partners for delivery orders. Other cases will be fully handled by the company’s waiter.

Order Cancellation

To cancel an order, the following must be provided:

AttributeDescription
order_status: :cancelledThe status indicating that the order has been canceled.
cancellation_reason_objectJSON Object that contains a status enum that specifies the reason for order cancellation.

Cancellation Reason Statuses

Enum Value
customer_wants_to_cancel_while_the_order_is_pending
customer_wants_to_cancel_before_the_estimation_time_ends
customer_wants_to_cancel_because_the_company_is_late
company_wants_to_cancel_because_the_customer_didnt_show_up
🚧

A cancellation reason is mandatory when canceling an order to maintain clear records.

Is Customer Arrived

For curbside orders (service_type=curbside), you can update the is_customer_arrived attribute as follows:

AttributeDescription
is_customer_arrivedBoolean indicating whether the customer has arrived at the branch for pickup.
📘

Is Customer Arrived

Setting this attribute to true notifies the branch waiter that the customer is ready to receive their order.

Language
Credentials
Bearer
Click Try It! to start a request and see the response here!