HikaShop can be driven from a command line, so that a shop can be managed from a terminal, a cron entry, a deployment script or a Makefile, without opening a browser. It works on both platforms, using the command line each of them already provides: the Joomla console for a Joomla site, and WP-CLI for a WordPress one.

Nothing is sent over the network. The commands run inside your own site, on the machine the site is installed on, so there is no key to create and nothing to open to the outside.

Getting started

On Joomla the commands come from the "Console - HikaShop" plugin, installed and enabled with HikaShop. On WordPress they come with the HikaShop plugin itself and need WP-CLI. Ask for the list:

php cli/joomla.php list        # Joomla
wp hikashop                    # WordPress

Each platform spells the same command its own way, Joomla with colons and WordPress with spaces. Everything else is identical: the same arguments, the same options, the same output and the same exit codes.

php cli/joomla.php hikashop:product:list --limit=5
wp hikashop product list --limit=5

Options every command understands

OptionWhat it does
--formattable to read, json to pipe into something else, and also pretty, csv, ids and count. Listings show a table by default, single records show indented JSON.
--userWhich account the command acts as, given by id, user name or email address. It decides what the command may do, through the access levels of your site and of the HikaShop configuration. On WordPress this is WP-CLI's own --user, which behaves the same and can be set once in wp-cli.yml.
--yesRequired by the commands that remove data or act on many records at once. Without it they refuse and change nothing.
--live-siteJoomla only. The address of your site, needed when your configuration does not set one, so that the links the shop generates are correct.

With no --user a command runs as nobody in particular. On a shop that has not restricted anything this is enough; on a shop that has restricted a kind of record to a group of users, the command is refused and says to name a user. Choosing an account also means your change log records who made the change.

What the shell gets back

Only the data is printed to the standard output, so --format=json can always be piped into another program. Warnings and error messages go to the error output and never mix into it.

Answers carry the same envelope the Connector API uses: data is what you asked for, meta holds the paging of a listing, and error is null unless something went wrong. The tables below describe what is inside data.

The exit code says what happened, which is what a script should test:

CodeMeaning
0It worked
1Something went wrong
2The command was asked for wrongly, for example a missing option
3The record does not exist
4This account is not allowed to do that

The commands for your products, orders, customers, categories, coupons and mass actions come through the HikaShop Connector plugin, which ships with the Business edition. The commands for the shop itself, its configuration, its caches and its database, are available in every edition. Running the cron this way needs the Essential or the Business edition, as the cron itself does.

All commands

Products

product:list

List products.

The catalogue as the backend sees it, unpublished products included, which is what makes this different from the front end. Variants are not listed on their own. A parent carries has_variants, and GET /products/{id} returns the variants themselves.

php cli/joomla.php hikashop:product:list [--search=<search>] [--limit=<limit>] [--start=<start>] [--category=<category>] [--ids=<ids>]
wp hikashop product list [--search=<search>] [--limit=<limit>] [--start=<start>] [--category=<category>] [--ids=<ids>]
OptionTypeDescription
--searchstringFilter on a search term
--limitintHow many to return
--startintSkip this many first
--categoryintOnly this category
--idsstringOnly these product ids, comma separated
ReturnsTypeDescription
id
name
codeThe SKU. Unique within the shop.
quantity-1 when the product does not track stock, which is not the same as 0.
published
has_variantsAsk GET /products/{id} for the variants themselves.
imagestring|nullAbsolute URL of the main image, or null.
pricenull when the product has no price row at all.
currency_idA row in the shop's currency table, not an ISO code.
custom_fieldsobjectThe listing values of this product, keyed by field namekey.
In metaTypeDescription
startintegerEchoes the offset used.
limitintegerEchoes the page size used.
totalintegerRows matching the filter, before paging. This is how you know there is another page.
fieldsobject[]The custom fields shown on listings, so a client can label the values it just received.

product:get

Show one product.

Everything the product editor needs in one call: the record, its prices, its images and files, its categories, its characteristics and variants, and the definitions of the custom fields that apply to it. Ask for a variant's id and you get the variant, with parent_id set. A parent's variants are listed in full, so you rarely need to.

php cli/joomla.php hikashop:product:get <id>
wp hikashop product get <id>
ArgumentDescription
<id> requiredProduct id
ReturnsTypeDescription
id
name
codeThe SKU. Unique within the shop.
descriptionThe long description, as HTML.
description_typeWhich editor the description was written with.
published
quantity-1 when this product does not track stock, which is not the same as 0.
msrpThe manufacturer's suggested price, shown struck through when the shop is configured to.
gtinThe barcode: EAN, UPC or ISBN. This is what GET /products/lookup matches on.
conditionNew, used, refurbished. Used by the feeds rather than by the shop itself.
weightShipping weight, in weight_unit.
weight_unitkg, g, lb or oz.
widthIn dimension_unit.
heightIn dimension_unit.
lengthIn dimension_unit.
dimension_unitm, cm, mm, ft or in.
min_per_orderThe smallest quantity a customer may order, 0 for no minimum.
max_per_orderThe largest, 0 for no maximum.
sale_startinteger|nullUnix timestamp before which the product is not on sale.
sale_endinteger|nullUnix timestamp after which it is no longer sold.
page_titleSEO title, empty to use the name.
meta_descriptionSEO description.
keywordsSEO keywords.
canonicalA canonical URL, when this page should point at another.
urlThe address of the product page on the shop.
aliasThe slug used in that address.
accessobjectWho may see the product: mode (all, none or groups) and groups, which are user **group** ids and not Joomla view levels. The two id spaces overlap and disagree, so a value that looks plausible can grant the wrong audience.
access.modestringall, none, or groups when it is restricted to some.
access.groupsinteger[]User group ids, meaningful only when the mode is groups.
contactWhether this product is enquired about rather than bought.
warehouse_idThe warehouse holding the stock, 0 when the shop has none.
typemain for a product, variant for one of its variants.
parent_idThe parent product when this is a variant, 0 otherwise.
value_idsinteger[]For a variant, the characteristic values it stands for.
manufacturer_idThe brand, 0 when unset.
manufacturer_namestringIts name, saving a second call.
tax_idThe tax category, 0 when the product is untaxed.
tax_namestringIts name.
tax_ratenumberThe rate as a fraction, so 0.2 is twenty percent.
pricesobject[]Every price row, including the restricted ones. A product with none is not sellable.
prices.id
prices.valueTax excluded, as stored.
prices.currency_id
prices.min_quantityFrom how many items this row applies, which is how quantity breaks are expressed.
prices.accessobjectWho this price is for, in the same shape as the product access.
prices.access.modestringAs above.
prices.access.groupsinteger[]As above.
prices.usersinteger[]Named customers, empty for everyone.
prices.zone_idsinteger[]Zones this price applies in, empty for everywhere.
prices.start_dateinteger|nullUnix timestamp.
prices.end_dateinteger|nullUnix timestamp.
imagesobject[]In the order the editor shows them; the first is the main image.
images.id
images.name
images.pathRelative to the upload folder.
images.urlAbsolute, ready to display.
images.ordering
images.descriptionThe alt text.
images.accessobjectWho may see it.
images.access.modestringAs above.
images.access.groupsinteger[]As above.
images.free_downloadFiles only; meaningless on an image.
filesobject[]Downloadable files, in the same shape as the images.
files.id
files.name
files.pathRelative to the upload folder.
files.urlAbsolute.
files.ordering
files.description
files.accessobjectWho may download it.
files.free_downloadWhether it can be downloaded without buying the product.
categoriesobject[]The categories the product is in.
categories.id
categories.name
bundleobject[]The products this one is made of, when it is a bundle.
bundle.id
bundle.name
bundle.code
bundle.quantityHow many of it the bundle contains.
optionsobject[]Products offered as options alongside this one.
options.id
options.name
options.code
options.quantity
relatedobject[]Products shown as related.
related.id
related.name
related.code
related.quantity
tagsinteger[]CMS tag ids.
characteristicsobject[]The characteristics this product varies on. Empty when it has no variants.
characteristics.idintegerThe characteristic, such as Size.
characteristics.namestringIts name.
characteristics.valuesobject[]The values of it this product uses, such as S, M and L.
characteristics.values.idintegerThe value id, which is what a variant refers to.
characteristics.values.valuestringIts name, such as M.
variantsobject[]Every variant, with its own code, stock, price and images. Empty for a product that does not vary.
variants.idintegerThe variant is a product in its own right, and this is its id.
variants.codestringIts own SKU.
variants.quantityintegerIts own stock. This is the figure to change, not the parent's.
variants.publishedboolean
variants.pricenumber|nullnull when the variant has no price of its own and the parent's applies.
variants.valuesobject[]Which characteristic values this variant stands for, one per characteristic.
variants.values.option_idintegerThe characteristic.
variants.values.option_namestringIts name, so the variant can be labelled without a second call.
variants.values.value_idintegerThe value.
variants.values.valuestringIts name.
variants.imagesobject[]The variant's own images, in the same shape as the product's.
variants.images.idinteger
variants.images.namestring
variants.images.pathstringRelative to the upload folder.
variants.images.urlstringAbsolute.
variants.images.orderinginteger
fieldsobject[]The definitions of the custom fields that apply to this product, so a client can build a form for them.
fields.namekeystringThe key used in custom_fields.
fields.labelstringTranslated into the operator's language.
fields.typestringtext, radio, singledropdown, file, and the rest of HikaShop's field types.
fields.requiredbooleanWhether the shop refuses to save the product without it.
fields.translatablebooleanWhether its value can be translated, which is what the translation routes offer.
fields.upload_dirstringFor a file field, where its uploads are kept.
fields.raw_typestringHikaShop's own name for the type, before it is mapped to something a client can render.
fields.defaultstringThe value used when none is given.
fields.optionsobject[]The choices, for a field that has them. Empty for a free text one.
fields.multiplebooleanWhether more than one choice may be selected.
fields.allowed_extensionsstringFor a file field, the extensions it accepts, comma separated. Empty means the shop default.
fields.date_formatstringFor a date field, the format it is stored in.
custom_fieldsobjectTheir values, keyed by namekey.
custom_field_filesobjectFor custom fields holding a file, the file behind each value.

product:create

Create a product.

Creates a product and answers with its id. Only the name is required; everything else can be set now or later with PUT /products/{id}. Prices, images and categories are separate calls, so a new product is not sellable until it has at least one price.

php cli/joomla.php hikashop:product:create --name=<name> [--code=<code>] [--quantity=<quantity>] [--published] [--description=<description>] [--categories=<categories>]
wp hikashop product create --name=<name> [--code=<code>] [--quantity=<quantity>] [--published] [--description=<description>] [--categories=<categories>]
OptionTypeDescription
--name requiredstringProduct name
--codestringProduct code, derived from the name when left out
--quantityintStock, -1 for unlimited
--publishedflagPublish it
--descriptionstringDescription
--categoriesids, comma separatedCategory ids, comma separated
ReturnsTypeDescription
id
name
codeThe SKU. Unique within the shop.
descriptionThe long description, as HTML.
description_typeWhich editor the description was written with.
published
quantity-1 when this product does not track stock, which is not the same as 0.
msrpThe manufacturer's suggested price, shown struck through when the shop is configured to.
gtinThe barcode: EAN, UPC or ISBN. This is what GET /products/lookup matches on.
conditionNew, used, refurbished. Used by the feeds rather than by the shop itself.
weightShipping weight, in weight_unit.
weight_unitkg, g, lb or oz.
widthIn dimension_unit.
heightIn dimension_unit.
lengthIn dimension_unit.
dimension_unitm, cm, mm, ft or in.
min_per_orderThe smallest quantity a customer may order, 0 for no minimum.
max_per_orderThe largest, 0 for no maximum.
sale_startinteger|nullUnix timestamp before which the product is not on sale.
sale_endinteger|nullUnix timestamp after which it is no longer sold.
page_titleSEO title, empty to use the name.
meta_descriptionSEO description.
keywordsSEO keywords.
canonicalA canonical URL, when this page should point at another.
urlThe address of the product page on the shop.
aliasThe slug used in that address.
accessobjectWho may see the product: mode (all, none or groups) and groups, which are user **group** ids and not Joomla view levels. The two id spaces overlap and disagree, so a value that looks plausible can grant the wrong audience.
access.modestringall, none, or groups when it is restricted to some.
access.groupsinteger[]User group ids, meaningful only when the mode is groups.
contactWhether this product is enquired about rather than bought.
warehouse_idThe warehouse holding the stock, 0 when the shop has none.
typemain for a product, variant for one of its variants.
parent_idThe parent product when this is a variant, 0 otherwise.
value_idsinteger[]For a variant, the characteristic values it stands for.
manufacturer_idThe brand, 0 when unset.
manufacturer_namestringIts name, saving a second call.
tax_idThe tax category, 0 when the product is untaxed.
tax_namestringIts name.
tax_ratenumberThe rate as a fraction, so 0.2 is twenty percent.
pricesobject[]Every price row, including the restricted ones. A product with none is not sellable.
prices.id
prices.valueTax excluded, as stored.
prices.currency_id
prices.min_quantityFrom how many items this row applies, which is how quantity breaks are expressed.
prices.accessobjectWho this price is for, in the same shape as the product access.
prices.access.modestringAs above.
prices.access.groupsinteger[]As above.
prices.usersinteger[]Named customers, empty for everyone.
prices.zone_idsinteger[]Zones this price applies in, empty for everywhere.
prices.start_dateinteger|nullUnix timestamp.
prices.end_dateinteger|nullUnix timestamp.
imagesobject[]In the order the editor shows them; the first is the main image.
images.id
images.name
images.pathRelative to the upload folder.
images.urlAbsolute, ready to display.
images.ordering
images.descriptionThe alt text.
images.accessobjectWho may see it.
images.access.modestringAs above.
images.access.groupsinteger[]As above.
images.free_downloadFiles only; meaningless on an image.
filesobject[]Downloadable files, in the same shape as the images.
files.id
files.name
files.pathRelative to the upload folder.
files.urlAbsolute.
files.ordering
files.description
files.accessobjectWho may download it.
files.free_downloadWhether it can be downloaded without buying the product.
categoriesobject[]The categories the product is in.
categories.id
categories.name
bundleobject[]The products this one is made of, when it is a bundle.
bundle.id
bundle.name
bundle.code
bundle.quantityHow many of it the bundle contains.
optionsobject[]Products offered as options alongside this one.
options.id
options.name
options.code
options.quantity
relatedobject[]Products shown as related.
related.id
related.name
related.code
related.quantity
tagsinteger[]CMS tag ids.
characteristicsobject[]The characteristics this product varies on. Empty when it has no variants.
characteristics.idintegerThe characteristic, such as Size.
characteristics.namestringIts name.
characteristics.valuesobject[]The values of it this product uses, such as S, M and L.
characteristics.values.idintegerThe value id, which is what a variant refers to.
characteristics.values.valuestringIts name, such as M.
variantsobject[]Every variant, with its own code, stock, price and images. Empty for a product that does not vary.
variants.idintegerThe variant is a product in its own right, and this is its id.
variants.codestringIts own SKU.
variants.quantityintegerIts own stock. This is the figure to change, not the parent's.
variants.publishedboolean
variants.pricenumber|nullnull when the variant has no price of its own and the parent's applies.
variants.valuesobject[]Which characteristic values this variant stands for, one per characteristic.
variants.values.option_idintegerThe characteristic.
variants.values.option_namestringIts name, so the variant can be labelled without a second call.
variants.values.value_idintegerThe value.
variants.values.valuestringIts name.
variants.imagesobject[]The variant's own images, in the same shape as the product's.
variants.images.idinteger
variants.images.namestring
variants.images.pathstringRelative to the upload folder.
variants.images.urlstringAbsolute.
variants.images.orderinginteger
fieldsobject[]The definitions of the custom fields that apply to this product, so a client can build a form for them.
fields.namekeystringThe key used in custom_fields.
fields.labelstringTranslated into the operator's language.
fields.typestringtext, radio, singledropdown, file, and the rest of HikaShop's field types.
fields.requiredbooleanWhether the shop refuses to save the product without it.
fields.translatablebooleanWhether its value can be translated, which is what the translation routes offer.
fields.upload_dirstringFor a file field, where its uploads are kept.
fields.raw_typestringHikaShop's own name for the type, before it is mapped to something a client can render.
fields.defaultstringThe value used when none is given.
fields.optionsobject[]The choices, for a field that has them. Empty for a free text one.
fields.multiplebooleanWhether more than one choice may be selected.
fields.allowed_extensionsstringFor a file field, the extensions it accepts, comma separated. Empty means the shop default.
fields.date_formatstringFor a date field, the format it is stored in.
custom_fieldsobjectTheir values, keyed by namekey.
custom_field_filesobjectFor custom fields holding a file, the file behind each value.
Can also fail withMeaning
invalid_fieldsOne of your own fields was rejected by its own rules.
save_failedThe shop refused to save the product.

product:update

Change a product.

Changes the fields you send and leaves the rest alone, which is the opposite of the price and category calls: this one merges. Sending nothing to change is refused rather than treated as a success, so a client cannot believe it saved something it did not.

php cli/joomla.php hikashop:product:update <id> [--name=<name>] [--code=<code>] [--description=<description>] [--published] [--msrp=<msrp>] [--gtin=<gtin>] [--weight=<weight>] [--tax-id=<tax-id>]
wp hikashop product update <id> [--name=<name>] [--code=<code>] [--description=<description>] [--published] [--msrp=<msrp>] [--gtin=<gtin>] [--weight=<weight>] [--tax-id=<tax-id>]
ArgumentDescription
<id> requiredProduct id
OptionTypeDescription
--namestringProduct name
--codestringProduct code
--descriptionstringDescription
--publishedflagPublish it
--msrpfloatRecommended retail price
--gtinstringGTIN / barcode
--weightfloatWeight
--tax-idintTax category id
ReturnsTypeDescription
id
name
codeThe SKU. Unique within the shop.
descriptionThe long description, as HTML.
description_typeWhich editor the description was written with.
published
quantity-1 when this product does not track stock, which is not the same as 0.
msrpThe manufacturer's suggested price, shown struck through when the shop is configured to.
gtinThe barcode: EAN, UPC or ISBN. This is what GET /products/lookup matches on.
conditionNew, used, refurbished. Used by the feeds rather than by the shop itself.
weightShipping weight, in weight_unit.
weight_unitkg, g, lb or oz.
widthIn dimension_unit.
heightIn dimension_unit.
lengthIn dimension_unit.
dimension_unitm, cm, mm, ft or in.
min_per_orderThe smallest quantity a customer may order, 0 for no minimum.
max_per_orderThe largest, 0 for no maximum.
sale_startinteger|nullUnix timestamp before which the product is not on sale.
sale_endinteger|nullUnix timestamp after which it is no longer sold.
page_titleSEO title, empty to use the name.
meta_descriptionSEO description.
keywordsSEO keywords.
canonicalA canonical URL, when this page should point at another.
urlThe address of the product page on the shop.
aliasThe slug used in that address.
accessobjectWho may see the product: mode (all, none or groups) and groups, which are user **group** ids and not Joomla view levels. The two id spaces overlap and disagree, so a value that looks plausible can grant the wrong audience.
access.modestringall, none, or groups when it is restricted to some.
access.groupsinteger[]User group ids, meaningful only when the mode is groups.
contactWhether this product is enquired about rather than bought.
warehouse_idThe warehouse holding the stock, 0 when the shop has none.
typemain for a product, variant for one of its variants.
parent_idThe parent product when this is a variant, 0 otherwise.
value_idsinteger[]For a variant, the characteristic values it stands for.
manufacturer_idThe brand, 0 when unset.
manufacturer_namestringIts name, saving a second call.
tax_idThe tax category, 0 when the product is untaxed.
tax_namestringIts name.
tax_ratenumberThe rate as a fraction, so 0.2 is twenty percent.
pricesobject[]Every price row, including the restricted ones. A product with none is not sellable.
prices.id
prices.valueTax excluded, as stored.
prices.currency_id
prices.min_quantityFrom how many items this row applies, which is how quantity breaks are expressed.
prices.accessobjectWho this price is for, in the same shape as the product access.
prices.access.modestringAs above.
prices.access.groupsinteger[]As above.
prices.usersinteger[]Named customers, empty for everyone.
prices.zone_idsinteger[]Zones this price applies in, empty for everywhere.
prices.start_dateinteger|nullUnix timestamp.
prices.end_dateinteger|nullUnix timestamp.
imagesobject[]In the order the editor shows them; the first is the main image.
images.id
images.name
images.pathRelative to the upload folder.
images.urlAbsolute, ready to display.
images.ordering
images.descriptionThe alt text.
images.accessobjectWho may see it.
images.access.modestringAs above.
images.access.groupsinteger[]As above.
images.free_downloadFiles only; meaningless on an image.
filesobject[]Downloadable files, in the same shape as the images.
files.id
files.name
files.pathRelative to the upload folder.
files.urlAbsolute.
files.ordering
files.description
files.accessobjectWho may download it.
files.free_downloadWhether it can be downloaded without buying the product.
categoriesobject[]The categories the product is in.
categories.id
categories.name
bundleobject[]The products this one is made of, when it is a bundle.
bundle.id
bundle.name
bundle.code
bundle.quantityHow many of it the bundle contains.
optionsobject[]Products offered as options alongside this one.
options.id
options.name
options.code
options.quantity
relatedobject[]Products shown as related.
related.id
related.name
related.code
related.quantity
tagsinteger[]CMS tag ids.
characteristicsobject[]The characteristics this product varies on. Empty when it has no variants.
characteristics.idintegerThe characteristic, such as Size.
characteristics.namestringIts name.
characteristics.valuesobject[]The values of it this product uses, such as S, M and L.
characteristics.values.idintegerThe value id, which is what a variant refers to.
characteristics.values.valuestringIts name, such as M.
variantsobject[]Every variant, with its own code, stock, price and images. Empty for a product that does not vary.
variants.idintegerThe variant is a product in its own right, and this is its id.
variants.codestringIts own SKU.
variants.quantityintegerIts own stock. This is the figure to change, not the parent's.
variants.publishedboolean
variants.pricenumber|nullnull when the variant has no price of its own and the parent's applies.
variants.valuesobject[]Which characteristic values this variant stands for, one per characteristic.
variants.values.option_idintegerThe characteristic.
variants.values.option_namestringIts name, so the variant can be labelled without a second call.
variants.values.value_idintegerThe value.
variants.values.valuestringIts name.
variants.imagesobject[]The variant's own images, in the same shape as the product's.
variants.images.idinteger
variants.images.namestring
variants.images.pathstringRelative to the upload folder.
variants.images.urlstringAbsolute.
variants.images.orderinginteger
fieldsobject[]The definitions of the custom fields that apply to this product, so a client can build a form for them.
fields.namekeystringThe key used in custom_fields.
fields.labelstringTranslated into the operator's language.
fields.typestringtext, radio, singledropdown, file, and the rest of HikaShop's field types.
fields.requiredbooleanWhether the shop refuses to save the product without it.
fields.translatablebooleanWhether its value can be translated, which is what the translation routes offer.
fields.upload_dirstringFor a file field, where its uploads are kept.
fields.raw_typestringHikaShop's own name for the type, before it is mapped to something a client can render.
fields.defaultstringThe value used when none is given.
fields.optionsobject[]The choices, for a field that has them. Empty for a free text one.
fields.multiplebooleanWhether more than one choice may be selected.
fields.allowed_extensionsstringFor a file field, the extensions it accepts, comma separated. Empty means the shop default.
fields.date_formatstringFor a date field, the format it is stored in.
custom_fieldsobjectTheir values, keyed by namekey.
custom_field_filesobjectFor custom fields holding a file, the file behind each value.
Can also fail withMeaning
not_foundNo such product, or the operator may not change it.
invalid_fieldsOne of your own fields was rejected by its own rules.
nothingThe body held no field this shop knows, so nothing would have been written.

