AlmondTill/G3N API

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”.

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 + the unrestricted capability.

Before you call

A bearer session from an API key (see Authentication and key hygiene) or a signed-in user.

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

Roles that may call it:

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.

Arguments

NameTypeRequiredNotes
inputAcceptTransferRequestInput AcceptTransferRequestInput!yesAccept-input for acceptTransferRequest: ONE acceptance = ONE linked Transfer born ready at the accepting source (a light pair births completed — the whole movement in the accept transaction).
revisionID ID!yesThe revision id you read on the record; the change is refused if an edit landed in the meantime.
reasonStringno

Concurrency

Send the record’s current revision from your last read as revision. A stale revision is refused as CONFLICT/REVISION_STALE — read the record again and retry with the new value.

Returns

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

Example request

graphql
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:

json
{
  "input": {
    "transferRequestId": "01900000-0000-7000-8000-735fcc6b0000",
    "sourceLogicalFacilityId": "01900000-0000-7000-8000-280b436e0000",
    "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

json
{
  "data": {
    "acceptTransferRequest": {
      "transferRequest": {
        "id": "01900000-0000-7000-8000-735fcc6b0000",
        "sysId": "TR-EXMP-0000-000F",
        "type": "TransferRequest",
        "caption": "Blue jeans",
        "status": "draft",
        "parentId": "01900000-0000-7000-8000-10c08c590000",
        "rootId": "01900000-0000-7000-8000-a1295a650000",
        "createdAt": "2027-01-31T00:00:00.000Z",
        "updatedAt": "2027-01-31T00:00:00.000Z",
        "revisionNum": 1,
        "revision": "01900000-0000-7000-8000-53c6eea90000",
        "requestingOrganizationId": "01900000-0000-7000-8000-fb3068010000",
        "targetLogicalFacilityId": "01900000-0000-7000-8000-9cda417e0000",
        "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