Skip to main content
POST
https://api.zenflow.com.ar
/
api
/
v1
/
orders
Create Orders
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
    }
  ]
}
'
{
  "success": true,
  "data": {
    "created_count": 123,
    "existing_count": 123,
    "orders": [
      {}
    ]
  }
}

Create Orders

Create one or multiple orders for fulfillment.
Requires write:orders scope.

Request

POST /api/v1/orders

Body Parameters

You can send a single order or an array of orders.
order_tenant_id
string
required
Your unique order identifier (used for idempotency)
assembly_date
string
required
Date when the order should be fulfilled (YYYY-MM-DD)
customer_name
string
Customer name
shipping_address
string
Shipping address
order_detail
array
required
Array of order line items

Response

success
boolean
Whether the request was successful
data
object

Examples

Single Order

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": "John Doe",
    "shipping_address": "123 Main St, City",
    "order_detail": [
      {
        "barcode": "7891234567890",
        "quantity": 2,
        "price": 29.99
      },
      {
        "barcode": "7891234567891",
        "quantity": 1,
        "price": 49.99
      }
    ]
  }'

Multiple Orders

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}]
      }
    ]
  }'

Success Response

{
  "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
      }
    ]
  }
}

Error Responses

400 Validation Error

{
  "success": false,
  "error": {
    "code": "validation_error",
    "message": "Invalid order data",
    "details": [
      {
        "index": 0,
        "error": "assembly_date is required"
      }
    ]
  }
}

400 Product Not Found

{
  "success": false,
  "error": {
    "code": "creation_error",
    "message": "Product with barcode 7891234567890 not found"
  }
}