Create a Work Order

Purpose

To insert a new work order record.

Request URL

https://fsm.zoho.com/fsm/v1/Work_Orders

Request Method

POST

Scope

scope=ZohoFSM.modules.WorkOrders.CREATE

Mandatory Input JSON Keys

NameDescriptionType
SummaryA summary for the work orderString
TypeWhether the work order is of type Service or InspectionString
Contact*The ID of the contact for whom the work order is being createdString
Company*The ID of the company for which the work order is being createdString
Territory

The ID of the territory where you want the work order to be assigned

This field will be mandatory only if territories other than the default service territory have been added to your FSM organization.

String
Service_Address

Specify the ID of the service address you want for the work order

Example: "id": "1011000000208180"

JSON Object
Billing_Address

Specify the ID of the business address you want for the work order

Example: "id": "1011000000208179"

JSON Object
Service_Line_Items

Details of the services for which the work order is being created:

  • Service: the ID of the service
  • Contact: the ID of the contact for whom the work order is being created
  • Quantity: The quantity of the service line item
  • Sequence: The order in which the service will be displayed in the Work Order Details page

JSON Array

String

String

Integer

Integer

*This field will be mandatory depending on the sync type for the FSM-Invoice/Books integration

Input JSON Keys

NameDescriptionType
$record_templateThe ID of the record template you want to use. The values provided in the input JSON will take precedence over the values in the record template.String

Sample Request

Copiedcurl --request POST 'https://fsm.zoho.com/fsm/v1/Work_Orders' \
--header 'Authorization: Zoho-oauthtoken 1000.26xxxxxxxxxx.xxxxxxxxxx0' \
-d "@newWO.json"

Sample Input

Copied{
    "data": [
        {
            "Summary": "Remodeling of the Crawford House",
            "Priority": "Medium",
            "Type": "Service",
            "Due_Date": "2022-03-08",
            "Estimate": null,
            "Request": null,
            "Contact": "2287000000197011",
            "Company": "2287000000179310",
            "Phone": "111-111-1111",
            "Email": "lucy.robins@zylker.com",
            "Asset": null,
            "Territory": "2287000000179179",
            "Service_Address": {
                "id": "2287000000226246",
                "Service_Street_1": "813 E State St",
                "Service_Street_2": null,
                "Service_State": "Illinois",
                "Service_Zip_Code": "61104",
                "Service_Longitude": "-89.084456",
                "Service_City": "Rockford",
                "Service_Country": "United States",
                "Service_Latitude": "42.266611",
                "Service_Address_Name": "Service Address"
            },
            "Billing_Address": {
                "id": "2287000000226245",
                "Billing_City": "Rockford",
                "Billing_Country": "United States",
                "Billing_Latitude": "42.310056",
                "Billing_Street_1": "3338 N Main St",
                "Billing_Street_2": null,
                "Billing_State": "Illinois",
                "Billing_Zip_Code": "61103",
                "Billing_Longitude": "-89.077599",
                "Billing_Address_Name": "Billing Address"
            },
            "Preference": {
                "Preferred_Date_1": null,
                "Preferred_Date_2": null,
                "Preferred_Time": null,
                "Preference_Note": null
            },
            "Currency": "USD",
            "Exchange_Rate": "1.000000000",
            "Sub_Total": 350,
            "Tax_Amount": 21.88,
            "Adjustment": 0,
            "Grand_Total": 372,
            "Service_Line_Items": [
                {
                    "Service": "2287000000179212",
                    "Description": null,
                    "Quantity": 1,
                    "Unit": null,
                    "List_Price": 150,
                    "Amount": 150,
                    "Discount": 0,
                    "Sequence": 1,
                    "Tax": {
                        "Tax_Name": "CaliforniaExciseTax",
                        "Tax_Exemption_Code": null,
                        "Tax_Id": "3526553000000091001",
                        "Tax_Percentage": 7,
                        "Tax_Exemption_Id": null
                    },
                    "Line_Item_Amount": 159.38,
                    "Discount_Type": "Currency",
                    "Status": "New",
                    "Contact": "2287000000197011",
                    "Skill_Line_Items": [],
                    "Service_Tasks_Line_Items": [
                        {
                            "ServiceTask_Name": "Clean and prep wall",
                            "Description": null,
                            "Service_Task": "2287000000179216",
                            "Duration": "0",
                            "Sequence": 1
                        },
                        {
                            "ServiceTask_Name": "Sand or repair surfaces",
                            "Description": null,
                            "Service_Task": "2287000000179217",
                            "Duration": "0",
                            "Sequence": 2
                        }
                    ],
                    "Part_Line_Items": [
                        {
                            "Part": "2287000000191805",
                            "Description": null,
                            "Quantity": 1,
                            "Unit": "Quantity",
                            "List_Price": 200,
                            "Amount": 200,
                            "Discount": 0,
                            "Sequence": 1,
                            "Tax": {
                                "Tax_Name": "CaliforniaExciseTax",
                                "Tax_Exemption_Code": null,
                                "Tax_Id": "3526553000000091001",
                                "Tax_Percentage": 7,
                                "Tax_Exemption_Id": null
                            },
                            "Line_Item_Amount": 212.5,
                            "Discount_Type": "Currency"
                        }
                    ]
                }
            ]
        }
    ]
}

