The Order Service REST API is available atDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/microservices-patterns/ftgo-application/llms.txt
Use this file to discover all available pages before exploring further.
http://localhost:8082. It manages the full lifecycle of a customer order — from initial placement through cancellation or revision — and coordinates with downstream services via domain events.
POST /orders
Creates a new order for a consumer at a specific restaurant. The service validates the consumer, the restaurant, and each line item before persisting the order and returning its assigned ID.Request body
The ID of the consumer placing the order.
The ID of the restaurant fulfilling the order.
The requested delivery time in ISO-8601 local date-time format, e.g.
2024-11-15T18:30:00.The address to deliver the order to.
One or more items to include in the order.
Response
The unique identifier assigned to the newly created order.
Status codes
| Code | Meaning |
|---|---|
200 OK | Order created successfully. |
Example
GET /orders/
Retrieves the current state and total of an existing order.Path parameters
The unique ID of the order to retrieve.
Response
The unique identifier of the order.
Current state of the order. One of
APPROVAL_PENDING, APPROVED, REJECTED, CANCEL_PENDING, CANCELLED, REVISION_PENDING.The monetary total of the order.
Status codes
| Code | Meaning |
|---|---|
200 OK | Order found and returned. |
404 Not Found | No order exists with the given orderId. |
Example
POST /orders//cancel
Cancels an existing order. The service transitions the order throughCANCEL_PENDING and eventually to CANCELLED via the saga pattern.
Path parameters
The unique ID of the order to cancel.
Response
The unique identifier of the order.
Updated state of the order after the cancel request. Typically
CANCEL_PENDING immediately after the call.The monetary total of the order.
Status codes
| Code | Meaning |
|---|---|
200 OK | Cancel request accepted. |
404 Not Found | No order exists with the given orderId. |
Example
POST /orders//revise
Revises the line items of an existing order. Replaces the current quantities for the specified menu items. The order must be in a revisable state.Path parameters
The unique ID of the order to revise.
Request body
The updated list of order line items. Each entry replaces the quantity for the given menu item.
Response
The unique identifier of the order.
Updated state of the order. Typically
REVISION_PENDING immediately after the call.The revised monetary total of the order.
Status codes
| Code | Meaning |
|---|---|
200 OK | Revision request accepted. |
404 Not Found | No order exists with the given orderId. |