{"swagger":"2.0","info":{"description":"This API describes how RAS can create invoices and create/link payments to it on the AbaNinja over a REST API. The authentification will take place over the HTTP-Header 'AUTH-TOKEN'.","version":"1.0.0","title":"AbaNinja - Invoice & Payments API"},"tags":[{"name":"invoices","description":"Management of invoices"},{"name":"payments","description":"Management of payments"}],"paths":{"/invoices":{"post":{"tags":["invoices"],"summary":"creates an new invoice","description":"Create a new invoice based on the passed parameters","consumes":["application/json"],"produces":["application/json"],"parameters":[{"in":"body","name":"invoice","description":"Invoice object (without id)","schema":{"$ref":"#/definitions/invoice"}}],"responses":{"201":{"description":"Created","schema":{"$ref":"#/definitions/invoice"}},"400":{"description":"Invalid input/object. Customer number is not allowed."}}}},"/invoices/{iid}":{"get":{"tags":["invoices"],"parameters":[{"name":"iid","in":"path","type":"string","required":true}],"summary":"fetches as specific invoice by {id}","consumes":["application/json"],"produces":["application/json"],"responses":{"200":{"description":"Invoice-Object with the {iid}","schema":{"type":"array","items":{"$ref":"#/definitions/invoice"}}},"403":{"description":"Object not found"},"404":{"description":"Object not found"}}},"delete":{"tags":["invoices"],"parameters":[{"name":"iid","in":"path","type":"string","required":true}],"summary":"deletes invoice by {iid}","description":"deletes the invoice by {iid} and all attached payments","consumes":["application/json"],"produces":["application/json"],"responses":{"200":{"description":"Ok"},"403":{"description":"Object (invoice) was not found"},"404":{"description":"Object (invoice) was not found"}}}},"/invoices/{iid}/payments":{"post":{"tags":["payments"],"parameters":[{"name":"iid","in":"path","type":"string","required":true}],"summary":"add a payment to invoice with {id}","consumes":["application/json"],"produces":["application/json"],"responses":{"201":{"description":"Created","schema":{"$ref":"#/definitions/invoice"}},"400":{"description":"Invalid input/object. Unknown invoice id"}}},"get":{"tags":["payments"],"parameters":[{"name":"iid","in":"path","type":"string","required":true}],"summary":"retrieves all payments of invoice with {iid}","consumes":["application/json"],"produces":["application/json"],"responses":{"200":{"description":"Array of payments linked to the invoice with {iid}","schema":{"type":"array","items":{"$ref":"#/definitions/payment"}}}}}},"/invoices/{iid}/payments/{pid}":{"get":{"tags":["payments"],"parameters":[{"name":"iid","in":"path","type":"string","required":true},{"name":"pid","in":"path","type":"string","required":true}],"summary":"retrieve payment with specific {pid} from invoice with {iid}","consumes":["application/json"],"produces":["application/json"],"responses":{"200":{"description":"returns specific payment with {pid}","schema":{"$ref":"#/definitions/payment"}},"403":{"description":"Payment with {pid} not found"},"404":{"description":"Payment with {pid} not found"}}},"delete":{"tags":["payments"],"parameters":[{"name":"iid","in":"path","type":"string","required":true},{"name":"pid","in":"path","type":"string","required":true}],"summary":"remove a payment by {id} from invoice with {id}","consumes":["application/json"],"produces":["application/json"],"responses":{"200":{"description":"Ok"},"403":{"description":"Payment with {pid} not found"},"404":{"description":"Payment with {pid} not found"}}}}},"definitions":{"invoice":{"type":"object","required":["customer_number","invoice_number","transaction_date","due_date"],"properties":{"id":{"type":"integer","format":"int32","example":245},"invoice_number":{"type":"string","format":"string","example":"RAS-2003"},"customer_number":{"type":"string","format":"string","example":"KD-444"},"transaction_date":{"type":"string","format":"Date","example":"2018-03-12"},"due_date":{"type":"string","format":"Date","example":"2018-04-11"},"reference":{"type":"string","format":"string","example":6837463},"bank_accout":{"type":"string","format":"string","example":3},"items":{"type":"array","items":{"$ref":"#/definitions/invoiceItem"}}}},"invoiceItem":{"type":"object","required":["product_number","quantity","price","description"],"properties":{"product_number":{"type":"string","format":"string","example":"PROD334"},"quantity":{"type":"number","format":"int32","example":2},"price":{"type":"number","format":"float","example":3456.25},"description":{"type":"string","format":"string","example":"Produckt 334"}}},"payment":{"type":"object","required":["account_number","date","amount","description"],"properties":{"account_number":{"type":"string","format":"string","example":"CC_Mastercard"},"date":{"type":"string","format":"Date","example":"2018-03-15"},"amount":{"type":"number","format":"float","example":122.35},"description":{"type":"string","format":"string","example":"Mastercard"}}}},"host":"virtserver.swaggerhub.com","schemes":["https"],"basePath":"/Digio-GmbH/AbaNinjaAPI/1.0.0"}