{"openapi":"3.1.0","info":{"title":"POST /api/v1/purchase-orders/{id}/payments","version":"1.0.0","description":"Record payment for purchase order"},"servers":[{"url":"https://api.ondayzero.com","description":"Production"}],"paths":{"/api/v1/purchase-orders/{id}/payments":{"post":{"tags":["purchase-orders"],"summary":"Record payment for purchase order","description":"Link a bank transaction to a purchase order as a payment.","operationId":"record_order_payment_api_v1_purchase_orders__id__payments_post","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderPaymentRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderPaymentResponse"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"detail":"Resource not found"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"OrderPaymentRequest":{"properties":{"transaction_id":{"type":"string","title":"Transaction Id","description":"UUID of the bank transaction representing the payment."},"amount":{"type":"integer","exclusiveMinimum":0.0,"title":"Amount","description":"Payment amount in cents. Must be > 0."},"paid_on":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Paid On","description":"Override payment date (ISO 8601). Defaults to the transaction datetime if omitted."}},"type":"object","required":["transaction_id","amount"],"title":"OrderPaymentRequest","description":"Request schema for recording a payment against a purchase order.\n\nLinks a bank transaction to a PO to track partial or full payment."},"OrderPaymentResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Payment UUID."},"inventory_order_id":{"type":"string","title":"Inventory Order Id","description":"Parent order UUID."},"amount":{"type":"integer","title":"Amount","description":"Payment amount in cents."},"paid_on":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Paid On","description":"Payment date."},"transaction_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Transaction Id","description":"Linked bank transaction UUID."},"method":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Method","description":"Payment method."}},"type":"object","required":["id","inventory_order_id","amount"],"title":"OrderPaymentResponse","description":"Response schema for a recorded order payment."},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}},"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Token","description":"API token authentication. Format: `Bearer dz_...`"}}},"security":[{"BearerAuth":[]}]}