# vendorInvoice

query · in the family [Vendor invoice](/reference/vendor-invoice/)

## What it does

Look up one record — a vendor’s invoice — what a supplier billed you against a purchase.

A VendorInvoice by id, within the caller's OWN org-group family; requires authentication. A cross-tenant id reads as null (not-found) AND trips the rootId tripwire server-side.

## What happens

Reads only — changes nothing.

## Who may call it

Capability area: **Reading your records** — Looking up and listing the records of your organization.

- Owner
- System Administrator
- Manager
- Associate Manager
- Warehouse Associate
- Sales Associate
- An API key whose scope allows `api:vendorInvoice`

## Arguments

| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| `id` | [ID](/types/#scalars) `ID!` | yes | The id of the record. |

## Returns

[VendorInvoice](/types/VendorInvoice/) — A captured vendor bill: the 3-way match and the landed-cost TRUE-UP run from it at capture. NOT a payables subledger. Parent = the PO (the match is per-PO; N invoices per PO are legal — partial-shipment invoicing); invoiceOrgVendorId MAY differ from the PO vendor: ONE construct covers merchandise invoices (match lines) AND cost bills (landed ACTUAL components) — either or both, never neither. CAPTURE stamps matchStatus matched|flagged at tolerance ZERO (price/qty variance FLAGS, never blocks — the flag IS the approval queue until) and posts the landed true-up (actuals vs the receipts NOT-yet-trued estimates per component type -> cost_true_up value-only movements re-weighting each touched book at its CURRENT cost-bearing quantity; the sold-share stays a reports-only fact — the precedent). The (invoiceOrgVendor x normalized invoice number) UNIQ pair is the double-pay gate (CONFLICT/IDENTITY_TAKEN naming the holder; a cancelled holder is taken over). captured is the immutable fact (corrections are compensating entries, never un-capture); cancelled is the doomed terminal (lists filter it).

## Example request

```graphql
query ExampleVendorInvoice($id: ID!) {
  vendorInvoice(id: $id) {
    id
    sysId
    type
    caption
    status
    parentId
    rootId
    createdAt
    updatedAt
    revisionNum
    revision
    invoiceOrgVendorId
    invoiceNumber
    invoiceDate
    notes
    matchStatus
  }
}
```

Variables:

```json
{
  "id": "01900000-0000-7000-8000-37386ae00000"
}
```

## Example response

```json
{
  "data": {
    "vendorInvoice": {
      "id": "01900000-0000-7000-8000-37386ae00000",
      "sysId": "VI-EXMP-0000-000F",
      "type": "VendorInvoice",
      "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",
      "invoiceOrgVendorId": "01900000-0000-7000-8000-38bdd2a10000",
      "invoiceNumber": "<invoice number>",
      "invoiceDate": "2027-01-31",
      "notes": "Restock before the weekend.",
      "matchStatus": "matched"
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": null,
        "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/))
