{"swagger":"2.0","info":{"title":"Zola Takehome","description":"Zola interview takehome assignment","version":"1.0.0-dev"},"basePath":"localhost","consumes":["application/json"],"produces":["application/json"],"paths":{"/v1/invoices":{"put":{"description":"Insert an invoice","parameters":[{"name":"invoice","in":"body","schema":{"$ref":"#/definitions/invoice"}}],"responses":{"201":{"description":"201 response","schema":{"$ref":"#/definitions/invoice"}}}},"get":{"description":"Find an invoice by invoice_number or po_number. If neither is provided, returns all invoices.","parameters":[{"name":"invoice_number","in":"query","description":"An invoice number to search for.","required":false,"type":"string"},{"name":"po_number","in":"query","description":"An purchase order number to search for.","required":false,"type":"string"},{"name":"limit","in":"query","description":"How many records to return. Defaults to 50 if not provided or not in the range 0 < limit <= 50.","required":false,"type":"integer","format":"int32"},{"name":"offset","in":"query","description":"Pagination offset; e.g., to retrieve the second page of invoices with a limit of 50, set to 51. If not provided, defaults to 0.","required":false,"type":"integer","format":"int32"}],"responses":{"200":{"description":"200 response","schema":{"type":"array","items":{"$ref":"#/definitions/invoice"}}}}}}},"definitions":{"invoice":{"type":"object","description":"An invoice","title":"invoice","required":["invoice_number","po_number","due_date","amount_cents"],"properties":{"id":{"description":"Unique identifier for an invoice","type":"integer","format":"int32"},"invoice_number":{"description":"The invoice number associated with the invoice","type":"string"},"po_number":{"description":"The purchase number associated with the invoice","type":"string"},"due_date":{"description":"When invoice payment is due","type":"string","format":"date"},"amount_cents":{"description":"Total amount of invoice in US cents","type":"integer","format":"int64"},"created_at":{"description":"Invoice creation timestamp","type":"string","format":"date-time"}}}}}