> For the complete documentation index, see [llms.txt](https://help.dollarlabs.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.dollarlabs.io/dollarlabs-b2b-custom-pricing/credit/import-and-export.md).

# Import & export

Import credit limits and opening balances by CSV, and export limits, rules and the credit ledger.

{% hint style="info" %}
**Plan:** Credit limits & net terms are available on the Founding plan.
{% endhint %}

Open **Dollarlabs B2B → Credit → Limits** and select **Import CSV**. The import has two tabs:

* **Limits** — set or remove credit limits in bulk.
* **Balances** — post opening balances, old invoices and payments.

Drop a file on **Drop a CSV here or click to select**, then select **Import**.

| Limit     | Value                              |
| --------- | ---------------------------------- |
| File size | 2 MB                               |
| Rows      | 5,000 per file. Split larger files |
| Currency  | Your store's currency only         |

After the import you see **Import complete**, **Imported with errors** or **Nothing was imported**, with the first errors listed as "Row {n}: …". **Download errors CSV** lists every error with its line number.

## Limits CSV

The easiest start is **Export CSV** on the Limits page: edit the file and import it back. The header is:

```
op,scope,ownerId,name,email,limit,currency,visibleToMembers
```

| Column             | What to put                                                                                                                                                        | Required                        |
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------- |
| `op`               | `upsert` to set a limit (or leave it blank), `delete` to remove it                                                                                                 | No                              |
| `scope`            | `customer`, `company`, `location`, or `shop` for the global default                                                                                                | Yes                             |
| `ownerId`          | The Shopify ID, for example `gid://shopify/Company/123`, `gid://shopify/CompanyLocation/456` or `gid://shopify/Customer/789`. Required for companies and locations | For companies and locations     |
| `name`             | For your reference. Ignored on import                                                                                                                              | No                              |
| `email`            | A customer row can use the email instead of `ownerId`                                                                                                              | For customers without `ownerId` |
| `limit`            | A number, 0 or more, no currency symbol                                                                                                                            | Yes                             |
| `currency`         | Your store's currency code, for example `USD`                                                                                                                      | Yes                             |
| `visibleToMembers` | Companies and locations only. `false`, `0` or `no` hides the limit from buyers; blank leaves it as it is                                                           | No                              |

Columns can be in any order, and header case doesn't matter.

```csv
op,scope,ownerId,name,email,limit,currency,visibleToMembers
upsert,company,gid://shopify/Company/123,Harbor Print Co.,,10000,USD,
upsert,location,gid://shopify/CompanyLocation/456,HQ,,6000,USD,
upsert,customer,,,dev@example.com,1500,USD,
delete,customer,gid://shopify/Customer/789,,,0,USD,
```

The result reads "Imported N, removed N, skipped N."

## Opening balances

**The app counts only orders placed after you set up credit.** It doesn't go back through older orders. If buyers already owe you money when you start, import it as an opening balance — otherwise their limits are measured against $0 owed.

### Balances CSV

On the **Balances** tab, select **Download template** for a file with two example rows. The header is:

```
scope,ownerId,email,type,amount,currency,dueAt,reference,reason
```

| Column      | What to put                                                                                      | Required                       |
| ----------- | ------------------------------------------------------------------------------------------------ | ------------------------------ |
| `scope`     | `customer`, `company` or `location`                                                              | Yes                            |
| `ownerId`   | The Shopify ID, as for limits                                                                    | Yes, or `email` for a customer |
| `email`     | A customer's email instead of `ownerId`                                                          |                                |
| `type`      | `debit` — money owed, such as an open invoice. `credit` — a payment or write-off                 | Yes                            |
| `amount`    | Above 0                                                                                          | Yes                            |
| `currency`  | Your store's currency code                                                                       | Yes                            |
| `dueAt`     | The due date as `YYYY-MM-DD`. **Required for debits.** Overdue rules and reminders count from it | For debits                     |
| `reference` | Your own reference, up to 80 characters                                                          | No                             |
| `reason`    | Up to 200 characters. **The buyer sees it on their statement**                                   | Yes                            |

Importing the same rows again posts nothing twice. The result shows **N posted**, **N already posted** and **N skipped**.

{% hint style="warning" %}
**For a company buyer, add three rows: the contact, the location and the company.** Each balance row posts to one account only. A company order normally counts at all three levels, so an opening balance should too. With only a company row, the balance doesn't show on any location or for any contact — and doesn't count against their limits. The import warns you when rows are missing.
{% endhint %}

Example — Harbor Print Co. owes $1,200 from an invoice that was due on 20 September, placed by Ana at HQ:

```csv
scope,ownerId,email,type,amount,currency,dueAt,reference,reason
customer,gid://shopify/Customer/789,,debit,1200,USD,2026-09-20,INV-0412,Opening balance
location,gid://shopify/CompanyLocation/456,,debit,1200,USD,2026-09-20,INV-0412,Opening balance
company,gid://shopify/Company/123,,debit,1200,USD,2026-09-20,INV-0412,Opening balance
```

To post a single balance by hand, use [Adjust balance](https://help.dollarlabs.io/dollarlabs-b2b-custom-pricing/credit/set-up-credit-limits.md#adjust-balance) on the account page.

## Exports

| Export            | Where             | Contains                                                   |
| ----------------- | ----------------- | ---------------------------------------------------------- |
| **Export CSV**    | Limits page       | Every limit, in the Limits CSV format above. Re-importable |
| **Export usage**  | Limits page       | Every ledger entry for every account                       |
| **Export ledger** | An account's page | That account's entries with a running balance              |
| **Export CSV**    | Activity → Ledger | The ledger entries that match your filters                 |
| **Export ledger** | Activity → Trends | The whole ledger                                           |
| **Export CSV**    | Rules page        | Your rules, as a backup. Rules can't be imported           |

Files are UTF-8 and open in Excel, Numbers and Google Sheets. Amounts are in your store's currency.
