Zoho: Convert Inventory Record
Zoho inventoryConvert.convertInventory: arguments, response, policy and SDK examples.
← Inventory convert operations · Get started
Operation zoho.convertinventory
Provider route: POST /crm/v8/{moduleApiName}/{id}/actions/convert. Alter supplies the connection’s credentials and routing.
Call through Alter
Section titled “Call through Alter”Install @alter-ai/sdk @alter-ai/zoho with npm, or alter-sdk-zoho with pip. Supply your connected customer’s grant ID and the arguments described below.
import { App } from "@alter-ai/sdk";import { ZohoIntegration } from "@alter-ai/zoho";
async function execute(input: Parameters<ZohoIntegration["inventoryConvert"]["convertInventory"]>[0]) { const app = new App({ apiKey: process.env.ALTER_API_KEY! }); try { const provider = new ZohoIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! }); const call = await provider.inventoryConvert.convertInventory(input); const result = await call.wait(); return result.bodyJson(); } finally { await app.close(); }}import osfrom alter_sdk import Appfrom alter_sdk_zoho import ZohoIntegration
async def execute(arguments): async with App(api_key=os.environ["ALTER_API_KEY"]) as app: provider = ZohoIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]}) call = await provider.inventory_convert.convert_inventory(arguments) result = await call.wait() return result.body_json()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
path | object | Required within parent | Additional keys: not allowed |
path.moduleApiName | string | Required within parent | One of: Quotes, Sales_Orders |
path.id | string | Required within parent | Maximum length: 255 |
body | object | Required within parent | Represents the request payload for the inventory record conversion. Additional keys: not allowed |
body.data | array | Optional | Specify the inventory record conversion details. Maximum items: 1 |
body.data[] | object | Each item | Specify the details for the inventory record to convert. Additional keys: not allowed |
body.data[].convert_to | array | Required within parent | Specify the target module details for the conversion. Maximum items: 1 |
body.data[].convert_to[] | object | Each item | Specify the target module name and ID for the converted record. Additional keys: not allowed |
body.data[].convert_to[].carry_over_tags | boolean | Optional | Specifies whether the tags from the source record are carried over to the converted target record. Must be set to true or omitted; setting this to false returns a NOT_ALLOWED error. |
body.data[].convert_to[].module | object | Required within parent | Specify the target inventory module to which the record is to be converted. Additional keys: not allowed |
body.data[].convert_to[].module.api_name | string | Required within parent | Specify the API name of the target inventory module. Possible values: Invoices, Sales_Orders. Use the [Get Modules API](modules.yaml#$.paths./settings/modules.get) to retrieve module IDs and API names. Maximum length: 50 |
body.data[].convert_to[].module.id | string | Required within parent | Unique ID of the target module. Use the [Get Modules API](modules.yaml#$.paths./settings/modules.get) to retrieve module ID. Format: int64 Maximum length: 255 |
Response
Section titled “Response”Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents the successful response returned when the inventory record is converted. Additional keys: not allowed |
data | array | Optional | Represents the list of conversion results returned by the operation. Maximum items: 1 |
data[] | object | Each item | Represents the conversion result for the inventory record. Additional keys: not allowed |
data[].code | string | Optional | Represents the result code of the conversion operation. Possible values: SUCCESS. Known values: SUCCESS |
data[].details | object | Optional | Represents the details of the converted record, organized by the target module API name. Additional keys: not allowed |
data[].details.Invoices | object | Optional | Represents the details of the converted Invoice record. Additional keys: not allowed |
data[].details.Invoices.id | string | Optional | Represents the unique ID of the converted Invoice record. Maximum length: 255 |
data[].details.Invoices.name | string | Optional | Represents the display name of the converted Invoice record. Maximum length: 50 |
data[].details.Sales_Orders | object | Optional | Represents the details of the converted Sales Order record. Additional keys: not allowed |
data[].details.Sales_Orders.id | string | Optional | Represents the unique ID of the converted Sales Order record. Maximum length: 255 |
data[].details.Sales_Orders.name | string | Optional | Represents the display name of the converted Sales Order record. Maximum length: 50 |
data[].message | string | Optional | Represents the message describing the result of the conversion operation. Known values: The record has been converted successfully |
data[].status | string | Optional | Represents the status of the conversion operation. Possible values: success. Known values: success |
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: zoho.convertinventory. Catalog operation: convertInventory. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.
Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.