Getting Started

Welcome to the Marc's Inventory API!

  • Base URL: https://api.marcsinventory.com
  • Format: All requests and responses use JSON with UTF-8 encoding
  • Authentication: Bearer token in Authorization header (see Authentication section)
  • Rate Limit: 100 requests per minute per token
  • Response Format: {success: bool, data: object, error: string}
  • Timestamps: All timestamps are in ISO 8601 format (UTC)

Tip: Use Bearer tokens to authenticate all requests. Include the header: Authorization: Bearer YOUR_TOKEN

Authentication

POST /auth/login

Authenticate with email and password to receive access token

Request Body

{
  "email": "user@example.com",
  "password": "securepassword123"
}

Response

{
  "success": true,
  "data": {
    "access_token": "eyJ0eXAiOiJKV1QiLCJhbGc...",
    "expires_in": 3600,
    "user": {
      "id": "user_123",
      "email": "user@example.com",
      "account_id": "acc_123"
    }
  }
}
No Auth Required
POST /auth/refresh

Refresh an expired access token

Request Body

{
  "refresh_token": "eyJ0eXAiOiJKV1QiLCJhbGc..."
}

Response

{
  "success": true,
  "data": {
    "access_token": "eyJ0eXAiOiJKV1QiLCJhbGc...",
    "expires_in": 3600
  }
}
No Auth Required
POST /auth/register

Register a new user account with email and password

No Auth Required
POST /auth/logout

Invalidate the current session and refresh token

Bearer Token Required
GET /auth/me

Get the current authenticated user's info

Bearer Token Required
GET /auth/accounts

List all accounts the current user belongs to

Bearer Token Required
POST /auth/switch-account

Switch the active account context for multi-tenant users

Bearer Token Required
GET /auth/invitation-info

Get details about a team invitation by token

No Auth Required
POST /auth/accept-invite

Accept a team invitation and join the account

No Auth Required

API Keys

Create and manage per-account API keys for programmatic access.

GET/admin/api-keys

List all API keys for the current account

Response

{
  "success": true,
  "data": [
    { "id": "key_001", "name": "Production", "prefix": "mi_live_abc1", "created_at": "2026-03-20T10:00:00Z", "last_used_at": "2026-03-22T08:15:00Z" }
  ]
}
Bearer Token Required
POST/admin/api-keys

Create a new API key

Request Body

{ "name": "Warehouse Integration" }

Response

{
  "success": true,
  "data": { "id": "key_002", "name": "Warehouse Integration", "key": "mi_live_xyz789...", "created_at": "2026-03-22T12:00:00Z" }
}
Bearer Token Required

Health Check API

Monitor API availability and service health.

GET/health

Quick health check — returns OK if API is running

No Auth Required

Tenant Signup API

Register new tenant accounts (stores) on the platform.

POST/signup

Register a new tenant (store) with owner account

No Auth Required
POST/signup/check-availability

Check if a store name or subdomain is available

No Auth Required
GET/signup/plans

List available signup plans and pricing tiers

No Auth Required