{"openapi":"3.1.0","info":{"title":"POST /api/v1/bills/{bill_id}/payments","version":"1.0.0","description":"Add payment to bill"},"servers":[{"url":"https://api.ondayzero.com","description":"Production"}],"paths":{"/api/v1/bills/{bill_id}/payments":{"post":{"tags":["bills"],"summary":"Add payment to bill","description":"Create a new payment for a specific bill.","operationId":"create_bill_payment_api_v1_bills__bill_id__payments_post","parameters":[{"name":"bill_id","in":"path","required":true,"schema":{"type":"string","title":"Bill 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/BillPaymentRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillPaymentResponse"}}}},"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":{"BillPaymentRequest":{"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":"BillPaymentRequest","description":"Schema for recording a payment against a bill.\n\nLinks a bank transaction to a bill to track partial or full payment.\nSupports split payments (one transaction paying multiple bills) and\npartial payments (multiple transactions paying one bill).","example":{"amount":125000,"transaction_id":"019ab37c-txn1-7000-8000-000000000001"}},"BillPaymentResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Payment record UUID."},"bill_id":{"type":"string","title":"Bill Id","description":"UUID of the bill being paid."},"transaction_id":{"type":"string","title":"Transaction Id","description":"UUID of the bank transaction."},"amount":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Amount","description":"Payment amount in cents."},"currency":{"type":"string","title":"Currency","description":"Currency for the payment (USD, CAD, AUD, EUR, or GBP).","default":"USD"},"paid_on":{"type":"string","format":"date-time","title":"Paid On","description":"Payment date."},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Record creation timestamp."},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"Last update timestamp."},"business_id":{"type":"string","title":"Business Id","description":"Business UUID."}},"type":"object","required":["id","bill_id","transaction_id","amount","paid_on","created_at","updated_at","business_id"],"title":"BillPaymentResponse","description":"Response schema for a bill payment record.\n\nRepresents a payment made against a bill, linking to the bank transaction.","example":{"amount":250000,"bill_id":"019ab37c-bill-7000-8000-000000000001","business_id":"019ab37c-bus1-7000-8000-000000000001","created_at":"2024-01-25T10:30:00Z","id":"019ab37c-pay1-7000-8000-000000000001","paid_on":"2024-01-25T00:00:00Z","transaction_id":"019ab37c-txn1-7000-8000-000000000001","updated_at":"2024-01-25T10:30:00Z"}},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"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":[]}]}