Create a Line Item Invoice

2 minute read

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  
WoIdentifier Required  
InvoiceText Optional/Required Required when Require Resolution Text is enabled in the invoice settings.
Labors Optional/Required Required when For Labor Charges subsection of the invoice settings includes the WO trade and/or category.
Materials Optional/Required Required when For Materials Charges subsection of the invoice settings includes the WO trade and/or category.
InvoiceTaxesDetails Optional/Required Required for all countries, except 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 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

Example request:

POST https://sb2api.servicechannel.com/v3/invoices HTTP/1.1
Authorization: Bearer {access_token}
Content-Type: application/json

{
  "InvoiceNumber": "N-987654321",
  "WoIdentifier": "88708120",
  "InvoiceTax": 130,
  "InvoiceTotal": 795,
  "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"
  },
  "Tax2Details": {
    "Tax2Amount": 5,
    "Tax2Name": "PST"
  },
  "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": 42224724
}

Response code: HTTP/1.1 201 Created

Note: Add Tax2Details only for Canada.

This is how the created invoice is displayed in the UI:

Standard Invoice, USA and Canada

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

Example request:

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:

Standard Invoice, USA and Canada

Updated: