{"openapi":"3.1.0","info":{"title":"LedgerLite","description":"Demo invoicing API for the fictional company Vandelay Industries. Sandbox tenants are deleted after 60 minutes. No outbound HTTP.","version":"1.0.0"},"paths":{"/":{"get":{"tags":["meta"],"summary":"Landing page","operationId":"landing__get","responses":{"200":{"description":"Demo page","content":{"text/html":{"schema":{"type":"string"}}}}},"security":[]}},"/healthz":{"get":{"tags":["meta"],"summary":"Liveness","operationId":"healthz_healthz_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Health"}}}},"429":{"description":"Too Many Requests","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Too Many Requests","status":429,"detail":"Too Many Requests","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"security":[]}},"/readyz":{"get":{"tags":["meta"],"summary":"Readiness","operationId":"readyz_readyz_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Health"}}}},"503":{"description":"Error","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Error","status":503,"detail":"Error","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"security":[]}},"/metrics":{"get":{"tags":["meta"],"summary":"Prometheus metrics","operationId":"metrics_metrics_get","responses":{"200":{"description":"Prometheus text","content":{"application/json":{"schema":{}},"text/plain":{"schema":{"type":"string"}}}}},"security":[]}},"/v1/auth/token":{"post":{"tags":["auth"],"summary":"Exchange a username and password for tokens","operationId":"issue_token_v1_auth_token_post","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_issue_token_v1_auth_token_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponse"}}}},"401":{"description":"Unauthorized","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Unauthorized","status":401,"detail":"Unauthorized","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Too Many Requests","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Too Many Requests","status":429,"detail":"Too Many Requests","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[]}},"/v1/auth/refresh":{"post":{"tags":["auth"],"summary":"Rotate a refresh token","operationId":"rotate_refresh_v1_auth_refresh_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefreshRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponse"}}}},"401":{"description":"Unauthorized","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Unauthorized","status":401,"detail":"Unauthorized","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Too Many Requests","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Too Many Requests","status":429,"detail":"Too Many Requests","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[]}},"/v1/me":{"get":{"tags":["auth"],"summary":"Describe the current principal","operationId":"me_v1_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeResponse"}}}},"401":{"description":"Unauthorized","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Unauthorized","status":401,"detail":"Unauthorized","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Too Many Requests","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Too Many Requests","status":429,"detail":"Too Many Requests","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"security":[{"bearer":[]},{"apiKey":[]}]}},"/v1/customers":{"get":{"tags":["customers"],"summary":"List customers","operationId":"list_customers_v1_customers_get","security":[{"bearer":[]},{"apiKey":[]}],"parameters":[{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}],"title":"Q"}},{"name":"country","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":2,"maxLength":2},{"type":"null"}],"title":"Country"}},{"name":"sort","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sort"}},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerPage"}}}},"400":{"description":"Bad Request","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Bad Request","status":400,"detail":"Bad Request","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Unauthorized","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Unauthorized","status":401,"detail":"Unauthorized","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Forbidden","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Forbidden","status":403,"detail":"Forbidden","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Unprocessable Entity","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Unprocessable Entity","status":422,"detail":"Unprocessable Entity","instance":"/v1/example","errors":[{"loc":["body","field"],"msg":"invalid"}]}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Too Many Requests","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Too Many Requests","status":429,"detail":"Too Many Requests","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}},"post":{"tags":["customers"],"summary":"Create a customer","operationId":"create_customer_v1_customers_post","security":[{"bearer":[]},{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerOut"}}}},"401":{"description":"Unauthorized","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Unauthorized","status":401,"detail":"Unauthorized","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Forbidden","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Forbidden","status":403,"detail":"Forbidden","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"Conflict","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Conflict","status":409,"detail":"Conflict","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Unprocessable Entity","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Unprocessable Entity","status":422,"detail":"Unprocessable Entity","instance":"/v1/example","errors":[{"loc":["body","field"],"msg":"invalid"}]}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Too Many Requests","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Too Many Requests","status":429,"detail":"Too Many Requests","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/customers/{customer_id}":{"get":{"tags":["customers"],"summary":"Fetch a customer","operationId":"get_customer_v1_customers__customer_id__get","security":[{"bearer":[]},{"apiKey":[]}],"parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","title":"Customer Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerOut"}}}},"401":{"description":"Unauthorized","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Unauthorized","status":401,"detail":"Unauthorized","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Forbidden","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Forbidden","status":403,"detail":"Forbidden","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not Found","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Not Found","status":404,"detail":"Not Found","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Too Many Requests","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Too Many Requests","status":429,"detail":"Too Many Requests","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["customers"],"summary":"Update a customer","operationId":"patch_customer_v1_customers__customer_id__patch","security":[{"bearer":[]},{"apiKey":[]}],"parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","title":"Customer Id"}},{"name":"If-Match","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"If-Match"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerPatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerOut"}}}},"401":{"description":"Unauthorized","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Unauthorized","status":401,"detail":"Unauthorized","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Forbidden","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Forbidden","status":403,"detail":"Forbidden","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not Found","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Not Found","status":404,"detail":"Not Found","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"412":{"description":"Precondition Failed","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Precondition Failed","status":412,"detail":"Precondition Failed","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Unprocessable Entity","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Unprocessable Entity","status":422,"detail":"Unprocessable Entity","instance":"/v1/example","errors":[{"loc":["body","field"],"msg":"invalid"}]}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"428":{"description":"Precondition Required","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Precondition Required","status":428,"detail":"Precondition Required","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Too Many Requests","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Too Many Requests","status":429,"detail":"Too Many Requests","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}},"delete":{"tags":["customers"],"summary":"Soft-delete a customer","operationId":"delete_customer_v1_customers__customer_id__delete","security":[{"bearer":[]},{"apiKey":[]}],"parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","title":"Customer Id"}}],"responses":{"204":{"description":"Successful Response"},"401":{"description":"Unauthorized","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Unauthorized","status":401,"detail":"Unauthorized","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Forbidden","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Forbidden","status":403,"detail":"Forbidden","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not Found","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Not Found","status":404,"detail":"Not Found","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"Conflict","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Conflict","status":409,"detail":"Conflict","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Too Many Requests","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Too Many Requests","status":429,"detail":"Too Many Requests","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/invoices":{"get":{"tags":["invoices"],"summary":"List invoices","operationId":"list_invoices_v1_invoices_get","security":[{"bearer":[]},{"apiKey":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"customer_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Id"}},{"name":"due_before","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Due Before"}},{"name":"due_after","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Due After"}},{"name":"min_total","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Min Total"}},{"name":"overdue","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Overdue"}},{"name":"sort","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sort"}},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoicePage"}}}},"400":{"description":"Bad Request","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Bad Request","status":400,"detail":"Bad Request","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Unauthorized","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Unauthorized","status":401,"detail":"Unauthorized","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Forbidden","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Forbidden","status":403,"detail":"Forbidden","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Unprocessable Entity","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Unprocessable Entity","status":422,"detail":"Unprocessable Entity","instance":"/v1/example","errors":[{"loc":["body","field"],"msg":"invalid"}]}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Too Many Requests","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Too Many Requests","status":429,"detail":"Too Many Requests","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}},"post":{"tags":["invoices"],"summary":"Create a draft invoice","operationId":"post_invoice_v1_invoices_post","security":[{"bearer":[]},{"apiKey":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Idempotency-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceDetail"}}}},"400":{"description":"Bad Request","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Bad Request","status":400,"detail":"Bad Request","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Unauthorized","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Unauthorized","status":401,"detail":"Unauthorized","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Forbidden","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Forbidden","status":403,"detail":"Forbidden","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not Found","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Not Found","status":404,"detail":"Not Found","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"Conflict","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Conflict","status":409,"detail":"Conflict","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Unprocessable Entity","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Unprocessable Entity","status":422,"detail":"Unprocessable Entity","instance":"/v1/example","errors":[{"loc":["body","field"],"msg":"invalid"}]}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Too Many Requests","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Too Many Requests","status":429,"detail":"Too Many Requests","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/invoices.csv":{"get":{"tags":["invoices"],"summary":"Export invoices as CSV","operationId":"export_invoices_v1_invoices_csv_get","security":[{"bearer":[]},{"apiKey":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"customer_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Id"}},{"name":"due_before","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Due Before"}},{"name":"due_after","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Due After"}},{"name":"min_total","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Min Total"}},{"name":"overdue","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Overdue"}},{"name":"sort","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sort"}}],"responses":{"200":{"description":"CSV export","content":{"application/json":{"schema":{}},"text/csv":{"schema":{"type":"string"}}}},"401":{"description":"Unauthorized","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Unauthorized","status":401,"detail":"Unauthorized","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Forbidden","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Forbidden","status":403,"detail":"Forbidden","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Unprocessable Entity","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Unprocessable Entity","status":422,"detail":"Unprocessable Entity","instance":"/v1/example","errors":[{"loc":["body","field"],"msg":"invalid"}]}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Too Many Requests","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Too Many Requests","status":429,"detail":"Too Many Requests","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/invoices/{invoice_id}":{"get":{"tags":["invoices"],"summary":"Fetch an invoice","operationId":"get_invoice_v1_invoices__invoice_id__get","security":[{"bearer":[]},{"apiKey":[]}],"parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string","title":"Invoice Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceDetail"}}}},"401":{"description":"Unauthorized","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Unauthorized","status":401,"detail":"Unauthorized","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Forbidden","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Forbidden","status":403,"detail":"Forbidden","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not Found","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Not Found","status":404,"detail":"Not Found","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Too Many Requests","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Too Many Requests","status":429,"detail":"Too Many Requests","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["invoices"],"summary":"Update a draft invoice","operationId":"update_invoice_v1_invoices__invoice_id__patch","security":[{"bearer":[]},{"apiKey":[]}],"parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string","title":"Invoice Id"}},{"name":"If-Match","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"If-Match"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoicePatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceDetail"}}}},"401":{"description":"Unauthorized","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Unauthorized","status":401,"detail":"Unauthorized","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Forbidden","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Forbidden","status":403,"detail":"Forbidden","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not Found","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Not Found","status":404,"detail":"Not Found","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"Conflict","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Conflict","status":409,"detail":"Conflict","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"412":{"description":"Precondition Failed","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Precondition Failed","status":412,"detail":"Precondition Failed","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Unprocessable Entity","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Unprocessable Entity","status":422,"detail":"Unprocessable Entity","instance":"/v1/example","errors":[{"loc":["body","field"],"msg":"invalid"}]}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"428":{"description":"Precondition Required","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Precondition Required","status":428,"detail":"Precondition Required","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Too Many Requests","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Too Many Requests","status":429,"detail":"Too Many Requests","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/invoices/{invoice_id}/send":{"post":{"tags":["invoices"],"summary":"Send a draft invoice","operationId":"send_v1_invoices__invoice_id__send_post","security":[{"bearer":[]},{"apiKey":[]}],"parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string","title":"Invoice Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceDetail"}}}},"401":{"description":"Unauthorized","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Unauthorized","status":401,"detail":"Unauthorized","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Forbidden","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Forbidden","status":403,"detail":"Forbidden","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not Found","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Not Found","status":404,"detail":"Not Found","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"Conflict","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Conflict","status":409,"detail":"Conflict","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Too Many Requests","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Too Many Requests","status":429,"detail":"Too Many Requests","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/invoices/{invoice_id}/void":{"post":{"tags":["invoices"],"summary":"Void a draft or open invoice","operationId":"void_v1_invoices__invoice_id__void_post","security":[{"bearer":[]},{"apiKey":[]}],"parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string","title":"Invoice Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceDetail"}}}},"401":{"description":"Unauthorized","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Unauthorized","status":401,"detail":"Unauthorized","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Forbidden","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Forbidden","status":403,"detail":"Forbidden","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not Found","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Not Found","status":404,"detail":"Not Found","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"Conflict","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Conflict","status":409,"detail":"Conflict","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Too Many Requests","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Too Many Requests","status":429,"detail":"Too Many Requests","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/payments":{"get":{"tags":["payments"],"summary":"List payments","operationId":"list_payments_v1_payments_get","security":[{"bearer":[]},{"apiKey":[]}],"parameters":[{"name":"sort","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sort"}},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentPage"}}}},"400":{"description":"Bad Request","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Bad Request","status":400,"detail":"Bad Request","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Unauthorized","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Unauthorized","status":401,"detail":"Unauthorized","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Forbidden","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Forbidden","status":403,"detail":"Forbidden","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Unprocessable Entity","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Unprocessable Entity","status":422,"detail":"Unprocessable Entity","instance":"/v1/example","errors":[{"loc":["body","field"],"msg":"invalid"}]}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Too Many Requests","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Too Many Requests","status":429,"detail":"Too Many Requests","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/invoices/{invoice_id}/payments":{"post":{"tags":["payments"],"summary":"Record a payment","operationId":"post_payment_v1_invoices__invoice_id__payments_post","security":[{"bearer":[]},{"apiKey":[]}],"parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string","title":"Invoice Id"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Idempotency-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentOut"}}}},"400":{"description":"Bad Request","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Bad Request","status":400,"detail":"Bad Request","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Unauthorized","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Unauthorized","status":401,"detail":"Unauthorized","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Forbidden","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Forbidden","status":403,"detail":"Forbidden","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Not Found","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Not Found","status":404,"detail":"Not Found","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"Conflict","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Conflict","status":409,"detail":"Conflict","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Unprocessable Entity","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Unprocessable Entity","status":422,"detail":"Unprocessable Entity","instance":"/v1/example","errors":[{"loc":["body","field"],"msg":"invalid"}]}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Too Many Requests","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Too Many Requests","status":429,"detail":"Too Many Requests","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/events":{"get":{"tags":["events"],"summary":"List events","operationId":"list_events_v1_events_get","security":[{"bearer":[]},{"apiKey":[]}],"parameters":[{"name":"type","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Type"}},{"name":"sort","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sort"}},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventPage"}}}},"400":{"description":"Bad Request","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Bad Request","status":400,"detail":"Bad Request","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Unauthorized","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Unauthorized","status":401,"detail":"Unauthorized","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Forbidden","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Forbidden","status":403,"detail":"Forbidden","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"Unprocessable Entity","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Unprocessable Entity","status":422,"detail":"Unprocessable Entity","instance":"/v1/example","errors":[{"loc":["body","field"],"msg":"invalid"}]}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Too Many Requests","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Too Many Requests","status":429,"detail":"Too Many Requests","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/v1/reports/aging":{"get":{"tags":["reports"],"summary":"Accounts-receivable aging","operationId":"aging_v1_reports_aging_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgingReport"}}}},"401":{"description":"Unauthorized","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Unauthorized","status":401,"detail":"Unauthorized","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"Forbidden","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Forbidden","status":403,"detail":"Forbidden","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Too Many Requests","content":{"application/problem+json":{"example":{"type":"/problems/example","title":"Too Many Requests","status":429,"detail":"Too Many Requests","instance":"/v1/example"}},"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"security":[{"bearer":[]},{"apiKey":[]}]}},"/docs":{"get":{"tags":["meta"],"summary":"Swagger UI","operationId":"docs_docs_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}},"security":[]}},"/redoc":{"get":{"tags":["meta"],"summary":"ReDoc","operationId":"redoc_redoc_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}},"security":[]}}},"components":{"schemas":{"AgingCurrency":{"properties":{"currency":{"type":"string","title":"Currency"},"current":{"type":"integer","title":"Current"},"days_1_30":{"type":"integer","title":"Days 1 30"},"days_31_60":{"type":"integer","title":"Days 31 60"},"days_61_90":{"type":"integer","title":"Days 61 90"},"days_90_plus":{"type":"integer","title":"Days 90 Plus"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["currency","current","days_1_30","days_31_60","days_61_90","days_90_plus","total"],"title":"AgingCurrency"},"AgingReport":{"properties":{"as_of":{"type":"string","format":"date","title":"As Of"},"currencies":{"items":{"$ref":"#/components/schemas/AgingCurrency"},"type":"array","title":"Currencies"}},"type":"object","required":["as_of","currencies"],"title":"AgingReport"},"Body_issue_token_v1_auth_token_post":{"properties":{"grant_type":{"anyOf":[{"type":"string","pattern":"password"},{"type":"null"}],"title":"Grant Type"},"username":{"type":"string","title":"Username"},"password":{"type":"string","title":"Password"},"scope":{"type":"string","title":"Scope","default":""},"client_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Id"},"client_secret":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Secret"}},"type":"object","required":["username","password"],"title":"Body_issue_token_v1_auth_token_post"},"CustomerCreate":{"properties":{"name":{"type":"string","maxLength":120,"minLength":1,"title":"Name"},"email":{"type":"string","maxLength":200,"minLength":3,"pattern":"^[^@\\s]+@[^@\\s]+\\.[^@\\s]+$","title":"Email"},"country":{"type":"string","maxLength":2,"minLength":2,"pattern":"^[A-Z]{2}$","title":"Country"},"currency":{"type":"string","pattern":"^(USD|EUR|GBP)$","title":"Currency"}},"additionalProperties":false,"type":"object","required":["name","email","country","currency"],"title":"CustomerCreate"},"CustomerOut":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"email":{"type":"string","title":"Email"},"country":{"type":"string","title":"Country"},"currency":{"type":"string","title":"Currency"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"version":{"type":"integer","title":"Version"}},"type":"object","required":["id","name","email","country","currency","created_at","version"],"title":"CustomerOut"},"CustomerPage":{"properties":{"data":{"items":{"$ref":"#/components/schemas/CustomerOut"},"type":"array","title":"Data"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"},"has_more":{"type":"boolean","title":"Has More"}},"type":"object","required":["data","has_more"],"title":"CustomerPage"},"CustomerPatch":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":120,"minLength":1},{"type":"null"}],"title":"Name"},"email":{"anyOf":[{"type":"string","maxLength":200,"minLength":3,"pattern":"^[^@\\s]+@[^@\\s]+\\.[^@\\s]+$"},{"type":"null"}],"title":"Email"},"country":{"anyOf":[{"type":"string","maxLength":2,"minLength":2,"pattern":"^[A-Z]{2}$"},{"type":"null"}],"title":"Country"},"currency":{"anyOf":[{"type":"string","pattern":"^(USD|EUR|GBP)$"},{"type":"null"}],"title":"Currency"}},"additionalProperties":false,"type":"object","title":"CustomerPatch"},"EventOut":{"properties":{"id":{"type":"integer","title":"Id"},"type":{"type":"string","title":"Type"},"resource_id":{"type":"string","title":"Resource Id"},"payload":{"type":"object","title":"Payload"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","type","resource_id","payload","created_at"],"title":"EventOut"},"EventPage":{"properties":{"data":{"items":{"$ref":"#/components/schemas/EventOut"},"type":"array","title":"Data"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"},"has_more":{"type":"boolean","title":"Has More"}},"type":"object","required":["data","has_more"],"title":"EventPage"},"FieldError":{"properties":{"loc":{"items":{"type":"string"},"type":"array","title":"Loc"},"msg":{"type":"string","title":"Msg"}},"type":"object","required":["loc","msg"],"title":"FieldError"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"Health":{"properties":{"status":{"type":"string","title":"Status"}},"type":"object","required":["status"],"title":"Health"},"InvoiceCreate":{"properties":{"customer_id":{"type":"string","maxLength":40,"minLength":4,"title":"Customer Id"},"issue_date":{"type":"string","format":"date","title":"Issue Date"},"due_date":{"type":"string","format":"date","title":"Due Date"},"currency":{"anyOf":[{"type":"string","pattern":"^(USD|EUR|GBP)$"},{"type":"null"}],"title":"Currency"},"notes":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Notes"},"lines":{"items":{"$ref":"#/components/schemas/InvoiceLineIn"},"type":"array","maxItems":50,"minItems":1,"title":"Lines"}},"additionalProperties":false,"type":"object","required":["customer_id","issue_date","due_date","lines"],"title":"InvoiceCreate"},"InvoiceDetail":{"properties":{"id":{"type":"string","title":"Id"},"customer_id":{"type":"string","title":"Customer Id"},"number":{"type":"string","title":"Number"},"status":{"type":"string","title":"Status"},"currency":{"type":"string","title":"Currency"},"issue_date":{"type":"string","format":"date","title":"Issue Date"},"due_date":{"type":"string","format":"date","title":"Due Date"},"subtotal":{"type":"integer","title":"Subtotal"},"tax_total":{"type":"integer","title":"Tax Total"},"total":{"type":"integer","title":"Total"},"amount_paid":{"type":"integer","title":"Amount Paid"},"amount_due":{"type":"integer","title":"Amount Due"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"version":{"type":"integer","title":"Version"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"overdue":{"type":"boolean","title":"Overdue"},"lines":{"items":{"$ref":"#/components/schemas/InvoiceLineOut"},"type":"array","title":"Lines"},"payments":{"items":{"$ref":"#/components/schemas/InvoicePaymentRef"},"type":"array","title":"Payments"}},"type":"object","required":["id","customer_id","number","status","currency","issue_date","due_date","subtotal","tax_total","total","amount_paid","amount_due","version","created_at","overdue","lines","payments"],"title":"InvoiceDetail"},"InvoiceLineIn":{"properties":{"description":{"type":"string","maxLength":200,"minLength":1,"title":"Description"},"quantity":{"type":"integer","maximum":1000000.0,"minimum":1.0,"title":"Quantity"},"unit_price":{"type":"integer","maximum":1000000000.0,"minimum":0.0,"title":"Unit Price"},"tax_rate_bp":{"type":"integer","maximum":10000.0,"minimum":0.0,"title":"Tax Rate Bp"}},"additionalProperties":false,"type":"object","required":["description","quantity","unit_price","tax_rate_bp"],"title":"InvoiceLineIn"},"InvoiceLineOut":{"properties":{"id":{"type":"integer","title":"Id"},"description":{"type":"string","title":"Description"},"quantity":{"type":"integer","title":"Quantity"},"unit_price":{"type":"integer","title":"Unit Price"},"tax_rate_bp":{"type":"integer","title":"Tax Rate Bp"}},"type":"object","required":["id","description","quantity","unit_price","tax_rate_bp"],"title":"InvoiceLineOut"},"InvoiceListItem":{"properties":{"id":{"type":"string","title":"Id"},"customer_id":{"type":"string","title":"Customer Id"},"number":{"type":"string","title":"Number"},"status":{"type":"string","title":"Status"},"currency":{"type":"string","title":"Currency"},"issue_date":{"type":"string","format":"date","title":"Issue Date"},"due_date":{"type":"string","format":"date","title":"Due Date"},"subtotal":{"type":"integer","title":"Subtotal"},"tax_total":{"type":"integer","title":"Tax Total"},"total":{"type":"integer","title":"Total"},"amount_paid":{"type":"integer","title":"Amount Paid"},"amount_due":{"type":"integer","title":"Amount Due"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"version":{"type":"integer","title":"Version"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"overdue":{"type":"boolean","title":"Overdue"}},"type":"object","required":["id","customer_id","number","status","currency","issue_date","due_date","subtotal","tax_total","total","amount_paid","amount_due","version","created_at","overdue"],"title":"InvoiceListItem"},"InvoicePage":{"properties":{"data":{"items":{"$ref":"#/components/schemas/InvoiceListItem"},"type":"array","title":"Data"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"},"has_more":{"type":"boolean","title":"Has More"}},"type":"object","required":["data","has_more"],"title":"InvoicePage"},"InvoicePatch":{"properties":{"issue_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Issue Date"},"due_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Due Date"},"notes":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Notes"},"lines":{"anyOf":[{"items":{"$ref":"#/components/schemas/InvoiceLineIn"},"type":"array","maxItems":50,"minItems":1},{"type":"null"}],"title":"Lines"}},"additionalProperties":false,"type":"object","title":"InvoicePatch"},"InvoicePaymentRef":{"properties":{"id":{"type":"string","title":"Id"},"invoice_id":{"type":"string","title":"Invoice Id"},"amount":{"type":"integer","title":"Amount"},"method":{"type":"string","title":"Method"},"received_at":{"type":"string","format":"date-time","title":"Received At"}},"type":"object","required":["id","invoice_id","amount","method","received_at"],"title":"InvoicePaymentRef"},"MeResponse":{"properties":{"subject":{"type":"string","title":"Subject"},"tenant_id":{"type":"integer","title":"Tenant Id"},"tenant_name":{"type":"string","title":"Tenant Name"},"tenant_kind":{"type":"string","title":"Tenant Kind"},"scopes":{"items":{"type":"string"},"type":"array","title":"Scopes"},"sandbox_expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Sandbox Expires At"}},"type":"object","required":["subject","tenant_id","tenant_name","tenant_kind","scopes"],"title":"MeResponse"},"PaymentCreate":{"properties":{"amount":{"type":"integer","maximum":1000000000.0,"exclusiveMinimum":0.0,"title":"Amount"},"method":{"type":"string","pattern":"^(bank_transfer|card|cash)$","title":"Method"},"received_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Received At"}},"additionalProperties":false,"type":"object","required":["amount","method"],"title":"PaymentCreate"},"PaymentOut":{"properties":{"id":{"type":"string","title":"Id"},"invoice_id":{"type":"string","title":"Invoice Id"},"amount":{"type":"integer","title":"Amount"},"method":{"type":"string","title":"Method"},"received_at":{"type":"string","format":"date-time","title":"Received At"},"currency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Currency"},"invoice_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invoice Status"},"amount_paid":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Amount Paid"},"amount_due":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Amount Due"}},"type":"object","required":["id","invoice_id","amount","method","received_at"],"title":"PaymentOut"},"PaymentPage":{"properties":{"data":{"items":{"$ref":"#/components/schemas/PaymentOut"},"type":"array","title":"Data"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"},"has_more":{"type":"boolean","title":"Has More"}},"type":"object","required":["data","has_more"],"title":"PaymentPage"},"Problem":{"properties":{"type":{"type":"string","title":"Type"},"title":{"type":"string","title":"Title"},"status":{"type":"integer","title":"Status"},"detail":{"type":"string","title":"Detail"},"instance":{"type":"string","title":"Instance"},"errors":{"anyOf":[{"items":{"$ref":"#/components/schemas/FieldError"},"type":"array"},{"type":"null"}],"title":"Errors"}},"type":"object","required":["type","title","status","detail","instance"],"title":"Problem"},"RefreshRequest":{"properties":{"refresh_token":{"type":"string","maxLength":500,"minLength":10,"title":"Refresh Token"}},"type":"object","required":["refresh_token"],"title":"RefreshRequest"},"TokenResponse":{"properties":{"access_token":{"type":"string","title":"Access Token"},"refresh_token":{"type":"string","title":"Refresh Token"},"token_type":{"type":"string","title":"Token Type"},"expires_in":{"type":"integer","title":"Expires In"}},"type":"object","required":["access_token","refresh_token","token_type","expires_in"],"title":"TokenResponse"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}},"securitySchemes":{"bearer":{"type":"oauth2","flows":{"password":{"scopes":{},"tokenUrl":"v1/auth/token"}}},"apiKey":{"type":"apiKey","in":"header","name":"X-API-Key"}}},"tags":[{"name":"meta","description":"Health, metrics, and the landing page."},{"name":"auth","description":"Password grant and refresh tokens."},{"name":"customers","description":"Customer records."},{"name":"invoices","description":"Invoices, lines, and CSV export."},{"name":"payments","description":"Payments recorded against open invoices."},{"name":"events","description":"Tenant event stream. Nothing is sent outbound."},{"name":"reports","description":"Accounts-receivable aging."}],"servers":[{"url":"/portfolio/ledgerlite"}]}