product:delete

Delete a product and its variants.

Deletes a product and its variants. Orders that already contain it are untouched: an order line records what was sold at the time, and it does not stop meaning something because the catalogue changed.

php cli/joomla.php hikashop:product:delete <id> --yes
wp hikashop product delete <id> --yes
ArgumentDescription
<id> requiredProduct id
ReturnsTypeDescription
idintegerThe product that was deleted.
deletedbooleanTrue when the row is gone.
Can also fail withMeaning
not_foundNo such product, or the operator may not delete it.
delete_failedThe shop refused to delete it.

product:stock

Set a product's stock.

Sets the tracked quantity to an absolute figure, which is what a stock take does. It is not an adjustment: send what the shelf holds, not the difference. A product with variants keeps no stock of its own, so set it on the variant instead. Asking to set it on the parent is refused rather than silently ignored.

php cli/joomla.php hikashop:product:stock <id> --quantity=<quantity>
wp hikashop product stock <id> --quantity=<quantity>
ArgumentDescription
<id> requiredProduct id
OptionTypeDescription
--quantity requiredintNew quantity, -1 for unlimited
ReturnsTypeDescription
idinteger
quantityintegerAs stored, so you can confirm what was written.
Can also fail withMeaning
not_foundNo such product, or the operator may not change it.
has_variantsIt is a parent: set the stock on one of its variants.

product:price

Replace a product's price set.

Replaces the whole price set, it does not merge into it. Send every price the product should have, including the ones you are not changing; anything you leave out is deleted. That is deliberate, because a price set is a set: quantity breaks and audience restrictions only make sense against each other.

php cli/joomla.php hikashop:product:price <id> --value=<value> [--currency=<currency>] [--min-quantity=<min-quantity>]
wp hikashop product price <id> --value=<value> [--currency=<currency>] [--min-quantity=<min-quantity>]
ArgumentDescription
<id> requiredProduct id
OptionTypeDescription
--value requiredfloatThe price
--currencyintCurrency id, the shop's own when left out
--min-quantityintQuantity this price starts at
ReturnsTypeDescription
idinteger
valuenumberTax excluded, as stored.
currency_idinteger
min_quantityintegerFrom how many items this row applies, which is how a quantity break is expressed.
accessobjectWhich user groups the price is for.
access.modestringall, none or groups.
access.groupsinteger[]User group ids, not view levels.
usersinteger[]Named customers, empty for everyone.
zone_idsinteger[]Zones it applies in, empty for everywhere.
start_dateinteger|nullUnix timestamp.
end_dateinteger|nullUnix timestamp.
Can also fail withMeaning
invalid_requestNo prices array was sent.
invalid_priceA price in the set cannot be stored, and the message says which one and why. Nothing is saved: a set is replaced whole or not at all.
not_foundNo such product, or the operator may not change it.

product:lowstock

List sellable products at or below a stock threshold.

Sellable items at or below a stock threshold, cheapest first to reorder. Variants are listed in their own right, since that is where the stock actually sits. Products that do not track stock are left out: they are not running out of anything.

php cli/joomla.php hikashop:product:lowstock [--threshold=<threshold>] [--limit=<limit>]
wp hikashop product lowstock [--threshold=<threshold>] [--limit=<limit>]
OptionTypeDescription
--thresholdintStock level to report at or below
--limitintHow many to return
ReturnsTypeDescription
idThe parent product.
variant_idThe variant that is low, 0 when the parent itself is.
name
codeThe SKU of whichever record is low.
quantityWhat is left.

Orders

order:list

List orders.

The orders the operator may see, newest first. It is the listing the app's order screen is built on, so it carries just enough to draw a row and no more; ask for one order when you need the rest.

