Skip to main content

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.

NameTypeDescription
user_idstringUser to use for cart lookup.
itemCartItemItem to add to cart.

Cart

Represents an existing cart for a specific user.

NameTypeDescription
user_idstringUser tied to this cart.
itemsrepeated CartItemItems this cart contains.

CartItem

Single item within a cart. This includes a reference to our catalog and user-provided selection.

NameTypeDescription
product_idstringProduct catalog reference.
quantityint32User-provided quantity for this item.

Empty

Represents successful response with no data required.

NameTypeDescription

EmptyCartRequest

Request to clear out a user's existing cart. No-op if no cart is initialized for the user.

NameTypeDescription
user_idstringUser to use for cart lookup.

GetCartRequest

Request to fetch a user's existing cart.

NameTypeDescription
user_idstringUser to use for cart lookup.

Services

CartService

Cart management service. this is a service created for the purpose of demonstration.

AddItem

MethodAddItem
RequestAddItemRequest
ResponseEmpty
DescriptionAdd an item to a specified cart.

GetCart

MethodGetCart
RequestGetCartRequest
ResponseCart
DescriptionGet the details for a specified cart.

EmptyCart

MethodEmptyCart
RequestEmptyCartRequest
ResponseEmpty
DescriptionClear out the specified cart.