---
title: "Transfer between locations | Docs | Inventory by R&D Copilot"
description: "Move stock from one location to another as two linked movements, from what is available at the source."
canonical: "https://inventory.rdcopilot.com/docs/guides/transfer-between-locations/"
language: en
updated: 2026-11-22
---

# Transfer between locations

Move stock from one location to another as two linked movements, from what is available at the source.

A transfer takes stock out of one location and puts it into another in one step. It is for locations of one company; stock does not move between companies.

## Send a transfer

A line names the item, the two locations and the quantity, with the revision of each balance: `fromExpectedRevision` and `toExpectedRevision`. The source and the destination must differ.

curl

```bash
curl -X POST "$RDC_BASE_URL/inventory/v1/transfers" \
  -H "Authorization: Bearer $RDC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "operationId": "bcd30db5-25d9-4143-b54f-c253778d63c4",
  "customerOrgId": "690fa0e3-547f-4f93-96b7-824475cc3d7c",
  "legalCompanyId": "d84ba982-ca9a-4e91-9566-21bd23f7227b",
  "occurredAt": "2026-11-23T07:33:00Z",
  "source": {
    "service": "erp",
    "documentId": "2bd25099-3b4b-4a8a-9f3a-beb62ca79072",
    "documentType": "stock-transfer",
    "documentRevision": 1
  },
  "actor": {
    "serviceId": "brumar-erp",
    "userId": "376a64f7-268a-4f79-808e-0d89162055ac"
  },
  "lines": [
    {
      "productId": "109ebad9-6627-4ac3-817e-f81ad628676b",
      "fromLocationId": "b006344d-2fae-4970-bb6f-c32877084b4f",
      "toLocationId": "b1d64d52-293e-4057-b4c8-123609bc9a38",
      "quantity": "20",
      "fromExpectedRevision": 4,
      "toExpectedRevision": 4
    }
  ]
}'
```

JavaScript

```javascript
const response = await fetch(`${process.env.RDC_BASE_URL}/inventory/v1/transfers`, {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.RDC_TOKEN}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "operationId": "bcd30db5-25d9-4143-b54f-c253778d63c4",
    "customerOrgId": "690fa0e3-547f-4f93-96b7-824475cc3d7c",
    "legalCompanyId": "d84ba982-ca9a-4e91-9566-21bd23f7227b",
    "occurredAt": "2026-11-23T07:33:00Z",
    "source": {
      "service": "erp",
      "documentId": "2bd25099-3b4b-4a8a-9f3a-beb62ca79072",
      "documentType": "stock-transfer",
      "documentRevision": 1
    },
    "actor": {
      "serviceId": "brumar-erp",
      "userId": "376a64f7-268a-4f79-808e-0d89162055ac"
    },
    "lines": [
      {
        "productId": "109ebad9-6627-4ac3-817e-f81ad628676b",
        "fromLocationId": "b006344d-2fae-4970-bb6f-c32877084b4f",
        "toLocationId": "b1d64d52-293e-4057-b4c8-123609bc9a38",
        "quantity": "20",
        "fromExpectedRevision": 4,
        "toExpectedRevision": 4
      }
    ]
  }),
});
const result = await response.json();
```

Python

```python
import os
import requests

response = requests.request(
    'POST',
    f'{os.environ["RDC_BASE_URL"]}/inventory/v1/transfers',
    headers={
        'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
    },
    json={
        'operationId': 'bcd30db5-25d9-4143-b54f-c253778d63c4',
        'customerOrgId': '690fa0e3-547f-4f93-96b7-824475cc3d7c',
        'legalCompanyId': 'd84ba982-ca9a-4e91-9566-21bd23f7227b',
        'occurredAt': '2026-11-23T07:33:00Z',
        'source': {
            'service': 'erp',
            'documentId': '2bd25099-3b4b-4a8a-9f3a-beb62ca79072',
            'documentType': 'stock-transfer',
            'documentRevision': 1,
        },
        'actor': {
            'serviceId': 'brumar-erp',
            'userId': '376a64f7-268a-4f79-808e-0d89162055ac',
        },
        'lines': [
            {
                'productId': '109ebad9-6627-4ac3-817e-f81ad628676b',
                'fromLocationId': 'b006344d-2fae-4970-bb6f-c32877084b4f',
                'toLocationId': 'b1d64d52-293e-4057-b4c8-123609bc9a38',
                'quantity': '20',
                'fromExpectedRevision': 4,
                'toExpectedRevision': 4,
            },
        ],
    },
)
result = response.json()
```

