# Receive a document

`POST /lokta-lms/api/v1/sourcing-partners/{partnerId}/documents`

Uploads a document for a sourcing partner.

Multipart. `file` is the document itself; `document_type` is a code from `/sourcing-partner-reference-data`. Optional: `title`, `reference_number`, `issued_on`, `valid_from`, `valid_to`.

**The file goes to the ledger's own document store; this API records only a reference.** Storing bytes here would make it a second document system with its own retention, backup and access story, and the one thing worse than no document store is two that disagree about what was filed. `core_document_id` on the read is how you fetch the bytes.

The core write happens first and the reference is recorded second. If the reference failed, an orphaned file would be left, which is recoverable; the reverse, a reference to a file that was never stored, is a checklist claiming a document was received when nothing was.

A retired document type is refused rather than accepted: a document filed against one would satisfy no checklist row and sit invisible until somebody audited the folder.

Arrives as `pending`. `valid_to` drives the checklist's derived `expired`, so supply it for anything that lapses.

## Parameters
- `partnerId` (path, string, required)

## Responses
- `default`: default response

## Example request (cURL)
```bash
curl -X POST \
  'https://default.lokta.tech/lokta-lms/api/v1/sourcing-partners/{partnerId}/documents' \
  -u '{username}:{password}' \
  -H 'Tenant-Identifier: default'
```

Interactive: https://developer.lokta.ai/reference#operation/receive
