Crear Ajuste de Stock
curl --request POST \
--url https://api.zenflow.com.ar/api/v1/stock/adjustment \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"product_id": 123,
"sku": "<string>",
"location_id": "<string>",
"adjustment_quantity": 123,
"reason": "<string>"
}
'import requests
url = "https://api.zenflow.com.ar/api/v1/stock/adjustment"
payload = {
"product_id": 123,
"sku": "<string>",
"location_id": "<string>",
"adjustment_quantity": 123,
"reason": "<string>"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
product_id: 123,
sku: '<string>',
location_id: '<string>',
adjustment_quantity: 123,
reason: '<string>'
})
};
fetch('https://api.zenflow.com.ar/api/v1/stock/adjustment', 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://api.zenflow.com.ar/api/v1/stock/adjustment",
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' => 123,
'sku' => '<string>',
'location_id' => '<string>',
'adjustment_quantity' => 123,
'reason' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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://api.zenflow.com.ar/api/v1/stock/adjustment"
payload := strings.NewReader("{\n \"product_id\": 123,\n \"sku\": \"<string>\",\n \"location_id\": \"<string>\",\n \"adjustment_quantity\": 123,\n \"reason\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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://api.zenflow.com.ar/api/v1/stock/adjustment")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"product_id\": 123,\n \"sku\": \"<string>\",\n \"location_id\": \"<string>\",\n \"adjustment_quantity\": 123,\n \"reason\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zenflow.com.ar/api/v1/stock/adjustment")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"product_id\": 123,\n \"sku\": \"<string>\",\n \"location_id\": \"<string>\",\n \"adjustment_quantity\": 123,\n \"reason\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyStock
Crear Ajuste de Stock
Agregar o remover stock (ajuste relativo)
POST
/
api
/
v1
/
stock
/
adjustment
Crear Ajuste de Stock
curl --request POST \
--url https://api.zenflow.com.ar/api/v1/stock/adjustment \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"product_id": 123,
"sku": "<string>",
"location_id": "<string>",
"adjustment_quantity": 123,
"reason": "<string>"
}
'import requests
url = "https://api.zenflow.com.ar/api/v1/stock/adjustment"
payload = {
"product_id": 123,
"sku": "<string>",
"location_id": "<string>",
"adjustment_quantity": 123,
"reason": "<string>"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
product_id: 123,
sku: '<string>',
location_id: '<string>',
adjustment_quantity: 123,
reason: '<string>'
})
};
fetch('https://api.zenflow.com.ar/api/v1/stock/adjustment', 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://api.zenflow.com.ar/api/v1/stock/adjustment",
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' => 123,
'sku' => '<string>',
'location_id' => '<string>',
'adjustment_quantity' => 123,
'reason' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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://api.zenflow.com.ar/api/v1/stock/adjustment"
payload := strings.NewReader("{\n \"product_id\": 123,\n \"sku\": \"<string>\",\n \"location_id\": \"<string>\",\n \"adjustment_quantity\": 123,\n \"reason\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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://api.zenflow.com.ar/api/v1/stock/adjustment")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"product_id\": 123,\n \"sku\": \"<string>\",\n \"location_id\": \"<string>\",\n \"adjustment_quantity\": 123,\n \"reason\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zenflow.com.ar/api/v1/stock/adjustment")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"product_id\": 123,\n \"sku\": \"<string>\",\n \"location_id\": \"<string>\",\n \"adjustment_quantity\": 123,\n \"reason\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyCrear Ajuste de Stock
Crea un ajuste de stock agregando o removiendo una cantidad.Requiere scope
write:stock.Solicitud
POST /api/v1/stock/adjustment
Parámetros del Body
integer
ID del producto (o usar sku)
string
SKU del producto (alternativa a product_id)
string
required
ID de la ubicación
number
required
Cantidad a agregar (positivo) o remover (negativo)
string
Razón del ajuste
Ejemplos
Agregar Stock
curl -X POST "https://api.zenflow.com.ar/api/v1/stock/adjustment" \
-H "X-API-Key: zenflow_live_your_key" \
-H "Content-Type: application/json" \
-d '{
"product_id": 100,
"location_id": "LOC-A1",
"adjustment_quantity": 25,
"reason": "Recibido de proveedor"
}'
Respuesta
{
"success": true,
"data": {
"type": "addition",
"quantity_adjusted": 25,
"stock": {
"product_id": 100,
"location_id": "LOC-A1",
"previous_quantity": 50,
"new_quantity": 75
}
}
}
Remover Stock
curl -X POST "https://api.zenflow.com.ar/api/v1/stock/adjustment" \
-H "X-API-Key: zenflow_live_your_key" \
-H "Content-Type: application/json" \
-d '{
"sku": "SKU-001",
"location_id": "LOC-A1",
"adjustment_quantity": -10,
"reason": "Items dañados removidos"
}'
Respuesta
{
"success": true,
"data": {
"type": "removal",
"quantity_adjusted": -10,
"stock": {
"product_id": 100,
"location_id": "LOC-A1",
"previous_quantity": 75,
"new_quantity": 65
}
}
}
Respuestas de Error
400 Cantidad Cero
{
"success": false,
"error": {
"code": "validation_error",
"message": "adjustment_quantity no puede ser cero"
}
}
400 Stock Insuficiente
{
"success": false,
"error": {
"code": "adjustment_error",
"message": "Stock insuficiente. Disponible: 5, Solicitado: 10"
}
}
404 Producto No Encontrado
{
"success": false,
"error": {
"code": "not_found",
"message": "Producto no encontrado"
}
}
⌘I

