AlmondTill/G3N API

Record and match a supplier’s invoice

Record what the supplier billed you against the purchase and capture it so the three-way story — ordered, received, billed — builds; cancel one recorded in error.

Procurement · a play in 3 steps.

The steps

  1. Record the supplier’s invoice against the purchase. — createVendorInvoice
  2. Capture it — the ordered / received / billed story builds from here. — captureVendorInvoice
  3. Cancel one recorded in error. — cancelVendorInvoice

The calls

Every operation this use case runs, in the order it first appears, with the request and the response its reference page shows.

createVendorInvoice

createVendorInvoice — mutation · Create a new vendor’s invoice — what a supplier billed you against a purchase at your organization.

Example request

mutation ExampleCreateVendorInvoice($input: CreateVendorInvoiceInput!) {
  createVendorInvoice(input: $input) {
    id
    sysId
    type
    caption
    status
    parentId
    rootId
    createdAt
    updatedAt
    revisionNum
    revision
    invoiceOrgVendorId
    invoiceNumber
    invoiceDate
    notes
    matchStatus
  }
}

Variables:

{
  "input": {
    "caption": "Blue jeans",
    "purchaseOrderId": "01900000-0000-7000-8000-54a5b8570000",
    "invoiceNumber": "<invoice number>",
    "invoiceDate": "2027-01-31"
  }
}

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

Example response

{
  "data": {
    "createVendorInvoice": {
      "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": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}

captureVendorInvoice

captureVendorInvoice — mutation · Capture a vendor’s invoice against a purchase — what they billed you.

Example request

mutation ExampleCaptureVendorInvoice($id: ID!, $revision: ID!, $reason: String) {
  captureVendorInvoice(id: $id, revision: $revision, reason: $reason) {
    id
    sysId
    type
    caption
    status
    parentId
    rootId
    createdAt
    updatedAt
    revisionNum
    revision
    invoiceOrgVendorId
    invoiceNumber
    invoiceDate
    notes
    matchStatus
  }
}

Variables:

{
  "id": "01900000-0000-7000-8000-37386ae00000",
  "revision": "01900000-0000-7000-8000-b7960e180000",
  "reason": "Correcting a miscount."
}

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

Example response

{
  "data": {
    "captureVendorInvoice": {
      "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": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}

cancelVendorInvoice

cancelVendorInvoice — mutation · Cancel a vendor’s invoice — what a supplier billed you against a purchase.

Example request

mutation ExampleCancelVendorInvoice($id: ID!, $revision: ID!, $reason: String) {
  cancelVendorInvoice(id: $id, revision: $revision, reason: $reason) {
    id
    sysId
    type
    caption
    status
    parentId
    rootId
    createdAt
    updatedAt
    revisionNum
    revision
    invoiceOrgVendorId
    invoiceNumber
    invoiceDate
    notes
    matchStatus
  }
}

Variables:

{
  "id": "01900000-0000-7000-8000-37386ae00000",
  "revision": "01900000-0000-7000-8000-b7960e180000",
  "reason": "Correcting a miscount."
}

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

Example response

{
  "data": {
    "cancelVendorInvoice": {
      "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": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}