# Receipt

object type

Over-receipt refuses CONFLICT/THREE_WAY_MATCH (the PO declared receive.match_flag form; tolerance ZERO until); under-receipt is partial, first-class — the next receipt is a NEW doc. posted is the immutable NON-doomed fact (corrections are compensating movements, never edits); cancelled is the doomed terminal (lists filter it). Re-running post RESUMES a stalled walk; on a healthy in-flight receipt it refuses CONFLICT/IN_PROGRESS naming the progress; one receipt posts against a purchase order at a time (its receivingReceiptId).

## Fields

| Field | Type | Notes |
| --- | --- | --- |
| `id` | [ID](/types/#scalars) `ID!` | The record’s id — a UUID the platform assigned when the record was created; every reference to this record uses it. |
| `sysId` | [String](/types/#scalars) `String!` | The group-scoped human-facing system id (RC-…). |
| `type` | [String](/types/#scalars) `String!` | The kind of record — always `Receipt` here. |
| `caption` | [String](/types/#scalars) `String!` | The record’s display name — what people see it called. |
| `status` | [String](/types/#scalars) `String!` | The FSM state: draft \| posting \| posted \| cancelled. |
| `parentId` | [ID](/types/#scalars) `ID!` | The parent PurchaseOrder (SPEC_CATALOG: PO per-LF — the saga this doc advances; receipts enumerate via the generic parent-children walk); for a Receipt parentId!== rootId. |
| `rootId` | [ID](/types/#scalars) `ID!` | The org-group family root. |
| `createdAt` | [String](/types/#scalars) `String!` | When the record was created, as a UTC timestamp. |
| `updatedAt` | [String](/types/#scalars) `String!` | When the record last changed, as a UTC timestamp. |
| `revisionNum` | [Int](/types/#scalars) `Int!` | How many times this record has been edited; the first save is 0. |
| `revision` | [ID](/types/#scalars) `ID!` | The OCC revision token — supply it on every mutation of this record; rotates on every write. |
| `refCaptions` | [RefCaption](/types/RefCaption/) `[RefCaption!]!` | The server-composed captions of this record's declared references (the referenced-caption rule) — one row per referenced id; see RefCaption. |
| `logicalFacilityId` | [ID](/types/#scalars) `ID!` | The receiving LogicalFacility — IMMUTABLE at birth (the Transfer LF-pair stance; wrong LF = cancel + recreate); must be named by >=1 parent-PO line; ACTIVE-re-checked at post (the SL-b use-time stance). |
| `organizationId` | [ID](/types/#scalars) `ID!` | The buying org — spine-stamped from the parent PO at birth (the attribution symmetry). |
| `lineCount` | [Int](/types/#scalars) `Int!` | Rollup: the LIVE line rows on this receipt (0..1000) — maintained in the SAME transaction as every line mutation. ALWAYS <= nextLineNo - 1: removed numbers are never reused. |
| `nextLineNo` | [Int](/types/#scalars) `Int!` | The MONOTONIC next lineNo this receipt will assign (born 1; +1 per minted line; a removed number is NEVER reused). Ceiling 1000 + 1 = the assignment exhausted. |
| `lines` | [ReceiptLine](/types/ReceiptLine/) `[ReceiptLine!]!` | The lines — child rows (RCPTLINE#) read LAZILY as a whole (<= 1000, in lineNo order; the 12-line embedded ceiling and its 7N+2 transaction bound retired: the post WALKS). Page them with receiptLines; edit wholesale (the diff rule) or through addReceiptLines · updateReceiptLine · removeReceiptLines while draft. Fixed at post — the chunk that books a line stamps its merchandiseUnitCost / landedUnitCost on the row. |
| `landedComponents` | [LandedCostComponent](/types/LandedCostComponent/) `[LandedCostComponent!]` | The landed-cost ESTIMATE components — allocated into the receive unit cost at post via allocateProportionally (EXACT conservation); trued up at VI capture. |
| `walk` | [ReceiptWalk](/types/ReceiptWalk/) | The post walk in flight: present EXACTLY while status is posting — kind post · cursor = the next lineNo to land in stock (cursor − 1 of lineCount landed) · chunks so far · lineCount · startedAt · the machine executionArn once started · stalledAt + problem when a step failed past its retries. Null on every other status; cleared by the LAST chunk in the same transaction that lands posted. Re-run post to RESUME a stalled walk; on a healthy one it refuses CONFLICT/IN_PROGRESS naming the progress. |

## Used by

- [addReceiptLines](/reference/inventory-operations/addReceiptLines/)
- [cancelReceipt](/reference/inventory-operations/cancelReceipt/)
- [createReceipt](/reference/inventory-operations/createReceipt/)
- [postReceipt](/reference/inventory-operations/postReceipt/)
- [receipt](/reference/receipt/receipt/)
- [removeReceiptLines](/reference/inventory-operations/removeReceiptLines/)
- [updateReceipt](/reference/receipt/updateReceipt/)
- [updateReceiptLine](/reference/inventory-operations/updateReceiptLine/)
