# Layered API Architecture

> Organize microservices into layers — fine-grained services below, process APIs orchestrating above.

- **Category**: Microservices
- **Subcategory**: API Design
- **Canonical URL**: https://designpattern.fyi/patterns/layered_api_architecture/

---

## Description
Clean, reusable architecture pattern.


## Use Cases
Checkout flow: MobileExperienceAPI (experience) → calls CheckoutProcessAPI (process) → orchestrates ProductService + InventoryService + PaymentService (system). Mobile team codes against one stable API; process layer absorbs complexity.





## Trade-offs


### Advantages

- Clear separation of concerns across layers

- Gradual migration path from SOA monolith to microservices

- Reuses existing SOA investments while adding microservice agility

- Experience layer enables client-optimized APIs without touching system services




### Considerations & Drawbacks

- Each layer adds network latency hops

- More services to deploy, monitor, and maintain

- Process layer can become a logic dumping ground (anemic system layer risk)

- Requires clear governance to prevent layer coupling







---
**Reference**: [Original Source](https://github.com/wso2/reference-architecture)