php cli/joomla.php hikashop:order:list [--search=<search>] [--limit=<limit>] [--start=<start>] [--status=<status>]
wp hikashop order list [--search=<search>] [--limit=<limit>] [--start=<start>] [--status=<status>]
OptionTypeDescription
--searchstringFilter on a search term
--limitintHow many to return
--startintSkip this many first
--statusstringOnly this order status
ReturnsTypeDescription
idThe order id, which is what every other order route takes.
numberThe order number the customer sees, which is not the id.
statusA namekey, not a label. GET /statuses translates it.
createdUnix timestamp.
totalWhat the customer owes, tax included, in the order currency.
currency_idThe order keeps the currency it was placed in, which need not be the shop default.
customerobjectEnough to name the buyer in a list.
customer.name
customer.email
custom_fieldsobjectThe listing values of your own order fields, keyed by namekey.
In metaTypeDescription
startintegerEchoes the offset used.
limitintegerEchoes the page size used.
totalintegerOrders matching the filter, before paging.
fieldsobject[]The definitions behind custom_fields.

order:get

Show one order.

The whole order: its lines, its totals, its addresses, its history and your own fields. Money is in the currency the order was placed in, which is not necessarily the shop's. Do not convert it: an order is a record of what was agreed at the time.

php cli/joomla.php hikashop:order:get <id>
wp hikashop order get <id>
ArgumentDescription
<id> requiredOrder id
ReturnsTypeDescription
feesobjectThe discount, shipping and payment amounts, which is what PUT /orders/{id}/fees writes.
fees.discountobjectIts amount, its tax, the tax_namekeys behind that tax, and the coupon code when one was used.
fees.discount.amountnumberA positive figure, already subtracted from the total.
fees.discount.taxnumberThe tax on it.
fees.discount.tax_namekeysstring[]Which tax rates that came from.
fees.discount.codestringThe coupon code, empty for a discount applied by hand.
fees.shippingobjectThe shipping charge and what carried it.
fees.shipping.amountnumberTax excluded.
fees.shipping.taxnumberThe tax on it.
fees.shipping.tax_namekeysstring[]Which tax rates that came from.
fees.shipping.methodstringThe plugin that handled it.
fees.shipping.method_namestringAs the merchant named it.
fees.paymentobjectThe payment fee and what took it.
fees.payment.amountnumberTax excluded.
fees.payment.taxnumberThe tax on it.
fees.payment.tax_namekeysstring[]Which tax rates that came from.
fees.payment.methodstringThe plugin that took it.
fees.payment.method_namestringAs the merchant named it.
totalsobjectThe figures. See the shape below.
totals.totalnumberWhat the customer owes, tax included.
totals.discountnumberThe discount applied, as a positive figure already subtracted.
totals.shippingnumberThe shipping charged.
totals.paymentnumberThe payment fee charged.
totals.taxnumberThe tax within the total, not on top of it.
id
numberThe number the customer sees.
statusA namekey.
createdUnix timestamp.
modifiedUnix timestamp of the last change.
currency_idThe currency the order was placed in.
customerobjectWho placed it.
customer.name
customer.email
payment_methodstringHow it was paid, as the shop names it.
shipping_methodstringHow it ships.
invoice_numberstringEmpty until an invoice has been issued.
invoice_createdinteger|nullUnix timestamp of the invoice.
itemsobject[]The lines: id, name, code, quantity, price, tax and whether the line can still be edited.
items.idintegerThe line id, which is what PUT /orders/{id}/products/{lineId} takes. It is not the product id.
items.namestringThe product as it was named when ordered, which may since have changed.
items.codestringIts SKU at the time.
items.quantityinteger
items.pricenumberUnit price, tax excluded, as agreed at the time.
items.taxnumberTax on the line.
items.editablebooleanFalse once the line can no longer be changed, for instance on a shipped order.
billing_addressobject|nullThe address as it was at the time, null when there is none. It is a copy, not a pointer at the customer's current address.
shipping_addressobject|nullThe same, for delivery.
shipping_address_overridebooleanWhether the delivery address was set apart from the billing one.
historyobject[]What has happened to the order, oldest first.
history.statusThe namekey it moved to.
history.createdUnix timestamp.
history.typeWhat caused it: a payment notification, an operator, the shop itself.
history.reasonThe note recorded with the change, when there was one.
history.notifiedbooleanWhether the customer was emailed about it.
fieldsobject[]The definitions of your own order fields.
custom_fieldsobjectTheir values, keyed by namekey.
custom_field_filesobjectFor a field holding a file, the file behind the value.
tax_ratesobject[]The rates that made up the tax, each with its namekey and rate, so a total can be explained rather than only shown.
tax_rates.namekeystringThe tax rate as the shop names it.
tax_rates.ratenumberAs a fraction, so 0.1 is ten percent.

order:status

Change an order's status.

Moves the order and, when asked, sends the customer the same notification the backend would have sent. This calls the same code the backend does, so stock, invoices and every plugin listening on a status change behave exactly as they do there. It is not a database update.

php cli/joomla.php hikashop:order:status <id> <status> [--notify] [--reason=<reason>]
wp hikashop order status <id> <status> [--notify] [--reason=<reason>]
ArgumentDescription
<id> requiredOrder id
<status> requiredStatus namekey, e.g. confirmed or shipped
OptionTypeDescription
--notifyflagEmail the customer about the change
--reasonstringNote stored with the change
ReturnsTypeDescription
idintegerThe order id.
statusThe namekey the order now has.
changedFalse when the order already had that status.
notifiedbooleanWhether the customer was actually emailed, which can be false even when you asked, if the status has no notification configured.
Can also fail withMeaning
invalid_statusNo such status namekey on this shop.
not_foundNo such order, or the operator may not see it.
save_failedThe order could not be saved.

order:create

Create an empty order for a customer.

Creates an empty order for a customer, to be filled in with lines, fees and an address. Give it either an existing user_id or a guest with at least an email address, which is how an order gets taken over the telephone from somebody who has never bought before.

php cli/joomla.php hikashop:order:create [--customer=<customer>] [--guest]
wp hikashop order create [--customer=<customer>] [--guest]
OptionTypeDescription
--customerintHikaShop customer id
--guestflagCreate it for a guest instead
ReturnsTypeDescription
idintegerThe order that was created, to add lines to.
Can also fail withMeaning
no_customerNeither a user_id nor a usable guest was given.
save_failedThe order could not be created.

order:addproduct

Add a product line to an order.

Adds a product to an existing order and re-totals it. Send a price only to override what the shop would charge; leave it out and the order's own pricing applies, which is what GET /orders/{id}/products/precompute shows you beforehand.

