Development

REST API Design Best Practices for Business Applications

Clear resource names, consistent errors, safe retries, pagination and versioning: the REST API habits that keep integrations working as your business software grows.

Development

Why API design matters

An API is a promise to every system that calls it — your mobile app, your website, partners and future integrations. A careless design is cheap on day one and expensive for years. These practices keep APIs predictable and easy to integrate with.

Name resources, not actions

Use nouns for resources and HTTP methods for actions:

  • GET /orders — list orders
  • POST /orders — create an order
  • GET /orders/123 — read one order
  • PATCH /orders/123 — change part of an order

Keep names plural, lowercase and consistent. When an action does not fit (for example cancelling an order), a sub-resource such as POST /orders/123/cancellation is clearer than POST /cancelOrder.

Use status codes properly

  • 200/201 for success, 204 when there is nothing to return
  • 400 for malformed requests, 422 for validation errors
  • 401 when the caller is not signed in, 403 when they are not allowed
  • 404 when the resource does not exist, 409 for business-rule conflicts
  • 429 when a client is sending too many requests

Clients can then handle whole classes of errors without parsing messages.

Return consistent, useful errors

Pick one error format and use it everywhere. The Problem Details standard (RFC 9457) works well: a type, a title, a status and, for validation errors, a list of field names with messages. Field names should match the request exactly so forms can show errors next to the right input.

Make retries safe

Networks fail, and clients retry. GET, PUT and DELETE should be safe to repeat. For POST requests that create things — payments, orders — accept an idempotency key so that a retried request returns the original result instead of creating a duplicate.

Paginate every list

Never return an unbounded list. Use page-based pagination for admin screens and cursor-based pagination for large or fast-changing data. Return the total (when it is cheap to compute) or a link to the next page.

Filter, sort and select fields predictably

Simple query parameters such as ?status=paid&sort=-createdAt cover most needs. Document which fields can be filtered and sorted, and reject unknown ones with a clear error rather than ignoring them.

Version deliberately

Avoid breaking changes: adding fields is fine; removing or renaming them is not. When a breaking change is unavoidable, introduce a new version (for example /v2/), run both for a published period and tell integrators well in advance.

Secure by default

  • require HTTPS everywhere
  • use short-lived tokens and least-privilege scopes for integrations
  • check authorisation on every resource, not just at the login
  • rate-limit public endpoints and log access to sensitive data

Document it

Publish an OpenAPI description and keep it generated from the code so it never drifts. Good examples of requests and responses save integrators hours.

Need an API for your product or to connect existing systems? See our API development services.

  • On this page

  • Related services

    • API Development & Integration

      API development and system integration: secure, documented REST APIs, third-party integrations and middleware that connect your ERP, CRM, e-commerce, payment and partner systems reliably.

    • Web Application Development

      Custom web application development for portals, dashboards and line-of-business systems, built with ASP.NET Core, React and Angular and designed to scale with your business.

    • Cloud Application Development

      Cloud application development and migration on Azure and AWS: cloud-native architecture, containers, serverless, infrastructure as code and cost optimisation for reliable, scalable software.

FAQ

Frequently asked questions

  • Should I use PUT or PATCH to update a resource?

    Use PUT when the client sends the complete resource to replace it, and PATCH when it sends only the fields that change. Many business APIs use PATCH for edits because clients rarely hold the whole resource.

  • How should an API return validation errors?

    With status 422 and a consistent body — for example Problem Details — that lists each invalid field by the same name used in the request, with a readable message.

  • When do I need a new API version?

    Only for breaking changes such as removing or renaming fields or changing their meaning. Adding new optional fields or endpoints does not need a new version.

Proof

See it in practice

  • Dynamic Platform

    A multi-tenant SaaS platform for point of sale, inventory, purchasing, accounting and industry-specific business software, with offline sales and a Windows desktop edition.

  • Smart School

    A multi-tenant school, college and university management system with admissions, attendance, academics, exams, fees, accounting, payroll and portals for teachers, students and parents.

  • Dynamic Platform App

    The native Android and iOS app for the Dynamic Platform: POS, sales, purchasing, inventory, customers, installments and reports on a phone, using the same accounts, permissions and business rules as the web app.

Keep reading

Related articles

Request a Quote