1. Help Center
  2. API
  3. Work Order/Scheduling API

Work Order API

Create WorkOrder
URL /WorkOrder/Create
Method POST
Body

{
"ActorId":1,
"CreateDate":"\/Date(1347012989707)\/",
"CustomId":"3-2-2",
"Description":"",
"EndDate":"\/Date(1357030000000)\/",
"FieldWorkerId":1, 
"IdInContext":1,
"InvoicingMemo":"Invoice memo test",
"LocationId":null,
"ServiceRequestId":3,
"StartDate":"\/Date(1357022800000)\/",
 "StatusId":1
}

Response
HTTP/1.1 400 Business rule violation. CustomId should be unique
HTTP/1.1 200 OK
{
"ActorId":1,
"CreateDate":"\/Date(1347012989707)\/",
"CustomId":"3-2-2",
"Description":"",
"EndDate":"\/Date(1357030000000)\/",
"FieldWorkerId":1,
"Id":37,
"IdInContext":1,
"InvoicingMemo":"Invoice memo test",
"LocationId":null,
"ServiceRequestId":3,
"StartDate":"\/Date(1357022800000)\/",
 "StatusId":1,
"TaxNameId":null
}
Comments

 

  Update Work Order
URL /WorkOrder
Method PUT
Body

 

{
"ActorId":1,
"CreateDate":"\/Date(1347012989707)\/",
"CustomId":"3-2-2",
"Description":"",
"EndDate":"\/Date(1357030000000)\/",
"FieldWorkerId":1,
"Id":37,
"IdInContext":1,
"InvoicingMemo":"Invoice memo test",
"LocationId":null,
"ServiceRequestId":3,
"StartDate":"\/Date(1357022800000)\/",
 "StatusId":2
}

 

