Skip to content

API Landscape Overview

API Landscape Overview

Acme Retail exposes a suite of internal and external APIs that power the BookStore eCommerce platform, point-of-sale integrations, mobile applications, and partner ecosystems. This document provides a high-level map of every API surface, describes the authentication mechanisms in use, explains the versioning strategy, and defines the rate-limiting policies enforced by Azure API Management.

For detailed endpoint contracts, see the individual API reference pages linked from the landscape table. For the broader system context, refer to Architecture Overview and System Landscape.


API Landscape Map

The following table lists every API service maintained by Acme Retail engineering. The estate currently comprises approximately 45 endpoints distributed across seven services.

ServiceBase URLStyleExposurePrimary ConsumersApprox. Endpoints
BookStore eCommercehttps://api.acmeretail.com/store/v1RESTPublicWeb storefront, Mobile apps, Third-party affiliates18
Product Cataloguehttps://api.acmeretail.com/catalog/v1RESTInternalBookStore, POS, Recommendation Engine8
Inventory Managementhttps://api.acmeretail.com/inventory/v1RESTInternalBookStore, Fulfillment, POS6
Order Fulfillmenthttps://api.acmeretail.com/fulfillment/v1RESTInternalBookStore, Distribution WMS5
Loyalty Platformhttps://api.acmeretail.com/loyalty/v1RESTInternal + PartnerBookStore, Mobile app, Campaign tools4
Recommendation Enginehttps://api.acmeretail.com/recommendations/v1RESTInternalBookStore, Email service, Mobile app2
Payment Modulehttps://api.acmeretail.com/payments/v1RESTInternalBookStore checkout only2

Service Ownership

Each service is owned by a dedicated squad within Acme Retail Engineering. Ownership includes on-call responsibility, schema governance, and consumer onboarding. Ownership details are maintained in the internal service registry and in each service’s individual technical documentation (see ../technical/).

Environment URLs

EnvironmentBase DomainPurpose
Productionapi.acmeretail.comLive customer-facing traffic
Stagingapi-staging.acmeretail.comPre-release validation, partner integration testing
Developmentapi-dev.acmeretail.comEngineering development and automated tests

All environments sit behind Azure API Management and share identical authentication and rate-limiting configurations, except that staging and development have relaxed rate limits for load-testing windows.


Authentication

Acme Retail uses three distinct authentication models depending on the caller type. All token issuance and validation is managed through Microsoft Entra ID (formerly Azure AD).

Internal Service-to-Service

Internal APIs authenticate using the OAuth 2.0 client credentials grant. Each service is registered as an application in Microsoft Entra ID and requests tokens with the client_credentials grant type against the target API’s resource identifier.

  • Grant type: client_credentials
  • Token endpoint: https://login.microsoftonline.com/{tenantId}/oauth2/v2.0/token
  • Scope: api://{service-app-id}/.default
  • Token lifetime: 60 minutes (non-refreshable; services request a new token before expiry)
  • Transport: TLS 1.2+ mandatory on all internal calls

Services cache tokens locally using the Microsoft.Identity.Web library and refresh them proactively at the 75 % lifetime mark to avoid clock-skew failures.

Customer-Facing (BookStore Web & Mobile)

Customer-facing applications authenticate end users via the OAuth 2.0 authorization code flow with PKCE (Proof Key for Code Exchange). This is the recommended flow for public clients (SPAs, mobile apps) where a client secret cannot be stored securely.

  • Grant type: authorization_code with PKCE
  • Authorization endpoint: https://login.microsoftonline.com/{tenantId}/oauth2/v2.0/authorize
  • Token endpoint: https://login.microsoftonline.com/{tenantId}/oauth2/v2.0/token
  • Access token lifetime: 1 hour
  • Refresh token lifetime: 30 days (sliding window; revoked on password change or explicit sign-out)
  • Scopes: openid profile email api://bookstore/Orders.Read api://bookstore/Orders.Write api://bookstore/Profile.ReadWrite

Guest checkout sessions use an anonymous session token issued by the BookStore BFF (Backend for Frontend). These tokens grant access only to cart and checkout endpoints and expire after 4 hours.

Third-Party Partners

