Odoo Integration

Send transactional events from your Odoo instance.

POST /v1/odoo/events

Odoo source variant — identical to /v1/events but auto-tags every event with source: "odoo".

POSThttps://api.nonito.xyz/v1/odoo/events

Identical to /v1/events, but automatically injects "source": "odoo" into each event's properties. Use this endpoint when sending events from your Odoo integration.

Request Body

Same format as /v1/events:

json
{
  "batch": [
    {
      "event_id": "string (required)",
      "user_id": "string (required — E.164 phone)",
      "event_name": "string (required — allowed event type)",
      "timestamp": "string (optional — ISO 8601)",
      "properties": { /* validated against schema */ }
    }
  ]
}

Response (202 Accepted)

json
{
  "status": "queued",
  "request_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "message": "Successfully queued 1 events."
}

Error Responses

202Accepted — Batch validated and queued for ingestion
400Bad Request — Invalid Content-Type, Invalid Payload, or Validation Failed
401Unauthorized — Missing or invalid API key
500Internal Error — Database connection or ingestion failure

Allowed Event Types

Each event type maps to a specific Pydantic validation schema for the properties object.

Event NameDescription
order_createdA new order was placed
order_updatedAn existing order was modified
order_cancelledAn order was cancelled
order_packedAn order was packed for shipping
order_dispatchedAn order was dispatched
order_deliveredAn order was delivered
customer_createdA new customer was registered
customer_updatedCustomer info was updated

Validation Schemas

Each event type's properties object is validated against these Pydantic models. Invalid properties return a 400 with detailed per-field errors.

order_created

FieldTypeDescription
order_id RequiredstringUnique order identifier
channel Requiredstring"online" or "store"
financials RequiredFinancialsPayment and pricing details
branch ConditionalBranchInfoRequired when channel is "store"
customer RequiredCustomerInfoCustomer details
items RequiredOrderItem[]List of line items
note OptionalstringOrder note

order_updated

FieldTypeDescription
order_id RequiredstringOrder identifier
status RequiredstringNew order status
updated_at OptionalstringISO 8601 timestamp
note OptionalstringUpdate note
financials OptionalFinancialsUpdated financials
items OptionalOrderItem[]Updated line items
customer OptionalCustomerInfoUpdated customer info
branch OptionalBranchInfoUpdated branch info

order_cancelled

FieldTypeDescription
order_id RequiredstringOrder identifier
reason RequiredstringCancellation reason
refunded_amount OptionalfloatAmount refunded (default 0.0)
reference_number OptionalstringRefund transaction ID

order_packed / order_dispatched

FieldTypeDescription
order_id RequiredstringOrder identifier
delivery_company RequiredstringShipping carrier
tracking_number RequiredstringTracking number
tracking_link OptionalstringTracking URL
note OptionalstringPacking/dispatch note

order_delivered

FieldTypeDescription
order_id RequiredstringOrder identifier
delivery_company RequiredstringShipping carrier (e.g., Bosta, Aramex)
tracking_number RequiredstringTracking number
tracking_link OptionalstringTracking URL
delivery_agent OptionalstringDelivery agent name
received_by OptionalstringPerson who received the order

customer_created / customer_updated

FieldTypeDescription
first_name RequiredstringCustomer first name
last_name RequiredstringCustomer last name
email OptionalstringCustomer email
phone RequiredstringCustomer phone (E.164)
marketing_consent OptionalbooleanMarketing opt-in (default false)

Validation Error Format

json
{
  "error": "Validation Failed",
  "message": "One or more events in the batch are invalid.",
  "details": [
    {
      "index": 0,
      "errors": [
        "Missing required field: 'order_id'",
        "financials.total_price: field required"
      ]
    }
  ]
}

Nested Models

Shared data models referenced by the validation schemas above.

Financials

FieldTypeDefaultDescription
subtotal RequiredfloatPre-discount subtotal
total_discounts Optionalfloat0.0Total discounts applied
total_tax Optionalfloat0.0Total tax
total_price RequiredfloatFinal price
currency Optionalstring"EGP"Currency code
payment_method Requiredstringe.g., cash, visa, wallet
promo_codes Optionalstring[]Coupons applied

BranchInfo

FieldTypeDescription
branch_id RequiredstringBranch identifier
name RequiredstringBranch name
location OptionalstringPhysical address or coordinates
city OptionalstringCity / Governorate
phone OptionalstringBranch contact number

CustomerInfo

FieldTypeDescription
first_name RequiredstringFirst name
last_name RequiredstringLast name
email OptionalstringEmail address
phone RequiredstringPhone number

OrderItem

FieldTypeDefaultDescription
product_id RequiredstringProduct identifier / SKU
name RequiredstringProduct name
quantity RequiredintegerQuantity ordered
unit_price RequiredfloatPrice per unit
total_discount Optionalfloat0.0Discount on this item
total_tax Optionalfloat0.0Tax on this item
total_price RequiredfloatFinal line item price
category OptionalCategoryInfoProduct category

CategoryInfo

FieldTypeDescription
id RequiredstringCategory identifier
name RequiredstringCategory name

Code Examples

Send an order_created event from Odoo with automatic source tagging.

curl -X POST https://api.nonito.xyz/v1/odoo/events \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer your-api-key" \
  -d '{
    "batch": [{
      "event_id": "ord_001",
      "user_id": "+201234567890",
      "event_name": "order_created",
      "timestamp": "2025-01-15T10:30:00Z",
      "properties": {
        "order_id": "ORD-1001",
        "channel": "online",
        "financials": {
          "subtotal": 250.0,
          "total_discounts": 25.0,
          "total_tax": 31.5,
          "total_price": 256.5,
          "currency": "EGP",
          "payment_method": "visa"
        },
        "customer": {
          "first_name": "Ahmed",
          "last_name": "Hassan",
          "phone": "+201234567890"
        },
        "items": [{
          "product_id": "SKU-100",
          "name": "Classic T-Shirt",
          "quantity": 2,
          "unit_price": 125.0,
          "total_price": 250.0
        }]
      }
    }]
  }'