Create Invoices
Purpose
To insert a new invoice record.
Request URL
https://fsm.zoho.com/fsm/v1/Invoices
Request Method
POST
Scope
scope=ZohoFSM.modules.custom.ALL
Parameters
Name | Data Type | Description |
Work_Order | String | The ID of the work order for which the invoice is being created |
$Service_Line_Items | Array | Include the IDs of the service line items in the work order for which you want to create an invoice. You can find the IDs within the Service_Line_Items key present in the Get a Work Order API response. |
$finance_data date (optional) payment_terms (optional) due_date (optional) payment_terms_label (optional) discount_preference Discount (optional) Adjustment Discount_Type (optional) | JSON Object String Integer String String JSON Object Integer Integer String | Details required for creating the invoice The Invoice Date Value for Payment Terms The Due Date for the invoice The display name for Payment Terms Details of the discount offered The discount being offered Any change or adjustment you want to make to the invoice amount Whether Percent or Currency |
Sample Request
Copiedcurl --location --request POST 'https://fsm.zoho.com/fsm/v1/Invoices' \
-d "@newInvoice.json" \
--header 'Authorization: Zoho-oauthtoken 1xxx.xxxxxxxxxx'
Sample Input
Copied{
"data": [
{
"Work_Order": "1439000000278142",
"$Service_Line_Items": [
"1439000000282347"
],
"$finance_data": {
"date": "2022-09-20",
"payment_terms": 45,
"due_date": "2022-10-15",
"payment_terms_label": "Net 45",
"discount_preference": {
"Discount": 5,
"Adjustment": 0,
"Discount_Type": "Currency"
}
}
}
]
}
Sample Response
Copied{
"result": "success",
"data": {
"Invoices": [
{
"finance_data": {
"code": "2030",
"Invoice_Id": "3219741000000142005",
"message": "Invoice Created Successfully",
"status": "success"
},
"UID": "Invoices_0",
"Modified_Time": "2022-09-13T00:15:53-07:00",
"Modified_By": {
"name": "Mary Cooper",
"id": "1439000000161001"
},
"Created_Time": "2022-09-13T00:15:53-07:00",
"id": "1439000000282334",
"Created_By": {
"name": "Mary Cooper",
"id": "1439000000161001"
},
"TabName": "Invoices"
}
]
}
}
Sample Failure Response
Copied{
"code": "INTERNAL_ERROR",
"details": {},
"message": "Internal Server Error",
"status": "error"
}
Sample Failure Response
Copied{
"code": "2031",
"message": "One or more line items are already invoiced",
"status": "error"
}