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

Input JSON Keys

NameDescriptionType
Summary (mandatory)A summary for the work orderString
Type (mandatory)Whether the work order is of type Service or InspectionString
Contact* (mandatory)The ID of the contact you want to choose for this work orderString
Company* (mandatory)The ID of the company you want to choose for this work orderString
AssetThe ID of the asset you want to choose for this work orderString
Territory (mandatory)

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 (mandatory)

Specify the ID of the service address of the Company/Contact or the address of the Asset you want to use in the work order. The ID can be obtained from the Service_Address key in the response of the Get a Contact/Company API or the Address key in the Get a Asset API.

Example: "id": "1011000000208180"

JSON Object
Billing_Address (mandatory)

Specify the ID of the business address of the Company/Contact you want to use in the work order. The ID can be obtained from the Billing_Address key in the response of the Get a Contact/Company API.

Example: "id": "1011000000208179"

JSON Object
Service_Line_Items (mandatory)

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

  • Service: the ID of the service
  • 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' \
--header 'content-type: application/json' \
--data "{"field1":"value1","field2":"value2"}"

Sample Input

Copied{
    "data": [
        {
            "Summary": "Remodeling of the Crawford House",
            "Type": "Service",
            "Contact": "2373000000232155",
            "Company": null,
            "Territory": "2373000000205267",
            "Service_Address": {
                "id": "2373000000232160"
            },
            "Billing_Address": {
                "id": "2373000000232159"
            },
            "Service_Line_Items": [
                {
                    "Service": "2373000000214003",
                    "Quantity": 1,
                    "Sequence": 1,
                    "Service_Tasks_Line_Items": [
                        {
                            "ServiceTask_Name": "Scrubbing",
                            "Service_Task": "2373000000415009",
                            "Sequence": 1
                        }
                    ],
                    "Part_Line_Items": [
                        {
                            "Part": "2373000000214011",
                            "Quantity": 1,
                            "Sequence": 1
                        }
                    ]
                }
            ]
        }
    ]
}

Sample Response

Copied{
    "result": "success",
    "code": "SUCCESS",
    "data": {
        "Service_Line_Items": [
            {
                "UID": "Service_Line_Items_0",
                "Modified_Time": "2024-07-30T12:04:15+05:30",
                "Modified_By": {
                    "name": "Lilly Rush",
                    "id": "2373000000205001"
                },
                "Created_Time": "2024-07-30T12:04:15+05:30",
                "id": "2373000000750045",
                "Created_By": {
                    "name": "Lilly Rush",
                    "id": "2373000000205001"
                },
                "TabName": "ServiceLineItems"
            }
        ],
        "Service_Tasks_Line_Items": [
            {
                "UID": "Service_Line_Items_0_Service_Tasks_Line_Items_0",
                "Modified_Time": "2024-07-30T12:04:15+05:30",
                "Modified_By": {
                    "name": "Lilly Rush",
                    "id": "2373000000205001"
                },
                "Created_Time": "2024-07-30T12:04:15+05:30",
                "id": "2373000000750055",
                "Created_By": {
                    "name": "Lilly Rush",
                    "id": "2373000000205001"
                },
                "TabName": "ServiceTasksLineItems"
            }
        ],
        "Part_Line_Items": [
            {
                "UID": "Service_Line_Items_0_Part_Line_Items_0",
                "Modified_Time": "2024-07-30T12:04:15+05:30",
                "Modified_By": {
                    "name": "Lilly Rush",
                    "id": "2373000000205001"
                },
                "Created_Time": "2024-07-30T12:04:15+05:30",
                "id": "2373000000750050",
                "Created_By": {
                    "name": "Lilly Rush",
                    "id": "2373000000205001"
                },
                "TabName": "PartLineItems"
            }
        ],
        "Work_Orders": [
            {
                "UID": "Work_Orders_0",
                "Modified_Time": "2024-07-30T12:04:14+05:30",
                "Modified_By": {
                    "name": "Lilly Rush",
                    "id": "2373000000205001"
                },
                "Created_Time": "2024-07-30T12:04:14+05:30",
                "id": "2373000000750038",
                "Created_By": {
                    "name": "Lilly Rush",
                    "id": "2373000000205001"
                },
                "TabName": "WorkOrders"
            }
        ]
    },
    "status": "success"
}