# Ask another location for stock

Raise the request, submit it to the sending location, let them accept — reserving the stock and starting the transfer — or decline it; open a regular lane between two locations that move stock often.

Warehouse · a play in 3 steps.

## The steps

1. Raise the request and submit it — the pull request reaches the sending location. — [createTransferRequest](/reference/inventory-operations/createTransferRequest/), [submitTransferRequest](/reference/inventory-operations/submitTransferRequest/)
2. The sender accepts — the stock reserves and the transfer paperwork starts — or declines. — [acceptTransferRequest](/reference/inventory-operations/acceptTransferRequest/), [rejectTransferRequest](/reference/inventory-operations/rejectTransferRequest/)
3. Open a regular lane — a named sender-to-receiver route — and see which lanes serve a move best. — [createTransferLane](/reference/transfer-lane/createTransferLane/), [transferLaneRanking](/reference/reading-your-records/transferLaneRanking/)

## The calls

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

### createTransferRequest

[createTransferRequest](/reference/inventory-operations/createTransferRequest/) — mutation · Create a new stock-transfer request between your locations at your organization.

**Example request**

```graphql
mutation ExampleCreateTransferRequest($input: CreateTransferRequestInput!) {
  createTransferRequest(input: $input) {
    id
    sysId
    type
    caption
    status
    parentId
    rootId
    createdAt
    updatedAt
    revisionNum
    revision
    requestingOrganizationId
    targetLogicalFacilityId
    neededBy
    priority
  }
}
```

Variables:

```json
{
  "input": {
    "caption": "Blue jeans",
    "requestingLogicalFacilityId": "01900000-0000-7000-8000-9b4a35b10000",
    "lines": [
      {
        "variantId": "01900000-0000-7000-8000-8415e73b0000",
        "quantity": "2",
        "orderLineRef": {
          "orderId": "01900000-0000-7000-8000-f6d8263a0000",
          "orderLineNo": 1
        }
      }
    ]
  }
}
```

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

**Example response**

```json
{
  "data": {
    "createTransferRequest": {
      "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
        }
      }
    }
  }
}
```

### submitTransferRequest

[submitTransferRequest](/reference/inventory-operations/submitTransferRequest/) — mutation · Ask another of your locations for stock — the pull request.

**Example request**

```graphql
mutation ExampleSubmitTransferRequest($id: ID!, $revision: ID!, $reason: String) {
  submitTransferRequest(id: $id, revision: $revision, reason: $reason) {
    id
    sysId
    type
    caption
    status
    parentId
    rootId
    createdAt
    updatedAt
    revisionNum
    revision
    requestingOrganizationId
    targetLogicalFacilityId
    neededBy
    priority
  }
}
```

Variables:

```json
{
  "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**

```json
{
  "data": {
    "submitTransferRequest": {
      "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
        }
      }
    }
  }
}
```

### acceptTransferRequest

[acceptTransferRequest](/reference/inventory-operations/acceptTransferRequest/) — mutation · Approve another location’s request to move stock — the sending side saying “yes, take it”.

**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-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**

```json
{
  "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
        }
      }
    }
  }
}
```

### rejectTransferRequest

[rejectTransferRequest](/reference/inventory-operations/rejectTransferRequest/) — mutation · Decline another location’s stock request.

**Example request**

```graphql
mutation ExampleRejectTransferRequest($input: RejectTransferRequestInput!, $revision: ID!, $reason: String) {
  rejectTransferRequest(input: $input, revision: $revision, reason: $reason) {
    id
    sysId
    type
    caption
    status
    parentId
    rootId
    createdAt
    updatedAt
    revisionNum
    revision
    requestingOrganizationId
    targetLogicalFacilityId
    neededBy
    priority
  }
}
```

Variables:

```json
{
  "input": {
    "transferRequestId": "01900000-0000-7000-8000-7d4929a60000",
    "sourceLogicalFacilityId": "01900000-0000-7000-8000-4971feb30000",
    "lines": [
      {
        "lineNo": 1,
        "reason": "Correcting a miscount."
      }
    ]
  },
  "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": {
    "rejectTransferRequest": {
      "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
        }
      }
    }
  }
}
```

### createTransferLane

[createTransferLane](/reference/transfer-lane/createTransferLane/) — mutation · Create a new transfer lane — a named sender→receiver route stock moves along at your organization.

**Example request**

```graphql
mutation ExampleCreateTransferLane($input: NewTransferLaneInput!) {
  createTransferLane(input: $input) {
    id
    sysId
    type
    caption
    status
    parentId
    rootId
    createdAt
    updatedAt
    revisionNum
    revision
    sourceLfId
    destinationLfId
    mode
    rank
    typicalLeadTimeDays
    weightClass
  }
}
```

Variables:

```json
{
  "input": {
    "caption": "Blue jeans",
    "sourceLfId": "01900000-0000-7000-8000-366bfb930000",
    "destinationLfId": "01900000-0000-7000-8000-7bd4ce680000",
    "mode": "never"
  }
}
```

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

**Example response**

```json
{
  "data": {
    "createTransferLane": {
      "id": "01900000-0000-7000-8000-37386ae00000",
      "sysId": "TL-EXMP-0000-000F",
      "type": "TransferLane",
      "caption": "Blue jeans",
      "status": "active",
      "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",
      "sourceLfId": "01900000-0000-7000-8000-366bfb930000",
      "destinationLfId": "01900000-0000-7000-8000-7bd4ce680000",
      "mode": "never",
      "rank": 1,
      "typicalLeadTimeDays": 1,
      "weightClass": "light"
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}
```

### transferLaneRanking

[transferLaneRanking](/reference/reading-your-records/transferLaneRanking/) — query · Which transfer lanes (location pairs) serve a move best, ranked.

**Example request**

```graphql
query ExampleTransferLaneRanking($destinationLogicalFacilityId: ID!) {
  transferLaneRanking(destinationLogicalFacilityId: $destinationLogicalFacilityId) {
    destinationLfId
    sourceLfId
    basis
    rank
    laneId
    weightClass
    distanceKm
    samePfl
    noGeo
    position
  }
}
```

Variables:

```json
{
  "destinationLogicalFacilityId": "01900000-0000-7000-8000-3885245e0000"
}
```

**Example response**

```json
{
  "data": {
    "transferLaneRanking": [
      {
        "destinationLfId": "01900000-0000-7000-8000-7bd4ce680000",
        "sourceLfId": "01900000-0000-7000-8000-366bfb930000",
        "basis": "<basis>",
        "rank": 1,
        "laneId": "01900000-0000-7000-8000-15be5b420000",
        "weightClass": "light",
        "distanceKm": 1.5,
        "samePfl": true,
        "noGeo": true,
        "position": 1
      }
    ]
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": null,
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}
```
