# Tier One ERP — Developer Platform

> REST API, real-time webhooks, and pre-built connectors for the platforms you already use.
> One API key, versioned endpoints, and full multi-tenant isolation.

- **130+ API Endpoints** — Versioned under /api/v1
- **12 Webhook Events** — HMAC-SHA256 signed
- **19 Platform Connectors** — Pre-built integrations

Base URL: `https://www.tieroneerp.com`
OpenAPI Spec: `https://www.tieroneerp.com/swagger/v1/swagger.json`
Integration Guide: `https://www.tieroneerp.com/docs/integration-guide`

---

## Quick Start

### Step 1: Register for a Tier One ERP account

Go to https://www.tieroneerp.com/register and create your workspace.
The free trial includes full API access with no credit card required.

### Step 2: Generate an API key

From your dashboard, navigate to Settings → API Keys.
Click "Create Key", give it a name like "Production Integration", and copy the key.
It is only shown once.

### Step 3: Make your first API call

Set your base URL, pass your API key in the `X-API-Key` header and your tenant ID in `X-Tenant-ID`.
All endpoints are versioned under `/api/v1`.

```bash
curl -X GET https://www.tieroneerp.com/api/v1/customers \
  -H "X-API-Key: sk_live_YOUR_KEY" \
  -H "X-Tenant-ID: your-tenant-id" \
  -H "Content-Type: application/json"
```

---

## Authentication

Every request requires two headers:

| Header        | Description                          |
|---------------|--------------------------------------|
| `X-API-Key`   | Your API key (starts with `sk_live_`)|
| `X-Tenant-ID` | Your tenant identifier (GUID)        |

---

## API Surface — 130+ Endpoints

| #  | Area           | Description                                  | Endpoints |
|----|----------------|----------------------------------------------|-----------|
| 01 | Financial      | General ledger, invoicing, payments          | 24        |
| 02 | Sales & CRM    | Customers, orders, leads, POS                | 32        |
| 03 | Inventory      | Products, stock, warehouses, transfers       | 28        |
| 04 | Manufacturing  | BOMs, work orders, quality control           | 18        |
| 05 | Analytics      | Reports, dashboards, forecasting             | 12        |
| 06 | Platform       | Tenants, users, webhooks, imports            | 16        |

---

## Code Examples

### List Customers (curl)

```bash
curl -X GET https://www.tieroneerp.com/api/v1/customers \
  -H "X-API-Key: sk_live_a1b2c3d4e5f6" \
  -H "X-Tenant-ID: your-tenant-id" \
  -H "Content-Type: application/json"

# 200 OK
{
  "data": [
    {
      "id": "c7f3a2b1-...",
      "name": "Acme Corp",
      "email": "orders@acme.com",
      "status": "active"
    }
  ],
  "pagination": {
    "page": 1,
    "pageSize": 25,
    "totalCount": 142
  }
}
```

### Create a Product (JavaScript)

```javascript
const response = await fetch(
  'https://www.tieroneerp.com/api/v1/products',
  {
    method: 'POST',
    headers: {
      'X-API-Key': 'sk_live_a1b2c3d4e5f6',
      'X-Tenant-ID': 'your-tenant-id',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      sku: 'TIR-WIDGET-001',
      name: 'Premium Widget',
      description: 'High-quality widget',
      unitPrice: 29.99,
      category: 'Widgets',
      trackInventory: true,
      reorderPoint: 25,
    }),
  }
);

const product = await response.json();
console.log('Created product:', product.id);
```

### Send a POS Transaction (curl)

```bash
curl -X POST https://www.tieroneerp.com/api/v1/sales/pos \
  -H "X-API-Key: sk_live_a1b2c3d4e5f6" \
  -H "X-Tenant-ID: your-tenant-id" \
  -H "Content-Type: application/json" \
  -d '{
    "customerId": "c7f3a2b1-...",
    "items": [
      {
        "productId": "p1a2b3c4-...",
        "quantity": 2,
        "unitPrice": 29.99
      }
    ],
    "paymentMethod": "card",
    "reference": "POS-TXN-00412"
  }'

# 201 Created
{
  "id": "txn_x9y8z7...",
  "total": 59.98,
  "status": "completed"
}
```

### Register a Webhook (curl)

```bash
curl -X POST https://www.tieroneerp.com/api/v1/webhooks \
  -H "X-API-Key: sk_live_a1b2c3d4e5f6" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://your-app.com/hooks/tierone",
    "events": [
      "inventory.low_stock",
      "order.created"
    ],
    "secret": "whsec_your_signing_secret"
  }'
```

