AlmondTill/G3N API

On this page

acceptTransferRequest

mutation · in the family Inventory operations

What it does

Approve another location’s request to move stock — the sending side saying “yes, take it”.

ACCEPT lines of an OPEN TransferRequest: ONE TransactWriteItems births ONE linked Transfer at ready (create+submit fusion — the claims reserve the source stock, holding the accepting-reserves law; a LIGHT pair births completed, posting BOTH legs immediately) + the request allocation-rollup rewrite LAST under the request OCC (the doc IS the allocation serializer — raced accepts are retryable CONFLICT/REVISION_STALE). The full.1 birth gates ride (source LF ACTIVE +!= requesting; per line the source II [variant x source LF] ACTIVE + STOCKED + junction-EXISTING; available >= q or CONFLICT/INSUFFICIENT_STOCK at location facility); a foreign source on a TARGETED request refuses NAMED; cumulative over-allocation refuses CONFLICT/DISCREPANCY {lineNo, outstanding, supplied}. Returns BOTH documents (TR-p). Requires the doc CURRENT revision (OCC) + the unrestricted capability.

What happens

Reserves the stock at the sending location and starts the transfer paperwork.

Careful

Reserved stock stops being sellable at the sender until the transfer completes or is cancelled.

Who may call it

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

Arguments

NameTypeRequiredNotes
inputAcceptTransferRequestInput AcceptTransferRequestInput!yesNo further notes.
revisionID ID!yesThe revision id you read on the record; the change is refused if an edit landed in the meantime.
reasonStringnoNo further notes.

Returns

AcceptTransferRequestResult AcceptTransferRequestResult! — The acceptTransferRequest result: BOTH touched documents.

Example request

mutation ExampleAcceptTransferRequest($input: AcceptTransferRequestInput!, $revision: ID!, $reason: String) {
  acceptTransferRequest(input: $input, revision: $revision, reason: $reason) {
    transferRequest {
      id
      sysId
      type
      caption
      status
      parentId
      rootId
      createdAt
      updatedAt
      revisionNum
      revision
      requestingOrganizationId
      targetLogicalFacilityId
      neededBy
      priority
    }
  }
}

Variables:

{
  "input": {
    "transferRequestId": "01900000-0000-7000-8000-7d4929a60000",
    "sourceLogicalFacilityId": "01900000-0000-7000-8000-4971feb30000",
    "caption": "Blue jeans",
    "lines": [
      {
        "lineNo": 1,
        "quantity": "2"
      }
    ]
  },
  "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": {
    "acceptTransferRequest": {
      "transferRequest": {
        "id": "01900000-0000-7000-8000-37386ae00000",
        "sysId": "TR-EXMP-0000-000F",
        "type": "TransferRequest",
        "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",
        "requestingOrganizationId": "01900000-0000-7000-8000-93bd40d40000",
        "targetLogicalFacilityId": "01900000-0000-7000-8000-2938ce830000",
        "neededBy": "<needed by>",
        "priority": "low"
      }
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}

Errors this call can answer

Used in