Sample Response

Copied{
    "result": "success",
    "code": "SUCCESS",
    "data": {
        "Service_Line_Items": [
            {
                "UID": "Service_Line_Items_0",
                "Modified_Time": "2023-08-04T15:05:19+05:30",
                "Modified_By": {
                    "name": "William Turner",
                    "id": "2287000000179001"
                },
                "Created_Time": "2023-08-04T15:05:19+05:30",
                "id": "2287000000441195",
                "Created_By": {
                    "name": "William Turner",
                    "id": "2287000000179001"
                },
                "TabName": "ServiceLineItems"
            }
        ],
        "Service_Tasks_Line_Items": [
            {
                "UID": "Service_Line_Items_0_Service_Tasks_Line_Items_0",
                "Modified_Time": "2023-08-04T15:05:19+05:30",
                "Modified_By": {
                    "name": "William Turner",
                    "id": "2287000000179001"
                },
                "Created_Time": "2023-08-04T15:05:19+05:30",
                "id": "2287000000441205",
                "Created_By": {
                    "name": "William Turner",
                    "id": "2287000000179001"
                },
                "TabName": "ServiceTasksLineItems"
            },
            {
                "UID": "Service_Line_Items_0_Service_Tasks_Line_Items_1",
                "Modified_Time": "2023-08-04T15:05:19+05:30",
                "Modified_By": {
                    "name": "William Turner",
                    "id": "2287000000179001"
                },
                "Created_Time": "2023-08-04T15:05:19+05:30",
                "id": "2287000000441206",
                "Created_By": {
                    "name": "William Turner",
                    "id": "2287000000179001"
                },
                "TabName": "ServiceTasksLineItems"
            }
        ],
        "Part_Line_Items": [
            {
                "UID": "Service_Line_Items_0_Part_Line_Items_0",
                "Modified_Time": "2023-08-04T15:05:19+05:30",
                "Modified_By": {
                    "name": "William Turner",
                    "id": "2287000000179001"
                },
                "Created_Time": "2023-08-04T15:05:19+05:30",
                "id": "2287000000441200",
                "Created_By": {
                    "name": "William Turner",
                    "id": "2287000000179001"
                },
                "TabName": "PartLineItems"
            }
        ],
        "Work_Orders": [
            {
                "UID": "Work_Orders_0",
                "Modified_Time": "2023-08-04T15:05:19+05:30",
                "Modified_By": {
                    "name": "William Turner",
                    "id": "2287000000179001"
                },
                "Created_Time": "2023-08-04T15:05:19+05:30",
                "id": "2287000000441186",
                "Created_By": {
                    "name": "William Turner",
                    "id": "2287000000179001"
                },
                "TabName": "WorkOrders"
            }
        ]
    },
    "status": "success"
}