PHP

```php
<?php

$body = <<<'JSON'
{
  "operationId": "bcd30db5-25d9-4143-b54f-c253778d63c4",
  "customerOrgId": "690fa0e3-547f-4f93-96b7-824475cc3d7c",
  "legalCompanyId": "d84ba982-ca9a-4e91-9566-21bd23f7227b",
  "occurredAt": "2026-11-23T07:33:00Z",
  "source": {
    "service": "erp",
    "documentId": "2bd25099-3b4b-4a8a-9f3a-beb62ca79072",
    "documentType": "stock-transfer",
    "documentRevision": 1
  },
  "actor": {
    "serviceId": "brumar-erp",
    "userId": "376a64f7-268a-4f79-808e-0d89162055ac"
  },
  "lines": [
    {
      "productId": "109ebad9-6627-4ac3-817e-f81ad628676b",
      "fromLocationId": "b006344d-2fae-4970-bb6f-c32877084b4f",
      "toLocationId": "b1d64d52-293e-4057-b4c8-123609bc9a38",
      "quantity": "20",
      "fromExpectedRevision": 4,
      "toExpectedRevision": 4
    }
  ]
}
JSON;

$curl = curl_init(getenv('RDC_BASE_URL') . '/inventory/v1/transfers');
curl_setopt_array($curl, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('RDC_TOKEN'),
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => $body,
]);
$result = json_decode(curl_exec($curl), true);
curl_close($curl);
```

C#

```csharp
using System.Net.Http.Headers;

var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/inventory/v1/transfers");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
request.Content = new StringContent("""
{
  "operationId": "bcd30db5-25d9-4143-b54f-c253778d63c4",
  "customerOrgId": "690fa0e3-547f-4f93-96b7-824475cc3d7c",
  "legalCompanyId": "d84ba982-ca9a-4e91-9566-21bd23f7227b",
  "occurredAt": "2026-11-23T07:33:00Z",
  "source": {
    "service": "erp",
    "documentId": "2bd25099-3b4b-4a8a-9f3a-beb62ca79072",
    "documentType": "stock-transfer",
    "documentRevision": 1
  },
  "actor": {
    "serviceId": "brumar-erp",
    "userId": "376a64f7-268a-4f79-808e-0d89162055ac"
  },
  "lines": [
    {
      "productId": "109ebad9-6627-4ac3-817e-f81ad628676b",
      "fromLocationId": "b006344d-2fae-4970-bb6f-c32877084b4f",
      "toLocationId": "b1d64d52-293e-4057-b4c8-123609bc9a38",
      "quantity": "20",
      "fromExpectedRevision": 4,
      "toExpectedRevision": 4
    }
  ]
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync();
```

Response 202

```json
{
  "operationId": "bcd30db5-25d9-4143-b54f-c253778d63c4",
  "status": "completed",
  "aggregateRevision": 5,
  "movementIds": [
    "6c5e91a6-ee64-4652-8768-44120551279d",
    "cec159cc-3aa3-498f-ae0a-efdb5d0cfe49"
  ]
}
```

## Two movements, one group

Each line records two movements: the source first, with a negative `onHandDelta`, then the destination. Both carry the same `transferGroupId`. Read them from the stock card of the item.

## Refusals

| Status | Code | Why |
| --- | --- | --- |
| `422` | `insufficient_available_stock` | The quantity is not available at the source. Stock that is reserved cannot be moved. |
| `409` | `revision_conflict` | Either balance moved since you read it. |
| `400` | `invalid_request` | The two locations are the same, or the same item and location appear twice in the command. |
| `403` | `forbidden` | A location is not set up for the company, or the token does not cover it. |

## Undo a transfer

A transfer is reversed with both of its movements in one reversal command, each line with the revision of its own balance. Naming only one is refused with a 422 and `transfer_reversal_needs_both_movements`. The reversal is refused if the stock has since left the destination.
