carts.proto
path protobuffet/example/carts/v1/carts.proto
package protobuffet.example.carts.v1
Messages
AddItemRequest
Request to add an item to a user's cart. This will automatically initialize a cart for the user if no existing.
| Name | Type | Description |
|---|---|---|
user_id | string | User to use for cart lookup. |
item | CartItem | Item to add to cart. |
Cart
Represents an existing cart for a specific user.
| Name | Type | Description |
|---|---|---|
user_id | string | User tied to this cart. |
items | repeated CartItem | Items this cart contains. |
CartItem
Single item within a cart. This includes a reference to our catalog and user-provided selection.
| Name | Type | Description |
|---|---|---|
product_id | string | Product catalog reference. |
quantity | int32 | User-provided quantity for this item. |
Empty
Represents successful response with no data required.
| Name | Type | Description |
|---|
EmptyCartRequest
Request to clear out a user's existing cart. No-op if no cart is initialized for the user.
| Name | Type | Description |
|---|---|---|
user_id | string | User to use for cart lookup. |
GetCartRequest
Request to fetch a user's existing cart.
| Name | Type | Description |
|---|---|---|
user_id | string | User to use for cart lookup. |
Services
CartService
Cart management service. this is a service created for the purpose of demonstration.
AddItem
| Method | AddItem |
|---|---|
| Request | AddItemRequest |
| Response | Empty |
| Description | Add an item to a specified cart. |
GetCart
| Method | GetCart |
|---|---|
| Request | GetCartRequest |
| Response | Cart |
| Description | Get the details for a specified cart. |
EmptyCart
| Method | EmptyCart |
|---|---|
| Request | EmptyCartRequest |
| Response | Empty |
| Description | Clear out the specified cart. |