Crear Pedidos
curl --request POST \
--url https://api.zenflow.com.ar/api/v1/orders \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"order_tenant_id": "<string>",
"assembly_date": "<string>",
"customer_name": "<string>",
"shipping_address": "<string>",
"order_detail": [
{
"barcode": "<string>",
"quantity": 123,
"price": 123
}
]
}
'import requests
url = "https://api.zenflow.com.ar/api/v1/orders"
payload = {
"order_tenant_id": "<string>",
"assembly_date": "<string>",
"customer_name": "<string>",
"shipping_address": "<string>",
"order_detail": [
{
"barcode": "<string>",
"quantity": 123,
"price": 123
}
]
}
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({
order_tenant_id: '<string>',
assembly_date: '<string>',
customer_name: '<string>',
shipping_address: '<string>',
order_detail: [{barcode: '<string>', quantity: 123, price: 123}]
})
};
fetch('https://api.zenflow.com.ar/api/v1/orders', 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/orders",
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([
'order_tenant_id' => '<string>',
'assembly_date' => '<string>',
'customer_name' => '<string>',
'shipping_address' => '<string>',
'order_detail' => [
[
'barcode' => '<string>',
'quantity' => 123,
'price' => 123
]
]
]),
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/orders"
payload := strings.NewReader("{\n \"order_tenant_id\": \"<string>\",\n \"assembly_date\": \"<string>\",\n \"customer_name\": \"<string>\",\n \"shipping_address\": \"<string>\",\n \"order_detail\": [\n {\n \"barcode\": \"<string>\",\n \"quantity\": 123,\n \"price\": 123\n }\n ]\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/orders")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"order_tenant_id\": \"<string>\",\n \"assembly_date\": \"<string>\",\n \"customer_name\": \"<string>\",\n \"shipping_address\": \"<string>\",\n \"order_detail\": [\n {\n \"barcode\": \"<string>\",\n \"quantity\": 123,\n \"price\": 123\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zenflow.com.ar/api/v1/orders")
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 \"order_tenant_id\": \"<string>\",\n \"assembly_date\": \"<string>\",\n \"customer_name\": \"<string>\",\n \"shipping_address\": \"<string>\",\n \"order_detail\": [\n {\n \"barcode\": \"<string>\",\n \"quantity\": 123,\n \"price\": 123\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"created_count": 123,
"existing_count": 123,
"orders": [
{}
]
}
}Pedidos
Crear Pedidos
Crear uno o múltiples pedidos
POST
/
api
/
v1
/
orders
Crear Pedidos
curl --request POST \
--url https://api.zenflow.com.ar/api/v1/orders \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"order_tenant_id": "<string>",
"assembly_date": "<string>",
"customer_name": "<string>",
"shipping_address": "<string>",
"order_detail": [
{
"barcode": "<string>",
"quantity": 123,
"price": 123
}
]
}
'import requests
url = "https://api.zenflow.com.ar/api/v1/orders"
payload = {
"order_tenant_id": "<string>",
"assembly_date": "<string>",
"customer_name": "<string>",
"shipping_address": "<string>",
"order_detail": [
{
"barcode": "<string>",
"quantity": 123,
"price": 123
}
]
}
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({
order_tenant_id: '<string>',
assembly_date: '<string>',
customer_name: '<string>',
shipping_address: '<string>',
order_detail: [{barcode: '<string>', quantity: 123, price: 123}]
})
};
fetch('https://api.zenflow.com.ar/api/v1/orders', 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/orders",
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([
'order_tenant_id' => '<string>',
'assembly_date' => '<string>',
'customer_name' => '<string>',
'shipping_address' => '<string>',
'order_detail' => [
[
'barcode' => '<string>',
'quantity' => 123,
'price' => 123
]
]
]),
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/orders"
payload := strings.NewReader("{\n \"order_tenant_id\": \"<string>\",\n \"assembly_date\": \"<string>\",\n \"customer_name\": \"<string>\",\n \"shipping_address\": \"<string>\",\n \"order_detail\": [\n {\n \"barcode\": \"<string>\",\n \"quantity\": 123,\n \"price\": 123\n }\n ]\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/orders")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"order_tenant_id\": \"<string>\",\n \"assembly_date\": \"<string>\",\n \"customer_name\": \"<string>\",\n \"shipping_address\": \"<string>\",\n \"order_detail\": [\n {\n \"barcode\": \"<string>\",\n \"quantity\": 123,\n \"price\": 123\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zenflow.com.ar/api/v1/orders")
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 \"order_tenant_id\": \"<string>\",\n \"assembly_date\": \"<string>\",\n \"customer_name\": \"<string>\",\n \"shipping_address\": \"<string>\",\n \"order_detail\": [\n {\n \"barcode\": \"<string>\",\n \"quantity\": 123,\n \"price\": 123\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"created_count": 123,
"existing_count": 123,
"orders": [
{}
]
}
}Crear Pedidos
Crea uno o múltiples pedidos para fulfillment.Requiere scope
write:orders.Solicitud
POST /api/v1/orders
Parámetros del Body
Puedes enviar un pedido individual o un array de pedidos.string
required
Tu identificador único de pedido (usado para idempotencia)
string
required
Fecha en que el pedido debe ser preparado (YYYY-MM-DD)
string
Nombre del cliente
string
Dirección de envío
array
required
Respuesta
boolean
Si la solicitud fue exitosa
object
Ejemplos
Pedido Individual
curl -X POST "https://api.zenflow.com.ar/api/v1/orders" \
-H "X-API-Key: zenflow_live_your_key" \
-H "Content-Type: application/json" \
-d '{
"order_tenant_id": "ORD-001",
"assembly_date": "2024-01-15",
"customer_name": "Juan Pérez",
"shipping_address": "Av. Corrientes 1234, CABA",
"order_detail": [
{
"barcode": "7891234567890",
"quantity": 2,
"price": 29.99
},
{
"barcode": "7891234567891",
"quantity": 1,
"price": 49.99
}
]
}'
const response = await fetch("https://api.zenflow.com.ar/api/v1/orders", {
method: "POST",
headers: {
"X-API-Key": "zenflow_live_your_key",
"Content-Type": "application/json",
},
body: JSON.stringify({
order_tenant_id: "ORD-001",
assembly_date: "2024-01-15",
customer_name: "Juan Pérez",
order_detail: [
{ barcode: "7891234567890", quantity: 2 },
{ barcode: "7891234567891", quantity: 1 },
],
}),
});
import requests
response = requests.post(
'https://api.zenflow.com.ar/api/v1/orders',
headers={
'X-API-Key': 'zenflow_live_your_key',
'Content-Type': 'application/json'
},
json={
'order_tenant_id': 'ORD-001',
'assembly_date': '2024-01-15',
'customer_name': 'Juan Pérez',
'order_detail': [
{'barcode': '7891234567890', 'quantity': 2},
{'barcode': '7891234567891', 'quantity': 1}
]
}
)
Múltiples Pedidos
curl -X POST "https://api.zenflow.com.ar/api/v1/orders" \
-H "X-API-Key: zenflow_live_your_key" \
-H "Content-Type: application/json" \
-d '{
"orders": [
{
"order_tenant_id": "ORD-001",
"assembly_date": "2024-01-15",
"order_detail": [{"barcode": "7891234567890", "quantity": 2}]
},
{
"order_tenant_id": "ORD-002",
"assembly_date": "2024-01-15",
"order_detail": [{"barcode": "7891234567891", "quantity": 1}]
}
]
}'
Respuesta Exitosa
{
"success": true,
"data": {
"created_count": 2,
"existing_count": 0,
"orders": [
{
"id": 12345,
"order_tenant_id": "ORD-001",
"state_id": 1
},
{
"id": 12346,
"order_tenant_id": "ORD-002",
"state_id": 1
}
]
}
}
Respuestas de Error
400 Error de Validación
{
"success": false,
"error": {
"code": "validation_error",
"message": "Datos de pedido inválidos",
"details": [
{
"index": 0,
"error": "assembly_date es requerido"
}
]
}
}
400 Producto No Encontrado
{
"success": false,
"error": {
"code": "creation_error",
"message": "Producto con código de barras 7891234567890 no encontrado"
}
}
⌘I