Response
HTTP/1.1 400 Business rule violation.  CustomId should be unique
HTTP/1.1 200 OK
{
"ActorId":1,
"CreateDate":"\/Date(1347012989707)\/",
"CustomId":"3-2-2",
"Description":"",
"EndDate":"\/Date(1357030000000)\/",
"FieldWorkerId":1,
"Id":37,
"IdInContext":1,
"InvoicingMemo":"Invoice memo test",
"LocationId":null,
"ServiceRequestId":3,
"StartDate":"\/Date(1357022800000)\/",
 "StatusId":2,
"TaxNameId":null
Comments

 

  Delete Work Order
URL /WorkOrder/{id}
Method DELETE
Body

 

Response
HTTP/1.1 400 Entity not found
HTTP/1.1 200 OK
Comments

 

  Get Work Orders
URL /WorkOrder/List
Method POST
Body

{
"FromModifiedDate":"\/Date(1347022800000)\/",
"ToModifiedDate":"\/Date(1347022800000)\/"
}

Response

[   

{
"ActorId":1,
"CreateDate":"\/Date(1347012989707)\/",
"CustomId":"3-2-2",
"Description":"",
"EndDate":"\/Date(1357030000000)\/",
"FieldWorkerId":1,
"Id":37,
"IdInContext":1,
"InvoicingMemo":"Invoice memo test",
"LocationId":null,
"ServiceRequestId":3,
"StartDate":"\/Date(1357022800000)\/",
 "StatusId":2,
"TaxNameId":null
}

 ]

Comments

 

  Get WorkOrder
URL /WorkOrder/{id}
Method GET
Body

 

Response
{
"ActorId":1,
"CreateDate":"\/Date(1347012989707)\/",
"CustomId":"3-2-2",
"Description":"",
"EndDate":"\/Date(1357030000000)\/",
"FieldWorkerId":1,
"Id":37,
"IdInContext":1,
"InvoicingMemo":"Invoice memo test",
"LocationId":null,
"ServiceRequestId":3,
"StartDate":"\/Date(1357022800000)\/",
 "StatusId":2,
"TaxNameId":null
}

 

Comments

 

 
Get Addresses list to be exported into QB as SubCustomers
URL /WorkOrder/GetAddressesAsSubCustomers
Method POST
Body

{
"WorkOrderIds":[
76
]
}

Response

[
{
"AltPhone":null,
"BillAddr1":"BillAddr1",
"BillAddr2":"BillAddr2",
"BillAddr3":"BillAddr3",
"CompanyName":null,
"Contact":"contact name",
"CustomerListId":"80001653-1395783257",
"Email":"examplemail@gmail.com",
"Fax":null,
"FirstName":"first name",
"LastName":"last name",
"Name":"Address name",
"Phone":"(111) 111-1111",
"ServiceAddr1":"ServiceAddr1",
"ServiceAddr2":"ServiceAddr2",
"ServiceAddr3":"ServiceAddr3"
}
]

 
Get Service Request list to be exported into QB as Jobs
URL /WorkOrder/GetServiceRequestsAsJobs
Method POST
Body

{
"WorkOrderIds":[
76
]
}

Response

[
{
"AltPhone":null,
"BillAddr1":"BillAddr1",
"BillAddr2":"BillAddr2",
"BillAddr3":"BillAddr3",
"CompanyName":null,
"Contact":"contact name",
"CustomerListId":"80001657-1395783258",
"Email":"examplemail@gmail.com",
"Fax":null,
"FirstName":"first name",
"Id":72,
"LastName":"last name",
"Name":"test72",
"Phone":"(111) 111-1111",
"ServiceAddr1":"ServiceAddr1",
"ServiceAddr2":"ServiceAddr2",
"ServiceAddr3":"ServiceAddr3"
}
]

 
Update Address QuickBooks IDs
URL /WorkOrder/UpdateQuickBooksAddressIds
Method POST
Body {
"QuickBooksIds":
[
{
"ServerId":1,
"QuickBooksId":"80000031-1314102902",
"Name":"Address name"
}
]
}
Response [{"Id":1,"IsSuccess":true,"Message":null}]
 
Get Work Orders For Creating Invoices
URL /WorkOrder/GetWorkOrdersForCreatingInvoices?startDate=09/22/2014&endDate=10/22/2014
Method GET
Response [
{
"ActorId":0,
"CreateDate":"\/Date(1412260466310)\/",
"CustomId":"1077-122",
"Description":"Install Shower",
"EndDate":"\/Date(1412703000000)\/",
"FieldWorkerId":1,
"Id":1619,
"IdInContext":122,
"InvoicingMemo":null,
"LocationId":null,
"ServiceRequestId":1077,
"StartDate":"\/Date(1412694000000)\/",
"StatusId":2,
"TaxNameId":null
}
]
Comments startDate/endDate are optional parameters
 
Generate Invoice Entities
URL /WorkOrder/GenerateInvoiceEntities
Method POST
Body

{
"WorkOrderIds":[
1619
],
"IsMergeInvoice":false
}

Response

[
{
"Id":0,
"IsSuccess":false,
"Message":"Nothing to invoice"
}
]

Responce 2

[
{
"Id":1619,
"IsSuccess":true,
"Message":"Invoice is created"
}
]

Comment Response Id is Invoice.WorkOrders.First.Id
 
Get Invoices that can be exported to QuickBooks Desktop
URL

WorkOrder/GetInvoicesForExport?startDate={startDate}&endDate={endDate}

Method GET
Body  
Response
HTTP/1.1 200 OK
[
{
"AddressQuickBooksListId": true,
"BillTo": {
"AddressLines": [
"RazorSync",
"Customer Support",
"5801 Clearwater Drive",
"Minnetonka, MN 55343"
],
"CustomerDisplayName": "Customer Support",
"FullName": "Customer Support",
"Id": 1,
"QuickBooksDesktopListId": "80000031-1314102902",
"QuickBooksNumber": 292
},
"CustomerListId": 292,
"CustomerName": "Customer Support",
"CustomerQuickBooksDesktopListId": "80000031-1314102902",
"Date": "\/Date(1485239152563+0300)\/",
"DispatchId": "1",
"Id": 1,
"InvoiceServiceItems": [
{
"BillTo": {
"AddressLines": [
"RazorSync",
"Customer Support",
"5801 Clearwater Drive",
"Minnetonka, MN 55343"
],
"CustomerDisplayName": "Customer Support",
"FullName": "Customer Support",
"Id": 1,
"QuickBooksDesktopListId": "80000031-1314102902",
"QuickBooksNumber": 292
},
"Desc": true,
"Id": 0,
"IsDiscount": false,
"IsTaxable": false,
"ItemFullName": "RazorSync:Travel Time",
"ItemListId": true,
"ItemQuickBooksDesktopListId": true,
"Quantity": 1,
"Rate": 12,
"ServiceDate": true,
"TaxCode": true
}
],
"IsToBeEmailed": false,
"IsToBePrinted": true,
"JobId": true,
"Memo": "Work Order #1, 07\/08\/2016 11:30 AM, 07\/11\/2016 11:30 AM, Olga Chizh
Blablbla
Work Order #2, 07\/08\/2016 11:30 AM, 07\/11\/2016 11:30 AM, Test Test2

Payment:
Date: 07\/28\/2016 09:02 AM
User\/Payee: Test1
Method: Cash
Amount: $449.00
",
"RefNumber": "12",
"ServiceTo": {
"AddressLines": [
"RazorSync",
"Customer Support",
"5801 Clearwater Drive",
"Minnetonka, MN 55343"
],
"CustomerDisplayName": "Customer Support",
"FullName": "Customer Support",
"Id": 1,
"QuickBooksDesktopListId": "80000031-1314102902",
"QuickBooksNumber": 292
},
"ShipDate": "\/Date(1485239152563+0300)\/",
"TaxName": true,
"WorkOrderNumberAsInvoiceNumber": true
},
{
"AddressQuickBooksListId": true,
"BillTo": {
"AddressLines": [
"RazorSync",
"Customer Support",
"5801 Clearwater Drive",
"Minnetonka, MN 55343"
],
"CustomerDisplayName": "Customer Support",
"FullName": "Customer Support",
"Id": 1,
"QuickBooksDesktopListId": "80000031-1314102902",
"QuickBooksNumber": 292
},
"CustomerListId": 292,
"CustomerName": "Customer Support",
"CustomerQuickBooksDesktopListId": "80000031-1314102902",
"Date": "\/Date(1485239152780+0300)\/",
"DispatchId": "2",
"Id": 2,
"InvoiceServiceItems": [
{
"BillTo": {
"AddressLines": [
"RazorSync",
"Customer Support",
"5801 Clearwater Drive",
"Minnetonka, MN 55343"
],
"CustomerDisplayName": "Customer Support",
"FullName": "Customer Support",
"Id": 1,
"QuickBooksDesktopListId": "80000031-1314102902",
"QuickBooksNumber": 292
},
"Desc": true,
"Id": 0,
"IsDiscount": false,
"IsTaxable": false,
"ItemFullName": "RazorSync:Travel Time",
"ItemListId": true,
"ItemQuickBooksDesktopListId": true,
"Quantity": 1,
"Rate": 12,
"ServiceDate": true,
"TaxCode": true
}
],
"IsToBeEmailed": false,
"IsToBePrinted": true,
"JobId": true,
"Memo": "Work Order #2-1, 07\/13\/2016 12:00 PM, 07\/13\/2016 01:00 PM, Olga Chizh
234243

Payment:
Date: 07\/28\/2016 08:52 AM
User\/Payee: Test1
Method: Cash
Amount: $315.00
",
"RefNumber": "2-1",
"ServiceTo": {
"AddressLines": [
"RazorSync",
"Customer Support",
"5801 Clearwater Drive",
"Minnetonka, MN 55343"
],
"CustomerDisplayName": "Customer Support",
"FullName": "Customer Support",
"Id": 1,
"QuickBooksDesktopListId": "80000031-1314102902",
"QuickBooksNumber": 292
},
"ShipDate": "\/Date(1485239152780+0300)\/",
"TaxName": true,
"WorkOrderNumberAsInvoiceNumber": true
}
]
Comments

Dateformat for start and end dates is MM/dd/yyyy

For example, for getting all available for export invoices from 1th January 2016 till 24th January 2017 query should look like this:

WorkOrder/GetInvoicesForExport?startDate=01/01/2016&endDate=01/24/2017

 
Updating QuickBooks Desktop identifiers for invoices
URL WorkOrder/UpdateInvoiceQuickbooksIds
Method POST
Body
{
"QuickBooksIds": [
{
"ServerId": 1,
"QuickBooksId": "e134",
"QuickBooksNumber": 123,
"Name": "QWERTY"
},
{
"ServerId": 2,
"QuickBooksId": "sf12",
"QuickBooksNumber": 1,
"Name": "asdasd"
}
]
}
Response
HTTP/1.1 200 OK
[
{
"Id": 82574,
"IsSuccess": false,
"Message": "Invalid ServerId"
},
{
"Id": 2,
"IsSuccess": true,
"Message": "QuickBooksDesktopId is updated"
}
]

HTTP/1.1 200 OK
[
{
"Id": 1,
"IsSuccess": true,
"Message": "QuickBooksDesktopId is updated"
},
{
"Id": 2,
"IsSuccess": true,
"Message": "QuickBooksDesktopId is updated"
}
]
Comments ServerId is identifier of invoice in invoices table
 
Get all payments information that need to send to QuickBooks Desktop List
URL WorkOrder/GetPaymentsForExport
Method GET
Body  
Response
HTTP/1.1 200 OK
[
{
"AppliedToTxnAddTxnID": "sf12",
"CustomerName": "Customer Support",
"CustomerQuickBooksDesktopListId": "80000031-1314102902",
"Date": "\/Date(1485248565804+0300)\/",
"ExportPaymentNumberToQuickBooks": true,
"InvoiceServerId": 2,
"Memo": "Work Order #2-1, 07\/13\/2016 12:00 PM, 07\/13\/2016 01:00 PM, Olga Chizh
234243

Payment:
Date: 07\/28\/2016 08:52 AM
User\/Payee: Test1
Method: Cash
Amount: $315.00
",
"PaymentMethodRefFullName": "Cash",
"RefNumber": "2-1",
"ServerId": 2,
"TotalAmount": "315.00"
},
{
"AppliedToTxnAddTxnID": "e134",
"CustomerName": "Customer Support",
"CustomerQuickBooksDesktopListId": "80000031-1314102902",
"Date": "\/Date(1485248565807+0300)\/",
"ExportPaymentNumberToQuickBooks": true,
"InvoiceServerId": 1,
"Memo": "Work Order #1, 07\/08\/2016 11:30 AM, 07\/11\/2016 11:30 AM, Olga Chizh
Blablbla
Work Order #2, 07\/08\/2016 11:30 AM, 07\/11\/2016 11:30 AM, Test Test2

Payment:
Date: 07\/28\/2016 09:02 AM
User\/Payee: Test1
Method: Cash
Amount: $449.00
",
"PaymentMethodRefFullName": "Cash",
"RefNumber": "12",
"ServerId": 3,
"TotalAmount": "449.00"
}
]
Comments  
 
UpdatePaymentsQuickbooksIds
URL WorkOrder/UpdatePaymentQuickbooksIds
Method POST
Body
{
"QuickBooksIds": [
{
"ServerId": 1,
"QuickBooksId": "e134",
"QuickBooksNumber": 123,
"Name": "QWERTY"
},
{
"ServerId": 2,
"QuickBooksId": "sf12",
"QuickBooksNumber": 1,
"Name": "asdasd"
}
]
}
Response
HTTP/1.1 200 OK
[
{
"Id": 1,
"IsSuccess": false,
"Message": "QuickBooksId is empty"
},
{
"Id": 2,
"IsSuccess": true,
"Message": "QuickBooksDesktopId is updated"
}
]
HTTP/1.1 200 OK
[
{
"Id": 1,
"IsSuccess": true,
"Message": "QuickBooksDesktopId is updated"
},
{
"Id": 2,
"IsSuccess": true,
"Message": "QuickBooksDesktopId is updated"
}
]
Comments ServerId is identifier of payment in payments table