Create Services
Purpose
To add new services to your organization.
Endpoints
Request Details
Request URL
{api-domain}/crm/{version}/Services__s
Header
Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52
Scope
scope=ZohoCRM.modules.services.{operation_type}
Possible operation types
ALL - Full access to services data
CREATE - Create new services
Sample Request
Copiedcurl "https://www.zohoapis.com/crm/v5/Services__s "
-X POST
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"
Request JSON Keys
- Service_Namestring, mandatory
Represents the name of the service and it accepts alphanumeric characters.
- Durationinteger, mandatory
Represents the amount of time for which the particular service is offered.
Possible Values: Values are accepted only in minutes. It should be greater than 15 minutes and lesser than 1,440 minutes. - Locationstring, mandatory
Provides the location where the service is offered.
Possible Values: 'Client Address', 'Business Address' and 'Business Address and Client Address'. - MembersJSON object, mandatory
Contains the ID of users who perform the service. You can add up to 100 members for a service.
- Availability_Typestring, mandatory
Denotes the available days of service for customers.
Possible Values: 'Every Business Days', 'Specific Date Range', 'Specific Date(s)', and 'Specific Day(s)'. - Available_Fromstring, mandatory for Specific Date Range
Denotes the date from which the service is available for customers.
- Available_Tillstring, mandatory for Specific Date Range
Denotes the date until which the service is available for customers.
- Available_DatesJSON array, mandatory for Specific Date(s)
Contains the list of dates on which the service is available for customers. You can provide a maximum of 20 business dates. The values must follow the YYY-MM-DD format.
- Available_DaysJSON array, mandatory for Specific Day(s)
Contains the list of business days on which the service is available for customers.
- Priceinteger, mandatory
Denotes the cost allocated for the service. It takes the locale currency value configured in your organization. You can specify a maximum of 16 digits with 2 decimal places.
- Available_TimingsJSON array, optional
Contains the available time of service for the customers in the specified available days/dates. A maximum of two custom timings can be fed. Note that the customized available time should be equal to or greater than the service duration.
The default value is the same as the configured business hours of the organization.
The value of 'From' and 'To' keys must be given in the 24 hour time format. - TaxJSON array, optional
Contains the ID and value of the tax applied to the service cost. You can fetch the tax IDs and values from the GET Fields API of Services module.
- Job_Sheet_Requiredstring, optional
Denotes whether the members have to fill in a job sheet at the end of each service appointment.
Possible Values: 'Yes' and 'No'. The default value is No. - Job_Sheet_Section__sstring, mandatory only when "Job_Sheet_Required":"Yes"
Represents the Job Sheet which has to be associated with the service. Make a GET Fields API call to get the details of available job sheets in your organization. When Job_Sheet_Required is given 'No', the Job_Sheet_Section__s can either be null or not specified.
- Statusstring, optional
Denotes whether the service is active.
Possible Values: 'Available', 'Temporarily Unavailable' and 'Not in Use'. The default value is Available. - Unavailable_Fromstring, mandatory when status is Temporarily Unavailable or Not in Use
Represents the date and time from which the service is unavailable for customers. The values cannot be greater than the current time. Also, it should be given in the ISO 8601 format.
- Unavailable_Tillstring, mandatory when status is Temporarily Unavailable
Represents the date and time until which the service is unavailable for customers. It should be given in the ISO 8601 format.
- Descriptionstring, optional
Represents the description of the service, if any.
Note
- You can create a maximum of 100 services per API call.
- An organization can have a maximum of 500 active services.
- When the Status is Available, the keys 'Unavailable_From' and 'Unavailable_Till' are not mandatory. If you provide values, ensure that the 'Unavailable_Till' is less than the current time.
- Services with Not in Use Status can be created outside the business hours and business days.
Sample Input
Copied{
"data": [
{
"Service_Name": "AC Repair",
"Duration": "60",
"Location": "Client Address",
"Members": [
{
"Members": {
"id": "5545974000000393001"
}
}
],
"Availability_Type": "Specific Day(s)",
"Available_Days": [
"Monday",
"Tuesday"
],
"Available_Timings": [
{
"From": "10:00",
"To": "18:30"
}
],
"Price": 230.66,
"Tax": [
{
"id": "5545974000000021003",
"value": "Vat - 0.8 %"
}
],
"Status":"Available",
"Job_Sheet_Required": "Yes",
"Job_Sheet_Section__s": "Standard",
"Description":"AC repair and service at your doorstep."
}
]
}
Possible Errors
- DEPENDENT_FIELD_MISSINGHTTP 400
You have failed to provide the dependent fields of Availability_Type, Status and Job_Sheet_Required keys.
Solution: Check the Request JSON Keys section and specify the dependent fields. - DEPENDENT_MISMATCHHTTP 400
You have given an invalid value for Unavailable_Till.
Solution: When the status is temporarily unavailable, the value of 'Unavailable_Till' should be greater than the current time. The value of the same key should be less than the current time if the status is available. - DEPENDENT_MISMATCHHTTP 400
You have given either 'Unavailable_From' or 'Unavailable_Till' keys with available status.
Solution: When the status is available, you can choose either not to specify 'Unavailable_From' and 'Unavailable_Till' keys or specify them both. You cannot specify only one of the keys. - DEPENDENT_MISMATCHHTTP 400
When you have specified the Job_Sheet_Required key as 'No', you cannot specify the Job-Sheet_Section__s.
Solution: Job_Sheet_Section__s should be provided, only when Job_Sheet_Required is given 'Yes'. - DEPENDENT_MISMATCHHTTP 400
The specified Available Timings, Available_Days or Available_Dates do not fall within the business hours or business days of the organization.
Solution: Make a GET Business Hours API call and specify a valid input within the business hours of your organization. - INVALID_DATAHTTP 400
You have given an invalid Availability_Type.
Solution: You should specify any one of these 'Every Business Days', 'Specific Date Range', 'Specific Date(s)', and 'Specific Day(s)' picklist values. - INVALID_DATAHTTP 400
You have given an invalid date format for the Available_Dates key.
Solution: Use only YYYY-MM-DD format for dates. - INVALID_DATAHTTP 400
You have specified an invalid value for either the 'From' or 'To' key in the Available_Timings.
Solution: The custom available timings must be given in the 24 hour time format. - INVALID_DATAHTTP 400
You have specified an invalid Duration value.
Solution: Duration cannot be less than 15 minutes and greater than 1,440 minutes. Note that the value should always be in minutes. - INVALID_DATAHTTP 400
Your value for Available_Timings does not satisfy the service duration.
Solution:The value of Available_Timings key should be equal or greater than the service duration. - INVALID_DATAHTTP 400
You have given an invalid Status value.
Solution: The only possible values are 'Available','Temporarily Unavailable' and 'Not in Use'. - INVALID_DATAHTTP 400
You have given an invalid value for Unavailable_From.
Solution: Ensure that the value of 'Unavailable_From' is not greater than the current time. - INVALID_DATAHTTP 400
You have specified either an unconfirmed or inactive user ID in the Members key.
Solution: You can add only active and confirmed users as a part of service members in your organization. - INVALID_DATAHTTP 400
The value for Available_Till key is not greater than the value of Available_From key.
Solution: When the Availability_Type of a service is 'Specific Date Range', the Available_Till date should be greater than the Available_From date. - INVALID_MODULEHTTP 400
You have given an invalid module name in the request URL.
Solution: You can use only Services__s in the request URL. - INVALID_REQUEST_METHODHTTP 400
You have specified an invalid http request method type.
Solution: Use only the POST method in the request URL to access this API. - LIMIT_EXCEEDEDHTTP 400
You have exceeded the maximum limit either for members in a service or the number of active services in an organization.
Solution: You are allowed to add only up to 100 members to a service. The maximum number of active services in an organization is 500. - OAUTH_SCOPE_MISMATCHHTTP 401
You created the grant token using the wrong oauth scope.
Solution: Use either ZohoCRM.modules.services.CREATE or ZohoCRM.modules.services.ALL scope to create a new valid grant token. - INVALID_TOKENHTTP 401
You have used an invalid oauth token.
Solution: The access token you used has expired. Kindly refresh your token and retry. - NO_PERMISSIONHTTP 403
You do not have permission to create any services.
Solution: Contact your system administrator. - NOT_ALLOWEDHTTP 403
Job Sheet is not configured for your organization in service preferences.
Solution: Enable the job sheet preference before creating services with job sheets. You can update the configurations using the Update Service Preferences API. - NOT_ALLOWEDHTTP 403
You have specified the 'Available' status when the service availability dates are in the past.
Solution: You cannot mark a service as available or temporarily unavailable when the Available_Dates are in the past. - INVALID_URL_PATTERNHTTP 404
Check if you are trying to access the correct URL.
Solution: You have given an invalid request URL. Use only /Services__s endpoint in the URL. - INTERNAL_ERRORHTTP 500
Internal Server Error
Solution: Unexpected and unhandled exception in the server. Please contact our support team.
Sample Response
Copied{
"data": [
{
"code": "SUCCESS",
"details": {
"Modified_Time": "2023-03-29T21:19:19+05:30",
"Modified_By": {
"name": "Patricia Boyle",
"id": "5545974000000393001"
},
"Created_Time": "2023-03-29T21:19:19+05:30",
"id": "5545974000002180641",
"Created_By": {
"name": "Patricia Boyle",
"id": "5545974000000393001"
}
},
"message": "record added",
"status": "success"
}
]
}