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 Status | Description |
---|---|
pending_payment | The payment for the order has not yet been completed. |
paid | The payment for the order has been successfully completed. |
Payment StatusPartners 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
Status | Description | Valid Transitions | Valid Service Types |
---|---|---|---|
in_route | Indicates that the order is with the delivery person and is on its way | ready → in_route | delivery |
done | Indicates that the order has been successfully delivered. | in_route → done | delivery |
cancelled | Indicates that the order has been cancelled. This status can be updated for any service_type, but a cancellation reason must be provided. | Any | Any |
Valid TransitionsOrder statuses follow a sequential flow that is validated before confirming an update. For example, to update an order status to
in_route
, it must beready
first. Similarly, to update it todone
, the status must bein_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 TypesEach order status can only be updated for a specific set of service types. For example,
in_route
anddone
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:
Attribute | Description |
---|---|
order_status: :cancelled | The status indicating that the order has been canceled. |
cancellation_reason_object | JSON 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:
Attribute | Description |
---|---|
is_customer_arrived | Boolean indicating whether the customer has arrived at the branch for pickup. |
Is Customer ArrivedSetting this attribute to
true
notifies the branch waiter that the customer is ready to receive their order.