php cli/joomla.php hikashop:order:addproduct <id> --product=<product> [--quantity=<quantity>] [--price=<price>]
wp hikashop order addproduct <id> --product=<product> [--quantity=<quantity>] [--price=<price>]
ArgumentDescription
<id> requiredOrder id
OptionTypeDescription
--product requiredintProduct id
--quantityintHow many
--pricefloatUnit price, the product's own when left out
ReturnsTypeDescription
totalsobjectThe order totalled, so a client need not compute it and disagree with the shop.
totals.totalnumberWhat the customer owes, tax included.
totals.discountnumberThe discount applied, as a positive figure already subtracted.
totals.shippingnumberThe shipping charged.
totals.paymentnumberThe payment fee charged.
totals.taxnumberThe tax within the total, not on top of it.
items.idintegerThe line id, which is what the line routes take. It is not the product id.
items.namestringThe product as it was named when ordered.
items.codestringIts SKU at the time.
items.quantityinteger
items.pricenumberUnit price, tax excluded, as agreed at the time.
items.taxnumberTax on the line.
items.editablebooleanFalse once the line can no longer be changed.
idintegerThe order.
itemsobject[]The lines as they now stand, in the same shape as on the order.
Can also fail withMeaning
not_foundNo such order or product, or the operator may not change the order.
save_failedThe order could not be saved.

Customers

customer:list

List customers.

The customers the operator may see, with enough to recognise one and to know whether they have bought anything. Guests are included. A shop that lets people order without an account still has a row for each of them, and type is how you tell the two apart.

php cli/joomla.php hikashop:customer:list [--search=<search>] [--limit=<limit>] [--start=<start>]
wp hikashop customer list [--search=<search>] [--limit=<limit>] [--start=<start>]
OptionTypeDescription
--searchstringFilter on a search term
--limitintHow many to return
--startintSkip this many first
ReturnsTypeDescription
idThe HikaShop customer id, which is not the CMS user id.
nameThe account name, or for a guest the name on their default address, since a guest has no account to take one from.
email
typeregistered for an account, guest for someone who ordered without one.
createdUnix timestamp of the first time the shop saw them.
order_countHow many orders they have placed, so a list can be sorted by worth without a second call.
In metaTypeDescription
startintegerEchoes the offset used.
limitintegerEchoes the page size used.
totalintegerCustomers matching the filter, before paging.

customer:get

Show one customer.

A customer with their addresses, their orders, which groups they are in and your own customer fields. can_edit_account and groups_editable are worth reading before drawing a form: they say whether this operator may change this particular account at all, so a client can leave the controls out rather than offer something that will be refused. A customer can have many addresses and one default of each kind.

php cli/joomla.php hikashop:customer:get <id>
wp hikashop customer get <id>
ArgumentDescription
<id> requiredCustomer id
ReturnsTypeDescription
idintegerThe HikaShop customer id, which is what every customer route takes.
cms_idintegerThe Joomla or WordPress user id, 0 for a guest with no account.
namestring
emailstring
usernamestringThe login, empty for a guest.
typestringregistered or guest.
blockedbooleanWhether the CMS account is disabled.
can_edit_accountbooleanWhether this operator may change the login and password of this particular account. False for an account above their own level, which is how a super user is protected from staff.
groups_editablebooleanWhether this operator may change which groups the customer is in.
groupsobject[]The groups they are in.
groups.idinteger
groups.titlestring
available_groupsobject[]Every group, with whether this operator may put the customer into it, so a picker can grey out the rest rather than offering a refusal.
available_groups.idinteger
available_groups.titlestring
available_groups.assignablebooleanFalse for a group this operator may not grant.
createdintegerUnix timestamp of the first time the shop saw them.
addressesobject[]Their addresses, defaults first.
addresses.idinteger
addresses.typesstring[]Which of billing and shipping it is used for.
addresses.namestring
addresses.companystring
addresses.streetstring
addresses.citystring
addresses.post_codestring
addresses.telephonestring
addresses.defaultbooleanWhether it is the default for one of its types.
addresses.formattedobjectThe address laid out the way this shop lays addresses out, which depends on its address format setting.
addresses.formatted.textstringSeveral lines, for an invoice or a label.
addresses.formatted.one_linestringOne line, for a list.
ordersobject[]Their orders, newest first, enough to list them.
orders.idinteger
orders.numberstringThe number the customer sees.
orders.statusstringA namekey.
orders.createdintegerUnix timestamp.
orders.totalnumberTax included, in the order currency.
orders.currency_idintegerThat currency.
fieldsobject[]The definitions of your own customer fields.
custom_fieldsobjectTheir values, keyed by namekey.
custom_field_filesobjectFor a field holding a file, the file behind the value.
Can also fail withMeaning
not_foundNo such customer, or the operator may not see them.

customer:create

Create a customer.

Creates a customer from an email address and a name, as a guest: no account, no password, nothing for them to log in with. POST /customers/{id}/account turns one into a registered customer afterwards.

php cli/joomla.php hikashop:customer:create --email=<email> [--name=<name>]
wp hikashop customer create --email=<email> [--name=<name>]
OptionTypeDescription
--email requiredstringEmail address
--namestringFull name
ReturnsTypeDescription
idintegerThe customer that was created.
Can also fail withMeaning
email_takenAnother customer already has that address.
save_failedThe shop refused to save it.

customer:delete

Delete a customer.

Removes a customer and their addresses. A customer with orders is refused, which is what the backend does too: delete their orders first, and then the customer.

php cli/joomla.php hikashop:customer:delete <id> --yes
wp hikashop customer delete <id> --yes
ArgumentDescription
<id> requiredCustomer id
ReturnsTypeDescription
deletedbooleanTrue when the row is gone.
Can also fail withMeaning
not_foundNo such customer, or the operator may not delete them.
has_ordersThey have orders. Delete those first.
delete_failedThe shop refused to delete the row.

Categories

category:list

List product categories.

One level of the category tree at a time, unpublished categories included, which is what makes this a management view rather than a shop one. Pass a parent_id to walk down. has_children tells you whether there is anything below without asking, so a tree can be drawn lazily. HikaShop keeps its manufacturers and its tax categories in the same table as the product categories, told apart by their root. Ask for the tree you want.

php cli/joomla.php hikashop:category:list
wp hikashop category list
ReturnsTypeDescription
id
name
parent_idIts parent, so a flat answer can be rebuilt into a tree.
published
has_childrenWhether anything sits below it.
imagestring|nullAbsolute URL of its image, null when it has none.
In metaTypeDescription
totalintegerCategories matching, before paging.
startintegerEchoes the offset used.
limitintegerEchoes the page size used.

category:create

Create a product category.

Creates a category under another, or at the top of the product tree when no parent is given.

php cli/joomla.php hikashop:category:create --name=<name>
wp hikashop category create --name=<name>
OptionTypeDescription
--name requiredstringCategory name
ReturnsTypeDescription
idintegerThe category that was created.
namestring
parent_idintegerWhere it sits.
publishedboolean
Can also fail withMeaning
invalid_fieldsOne of your own fields was rejected by its own rules.
save_failedThe shop refused to save it.

category:delete

Delete a product category.

Deletes a category. The products in it are not deleted; they simply stop being in it, and a product left in no category at all disappears from the shop's listings.

