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

# Importing Data into Better Data

> Connect your ERP, WMS, or OMS to Better Data using the import API or CSV upload.

## Overview

Better Data accepts data via a REST import API. All imports are:

* **Async** - each request returns a `jobId`; poll `GET /api/import/status/[jobId]` for completion
* **Idempotent** - re-running an import with the same external reference IDs will not create duplicates
* **Partial-success** - row-level errors are reported per record; a single bad row does not fail the whole batch

## Import Order

Always import in this sequence. Later resources depend on earlier ones.

<Steps>
  ### 1. Suppliers

  No dependencies. Import your supplier master first.
  -> [Suppliers field reference](/import/field-mappings/suppliers)

  ### 2. Catalog

  No dependencies. Import products and SKUs.
  -> [Catalog field reference](/import/field-mappings/catalog)

  ### 3. Inventory

  Requires: Catalog + Locations (locations are configured in account setup).
  -> [Inventory field reference](/import/field-mappings/inventory)

  ### 4. Purchase Orders

  Requires: Suppliers + Catalog + Locations.
  -> [Purchase Orders field reference](/import/field-mappings/purchase-orders)

  ### 5. Orders

  Requires: Catalog + Locations.
  -> [Orders field reference](/import/field-mappings/orders)

  ### 6. Demand History

  Requires: Catalog + Locations. Week start dates must be Mondays.
  -> [Demand History field reference](/import/field-mappings/demand-history)
</Steps>

<Note>
  Locations are configured during account setup and are not imported via the API.
  Contact support to add or modify locations.
</Note>

## Quick Start

Download a CSV template, fill it in, and upload via the API or the in-app importer.

<CardGroup cols={2}>
  <Card title="Download templates" icon="download" href="/import/api-reference#templates">
    Get pre-formatted CSV templates for every resource.
  </Card>

  <Card title="API reference" icon="code" href="/import/api-reference">
    Full REST API docs for all import endpoints.
  </Card>

  <Card title="Fivetran / ERP connectors" icon="plug" href="/import/connectors/overview">
    Map your NetSuite, SAP, or Shopify data to Better Data fields.
  </Card>

  <Card title="Field mappings" icon="table" href="/import/field-mappings/catalog">
    Field-by-field reference with ERP analogs and constraints.
  </Card>
</CardGroup>

## Authentication

All import endpoints require an API key in the `x-api-key` header.

```bash theme={null}
curl -X POST https://api.betterdata.co/api/import/catalog \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "products": [...] }'
```

Generate API keys at: **apps.betterdata.co -> Settings -> API Keys**

## Checking Import Status

```bash theme={null}
curl https://api.betterdata.co/api/import/status/job_abc123 \
  -H "x-api-key: YOUR_API_KEY"
```

Response:

```json theme={null}
{
  "jobId": "job_abc123",
  "status": "COMPLETED",
  "rowCount": 142,
  "processedCount": 142,
  "failedCount": 0,
  "errors": [],
  "completedAt": "2026-03-01T10:00:04Z"
}
```

Status values: `PENDING` -> `PROCESSING` -> `COMPLETED` | `FAILED`
