# Create PurchaseOrder record Create a new PurchaseOrder record with the provided data. Validates all required fields and business rules. Endpoint: POST /public/v1/purchase-orders/ Version: 1.0.0 ## Request fields (application/json): - `date` (string, required) - `company_id` (integer, required) - `vendor_id` (integer, required) - `currency_iso_4217_code` (string, required) Enum: "AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BRL", "BSD", "BTN", "BWP", "BYN", "BZD", "CAD", "CDF", "CHF", "CLF", "CLP", "CNY", "COP", "CRC", "CUP", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD", "EGP", "ERN", "ETB", "EUR", "FJD", "FKP", "GBP", "GEL", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD", "HKD", "HNL", "HTG", "HUF", "IDR", "ILS", "INR", "IQD", "IRR", "ISK", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LYD", "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MRU", "MUR", "MVR", "MWK", "MXN", "MYR", "MZN", "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PGK", "PHP", "PKR", "PLN", "PYG", "QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SBD", "SCR", "SDG", "SEK", "SGD", "SHP", "SLL", "SOS", "SRD", "STN", "SVC", "SYP", "SZL", "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TWD", "TZS", "UAH", "UGX", "USD", "UYU", "UZS", "VES", "VND", "VUV", "WST", "XAF", "XAG", "XAU", "XCD", "XDR", "XOF", "XPD", "XPF", "XPT", "YER", "ZAR", "ZMW", "ZWL" - `exchange_rate` (any, required) - `memo` (string, required) - `items` (array, required) - `items.id` (integer,null) - `items.position` (integer, required) Position of the item in the purchase order - `items.item_id` (integer, required) ID of the item - `items.memo` (string, required) Memo of the item - `items.quantity` (any, required) Quantity of the item - `items.rate` (any, required) Rate of the item - `items.classifications` (array, required) Classifications of the item - `items.classifications.name` (string, required) - `items.classifications.line_id` (integer, required) - `items.classifications.line_name` (string, required) - `items.classifications.parent_classification_id` (integer,null) - `items.classifications.parent_classification_line_id` (integer,null) - `attachments` (array) - `attachments.file_name` (string, required) - `attachments.file_size` (integer, required) - `attachments.download_url` (string,null) - `attachments.upload_url` (string,null) - `record_status` (string) Enum: "draft", "posted", "archived" - `term_id` (integer,null) - `reference_number` (string) ## Response 200 fields (application/json): - `attachments` (array) - `attachments.id` (integer, required) - `attachments.file_name` (string, required) - `attachments.file_size` (integer, required) - `attachments.download_url` (string,null) - `term_id` (integer,null, required) - `term_name` (string, required) - `number` (integer, required) - `date` (string, required) - `company_id` (integer, required) - `company_name` (string, required) Name of the company - `company_currency` (string, required) - `vendor_id` (integer, required) - `vendor_name` (string, required) - `currency_iso_4217_code` (string, required) Enum: "AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BRL", "BSD", "BTN", "BWP", "BYN", "BZD", "CAD", "CDF", "CHF", "CLF", "CLP", "CNY", "COP", "CRC", "CUP", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD", "EGP", "ERN", "ETB", "EUR", "FJD", "FKP", "GBP", "GEL", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD", "HKD", "HNL", "HTG", "HUF", "IDR", "ILS", "INR", "IQD", "IRR", "ISK", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LYD", "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MRU", "MUR", "MVR", "MWK", "MXN", "MYR", "MZN", "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PGK", "PHP", "PKR", "PLN", "PYG", "QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SBD", "SCR", "SDG", "SEK", "SGD", "SHP", "SLL", "SOS", "SRD", "STN", "SVC", "SYP", "SZL", "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TWD", "TZS", "UAH", "UGX", "USD", "UYU", "UZS", "VES", "VND", "VUV", "WST", "XAF", "XAG", "XAU", "XCD", "XDR", "XOF", "XPD", "XPF", "XPT", "YER", "ZAR", "ZMW", "ZWL" - `exchange_rate` (any, required) - `billed_total` (any, required) Total quantity of items that were already billed - `due_total` (any, required) Total quantity of items yet to be billed - `amount` (any, required) Total amount of ordered items - `memo` (string, required) - `items` (array, required) - `items.classifications` (array, required) Classifications of the item - `items.classifications.name` (string, required) - `items.classifications.line_id` (integer, required) - `items.classifications.line_name` (string, required) - `items.classifications.parent_classification_id` (integer,null) - `items.classifications.parent_classification_line_id` (integer,null) - `items.id` (integer, required) ID of the item - `items.item_id` (integer, required) ID of the inventory item - `items.position` (integer, required) Position of the item in the purchase order - `items.memo` (string, required) Memo of the item - `items.quantity` (any, required) Quantity ordered - `items.rate` (any, required) Rate per unit - `items.quantity_billed` (any, required) Quantity of items that already have corresponding Bill - `items.quantity_due` (any, required) Quantity of items yet to be billed - `items.amount` (any, required) Total amount expected to be paid for this item - `record_status` (string, required) Enum: "draft", "posted", "archived" - `billed_status` (string, required) Enum: "billed", "unbilled", "partially_billed" - `reference_number` (string) ## Response 404 fields (application/json): - `success` (boolean) - `errors` (object, required) ## Response 422 fields (application/json): - `success` (boolean) - `errors` (object, required) ## Response 500 fields (application/json): - `success` (boolean) - `errors` (object, required)