Create inventory order

POST /api/v1/purchase-orders

Create a new purchase order for inventory restocking.

Operation ID: create_order_api_v1_purchase_orders_post · View as markdown · OpenAPI slice

Authentication

Bearer token authentication. Pass your DayZero API token in the Authorization header and the target business UUID in x-business-id.

Request body

vendor_id string required

Vendor UUID.

status string required

Order status (draft, submitted, confirmed, received, cancelled).

name string required

Order name/title.

po_number string required

Purchase order number.

line_items array · LineItem

Products being ordered.

fees array · Fee

Additional fees (shipping, handling, etc.).

payments array · Payment-Input

Payments made on this order.

description string

Order notes.

total integer

Total order amount in cents (calculated if not provided).

balance integer

Remaining balance in cents (total minus payments).

shipping_cost integer

Freight/shipping cost in cents.

ship_from_location_id string

Source location; defaults to vendor.default_location_id.

ship_to_location_id string

Destination location.

production_run_id string

Linked production run (for copacker orders).

expected_delivery_date string · date-time

Expected delivery date (ISO 8601).

payment_term_id string

Payment term ID for net terms (defaults to vendor's).

expected_paid_on string · date-time

Expected payment date (ISO 8601). Auto-calculated from delivery + net terms if not provided.

Responses

201 Successful Response

id string required

Order UUID.

vendor_id string required

Vendor UUID.

vendor_name string

Vendor name (resolved).

vendor_email string

Vendor email (resolved).

status string required

Order status.

name string required

Order name.

business_id string

Business UUID.

po_number string required

Purchase order number.

line_items array · object required

Order line items.

fees array · Fee requiredFee

Additional fees.

3 fields
name string

Fee name (e.g., 'Shipping', 'Handling').

description string

Fee description (alternative to name).

amount integer required

Fee amount in cents.

payments array · Payment-Output requiredPayment-Output

Payment records.

6 fields
id string

Payment UUID.

paid_on string · date-time

Payment date.

date string · date-time

Payment date (alias for paid_on).

amount integer required

Payment amount in cents.

inventory_order_id string

Parent order UUID.

method string

Payment method (e.g., 'check', 'wire', 'credit_card').

description string

Order notes.

total integer

Total amount in cents.

balance integer

Remaining balance in cents.

shipments array · object

Associated shipments.

created_at string · date-time required

Creation timestamp.

updated_at string · date-time required

Last update timestamp.

version integer

Version for optimistic locking.

shipping_cost integer

Freight/shipping cost in cents.

ship_from_location_id string

Source location UUID.

ship_to_location_id string

Destination location UUID.

ship_from_location_name string

Resolved source location name.

ship_to_location_name string

Resolved destination location name.

production_run_id string

Linked production run UUID.

transfer_id string

Linked inventory transfer UUID.

expected_delivery_date string · date-time

Expected delivery date.

payment_term_id string

Payment term UUID for net terms.

payment_term_name string

Resolved payment term name (e.g., 'Net 30').

payment_term_days integer

Days until due from the payment term.

expected_paid_on string · date-time

Expected payment date.

bill_id string

UUID of the Bill linked to this PO, if any.

bill_status string

Status of the linked bill: forecasted, received, partially_paid, paid, draft, or canceled.

bill_amount integer

Linked bill amount in cents.

bill_received_on string · date-time

Timestamp the linked bill was marked received from the vendor.

bill_paid_on string · date-time

Timestamp the linked bill was marked fully paid.

400 Bad Request - Invalid input

401 Unauthorized - Authentication required

403 Forbidden - Insufficient permissions

422 Validation Error

detail array · ValidationError ValidationError
5 fields
loc array · string | integer required
msg string required
type string required
input object
ctx object