php cli/joomla.php hikashop:category:delete <id> --yes
wp hikashop category delete <id> --yes
ArgumentDescription
<id> requiredCategory id
ReturnsTypeDescription
idintegerThe category that was deleted.
deletedbooleanTrue when the row is gone.
Can also fail withMeaning
not_foundNo such category, or the operator may not delete it.

Coupons and discounts

discount:list

List coupons and discounts.

Both kinds of reduction live in one table and are told apart by type: a **discount** applies by itself when its conditions are met, a **coupon** waits for its code to be entered. The restriction fields are the interesting part, and they are all lists of ids: which products, which categories, which zones, which customers, and the same again for exclusions. An empty list means no restriction of that kind rather than none allowed.

php cli/joomla.php hikashop:discount:list [--limit=<limit>] [--start=<start>]
wp hikashop discount list [--limit=<limit>] [--start=<start>]
OptionTypeDescription
--limitintHow many to return
--startintSkip this many first
ReturnsTypeDescription
idinteger
typestringdiscount applies by itself, coupon waits for its code.
codestringWhat the customer types. Empty on a discount.
kindstringWhether the value is a percentage or a fixed amount.
valuenumberThe reduction, read according to kind.
currency_idintegerThe currency a fixed amount is in.
publishedboolean
startinteger|nullUnix timestamp before which it does not apply.
endinteger|nullUnix timestamp after which it expires.
minimum_ordernumberOrder total below which it does not apply, 0 for none.
maximum_ordernumberOrder total above which it stops applying, 0 for none.
quotaintegerHow many times it may be used in total, 0 for no limit.
quota_per_userintegerHow many times one customer may use it, 0 for no limit.
used_timesintegerHow many times it already has been.
tax_includedbooleanWhether the value is understood as tax included.
tax_idintegerThe tax category of the reduction itself.
shipping_percentnumberA reduction on the shipping rather than on the goods.
minimum_productsintegerFewest items in the cart for it to apply.
maximum_productsintegerMost items for it to still apply.
product_idsinteger[]Restricted to these products. Empty means all of them.
exclude_product_idsinteger[]Never applies to these.
category_idsinteger[]Restricted to these categories.
category_childsbooleanWhether those categories include their sub-categories.
exclude_category_idsinteger[]Never applies in these categories.
exclude_category_childsbooleanWhether those exclusions include sub-categories.
zone_idsinteger[]Restricted to these zones.
user_idsinteger[]Restricted to these customers.
accessobjectWho this is for.
exclude_accessobjectWho this is for.
auto_loadbooleanFor a coupon, whether the shop applies it without the customer typing it.
product_onlybooleanWhether it reduces only the goods and leaves the fees alone.
discounted_productsintegerHow many products in the cart it applied to, on a discount that has been used.
access.modestringall, none, or groups when it is restricted to some.
access.groupsinteger[]User **group** ids, and not Joomla view levels. The two id spaces overlap and disagree, so a value that looks plausible can grant the wrong audience.
exclude_access.modestringall, none, or groups when it is restricted to some.
exclude_access.groupsinteger[]User **group** ids, and not Joomla view levels. The two id spaces overlap and disagree, so a value that looks plausible can grant the wrong audience.
In metaTypeDescription
startintegerEchoes the offset used.
limitintegerEchoes the page size used.
totalintegerRows matching the filter, before paging.

discount:create

Create a coupon or a discount.

Creates a reduction and answers with it as the shop stored it. type decides which kind it is: a coupon needs a code, a discount applies by itself. Either way value is required, read according to kind.

php cli/joomla.php hikashop:discount:create [--code=<code>] --value=<value> [--kind=<kind>] [--type=<type>] [--published]
wp hikashop discount create [--code=<code>] --value=<value> [--kind=<kind>] [--type=<type>] [--published]
OptionTypeDescription
--codestringCoupon code
--value requiredfloatAmount or percentage
--kindstringpercent or flat
--typestringcoupon or discount
--publishedflagPublish it
ReturnsTypeDescription
idinteger
typestringdiscount applies by itself, coupon waits for its code.
codestringWhat the customer types. Empty on a discount.
kindstringWhether the value is a percentage or a fixed amount.
valuenumberThe reduction, read according to kind.
currency_idintegerThe currency a fixed amount is in.
publishedboolean
startinteger|nullUnix timestamp before which it does not apply.
endinteger|nullUnix timestamp after which it expires.
minimum_ordernumberOrder total below which it does not apply, 0 for none.
maximum_ordernumberOrder total above which it stops applying, 0 for none.
quotaintegerHow many times it may be used in total, 0 for no limit.
quota_per_userintegerHow many times one customer may use it, 0 for no limit.
used_timesintegerHow many times it already has been.
tax_includedbooleanWhether the value is understood as tax included.
tax_idintegerThe tax category of the reduction itself.
shipping_percentnumberA reduction on the shipping rather than on the goods.
minimum_productsintegerFewest items in the cart for it to apply.
maximum_productsintegerMost items for it to still apply.
product_idsinteger[]Restricted to these products. Empty means all of them.
exclude_product_idsinteger[]Never applies to these.
category_idsinteger[]Restricted to these categories.
category_childsbooleanWhether those categories include their sub-categories.
exclude_category_idsinteger[]Never applies in these categories.
exclude_category_childsbooleanWhether those exclusions include sub-categories.
zone_idsinteger[]Restricted to these zones.
user_idsinteger[]Restricted to these customers.
accessobjectWho this is for.
exclude_accessobjectWho this is for.
auto_loadbooleanFor a coupon, whether the shop applies it without the customer typing it.
product_onlybooleanWhether it reduces only the goods and leaves the fees alone.
discounted_productsintegerHow many products in the cart it applied to, on a discount that has been used.
access.modestringall, none, or groups when it is restricted to some.
access.groupsinteger[]User **group** ids, and not Joomla view levels. The two id spaces overlap and disagree, so a value that looks plausible can grant the wrong audience.
exclude_access.modestringall, none, or groups when it is restricted to some.
exclude_access.groupsinteger[]User **group** ids, and not Joomla view levels. The two id spaces overlap and disagree, so a value that looks plausible can grant the wrong audience.
Can also fail withMeaning
code_requiredA coupon needs a code.
code_takenAnother coupon already uses that code.
value_requiredA reduction needs a value.
not_foundNot reachable when creating: the same handler serves the update, where it means no such discount.
save_failedThe shop refused to save it.

discount:delete

Delete a coupon or discount.

Deletes a reduction. Orders that already used it keep the amount they were given: the discount on an order is a figure, not a pointer at this row.

php cli/joomla.php hikashop:discount:delete <id> --yes
wp hikashop discount delete <id> --yes
ArgumentDescription
<id> requiredDiscount id
ReturnsTypeDescription
deletedbooleanTrue when the row is gone.
Can also fail withMeaning
not_foundNo such discount, or the operator may not delete it.

Mass actions

massaction:list

List the shop's own bulk operations.

The mass actions the merchant has configured for a listing, so a client can offer the merchant's own bulk operations rather than a fixed set of its own. Whatever they built in the backend appears here, and running one is POST /massactions/{id}.

