Storefront has been decoupled into micro-frontends with a dedicated commerce app and shared shell.

Read the architecture guide →

Update buyer address

Updates the authenticated Buyer's address using the supplied street, city, and province.

Customer Management
PATCH/api/v1/buyers/address

UpdateAddress replaces the shipping address on the authenticated customer’s BuyerEntityv1.0.0BuyerRepresents a customer's ordering profile and delivery address within the Ordering bounded context.Ownercommerce-fulfillment-teamOpen docs profile in 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 (PATCH /ordering/api/v1/buyers/address) and returns the updated buyer profile. Access is restricted strictly to the Microsoft Entra ID customer role (administrators cannot invoke this endpoint on another user’s behalf).

Overview

PropertyValue
Bounded ContextOrdering
Owner ServiceOrder 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 / FormatHTTP PATCH, application/json request and response
Gateway EndpointPATCH /ordering/api/v1/buyers/address (service path /api/v1/buyers/address)
Authentication & AuthorizationMicrosoft Entra ID JWT — customer policy only (role customer plus scopes ordering_read, ordering_write)
Idempotency / ConcurrencyNaturally idempotent full address replacement; no x-request-id header is required
Rate Limit / CachingGlobal concurrency (100), per-IP fixed-window (30 req/min), and per-user token bucket (30 burst, 20 per 10s, queue 5)
Contract Version1.0.0 (ApiVersions.V1)

Request & Response Contract

Request Body (application/json)

All three address fields are required together to replace the address value object.

NameTypeRequiredConstraintsDescription
streetstringYesNon-empty, max 50 characters; PII-redacted in logsUpdated street address
citystringYesNon-empty, max 50 characters; PII-redacted in logsUpdated city or district
provincestringYesNon-empty, max 50 characters; PII-redacted in logsUpdated province or state

Success Response (200 OK)

NameTypeRequiredConstraintsDescription
idstring (uuid)YesValid UUIDIdentifier of the authenticated buyer
namestring | nullNoPII-redacted in logsBuyer display name stored on the profile
addressstring | nullNoFormatted as "{Street}, {City}, {Province}"; PII-redacted in logsFormatted full address

Behavior & Side Effects

  • Session-bound lookup: Derives the buyer ID from the authenticated user’s NameIdentifier claim (no buyer ID is accepted in the route or body). Returns 404 Not Found if no profile exists yet; callers must first create a profile via Create buyerCommandv1.0.0Create buyerCreates a Buyer profile for the authenticated customer from the supplied address.Ownercommerce-fulfillment-teamSchemaDiagramOpen docs.
  • Atomic address replacement: Replaces the address value object inside a database transaction; emits no domain or integration events.
  • PII redaction: Request address fields and response name/address fields are automatically redacted in structured logs.

Error Responses

Status / CodeConditionClient Recovery Action
400 Bad RequestEmpty/whitespace address field, field exceeding 50 characters, or non-UUID NameIdentifier claimFix the request body or token claims; do not retry unchanged
401 UnauthorizedMissing, expired, or invalid Entra ID bearer tokenAcquire a fresh Entra ID access token and retry
403 ForbiddenCaller lacks the customer role (including admin-only tokens) or lacks ordering_read/ordering_write scopesAuthenticate as a customer with the required scopes
404 Not FoundAuthenticated caller does not have an existing buyer profileCreate the profile first using Create buyerCommandv1.0.0Create buyerCreates a Buyer profile for the authenticated customer from the supplied address.Ownercommerce-fulfillment-teamSchemaDiagramOpen docs
429 Too Many RequestsRate limit quota exceeded (Retry-After header included)Wait for the Retry-After interval before retrying
500 Internal Server ErrorUnhandled database or server failureRetry with backoff and inspect service logs

Update buyer address schema

3 properties

Address fields required to update the authenticated Buyer's address.

streetstring
required
citystring
required
provincestring
required