Jump to content

Possible to create/update/read Stockable Kits via the (XML/Live) API?


 Share

Recommended Posts

I am trying to create Inventory Items via the XML API, specifically the PHP SDK. 

I see in the REST API documentation that it's possible to define a Stockable Kit with its Kit Components via that API. When I look at my Lookup queries and the API reference, I see no reference to KIT_COMPONENTS or any other similar element I can use to define the components in a create/update request. Similarly, when I try guessing a column in order to query for those fields, I cannot get them. ReadByQueries similarly do not contain any component-related fields.

Has anyone had any luck defining stockable kits through the API?

Link to comment
Share on other sites

  • Members

You can create items of type kit using create_item API

Here is the DTD for create item

DTD:

<!ELEMENT create_item (itemid, name, status?, itemtype,enable_bins?,extended_description?, productlineid?, substituteid?,
ship_weight?, datelastsold?, datelastrecvd?, taxable?, cost_method?, standard_cost?, average_cost?, base_price?,
standard_unit?, purchase_unit?, purchase_unit_factor?, sales_unit?, sales_unit_factor?, default_warehouse?,
glgroup?, note?, inventory_precision?, purchasing_precision?, sales_precision?, upc?, hasstartenddates?, term_period?, defaultnoofperiods?, computepriceforshortterm?,
itaxgroup?, revenue_posting?, vendlineitems?, whslineitems?, complineitems?, taxcode?, vsoecategory?, vsoedlvrstatus?, vsoerevdefstatus?, 
incomeaccount?, invaccount?, expenseaccount?, cogsaccount?, offsetoeglaccount?, offsetpoglaccount?, defrevaccount?, uomgrp?, dropship?,
cnbillingtemplate?, cnrevenuetemplate?,  cnrevenue2template?, cnexpensetemplate?, cnexpense2template?, customfields?, mrr?)>
<!ATTLIST create_item
    ignoreduplicates (true | false) "false"
>

<!ELEMENT complineitems (complineitem+)>
<!ELEMENT complineitem (componentkey,quantity?,revpercent?,delete_component?,kcdlvrstatus?,kcrevdefstatus?)>

If you want to turn this item into a stockable/built kit you can then run this and reference this item:

https://developer.intacct.com/api/inventory-control/stockable-kit-transactions/#create-a-build-kits-transaction

 

To read the item and get all the components associated you can use "read" 56 is the record number of the item you're looking for.

This will return the ITEM information as well as the itemcomponent related list.

<content>
 <function controlid="testControlId">
  <read>
    <object>ITEM</object>
    <fields>*</fields>
    <keys>56</keys>
    <returnFormat>xml</returnFormat>
  </read>
 </function>
</content>

  • Like 1
Link to comment
Share on other sites

Thanks so much!

Just so you know, there's an alternernate way using

<componentinfo><itemcomponent><componentKey>XXX</componentKey></itemcomponent>...</componentinfo>

I have a fork of the PHP SDK and both create and update work this way. Do you expect that to not work in the future?

I was able to use the lookup query to get close with the componentInfo->itemComponents, and then guessed until I saw componentKey (required).

  • Thanks 1
Link to comment
Share on other sites

 Share

×
×
  • Create New...