php cli/joomla.php hikashop:massaction:list [--table=<table>]
wp hikashop massaction list [--table=<table>]
OptionTypeDescription
--tablestringWhich listing, e.g. product or order
ReturnsTypeDescription
idWhat to run.
nameAs the merchant named it.
descriptionTheir own note about what it does, when they wrote one.
tableThe listing it belongs to.
restrictedbooleanWhether it may only run on a selection rather than on everything matching a filter.
Can also fail withMeaning
invalid_requestThe table is not one the shop has mass actions for.
forbiddenThe operator may not view that kind of record.

massaction:run

Run a bulk operation over a selection.

Runs one of the merchant's own bulk operations over a selection. It runs the same code the backend runs, so whatever the action does there it does here, including whatever a third-party plugin added to it. Give it the ids to work on.

php cli/joomla.php hikashop:massaction:run <id> --ids=<ids> --yes
wp hikashop massaction run <id> --ids=<ids> --yes
ArgumentDescription
<id> requiredMass action id
OptionTypeDescription
--ids requiredids, comma separatedRecord ids to act on, comma separated
ReturnsTypeDescription
okbooleanWhether the action reported success.
countintegerHow many records it worked on.
reportstringWhatever the action had to say, ready to show. Its wording is the action's own.
Can also fail withMeaning
invalid_requestNo ids were sent, or the action is not one this shop has.
forbiddenThe operator may not work on that kind of record.

The shop itself

dbcheck

Bring the database schema up to date, what you want after restoring a dump. Runs inside the site itself and needs no plugin beyond HikaShop.

php cli/joomla.php hikashop:dbcheck
wp hikashop dbcheck
ReturnsTypeDescription
checkedbooleanAlways true once the check has run.
reportstring[]What it changed, one line per change. Empty when the schema was already correct.

shop:statuses

List the shop's order statuses.

Every published order status, in the order the backend shows them. A shop invents its own, so this list is not a fixed set and should never be hard coded. The namekey is the identifier to send to POST /orders/{id}/status; the name is for a person to read.

php cli/joomla.php hikashop:shop:statuses
wp hikashop shop statuses
ReturnsTypeDescription
namekeyThe identifier. This is what you send when changing an order.
nameTranslated into the operator's language, ready to display.
label_keyThe translation key behind that name, if you would rather translate it yourself.
colorThe colour the backend uses for this status, empty when none is set.

shop:stats

Show the dashboard totals.

Revenue, orders, average basket and new customers over a period, the same figures again for the period before it so a change can be shown, the series behind them, and the best sellers. Only orders the shop counts as sold are included, so a cancelled order does not inflate a total. Amounts are in the shop's own currency.

php cli/joomla.php hikashop:shop:stats [--range=<range>]
wp hikashop shop stats [--range=<range>]
OptionTypeDescription
--rangestringday, week, month or year
ReturnsTypeDescription
rangestringThe period the figures cover.
currency_idintegerThe shop's currency, which every amount here is in.
totalsobjectThe four headline figures.
totals.revenuenumberTaken in the period.
totals.ordersintegerHow many were placed.
totals.average_ordernumberRevenue divided by orders.
totals.customersintegerNew customers in the period.
previousobjectThe same four figures for the preceding period of the same length, for a comparison.
previous.revenuenumberTaken in the preceding period.
previous.ordersintegerPlaced in it.
previous.average_ordernumberIts average basket.
previous.customersintegerNew customers in it.
series_granularitystringWhether the series is by day, week, month or year, which follows from the range.
revenue_seriesobject[]One point per interval, for a chart.
revenue_series.datestringThe interval, as a date.
revenue_series.revenuenumberTaken in it.
top_productsobject[]The best sellers of the period.
top_products.namestring
top_products.quantityintegerHow many were sold.

Configuration

config:get

Read one configuration value. Runs inside the site itself and needs no plugin beyond HikaShop.

php cli/joomla.php hikashop:config:get <key>
wp hikashop config get <key>
ArgumentDescription
<key> requiredConfiguration key, e.g. main_currency
ReturnsTypeDescription
keystringThe key that was read.
valuemixedIts value, as the shop stores it.
Can also fail withMeaning
not_foundNo configuration key of that name.

config:set

Change one configuration value. Runs inside the site itself and needs no plugin beyond HikaShop.

php cli/joomla.php hikashop:config:set <key> <value>
wp hikashop config set <key> <value>
ArgumentDescription
<key> requiredConfiguration key
<value> requiredNew value
ReturnsTypeDescription
keystringThe key that was changed.
wasmixedThe value before the change, so a script can put it back.
nowmixedThe value after it.
Can also fail withMeaning
not_foundNo configuration key of that name. This changes existing keys, it does not invent them.
save_failedThe configuration could not be written.

Caches

cache:clean

Empty the shop's caches. Runs inside the site itself and needs no plugin beyond HikaShop.

php cli/joomla.php hikashop:cache:clean
wp hikashop cache clean
ReturnsTypeDescription
cleanedstring[]Which caches were emptied: the shop's own plugin cache, and the platform's.

Cron

cron:run

Run the scheduled tasks the shop would run on a page hit. Runs inside the site itself and needs no plugin beyond HikaShop.

php cli/joomla.php hikashop:cron:run
wp hikashop cron run
ReturnsTypeDescription
launchedbooleanFalse when the cron was not due to run yet.
messagesstring[]The summary the cron would otherwise have emailed.
detailsstring[]The detail lines behind that summary.
Can also fail withMeaning
cron_disabledThe cron is turned off in the shop configuration.

Anything the named commands do not cover

Everything the HikaShop Connector API can do is reachable from the command line as well, with the same paths and the same content the Connector API page documents, through a single command:

php cli/joomla.php hikashop:api GET products --query="limit=5&search=shirt"
php cli/joomla.php hikashop:api PUT products/12 --data='{"name":"New name"}'
wp hikashop api POST orders/44/status --data='{"status":"shipped"}'

The body can also be read from a file, or from the output of another program, with --data-file=<file> or --data-file=- for the standard input.

Examples

# The products lowest on stock
php cli/joomla.php hikashop:product:lowstock --threshold=3

# Every order id waiting to be confirmed, one per line, for a script to loop over
wp hikashop order list --status=created --format=ids

# Create a product and give it a price
php cli/joomla.php hikashop:product:create --name="Blue mug" --code=MUG-BLUE --quantity=40 --published
php cli/joomla.php hikashop:product:price 812 --value=12.50

# Mark an order shipped and tell the customer
wp hikashop order status 44 shipped --notify

# After restoring a backup
php cli/joomla.php hikashop:dbcheck

Running it from a cron

The scheduled tasks of your shop can be run from your server's own scheduler, which is more reliable than waiting for a visitor to open a page:

0 * * * * cd /path/to/your/site && php cli/joomla.php hikashop:cron:run --live-site=https://www.example.com

0 * * * * wp --path=/path/to/your/site hikashop cron run

The older cli/hikashop_cron.php script still works and does the same thing, so a cron entry that already uses it does not need changing.