Get basket
Returns the current basket and its item details.
/api/v1/basketsGetBasket retrieves the authenticated customer’s active basket from Basket APIServicev1.0.0Basket APIInternal HTTP and gRPC service for managing customer-scoped shopping baskets,
Catalog price enrichment, and post-checkou...PublishesGetBookGrpc, GetBooksGrpc +2SubscribesCreateBasket, UpdateBasket +4APIsOpenAPI, AsyncAPIOwnercommerce-fulfillment-teamDiagramRepositoryOpen docs (GET /basket/api/v1/baskets) and enriches non-empty basket items with live titles and pricing from Catalog APIServicev1.0.0Catalog APIInternal HTTP and gRPC service for Catalog product management, hybrid
discovery, and authoritative book metadata.
PublishesBookUpdatedRatingFailedIntegrationEventSubscribesCreatePublisher, UpdatePublisher +24APIsOpenAPI, AsyncAPIOwnercatalog-experience-teamDiagramRepositoryOpen docs over gRPC. The caller’s customer identity is resolved from the Microsoft Entra ID access token; no basket identifier parameter is accepted.
Overview
| Property | Value |
|---|---|
| Bounded Context | Shopping |
| Owner Service | Basket APIServicev1.0.0Basket APIInternal HTTP and gRPC service for managing customer-scoped shopping baskets, Catalog price enrichment, and post-checkou...PublishesGetBookGrpc, GetBooksGrpc +2SubscribesCreateBasket, UpdateBasket +4APIsOpenAPI, AsyncAPIOwnercommerce-fulfillment-teamDiagramRepositoryOpen docs |
| Protocol / Format | HTTP GET, application/json response |
| Gateway Endpoint | GET /basket/api/v1/baskets (service path /api/v1/baskets) |
| Authentication & Authorization | Microsoft Entra ID JWT — customer role plus scopes basket_read, basket_write |
| Idempotency / Concurrency | Read-only and naturally idempotent |
| Rate Limit / Caching | Global concurrency (100), per-IP fixed-window (30 req/min), and per-user token bucket (30 limit, 20 per 10s, queue 5) |
| Contract Version | 1.0.0 (ApiVersions.V1) |
Request & Response Contract
Request Parameters
Accepts no path parameters, query parameters, or request body; resolves the customer ID from the authenticated token.
Success Response (200 OK)
| Name | Type | Required | Constraints | Description |
|---|---|---|---|---|
id | string | null | Yes | — | Identifier of the customer’s basket |
items | object[] | Yes | Array (may be empty) | Line items currently stored in the basket |
items[].id | string | null | Yes | — | Catalog book identifier |
items[].quantity | integer | string | Yes | int32 | Requested unit quantity |
items[].name | string | null | No | Nullable | Book title enriched from Catalog APIServicev1.0.0Catalog APIInternal HTTP and gRPC service for Catalog product management, hybrid
discovery, and authoritative book metadata.
PublishesBookUpdatedRatingFailedIntegrationEventSubscribesCreatePublisher, UpdatePublisher +24APIsOpenAPI, AsyncAPIOwnercatalog-experience-teamDiagramRepositoryOpen docs (null when unavailable) |
items[].price | number | string | No | double, default 0 | Regular unit price enriched from Catalog APIServicev1.0.0Catalog APIInternal HTTP and gRPC service for Catalog product management, hybrid discovery, and authoritative book metadata. PublishesBookUpdatedRatingFailedIntegrationEventSubscribesCreatePublisher, UpdatePublisher +24APIsOpenAPI, AsyncAPIOwnercatalog-experience-teamDiagramRepositoryOpen docs |
items[].priceSale | number | string | null | No | double or null | Promotional sale price enriched from Catalog APIServicev1.0.0Catalog APIInternal HTTP and gRPC service for Catalog product management, hybrid
discovery, and authoritative book metadata.
PublishesBookUpdatedRatingFailedIntegrationEventSubscribesCreatePublisher, UpdatePublisher +24APIsOpenAPI, AsyncAPIOwnercatalog-experience-teamDiagramRepositoryOpen docs (null when no sale applies) |
Behavior & Side Effects
- Read-time catalog enrichment: Reads basket state from Redis and, when
itemsis non-empty, deduplicates book IDs and enriches items via Get books over gRPCQueryv1.0.0Get books over gRPCReturns multiple Catalog books by identifier through the book.v1 gRPC contract.Ownercatalog-experience-teamSchemaDiagramOpen docs. - No state mutation: Pure read query with no database writes or integration events.
Error Responses
| Status / Code | Condition | Client Recovery Action |
|---|---|---|
401 Unauthorized | Missing, expired, or invalid Entra ID bearer token | Re-authenticate the customer and retry |
403 Forbidden | Principal lacks the customer role or required basket_read/basket_write scopes | Request a token with the required customer scopes |
404 Not Found | No active basket exists in Redis for the authenticated customer | Treat as an empty/uninitialized basket until the customer creates one |
429 Too Many Requests | Rate limit quota exceeded (Retry-After header included) | Wait for the Retry-After duration before retrying |
Related Documentation
- Basket APIServicev1.0.0Basket APIInternal HTTP and gRPC service for managing customer-scoped shopping baskets, Catalog price enrichment, and post-checkou...PublishesGetBookGrpc, GetBooksGrpc +2SubscribesCreateBasket, UpdateBasket +4APIsOpenAPI, AsyncAPIOwnercommerce-fulfillment-teamDiagramRepositoryOpen docs — Service overview, Redis persistence, and endpoints.
- BasketEntityv1.0.0BasketCustomer-scoped, mutable pre-order collection of requested books and quantities managed prior to checkout.Ownercommerce-fulfillment-teamOpen docs — Basket entity model.
- Get basket over gRPCQueryv1.0.0Get basket over gRPCReturns the current basket through the basket.v1 gRPC contract.Ownercommerce-fulfillment-teamSchemaDiagramOpen docs — Internal gRPC contract used by Order APIServicev1.0.0Order APIAuthenticated Ordering service for Buyer profiles and the Order lifecycle, creating Orders from baskets, snapshotting pr...PublishesGetBasketGrpc, GetBookGrpc +5SubscribesCreateOrder, CompleteOrder +11APIsOpenAPI, AsyncAPI, Carrier Service LevelsOwnercommerce-fulfillment-teamDiagramRepositoryOpen docs during checkout.
- Get books over gRPCQueryv1.0.0Get books over gRPCReturns multiple Catalog books by identifier through the book.v1 gRPC contract.Ownercatalog-experience-teamSchemaDiagramOpen docs — Batch gRPC book lookup used to enrich basket items.
- Create basketCommandv1.0.0Create basketCreates a basket containing the supplied item identifiers and quantities.Ownercommerce-fulfillment-teamSchemaDiagramOpen docs — Create a new customer basket.