{ "name": "Zola Takehome", "description": "Zola interview takehome assignment", "base_url": "localhost", "apidoc": { "version": "1.0.0" }, "models": { "invoice": { "description": "An invoice", "fields": [ { "name": "id", "type": "integer", "description": "Unique identifier for an invoice", "required": false }, { "name": "invoice_number", "type": "string", "description": "The invoice number associated with the invoice" }, { "name": "po_number", "type": "string", "description": "The purchase number associated with the invoice" }, { "name": "due_date", "type": "date-iso8601", "description": "When invoice payment is due" }, { "name": "amount_cents", "type": "long", "description": "Total amount of invoice in US cents" }, { "name": "created_at", "type": "date-time-iso8601", "description": "Invoice creation timestamp", "required": false } ] } }, "resources": { "invoice": { "path": "/v1/invoices", "operations": [ { "description": "Insert an invoice", "method": "PUT", "body": { "type": "invoice" }, "responses": { "201": { "type": "invoice" } } }, { "description": "Find an invoice by invoice_number or po_number. If neither is provided, returns all invoices.", "method": "GET", "parameters": [ { "name": "invoice_number", "type": "string", "description": "An invoice number to search for.", "required": false }, { "name": "po_number", "type": "string", "description": "An purchase order number to search for.", "required": false }, { "name": "limit", "type": "integer", "description": "How many records to return. Defaults to 50 if not provided or not in the range 0 < limit <= 50.", "required": false }, { "name": "offset", "type": "integer", "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 } ], "responses": { "200": { "type": "[invoice]" } } } ] } } }