E-Commerce comes with a developed API to facilitate extension of the suite of modules. Here is a quick introduction to the API designed to get you started developing E-Commerce solutions.

The product API

Most E-Commerce hooks involve the product API, implemented through hook_productapi().

Product API hooks options include many of the actions of the nodeapi, enabling the creation of specialized product types, as well as several custom options for accomplishing actions like adjusting prices and managing inventory.

Product API options include:

op description return value
'wizard_select' Define the name of a product type. an array for the product type with a machine-readable key (typically, the name of the module) and value of a human-readable title
'in_stock' If stock is managed for an item, determine if there is stock available. boolean
'is_shippable' Is the product shippable? boolean
'on payment completion' Define action to be taken once payment has been completed. none
'adjust price' Modify the price of a product. new price

Product API also implements versions of the following hook_nodeapi() options: fields, validate, form, load, insert, update, delete.