# Getting started

The ReconSmiths API connects your own system - a shop, an ordering app, a point of sale, a job system, a payroll tool - to a company's books. Your system keeps doing what it does; ReconSmiths keeps the ledger: tax invoice numbers, VAT, receivables, statements, reconciliation.

## What you can do

- **Push** customers, sales orders, invoices, credit notes, receipts, supplier bills, employees, hours and leave.
- **Read** whether an invoice is paid, a customer's statement and ageing, unused credit, and everything that changed since you last asked.
- **Fetch** the issued documents - tax invoices, credit notes, statements, payslips - as PDF or as data.
- **Be told** when something happens, by webhook: an invoice posted, paid, credited.

## Three things that hold everywhere

1. **Your own references.** You name everything with your own id (`external_ref`). You never need to store ours.
2. **Every write is safe to retry.** Send an `Idempotency-Key` header on writes. If the network drops and you send it again, you get the first answer back, not a second invoice.
3. **The books stay balanced.** Every posting goes through the ledger's own functions: one balanced journal, an open-period check, the next number in the sequence. Something the ledger refuses comes back as `422` with the reason in words.

## Your first call in five minutes

1. Sign in to the office and open **Connected systems**. Create a connection for your system and copy the key. It is shown once. To explore first, connect **Something else**: its key has only the `read` permission, so it can look at everything and change nothing (see [Keys and permissions](02-keys-and-permissions.md)).
2. Find a customer:

```bash
curl 'https://api.reconsmith.com/v1/parties/search?q=northwind' \
  -H 'Authorization: Bearer $RECONSMITH_KEY'
```

3. Create one, under your own id:

```bash
curl -X POST 'https://api.reconsmith.com/v1/parties' \
  -H 'Authorization: Bearer $RECONSMITH_KEY' \
  -H 'Idempotency-Key: 0f8e2c1a-first-customer' \
  -H 'Content-Type: application/json' \
  -d '[{"source_system": "shop", "external_ref": "CUST-1001", "name": "Northwind Trading (Pty) Ltd", "vat_number": "4123456789"}]'
```

4. Invoice them:

```bash
curl -X POST 'https://api.reconsmith.com/v1/invoices' \
  -H 'Authorization: Bearer $RECONSMITH_KEY' \
  -H 'Idempotency-Key: 5d1b7e90-first-invoice' \
  -H 'Content-Type: application/json' \
  -d '[{"source_system": "shop", "external_ref": "ORD-5001", "customer_external_ref": "CUST-1001", "doc_date": "2026-12-01",
        "reference": "ORD-5001",
        "lines": [{"description": "Consulting, November", "amount_excl_tax": 1000.00, "tax_amount": 150.00}]}]'
```

The answer carries our `document_id`. The invoice number is ReconSmiths' own (for example `INV-00042`): you never send one.

5. Fetch the PDF to send or store: `GET /v1/documents/ORD-5001/pdf?sourceSystem=shop`.

## Where to go next

- [Requests, answers and errors](03-requests-answers-and-errors.md) - the rules every call follows.
- [Invoices and credit notes](05-invoices-and-credit-notes.md) - the heart of it.
- [Every endpoint](../reference/index.html) - the full list, what each does and what it is for.
