Create an Internal Transfer
Endpoint Overview
This API endpoint provides a detailed overview of the endpoint responsible for creating an internal transfer (a stock move between two companies/warehouses) within the Inventory module of the Juleb ERP. A single call can create one or many internal transfers at once.
Endpoint Details
- Method: POST
- URL:
/api/v1/inventory/picking/internal-transfer
Parameters
- Path Parameters: None
- Query Parameters: None
Request Body
The request body must wrap the transfer (or transfers) to create under a CompanyPicking key
- either a single object, or an array to create several transfers in one call:
{
"CompanyPicking": {
"companyId": integer,
"destCompanyId": integer,
"reason": string,
"note": string,
"origin": string,
"autoValidate": boolean,
"autoCreateBatch": boolean,
"rsd_deserialization": boolean,
"global_import": boolean,
"international_export": boolean,
"lines": [
{
"productId": integer,
"default_code": string,
"productQty": integer,
"batch": string,
"expiry": string
}
]
}
}
Field Reference
Same shared fields as Create a delivery (reason, note,
origin, autoValidate, autoCreateBatch, rsd_deserialization, global_import,
international_export, and the lines[] shape), plus:
| Field | Type | Required | Description |
|---|---|---|---|
companyId | integer | Yes | The company the stock is transferred from. |
destCompanyId | integer | Yes | The company the stock is transferred to. |
Unlike Create a delivery, internal transfers have no partnerId —
destCompanyId is used instead to resolve the destination.
Response
- 201 OK: The requested resource has been created.
- 400 Bad Request: Bad request.
- 401 Unauthorized: Unauthorized.
Response Body
{
"data": {
...record fields
}
}
Example
Request
- NodeJS
- curl
- python
- java
const axios = require('axios');
const accountName = process.env.ACCOUNT_NAME;
const apiKey = process.env.API_KEY;
axios.post(`https://${accountName}.juleb.com/api/v1/inventory/picking/internal-transfer`, {
CompanyPicking: {
companyId: 1,
destCompanyId: 2,
lines: [
{
productId: 34969,
productQty: 80,
batch: "13200001",
expiry: "30-09-2024"
}
]
}
}, {
headers: {
'accept': '*/*',
'Authorization': `TOKEN`,
'Content-Type': 'application/json'
}
})
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error('Error:', error);
});
curl -X POST \
-H "accept: */*" \
-H "Authorization: ******" \
-H "Content-Type: application/json" \
-d '{
"CompanyPicking": {
"companyId": 1,
"destCompanyId": 2,
"lines": [
{
"productId": 34969,
"productQty": 80,
"batch": "13200001",
"expiry": "30-09-2024"
}
]
}
}' \
"https://$ACCOUNT_NAME.juleb.com/api/v1/inventory/picking/internal-transfer"
import os
import requests
account_name = os.getenv('ACCOUNT_NAME')
api_key = os.getenv('API_KEY')
url = f'https://{account_name}.juleb.com/api/v1/inventory/picking/internal-transfer'
headers = {
'accept': '*/*',
'Authorization': f'******',
'Content-Type': 'application/json'
}
data = {
'CompanyPicking': {
'companyId': 1,
'destCompanyId': 2,
'lines': [
{
'productId': 34969,
'productQty': 80,
'batch': '13200001',
'expiry': '30-09-2024'
}
]
}
}
response = requests.post(url, headers=headers, json=data)
if response.status_code == 201:
print(response.json())
else:
print(f'Error: {response.status_code}', response.text)
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.http.HttpResponse.BodyHandlers;
public class Main {
public static void main(String[] args) throws Exception {
String accountName = System.getenv("ACCOUNT_NAME");
String apiKey = System.getenv("API_KEY");
String json = "{"
+ "\"CompanyPicking\": {"
+ "\"companyId\": 1,"
+ "\"destCompanyId\": 2,"
+ "\"lines\": [{"
+ "\"productId\": 34969,"
+ "\"productQty\": 80,"
+ "\"batch\": \"13200001\","
+ "\"expiry\": \"30-09-2024\""
+ "}]"
+ "}"
+ "}";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(new URI("https://" + accountName + ".juleb.com/api/v1/inventory/picking/internal-transfer"))
.header("accept", "*/*")
.header("Authorization", "Bearer " + apiKey)
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(json))
.build();
HttpResponse<String> response = client.send(request, BodyHandlers.ofString());
if (response.statusCode() == 201) {
System.out.println(response.body());
} else {
System.out.println("Error: " + response.statusCode() + ", " + response.body());
}
}
}
Response
{
"data": {
"id": 11002,
"name": "Demo/INT/01395",
"origin": null,
"note": null,
"state": "assigned",
"scheduled_date": "2024-09-03T23:44:21.000Z",
"location_id": 8,
"location_dest_id": 23,
"picking_type_id": 5,
"company_id": 1,
"dest_company_id": 2,
"is_inter_transfer": true
}
}