Our Lisbon API development covers design, implementation, documentation, and Portuguese system integration. API design (week 1): architecture decisions. REST vs. GraphQL: we choose based on the use case. REST: for simple CRUD operations, public APIs where broad compatibility matters, and integrations with systems that expect REST (most Portuguese systems). GraphQL: for complex data requirements where clients need flexibility in what data they request, mobile applications where bandwidth matters, and internal APIs serving multiple frontend applications. API design principles: resource-oriented design (URLs representing resources — /customers, /orders, /invoices — with HTTP methods representing operations), consistent error handling (standardised error response format with error codes, messages, and guidance — the same pattern across all endpoints), pagination (cursor-based for large datasets — more reliable than offset-based for datasets that change frequently), versioning (URL-based versioning — /v1/customers, /v2/customers — enabling API evolution without breaking existing integrations), and rate limiting (protecting the API from abuse and ensuring fair usage — implemented at the API gateway level with configurable limits per API key). API specification: OpenAPI 3.1 (formerly Swagger) — the API fully specified before implementation begins. The specification: serving as the contract between API provider and consumer, the basis for documentation generation, and the input for client SDK generation. Implementation (weeks 2-5): building the API. Technology stack: Node.js with Express or Fastify (for REST APIs — fast, well-supported, large ecosystem of middleware), or Node.js with Apollo Server (for GraphQL — type-safe, excellent developer experience), PostgreSQL (relational data — the default for most business data), Redis (caching, rate limiting, session management), and TypeScript throughout (type safety from database to API response — catching errors at compile time rather than runtime). Authentication: OAuth 2.0 with JWT tokens for user-facing APIs (supporting the authorization code flow for web applications and the client credentials flow for server-to-server integrations). API keys for simpler integrations (with rate limiting and usage tracking). Security: input validation (every API input validated against the OpenAPI specification — rejecting malformed requests before they reach business logic), SQL injection prevention (parameterised queries exclusively — never string concatenation for database queries), CORS configuration (restrictive CORS policies — only allowing requests from authorised origins), and HTTPS exclusively (TLS 1.3, HSTS headers, certificate management via Let's Encrypt or cloud provider). Portuguese system integrations (weeks 3-6): connecting to Portuguese infrastructure. SIBS integration: MB Way (mobile payment initiation and status checking — the API supporting payment requests, refunds, and payment status webhooks), Multibanco references (generating payment references that customers pay at ATMs or through home banking — the API generating references, tracking payments, and reconciling), and SIBS checkout (the hosted checkout page for card payments — integrating via redirect or iframe with customisable styling). AT fiscal integration: e-fatura (electronic invoicing — submitting invoice data to the Portuguese tax authority's webservices. XML document generation following AT specifications, digital certificate signing, and submission via SOAP webservice), SAF-T (Standard Audit File for Tax — generating the XML export file required for annual tax reporting. The SAF-T file: containing all invoicing, customer, product, and tax data in the AT-specified format), and QR code (Portuguese invoices requiring a QR code containing structured invoice data — generating the QR code according to AT specifications and including it in printed/PDF invoices). CTT and shipping: integration with CTT Expresso API (shipment creation, label generation in PDF format, tracking number retrieval, and delivery status webhooks) and other Portuguese shipping providers. Testing and documentation (weeks 5-7): ensuring quality and usability. Testing: unit tests (every function tested in isolation), integration tests (API endpoints tested with real database interactions), contract tests (verifying that the API matches its OpenAPI specification — ensuring documentation and implementation stay synchronised), and load tests (verifying performance under expected load — using K6 to simulate realistic traffic patterns). Documentation: auto-generated from OpenAPI specification (Redoc or Swagger UI — interactive documentation where developers can test API calls directly), getting started guide (step-by-step guide for the most common integration scenarios — from authentication to first API call), code examples (in JavaScript, Python, PHP, and cURL — the languages most commonly used by Lisbon developers integrating with APIs), and changelog (documenting every API change — enabling consumers to understand what changed and when).