Add() [InvoiceManager]

Add a new invoice

Description

Add a new invoice associated to a service request.

Package Details

Interface

IInvoiceManager

Syntax

await invoiceManager.Add(newInvoice);

Returns

Task<Invoice>

API

POST
/api/v1/invoices/

Parameters

Parameter

Description

Parameter Type

Parameter

Description

Parameter Type

InvoiceDTO

Invoice DTO

request body

Sample request body

{ "ServiceRequestId": 0, "Number": "string", "PaymentReferenceNumber": "string", "Amount": 0, "Date": "2020-01-01" }

Returns

200 OK - Invoice

Example

var invoiceNumber = “abc-123”; var paymentReferenceNumber = “xyz-jkl-123”; var newInvoice = new Invoice { Number = invoiceNumber, ServiceRequestId = ServiceRequestId, Date = DateTime.Now, Amount = Amount, PaymentReferenceNumber = paymentReferenceNumber }; var invoice = await _invoiceManager.Add(newInvoice);