Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs-mstore.faisalaffan.com/llms.txt

Use this file to discover all available pages before exploring further.

API Overview

Dokumentasi lengkap REST API MStore Backend untuk integrasi dengan client applications.

🌐 Base URLs

https://api-dev.mstore.com/v1

🔐 Authentication

MStore API menggunakan JWT Bearer Token untuk authentication.

Get Access Token

POST /auth/login
Content-Type: application/json

{
  "email": "[email protected]",
  "password": "your_password"
}
Response:
{
  "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "expires_in": 3600
}

Use Token in Requests

GET /api/v1/products
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...

📋 API Categories

Authentication

Login, register, refresh token, logout

Products

Product management, variants, pricing

Transactions

POS transactions, payments, refunds

Inventory

Stock management, warehouse operations

Customers

Customer management, loyalty points

Reports

Sales reports, analytics, exports

🎯 API Versioning

MStore API menggunakan URL versioning:
https://api.mstore.com/v1/products
https://api.mstore.com/v2/products
Current Version: v1
Latest Version: v1
API v1 akan di-maintain minimal 12 bulan setelah release v2.

📊 Response Format

Success Response

{
  "success": true,
  "data": {
    "id": "123",
    "name": "Product Name"
  },
  "meta": {
    "timestamp": "2024-01-01T00:00:00Z",
    "request_id": "req_abc123"
  }
}

Error Response

{
  "success": false,
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Invalid input parameters",
    "details": [
      {
        "field": "email",
        "message": "Email is required"
      }
    ]
  },
  "meta": {
    "timestamp": "2024-01-01T00:00:00Z",
    "request_id": "req_abc123"
  }
}

🔢 HTTP Status Codes

Status CodeDescription
200 OKRequest successful
201 CreatedResource created successfully
400 Bad RequestInvalid request parameters
401 UnauthorizedMissing or invalid authentication
403 ForbiddenInsufficient permissions
404 Not FoundResource not found
422 Unprocessable EntityValidation error
429 Too Many RequestsRate limit exceeded
500 Internal Server ErrorServer error

🚦 Rate Limiting

API rate limits per endpoint:
TierRequests per MinuteRequests per Hour
Free601,000
Basic30010,000
Premium1,00050,000
EnterpriseCustomCustom
Rate Limit Headers:
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 45
X-RateLimit-Reset: 1640995200

📄 Pagination

List endpoints support pagination:
GET /api/v1/products?page=1&limit=20
Response:
{
  "data": [...],
  "meta": {
    "page": 1,
    "limit": 20,
    "total": 150,
    "total_pages": 8
  }
}

🔍 Filtering & Sorting

Filtering

GET /api/v1/products?category=electronics&status=active

Sorting

GET /api/v1/products?sort=-created_at,name
  • Prefix - untuk descending
  • Comma-separated untuk multiple fields

🌍 Multi-Tenant

Semua API requests harus include Merchant ID di header:
X-Merchant-ID: merchant_abc123
Request tanpa X-Merchant-ID akan return 400 Bad Request.

🛠️ SDKs & Tools

Postman Collection

Import Postman collection untuk testing

OpenAPI Spec

Download OpenAPI 3.0 specification

Go SDK

Official Go SDK documentation

Flutter SDK

Official Flutter SDK documentation

📞 Support

Butuh bantuan dengan API?

🔄 Changelog

Track API changes dan updates:

API Changelog

View all API changes and updates