Get buyer
Returns the Buyer profile selected by identifier, subject to the caller's authorization.
/api/v1/buyers/meGetBuyer queries 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 (GET /ordering/api/v1/buyers/me) to retrieve a buyer’s profile (id, name, and address). Callers with the admin role retrieve the profile specified by the Id query parameter; all other authenticated callers are resolved to the buyer linked to their Microsoft Entra ID NameIdentifier claim.
Overview
| Property | Value |
|---|---|
| Bounded Context | Ordering |
| Owner Service | 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 |
| Protocol / Format | HTTP GET, application/json response |
| Gateway Endpoint | GET /ordering/api/v1/buyers/me (service path /api/v1/buyers/me) |
| Authentication & Authorization | Microsoft Entra ID JWT — customer or admin role plus scopes ordering_read, ordering_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
Query Parameters
| Name | Type | Required | Constraints | Description |
|---|---|---|---|---|
Id | string (uuid) | Yes | Valid UUID | Buyer identifier requested by admin callers; ignored for non-admin callers whose buyer ID is resolved from NameIdentifier |
Because Id binds as a non-nullable UUID, non-admin clients must still supply a valid UUID query parameter even though the service resolves their own authenticated buyer ID.
Success Response (200 OK)
| Name | Type | Required | Constraints | Description |
|---|---|---|---|---|
id | string (uuid) | Yes | Valid UUID | Unique identifier of the buyer profile |
name | string | null | Yes | Nullable | Buyer display name (null when unset) |
address | string | null | Yes | Nullable | Formatted shipping address (null when unset) |
Behavior & Side Effects
- Role-scoped resolution: Administrators query by the supplied
Idparameter; standard customers always resolve their own profile from their token’sNameIdentifierclaim. - No state mutation: Pure read query with no database writes or integration events.
Error Responses
| Status / Code | Condition | Client Recovery Action |
|---|---|---|
400 Bad Request | Missing or malformed Id UUID query parameter | Supply a valid UUID in the Id query parameter; do not retry unchanged |
401 Unauthorized | Missing, expired, or invalid Entra ID bearer token | Re-authenticate and retry |
403 Forbidden | Caller lacks Ordering API roles or scopes | Request a token with customer or admin role and Ordering scopes |
404 Not Found | No buyer profile exists for the resolved buyer ID | Prompt the user to create a buyer profile via Create buyerCommandv1.0.0Create buyerCreates a Buyer profile for the authenticated customer from the supplied address.Ownercommerce-fulfillment-teamSchemaDiagramOpen docs |
429 Too Many Requests | Rate limit quota exceeded (Retry-After header included) | Wait for the Retry-After duration before retrying |
Related Documentation
- 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 — Service overview, persistence, and endpoints.
- BuyerEntityv1.0.0BuyerRepresents a customer's ordering profile and delivery address within the Ordering bounded context.Ownercommerce-fulfillment-teamOpen docs — Buyer entity model.
- List buyersQueryv1.0.0List buyersReturns Buyer profiles with pagination.Ownercommerce-fulfillment-teamSchemaDiagramOpen docs — Admin-only paginated listing of all buyer profiles.
- Create buyerCommandv1.0.0Create buyerCreates a Buyer profile for the authenticated customer from the supplied address.Ownercommerce-fulfillment-teamSchemaDiagramOpen docs — Create a new buyer profile.
- Update buyer addressCommandv1.0.0Update buyer addressUpdates the authenticated Buyer's address using the supplied street, city, and province.Ownercommerce-fulfillment-teamSchemaDiagramOpen docs — Update a buyer’s shipping address.
Get buyer schema
Buyer profile response documented by the Ordering API OpenAPI contract.