create_inventory_item_m Sample Call and Response
This example shows a call to create_inventory_item_m that defines a new standalone inventory item, a “Premium Widget,” priced in two currencies and linked to one service and one installment term, based on methods_m_r73.yml, Admin Tools API.
This example covers every required field plus a representative set of optional fields telling one story: a standard inventory item (not a fee or resource item) with multi-currency pricing, stock-level tracking, and an installment term mapping. It does not cover the fee-item or resource-item variants, tiered rate schedules, images, or supplemental object fields.
Sample call
{
"rest_call": "create_inventory_item_m",
"output_format": "json",
"client_no": 900123,
"auth_key": "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6",
"item_type": 0,
"item_name": "Premium Widget",
"item_desc": "A premium widget sold as a standalone inventory item.",
"active_ind": 1,
"purchase_scope": 0,
"service_no": 8842001,
"service": {
"service_no": 8842001,
"name": "Premium Widget Service",
"gl_cd": "4000-SALES",
"taxable": 1,
"tax_group": 200
},
"client_sku": "SKU-PW-1001",
"currency_cd": "usd|gbp",
"item_price": "49.99|39.99",
"tax_inclusive_ind": "0|0",
"modify_price_ind": "N",
"stock_level_track": 1,
"stock_level_adjust": 100.0,
"installment_terms": [
{
"installment_term_no": 48213,
"is_default": 1
}
]
}
The rest_call and output_format fields are added by the REST layer and are not part of the method’s own documented arguments. The client_no and auth_key fields come from the shared param_defaults block. The item_type field is set to 0, meaning this is a standard inventory item; the other allowable values are 2 for a resource item and 3 for a fee (value 1, “Months To Stack,” is called out as deprecated in the field’s own description text, so this example avoids it, and the fee- and resource-only fields such as fee_type, fee_structure_list, days_to_expiry, and resource_type_no are left out entirely since they do not apply to a standard item). The service_no and client_service_id fields are alternatives to each other; this example supplies the Aria-assigned numeric service_no rather than the client-defined client_service_id. The nested service field is represented as a single object, not an array, because this method ties one inventory item to exactly one service, the same single-wrapper shape confirmed for update_inventory_item_m’s required service field; several placeholder attributes inside the service structure (service_type, taxable_ind, usage_type, ar_gl_cd, def_gl_cd, rev_rec_ind, deferred_ind, rate_type, pricing_rule, high_water, billing_option, threshold, and tax_inclusive_ind) are marked nonpublic in the yml and are left out. The currency_cd, item_price, and tax_inclusive_ind fields use the pipe-delimited convention: each is a single string holding one value per currency, in matching order, so “usd|gbp” paired with “49.99|39.99” and “0|0” means the item costs 49.99 United States dollars or 39.99 British pounds, with tax exclusive pricing (a value of 1 in that position would mean tax-inclusive pricing) for both currencies; a single-currency call would use a single value in each field with no pipe character. The installment_terms field is an array (the yml describes it as a list), shown here with one entry linking this item to the installment term created in a companion example, referenced by its Aria-assigned installment_term_no rather than the alternative client_installment_term_id; is_default is set to 1 because it is the only, and therefore default, installment term mapped to this item.
Sample response
{
"error_code": 0,
"error_msg": "OK",
"item_no": 20456789
}
An error_code of zero and an error_msg of “OK” indicate that Aria created the inventory item successfully. The item_no field is the Aria-assigned numeric identifier for the new inventory item. This example leaves out the deprecated client_item_id field (which carries a formal deprecate_version in the yml and so is omitted from the call entirely), the optional image, parent_class, and supplemental_obj_field structures, and the tiered rate schedule alternative to flat multi-currency pricing, since this response reflects only the single, flat-priced item shown in the sample call.