Stock
Create a stock entry
POST
/
v1
/
stocks
/
entry
Create a stock entry
curl --request POST \
--url https://dev.flextell.ai/api/v1/stocks/entry \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Tenant: <x-tenant>' \
--data '
{
"product_id": 2,
"warehouse_id": 2,
"quantity": 1.0001,
"boxes": 1,
"inner_units": 1,
"base_units": 1,
"notes": "<string>"
}
'import requests
url = "https://dev.flextell.ai/api/v1/stocks/entry"
payload = {
"product_id": 2,
"warehouse_id": 2,
"quantity": 1.0001,
"boxes": 1,
"inner_units": 1,
"base_units": 1,
"notes": "<string>"
}
headers = {
"X-Tenant": "<x-tenant>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Tenant': '<x-tenant>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
product_id: 2,
warehouse_id: 2,
quantity: 1.0001,
boxes: 1,
inner_units: 1,
base_units: 1,
notes: '<string>'
})
};
fetch('https://dev.flextell.ai/api/v1/stocks/entry', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://dev.flextell.ai/api/v1/stocks/entry",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'product_id' => 2,
'warehouse_id' => 2,
'quantity' => 1.0001,
'boxes' => 1,
'inner_units' => 1,
'base_units' => 1,
'notes' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Tenant: <x-tenant>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://dev.flextell.ai/api/v1/stocks/entry"
payload := strings.NewReader("{\n \"product_id\": 2,\n \"warehouse_id\": 2,\n \"quantity\": 1.0001,\n \"boxes\": 1,\n \"inner_units\": 1,\n \"base_units\": 1,\n \"notes\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Tenant", "<x-tenant>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://dev.flextell.ai/api/v1/stocks/entry")
.header("X-Tenant", "<x-tenant>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"product_id\": 2,\n \"warehouse_id\": 2,\n \"quantity\": 1.0001,\n \"boxes\": 1,\n \"inner_units\": 1,\n \"base_units\": 1,\n \"notes\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://dev.flextell.ai/api/v1/stocks/entry")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Tenant"] = '<x-tenant>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"product_id\": 2,\n \"warehouse_id\": 2,\n \"quantity\": 1.0001,\n \"boxes\": 1,\n \"inner_units\": 1,\n \"base_units\": 1,\n \"notes\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": "<string>",
"data": {
"id": 123,
"product": {
"id": 123,
"name": "<string>"
},
"warehouse": {
"id": 123,
"name": "<string>"
},
"type": "<string>",
"direction": "<string>",
"quantity": 123,
"unit_label": "<string>",
"reference": "<string>",
"user": {
"id": 123,
"name": "<string>"
},
"notes": "<string>",
"effective_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}Authorizations
oauth2bearer
The access token received from the authorization server in the OAuth 2.0 flow.
Headers
Tenant identifier. Send the Tenant ID in the X-Tenant header to scope API requests to a specific tenant.
Body
application/json
Filter by product ID.
Required range:
x >= 1Filter by warehouse ID.
Required range:
x >= 1Filter by type.
Available options:
full, partial The quantity value.
Required range:
x >= 0.0001Number of boxes.
Required range:
x >= 0Number of inner units.
Required range:
x >= 0Number of base units.
Required range:
x >= 0Internal notes.
Maximum string length:
65535⌘I
Create a stock entry
curl --request POST \
--url https://dev.flextell.ai/api/v1/stocks/entry \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Tenant: <x-tenant>' \
--data '
{
"product_id": 2,
"warehouse_id": 2,
"quantity": 1.0001,
"boxes": 1,
"inner_units": 1,
"base_units": 1,
"notes": "<string>"
}
'import requests
url = "https://dev.flextell.ai/api/v1/stocks/entry"
payload = {
"product_id": 2,
"warehouse_id": 2,
"quantity": 1.0001,
"boxes": 1,
"inner_units": 1,
"base_units": 1,
"notes": "<string>"
}
headers = {
"X-Tenant": "<x-tenant>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Tenant': '<x-tenant>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
product_id: 2,
warehouse_id: 2,
quantity: 1.0001,
boxes: 1,
inner_units: 1,
base_units: 1,
notes: '<string>'
})
};
fetch('https://dev.flextell.ai/api/v1/stocks/entry', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://dev.flextell.ai/api/v1/stocks/entry",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'product_id' => 2,
'warehouse_id' => 2,
'quantity' => 1.0001,
'boxes' => 1,
'inner_units' => 1,
'base_units' => 1,
'notes' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Tenant: <x-tenant>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://dev.flextell.ai/api/v1/stocks/entry"
payload := strings.NewReader("{\n \"product_id\": 2,\n \"warehouse_id\": 2,\n \"quantity\": 1.0001,\n \"boxes\": 1,\n \"inner_units\": 1,\n \"base_units\": 1,\n \"notes\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Tenant", "<x-tenant>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://dev.flextell.ai/api/v1/stocks/entry")
.header("X-Tenant", "<x-tenant>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"product_id\": 2,\n \"warehouse_id\": 2,\n \"quantity\": 1.0001,\n \"boxes\": 1,\n \"inner_units\": 1,\n \"base_units\": 1,\n \"notes\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://dev.flextell.ai/api/v1/stocks/entry")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Tenant"] = '<x-tenant>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"product_id\": 2,\n \"warehouse_id\": 2,\n \"quantity\": 1.0001,\n \"boxes\": 1,\n \"inner_units\": 1,\n \"base_units\": 1,\n \"notes\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": "<string>",
"data": {
"id": 123,
"product": {
"id": 123,
"name": "<string>"
},
"warehouse": {
"id": 123,
"name": "<string>"
},
"type": "<string>",
"direction": "<string>",
"quantity": 123,
"unit_label": "<string>",
"reference": "<string>",
"user": {
"id": 123,
"name": "<string>"
},
"notes": "<string>",
"effective_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}