> ## Documentation Index
> Fetch the complete documentation index at: https://api-docs.useopenwrench.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Internal Teams API

> Purchasing and inventory access for your internal service teams: purchase requests, purchase orders, receipts, parts and equipment catalogs, and stock levels.

The Internal Teams API is the integration surface for the systems behind your in-house service teams' purchasing and inventory: purchase requests and their line items, purchase orders through receipt, parts and equipment catalogs, stock locations, and the parts consumed on work orders.

## Base URL

```text theme={null}
https://api.useopenwrench.com/api/external
```

Internal-teams endpoints are served under the `/v1/partners/` path prefix.

## Authentication

These endpoints require a **partner API key** — a separate credential from buyer and supplier API keys. A buyer API key will not work against `/v1/partners/` endpoints, even though this section lives under the Buyer API docs.

Every request must carry **two headers**: `X-API-KEY` (the partner key) and `OW-KEY` (the OpenWrench shared secret issued alongside it). The key automatically scopes every request to your company's data. Requests missing either header return `401`.

```bash theme={null}
curl -H "X-API-KEY: <partner-key>" -H "OW-KEY: <shared-secret>" \
  "https://api.useopenwrench.com/api/external/v1/partners/ping"
```

To have a partner API key and shared secret issued, contact [support@useopenwrench.com](mailto:support@useopenwrench.com).

## Rate limits

10 requests per 20-second window per key. Beyond that you'll receive `429 Too Many Requests` — back off and retry.

## Response envelope

Single-entity responses:

```json theme={null}
{ "type": "SupplierPurchaseOrder", "data": { "...": "..." }, "status": "ok" }
```

List responses add a total `count`:

```json theme={null}
{ "type": "SupplierPurchaseRequest", "data": [ "..." ], "count": 42, "status": "ok" }
```

Errors:

```json theme={null}
{ "message": "Human-readable message", "type": "NotFoundException", "status": "error", "traceId": "abc123def45" }
```

`401` means a missing or invalid key; `400` covers bad input, bad filters, and permission denials; `429` is the rate limit.

## Pagination and filtering

List endpoints accept `offset`, `limit` (default 10, max 25), `sort_by`, and `order` (`asc` | `desc`). Additional query parameters are treated as field filters — pass a field name with a value (comma-separate multiple values) to filter the result set.

## The purchasing flow

A typical integration follows the purchasing lifecycle: read approved **purchase requests** and their line items, create a **purchase order** against a vendor, associate PR line items to PO line items, mark the PO **ordered**, and record **receipts** as items arrive (negative received quantities record returns). Parts, equipment types, vendors, and stock locations round out the reference data.

## Detailed guides

<CardGroup cols={2}>
  <Card title="Purchasing flow" href="/partners-api/purchasing-flow" icon="cart-flatbed">
    The lifecycle end to end: requests, orders, line items, and receipts.
  </Card>

  <Card title="Catalog & stock" href="/partners-api/catalog-and-stock" icon="boxes-stacked">
    Parts, equipment, vendors, stock locations, and work order consumption.
  </Card>
</CardGroup>
