I would like to create an item with a hard-coded ID so I know what the ID of the item is at all times. This is so at a later date I can verify it's existence by calling the getItem()
function on the InventoryConnector
and pass in this ID.
I create an item below like so:
Item i = new Item().setId(MY_ITEM_ID).setName(MY_ITEM_NAME).setPrice(0L).setPriceType(PriceType.VARIABLE).setDefaultTaxRates(false);
mInventoryConnector.createItem(i, new ServiceConnector.Callback<Item>() {
@Override
public void onServiceSuccess(Item result, ResultStatus status) {
//
}
@Override
public void onServiceFailure(ResultStatus status) {
//
}
@Override
public void onServiceConnectionFailure() {
//
}
});
In this case, the setId()
function does not work, and the item's ID is always a 13 character String generated by the SDK.
How might I set an item ID on creation?