---

## Platform Connectors

### E-Commerce
| Connector        | Methods              | Status    |
|------------------|----------------------|-----------|
| Shopify          | REST API, Webhooks   | Available |
| WooCommerce      | REST API, Webhooks   | Available |
| Magento          | REST API, Event Bus  | Coming Soon |
| EcomEngine       | REST API, Webhooks   | Available |

### Payments
| Connector | Methods            | Status    |
|-----------|--------------------|-----------|
| Stripe    | REST API, Webhooks | Available |
| PayPal    | REST API, Webhooks | Available |
| Square    | REST API, Webhooks | Available |

### Accounting
| Connector  | Methods               | Status    |
|------------|-----------------------|-----------|
| QuickBooks | REST API, File Import | Available |
| Xero       | REST API, Webhooks    | Available |

### Shipping
| Connector   | Methods            | Status      |
|-------------|--------------------|-------------|
| ShipStation | REST API, Webhooks | Available   |
| FedEx       | REST API           | Coming Soon |
| UPS         | REST API           | Coming Soon |

### CRM
| Connector  | Methods              | Status    |
|------------|----------------------|-----------|
| Salesforce | REST API, Event Bus  | Available |
| HubSpot    | REST API, Webhooks   | Available |

### POS
| Connector  | Methods              | Status      |
|------------|----------------------|-------------|
| Square POS | REST API, Event Bus  | Available   |
| Clover     | REST API, Webhooks   | Coming Soon |

### Marketplace
| Connector | Methods               | Status      |
|-----------|-----------------------|-------------|
| Amazon    | REST API, File Import | Available   |
| eBay      | REST API, Webhooks    | Coming Soon |

### Custom
| Connector        | Methods                                    | Status    |
|------------------|--------------------------------------------|-----------|
| Custom / Generic | REST API, Webhooks, Event Bus, File Import | Available |

---

## Webhook Events

All webhook payloads are signed with HMAC-SHA256. Failed deliveries are retried
with exponential backoff (3 attempts over 1 hour).

| Event                      | Description                                    |
|----------------------------|------------------------------------------------|
| `order.created`            | Fired when a new sales order is placed         |
| `order.updated`            | Fired when order status or details change      |
| `order.cancelled`          | Fired when an order is cancelled               |
| `payment.received`         | Fired when a payment is successfully processed |
| `payment.refunded`         | Fired when a refund is issued                  |
| `invoice.created`          | Fired when a new invoice is generated          |
| `customer.created`         | Fired when a new customer record is added      |
| `customer.updated`         | Fired when customer details are modified       |
| `inventory.stock_updated`  | Fired when stock levels change                 |
| `inventory.low_stock`      | Fired when stock falls below reorder threshold |
| `product.created`          | Fired when a new product is added to catalog   |
| `product.updated`          | Fired when product details are modified        |

---

## AI-Assisted Integration

Point your AI coding assistant at the OpenAPI spec to scaffold your integration:

**OpenAPI Spec:** `https://www.tieroneerp.com/swagger/v1/swagger.json`

### Example AI Prompt

> I need to integrate my e-commerce platform with Tier One ERP.
> Here is the OpenAPI spec: https://www.tieroneerp.com/swagger/v1/swagger.json
>
> Build me a Node.js service that:
> 1. Listens for sale webhooks from my platform
> 2. Creates a POS transaction in Tier One via POST /api/v1/sales/pos
> 3. Syncs the product catalog nightly via GET/POST /api/v1/products
> 4. Subscribes to inventory.low_stock webhooks from Tier One and alerts our Slack channel

---

## Key Endpoints for Integration

| Your Platform Event   | Tier One Endpoint          | Method   | Description      |
|-----------------------|----------------------------|----------|------------------|
| Sale / transaction    | `/api/v1/sales/pos`        | POST     | POS transaction  |
| Product catalog sync  | `/api/v1/products`         | GET/POST | Product CRUD     |
| Customer sync         | `/api/v1/customers`        | GET/POST | Customer CRUD    |
| Inventory check       | `/api/v1/stock`            | GET      | Stock levels     |
| Stock adjustment      | `/api/v1/stock/adjust`     | POST     | Adjust quantities|
| Order creation        | `/api/v1/sales/orders`     | POST     | Sales orders     |
| Webhook subscription  | `/api/v1/webhooks`         | POST     | Subscribe events |

---

## Contact

- Website: https://www.tieroneerp.com
- Email: hello@tieroneerp.com
- Registration: https://www.tieroneerp.com/register (free trial, no credit card)

(c) 2026 Tier One ERP