External partners (affiliate networks, marketplace integrators) authenticate with a combination of API key and IP allowlisting.

  • API key: Issued per partner via the Acme Retail Partner Portal. Keys are rotated every 90 days.
  • IP allowlisting: Partners must register the CIDR blocks from which they will call the API. Requests from non-allowlisted IPs receive 403 Forbidden.
  • Header: X-Api-Key: {key}
  • Rate limits: Partner-specific (see Rate Limiting section below).

Token Validation

All API gateway nodes validate incoming JWTs before forwarding requests to backend services. Validation checks include:

CheckDetail
SignatureVerified against the JWKS endpoint: https://login.microsoftonline.com/{tenantId}/discovery/v2.0/keys
Audience (aud)Must match the registered application URI of the target service
Issuer (iss)Must be https://login.microsoftonline.com/{tenantId}/v2.0
Scopes (scp / roles)Must include the scope required by the specific endpoint
Expiration (exp)Token must not be expired; a 5-minute clock-skew tolerance is applied

Tokens that fail any of these checks receive a 401 Unauthorized response with a WWW-Authenticate header describing the failure reason.


API Versioning Strategy

Versioning Scheme

Acme Retail uses URL path versioning. The version segment appears immediately after the service name:

https://api.acmeretail.com/{service}/v{major}/...

Examples:

  • https://api.acmeretail.com/store/v1/products
  • https://api.acmeretail.com/catalog/v2/products (planned)

Only major versions are expressed in the URL. Minor and patch changes are deployed in-place within the current major version.

Version Lifecycle

Every API version moves through three stages:

StageDescriptionSupport Level
ActiveCurrent recommended version. Receives new features, bug fixes, and security patches.Full
DeprecatedSuperseded by a newer major version. Enters a 12-month sunset period during which only critical security fixes are applied. Responses include a Sunset header and a Deprecation header per RFC 8594.Security fixes only
RetiredNo longer available. All requests return 410 Gone with a JSON body directing callers to the successor version.None

Current Version Status

ServiceActive VersionNotes
BookStore eCommercev1—
Product Cataloguev1v2 in development; adds GraphQL support for complex queries
Inventory Managementv1—
Order Fulfillmentv1—
Loyalty Platformv1—
Recommendation Enginev1—
Payment Modulev1—

Change Policy

  • Breaking changes (field removal, type change, behavioral change) require a new major version. The previous version enters the Deprecated stage immediately upon the new version reaching GA.
  • Non-breaking additions (new optional fields, new endpoints, new query parameters) are released within the current major version and documented in the changelog.
  • All API changes are reviewed by the Acme Retail API Governance Board before release. See ADR-002 for the rationale behind this policy.

Rate Limiting

Rate limiting is enforced at the Azure API Management gateway layer. Limits vary by caller type and are designed to protect backend services while providing a fair-use experience for all consumers.

Rate Limit Tiers

Caller TypeRequests / MinuteBurst (Requests / Second)ScopeExceeded Behavior
Authenticated Customer10020Per user (subject claim)429 Too Many Requests + Retry-After header
Internal Service1,000100Per service (client ID)429 Too Many Requests + circuit breaker opens after 5 consecutive 429s
Third-Party Partner6010Per API key429 Too Many Requests + automated notification to partner contact
Anonymous305Per source IP429 Too Many Requests + CAPTCHA challenge on subsequent web requests

Rate Limit Headers

Every response from the API gateway includes the following headers so that clients can implement proactive throttling:

HeaderDescriptionExample
X-RateLimit-LimitMaximum requests allowed in the current window100
X-RateLimit-RemainingRequests remaining in the current window73
X-RateLimit-ResetUTC epoch timestamp when the window resets1710523200

When a 429 response is returned, the body follows the standard error envelope:

{
"error": {
"code": "RATE_LIMIT_EXCEEDED",
"message": "You have exceeded the allowed request rate. Please retry after the time indicated in the Retry-After header.",
"retryAfterSeconds": 12
}
}

Client Best Practices

  • Respect Retry-After: Always wait the number of seconds indicated before retrying.
  • Implement exponential back-off: For batch integrations, use jittered exponential back-off starting from the Retry-After value.
  • Cache aggressively: Product and catalogue data support ETag and Cache-Control headers. Use conditional requests (If-None-Match) to reduce unnecessary calls.
  • Use webhooks where available: For inventory and order status updates, subscribe to events via RabbitMQ rather than polling. See Event Schemas for details.