# updateReceiptLine

mutation · in the family [Inventory operations](/reference/inventory-operations/)

## What it does

Replace one line on a draft goods receipt — its purchase-order line, quantity, routing, bin or pack.

REPLACE ONE line of a DRAFT Receipt WHOLE: the addressed lineNo is KEPT, every create-time gate re-runs on the replacement, and the header rollups move with it. ONE transaction — the row Put + the header rewrite. A live post-draft doc refuses CONFLICT/REF_STATE; an unknown lineNo refuses NOT_FOUND naming it. Requires the doc CURRENT revision (OCC) + the unrestricted capability. NO reason — the edit class.

## What happens

The whole line is rewritten and keeps its line number; anything you leave out is cleared, not kept.

## Careful

Only while the receipt is still a draft — once posted, a correction is a compensating stock movement, never an edit.

## Who may call it

Capability area: **Inventory operations** — Receiving, counting, transferring and moving stock.

- Owner
- Manager
- Associate Manager
- Warehouse Associate
- An API key whose scope allows `api:updateReceiptLine`

## Arguments

| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| `input` | [UpdateReceiptLineInput](/types/UpdateReceiptLineInput/) `UpdateReceiptLineInput!` | yes | No further notes. |
| `revision` | [ID](/types/#scalars) `ID!` | yes | The revision id you read on the record; the change is refused if an edit landed in the meantime. |

## Returns

[Receipt](/types/Receipt/) `Receipt!` — 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).

## Example request

```graphql
mutation ExampleUpdateReceiptLine($input: UpdateReceiptLineInput!, $revision: ID!) {
  updateReceiptLine(input: $input, revision: $revision) {
    id
    sysId
    type
    caption
    status
    parentId
    rootId
    createdAt
    updatedAt
    revisionNum
    revision
    logicalFacilityId
    organizationId
    lineCount
    nextLineNo
  }
}
```

Variables:

```json
{
  "input": {
    "receiptId": "01900000-0000-7000-8000-458bf62e0000",
    "lineNo": 1,
    "line": {
      "poLineNo": 1,
      "quantityReceived": "<quantity received>",
      "disposition": "accept"
    }
  },
  "revision": "01900000-0000-7000-8000-b7960e180000"
}
```

Send it with the envelope naming the version: `"extensions": {"at": {"version": {"name":"genesis","number":0}}}`.

## Example response

```json
{
  "data": {
    "updateReceiptLine": {
      "id": "01900000-0000-7000-8000-37386ae00000",
      "sysId": "RC-EXMP-0000-000F",
      "type": "Receipt",
      "caption": "Blue jeans",
      "status": "draft",
      "parentId": "01900000-0000-7000-8000-065235280000",
      "rootId": "01900000-0000-7000-8000-a093dd800000",
      "createdAt": "2027-01-31T00:00:00.000Z",
      "updatedAt": "2027-01-31T00:00:00.000Z",
      "revisionNum": 1,
      "revision": "01900000-0000-7000-8000-b7960e180000",
      "logicalFacilityId": "01900000-0000-7000-8000-8026f71c0000",
      "organizationId": "01900000-0000-7000-8000-44b781470000",
      "lineCount": 1,
      "nextLineNo": 1
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}
```

## Errors this call can answer

- `VALIDATION/INVALID` — Something in the request is not valid. ([VALIDATION](/errors/VALIDATION/))
- `AUTHN/REQUIRED` — Sign in to do this. ([AUTHN](/errors/AUTHN/))
- `AUTHZ/FORBIDDEN` — Your role does not allow this action. ([AUTHZ](/errors/AUTHZ/))
- `RATE_LIMIT/THROTTLED` — Too many requests in a short time. ([RATE_LIMIT](/errors/RATE_LIMIT/))
- `NOT_FOUND/*` — That record could not be found. ([NOT_FOUND](/errors/NOT_FOUND/))
- `CONFLICT/*` — The record’s state, or a change made in the meantime, does not allow this; the codes are on the CONFLICT page. ([CONFLICT](/errors/CONFLICT/))
- `VALIDATION/VERSION_REQUIRED` — The request did not say which app version it came from. ([VALIDATION](/errors/VALIDATION/))
