Skip to main content

OpenAPI Specification

OpenAPI 3.0 specification untuk MStore REST API.

📥 Download Specification


📋 OpenAPI Info

openapi: 3.0.3
info:
  title: MStore API
  description: REST API untuk MStore POS System
  version: 1.0.0
  contact:
    name: API Support
    email: [email protected]
    url: https://docs.mstore.com
  license:
    name: Proprietary
servers:
  - url: https://api.mstore.com/v1
    description: Production
  - url: https://api-staging.mstore.com/v1
    description: Staging
  - url: http://localhost:8080/v1
    description: Local Development

🔐 Security Schemes

components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
    MerchantID:
      type: apiKey
      in: header
      name: X-Merchant-ID

security:
  - BearerAuth: []
  - MerchantID: []

📦 Schema Examples

Product Schema

components:
  schemas:
    Product:
      type: object
      required:
        - id
        - sku
        - name
        - price
      properties:
        id:
          type: string
          example: "prod_123"
        sku:
          type: string
          example: "PROD-001"
        name:
          type: string
          example: "Product Name"
        description:
          type: string
        price:
          type: number
          format: double
          example: 100000
        stock:
          type: integer
          example: 50
        status:
          type: string
          enum: [active, inactive]
        created_at:
          type: string
          format: date-time

🛠️ Code Generation

Generate client SDKs menggunakan OpenAPI Generator:

Go Client

openapi-generator generate \
  -i openapi.yaml \
  -g go \
  -o ./client-go

TypeScript/Axios Client

openapi-generator generate \
  -i openapi.yaml \
  -g typescript-axios \
  -o ./client-ts

Dart/Flutter Client

openapi-generator generate \
  -i openapi.yaml \
  -g dart \
  -o ./client-flutter

📚 Tools & Resources


🔄 Versioning

OpenAPI spec di-maintain untuk setiap API version:
  • openapi-v1.yaml - API v1 specification
  • openapi-v2.yaml - API v2 specification (coming soon)
Selalu gunakan spec yang sesuai dengan API version yang Anda gunakan.

📞 Support

Butuh bantuan dengan OpenAPI spec?