Editing invoices
To update invoice content, use PUT /api/invoice/. method of the CorrigoPro Direct API.
Working with line items
Depending on the customer settings, an invoice may contain only provider-defined line items, customer price list items, or both. To retrieve available line items settings, call the GET /api/invoice/pricelist method of the CorrigoPro Direct API.
Provider line items
Provider line items fall into one of the following categories, described by the LineItemType enumeration, except PriceList.
Note: for a Labor line item, Quantity should contain a fractional number of hours spent.
Customer price list
Customer may provide a predefined list of line items (including default rate and description) to be used by the provider. See the LineItem data model for more details.
Warning
Items, which are not referenced by LineItem.Id in the update request, will be deleted. See also, Invoice.SubmissionDeadline.
Discounts
If you believe any discount is applicable, please specify a total discounted amount as a Invoice.DiscountAmount property value.
Attachments
It is possible to attach documents to the invoice. Invoice attachment rules are the same as for work order attachments, but note that the resource URL should be api/invoice/attachments instead of api/attachments.
Validation rules
PUT api/invoice
In order to guarantee consistency between CorrigoPro Direct and CorrigoPro Desktop invoicing application, the following validation checks are executed during each invoice edit request:
- Invoice should be editable. See a list of invoice statuses for details. An error with code 3036 is returned if this rule is violated.
- If your service area does not support composite tax, only one line item of type "Tax" is allowed per invoice. An error with code 3042 is returned if this rule is violated.
- If you specified a non-zero line item id which does not exist in the invoice, an error with code 3043 will be returned.
- Invoice line items of type "Pricelist" must have a price list item id specified, otherwise an error with code 3039 will be returned.
- If a nonexistent price list item (id) is specified, an error with code 3043 will be specified.
- If you specify a custom rate value for a price list item with a read-only rate, an error with code 3041 will be returned.
Note
In order to simplify invoice management, the system tries to execute as many line item checks as possible while processing a request. If multiple validation errors occur, an aggregated error with code 3044 is returned, and Details will contain a list of individual error details.
PUT api/invoice/submit
For detailed description of the validation checks done during invoice submit, please refer to Submitting invoices section.
Deleting invoice information
As you review invoice information, you might need to delete invoice information. To delete invoice information, call the DELETE api/invoice method of the CorrigoPro Direct API.
The following information is deleted:
Invoice date
Invoice number
Discount
Line items
* Attachments, that haven't been already sent to the customer.
Note
Delete operation is applicable only for editable invoices.
Note
Only invoice information will be deleted. Invoice itself will still be available to work with.
Updated about 4 years ago