> ## Documentation Index
> Fetch the complete documentation index at: https://developer.oplog.one/llms.txt
> Use this file to discover all available pages before exploring further.

# API Reference

> Complete API documentation for OPLOG.ONE logistics and supply chain management platform

## Welcome to OPLOG.ONE API

The OPLOG.ONE API provides comprehensive logistics and supply chain management capabilities through a RESTful interface. Our API enables businesses to integrate powerful logistics operations including product management, order processing, inventory tracking, and shipping coordination.

<CardGroup cols={2}>
  <Card title="Products API" icon="box" href="#products">
    Manage your product catalog with comprehensive inventory control
  </Card>

  <Card title="Sales Orders API" icon="shopping-cart" href="#sales-orders">
    Process orders with multiple payment methods and shipping options
  </Card>

  <Card title="Receiving Orders API" icon="truck" href="#receiving-orders">
    Handle incoming inventory with flexible transfer configurations
  </Card>

  <Card title="Returns API" icon="undo" href="#returns">
    Streamline return processing and customer service operations
  </Card>
</CardGroup>

## Environments

OPLOG.ONE provides two separate environments. Each environment has its own base URL, credentials, and data — they are completely isolated from each other.

<Tabs>
  <Tab title="Production">
    **Base URL**

    ```
    https://api.oplog.one/openapi/v1
    ```

    The production environment is your live system. All API requests here affect real orders, shipments, and inventory.

    **Example Request**

    ```bash theme={null}
    curl -X GET "https://api.oplog.one/openapi/v1/Products" \
      -H "X-Tenant-Id: your-tenant-id" \
      -H "Authorization: Bearer your-static-token" \
      -H "Content-Type: application/json"
    ```

    <Warning>
      Only use production after you have fully tested your integration in the staging environment.
    </Warning>
  </Tab>

  <Tab title="Staging">
    **Base URL**

    ```
    https://api.staging.oplog.one/openapi/v1
    ```

    The staging environment is a safe sandbox for development and testing. No real shipments are created and no live data is affected.

    **Example Request**

    ```bash theme={null}
    curl -X GET "https://api.staging.oplog.one/openapi/v1/Products" \
      -H "X-Tenant-Id: your-staging-tenant-id" \
      -H "Authorization: Bearer your-staging-static-token" \
      -H "Content-Type: application/json"
    ```

    <Info>
      Don't have a staging account yet? Contact our support team at [onboarding@oplog.io](mailto:onboarding@oplog.io) to get started. See the [Staging Environment](/staging) guide for full setup details.
    </Info>
  </Tab>
</Tabs>

<Warning>
  Production and staging credentials are not interchangeable. Never use production credentials in staging or vice versa.
</Warning>

## Authentication

OPLOG.ONE uses OAuth 2.0 authentication with tenant-specific tokens. Every API request must include the following headers:

```http theme={null}
X-Tenant-Id: your-tenant-id
Authorization: Bearer your-static-token
Content-Type: application/json
```

| Header          | Description                                                      |
| :-------------- | :--------------------------------------------------------------- |
| `X-Tenant-Id`   | Your unique tenant identifier, provided during integration setup |
| `Authorization` | Bearer token using your StaticToken                              |
| `Content-Type`  | Must be `application/json` for all requests                      |

<Warning>
  Ensure you include both `X-Tenant-Id` and `Authorization` headers in every request. Missing authentication will result in a 401 Unauthorized error.
</Warning>

## Response Format

All API responses follow a consistent JSON structure:

### Success Response

```json theme={null}
{
  "data": {
    // Response data
  },
  "status": "success"
}
```

### Error Response

```json theme={null}
{
  "error": {
    "code": 400,
    "message": "Validation Errors",
    "errors": [
      {
        "property": "fieldName",
        "message": "Error description",
        "errorCode": "ErrorCode"
      }
    ]
  },
  "requestId": "unique-request-id",
  "timestamp": "2025-06-24T13:37:00.123Z"
}
```

<Info>
  For detailed error codes and descriptions, see our [Error Reference](/errors) documentation.
</Info>
