Create a Line Item Invoice
For an API request to create a Line Item Invoice, the following parameters are either always required or can be required if the subscriber specifies so.
| Parameter | Required | Note |
|---|---|---|
| InvoiceNumber | Required | Invoice number entered by a user |
| WoIdentifier | Required | Unique work order identifier |
| InvoiceText | Optional/Required | Required when the Require Resolution Text preference is enabled in the invoice settings. |
| Labors | Optional/Required | Required when the Require Line Items preference is enabled For Labor Charges in the invoice settings. There should be listed the WO trades and/or categories that require labor line items. |
| Materials | Optional/Required | Required when the Require Line Items preference is enabled For Material Charges in the invoice settings. There should be listed the WO trades and/or categories that require material line items. |
| Travels | Optional/Required | Required when the Require Line Items preference is enabled For Travel Charges in the invoice settings. There should be listed the WO trades and/or categories that require travel line items. Note: Available with the InvoiceTravelCharges feature flag. |
| Others | Optional/Required | Required when the Require Line Items preference is enabled For Other Charges in the invoice settings. There should be listed the WO trades and/or categories that require other line items. Note: Available with the InvoiceMultipleOtherLineItems feature flag. |
| InvoiceTaxesDetails | Optional/Required | Required for all countries, except the USA and Canada. |
See Invoice Parameters for a detailed description of each parameter and Gather Invoice Requirements for information on invoice settings.
Important: The default value of monetary amounts is 0 (zero).
USA or Canada
For the USA and Canada, send the following API request to create a Line Item Invoice:
POST /invoices
| Header | Value |
|---|---|
| Content-Type | application/json |
| Parameter | Parameter type | Example value |
|---|---|---|
| request | Body | See below |
POST https://sb2api.servicechannel.com/v3/invoices HTTP/1.1
Authorization: Bearer {access_token}
Content-Type: application/json
{
"InvoiceNumber": "04302026inv",
"WoIdentifier": "346011703",
"InvoiceTax": 5,
"InvoiceTotal": 130,
"InvoiceText": "The bathroom door has been secured and fixed.",
"InvoiceAmountsDetails": {
"LaborAmount": 75,
"MaterialAmount": 24,
"TravelAmount": 3,
"FreightAmount": 0,
"OtherAmount": 23,
"OtherDescription": "Management fee applies here"
},
"Labors": [
{
"SkillLevel": "2",
"LaborType": "1",
"NumOfTech": "1",
"HourlyRate": 10,
"Hours": 3,
"Amount": 30
},
{
"SkillLevel": "1",
"LaborType": "1",
"NumOfTech": "1",
"HourlyRate": 15,
"Hours": 3,
"Amount": 45
}
],
"Materials": [
{
"Description": "Wood filler",
"PartNum": "4585D",
"UnitType": "7",
"UnitPrice": 3,
"Quantity": 3,
"Amount": 9
},
{
"Description": "Wood glue",
"PartNum": "453n",
"UnitType": "7",
"UnitPrice": 5,
"Quantity": 3,
"Amount": 15
}
],
"Others": [
{
"Description": "Management fee applies here",
"Type": "Management Fee",
"Amount": 23
}
]
}
Example response:
{
"Id": 171517657
}
Response code: HTTP/1.1 201 Created
Note: Add Tax2Details only for Canada.
This is how the created invoice is displayed in the UI:
Other Countries
When a subscriber’s location is not in the USA or Canada, generate an International Line Item Invoice:
POST /invoices
| Header | Value |
|---|---|
| Content-Type | application/json |
| Parameter | Parameter type | Example value |
|---|---|---|
| request | Body | See below |
POST https://sb2api.servicechannel.com/v3/invoices HTTP/1.1
Authorization: Bearer {access_token}
Content-Type: application/json
{
"InvoiceNumber": "inv11111120",
"WoIdentifier": "88708119",
"InvoiceTax": 131.025,
"InvoiceTotal": 791.025,
"InvoiceText": "Cut grass, cleared weeds in flower bed and trimmed shrubs",
"InvoiceAmountsDetails": {
"LaborAmount": 100,
"MaterialAmount": 300,
"TravelAmount": 200,
"FreightAmount": 50,
"OtherAmount": 10,
"OtherDescription": "Rental fee"
},
"InvoiceTaxesDetails": {
"LaborTax": 20,
"MaterialTax": 45,
"TravelTax": 60,
"FreightTax": 5.025,
"OtherTax": 1
},
"Labors": [
{
"SkillLevel": "2",
"LaborType": "1",
"NumOfTech": "1",
"HourlyRate": 10,
"Hours": 10,
"Amount": 100
}
],
"Materials": [
{
"Description": "Wall tiles",
"PartNum": "4585D",
"UnitType": "1",
"UnitPrice": 10,
"Quantity": 30,
"Amount": 300
}
]
}
Example response:
{
"Id": 42224723
}
Response code: HTTP/1.1 201 Created
When you open the created invoice in the UI, you see the following information:

