Create an Internal Transfer
Endpoint Overview
This API endpoint provides a detailed overview of the endpoint responsible for creating an internal transfer within the Inventory module of the Juleb ERP.
Endpoint Details
- Method: POST
- URL:
/api/v1/inventory/picking/internal-transfer
Parameters
- Path Parameters: None
- Query Parameters: None
{
"companyId": integer,
"lines": [
{
"productId": integer,
"productQty": integer,
"batch": string,
"expiry": string
}
],
"destCompanyId": integer
}
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`, {
companyId: 1,
lines: [
{
productId: 34969,
productQty: 80,
batch: "13200001",
expiry: "30-09-2024"
}
],
destCompanyId: 2
}, {
headers: {
'accept': '*/*',
'Authorization': `Bearer ${apiKey}`,
'Content-Type': 'application/json'
}
})
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error('Error:', error);
});
curl -X POST \
-H "accept: */*" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"companyId": 1,
"lines": [
{
"productId": 34969,
"productQty": 80,
"batch": "13200001",
"expiry": "30-09-2024"
}
],
"destCompanyId": 2
}' \
"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'Bearer {api_key}',
'Content-Type': 'application/json'
}
data = {
companyId: 1,
lines: [
{
productId: 34969,
productQty: 80,
batch: "13200001",
expiry: "30-09-2024"
}
],
destCompanyId: 2
}
response = requests.post(url, headers=headers, json=data)
if response.status_code == 200:
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;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.Files;
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 = "{\n" +
" \"companyId\": 1,\n" +
" \"lines\": [\n" +
" {\n" +
" \"productId\": 34969,\n" +
" \"productQty\": 80,\n" +
" \"batch\": \"13200001\",\n" +
" \"expiry\": \"30-09-2024\"\n" +
" }\n" +
" ],\n" +
" \"destCompanyId\": 2\n" +
"}";
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() == 200) {
System.out.println(response.body());
} else {
System.out.println("Error: " + response.statusCode() + ", " + response.body());
}
}
}
Response
{
"data": {
"id": 11002,
"message_main_attachment_id": null,
"name": "Demo/INT/01395",
"origin": null,
"note": null,
"backorder_id": null,
"move_type": "direct",
"state": "assigned",
"group_id": null,
"priority": "1",
"scheduled_date": "2024-09-03T23:44:21.000Z",
"date": "2024-09-03T23:44:21.000Z",
"date_done": null,
"location_id": 8,
"location_dest_id": 23,
"picking_type_id": 5,
"partner_id": null,
"company_id": 1,
"user_id": 2,
"owner_id": null,
"printed": null,
"is_locked": true,
"immediate_transfer": false,
"create_uid": 2,
"create_date": "2024-09-03T23:44:21.877Z",
"write_uid": 2,
"write_date": "2024-09-03T23:44:21.877Z",
"sale_id": null,
"is_return": false,
"is_inter_transfer": null,
"is_inter_receive": null,
"dest_company_id": 2,
"source_company_id": null,
"origin_picking_id": null,
"transfer_request_id": null,
"request_accepted": null,
"waiting_picking": null,
"destination_company_id": null,
"scrap_moved": null,
"return_from_po": null,
"stock_return": null,
"made_return": null,
"receive_products": false,
"rsd_notification_id": null,
"notify_en": null,
"notify_ar": null,
"from_pos": false,
"code": null,
"explanation": null,
"lead_time": -1,
"internal_transfer_type": "outgoing",
"po_internal_count": 0,
"comment": null,
"currency_id": 153,
"related_internal_transfer_state": "none",
"is_reverse_transfer": null,
"reversed_from": null,
"reversed_trust_qty": "incoming",
"reversed_reason": null,
"return_order_id": null,
"driver_user_id": null,
"return_sale_id": null,
"mongo_cases": null,
"mongo_pallets": null,
"receipt_sale_id": null,
"access_token": null,
"calculate_vat_bonus_qty": false,
"reason": null,
"show_form_header": null,
"global_import": null,
"scanned_packages": null,
"vendor_bill_count": null,
"purchase_order_reference": null,
"amount_total_cost_price": 988.8,
"amount_total_sale_price": 920,
"pricelist_id": null,
"partner_ref": null,
"start_auto_matching": null,
"amount_after_discount": 1977.6,
"apply_discount": null,
"global_discount_type": null,
"discount_value": null,
"discount_account": null,
"custom_amount_after_discount": 1977.6,
"rsd_deserialization": true,
"tatmeen_permit_number": null,
"international_export": null
}
}