Product commands
Products
CreateUpdateProductByID
Creates or updates a product in Microbizz.
If a product with the given product id already exists, then the product will be overwritten.
If the product provided have a product id of 0, a new product will be created and a new product id will be provided.
Input
product | product | The product to create/update |
Output
product | product | The product object as it is in Microbizz after the update |
CreateUpdateProductByProductNumber
Creates or updates a product in Microbizz.
If a product with the given product number already exists, then the product will be overwritten.
If several products exists with the given product number, only one of these (unpredicted) will be overwritten.
If a product number isn't provided in the product object, the command will fail.
The product id in the input product object will be ignored.
Input
product | product | The product to create/update |
Output
product | product | The product object as it is in Microbizz after the update |
GetProductByID
Get a product by their Microbizz product id
If no such product exist an empty collection will be returned.
Input
productid | number | The Microbizz product id of the product to fetch |
include_prices | boolean | Get prices even if these are disabled |
Output
products | collection[ product ] | A collection either empty if no products was found, or with exactly one element being the product. |
GetProductByProductNumber
Get a product by their product number.
If no such product exist an empty collection will be returned.
If several products exists with the provided product number, only one of these (unpredicted) is returned.
Input
productnumber | string | The product number of the product to fetch |
include_prices | boolean | Get prices even if these are disabled |
Output
products | collection[ product ] | A collection either empty if no products was found, or with exactly one element being the product. |
GetProductsByLastChange
Get a collection of products changed since a given date and time.
Input
changedate | date | Return all products changed on or after the provided date. |
changetime | time | If this is provided only return products changed after the provided date and time. |
resumekey | string | If a partial result is returned, provide the resumekey received along with the partial result, to get the rest of the entries |
include_prices | boolean | Get prices even if these are disabled |
ignoreclosed | boolean | Skip products that are deleted |
onlyfavorites | boolean | If 1 then only get products that are the favorites of the current user |
skip_deleted | boolean | If 1 then don't send deleted products |
Output
products | collection[ product ] | A collection of the relevant products, or an empty collection if no products were found. |
resumekey | string | Sometimes the entire result cannot be returned because it's to large. In that case a resumekey is returned along with the results. Execute the command again with this resumekey to get the remaining results. |
DeleteProductByID
Deletes a product by their Microbizz product id
The product is only deleted from the product catalog. Instances of the product used in offers and on customers are retained.
Input
productid | number | The Microbizz product id of the product to delete |
Output
None. | - | - |
CreateDirectOrder
Create a direct order / quotation.
Input
customerid | number | The ID of the customer in Microbizz |
lines | collection[directorderline] | The order lines |
note | string | A note to use for the quotation |
deliverydate | date | Delivery date for the quotation |
There must be at least 1 order line.
Output
None | - | - |
GetProductGroups
Get all product groups. Notice that product groups can be nested, so a product group can be the "child" of another product group.
Input
inclchildren | bool | Set to 0 to get only the "root" product groups, set to 1 to get all product groups. |
Output
groups | collection[productgroup] | All the product groups, each product group holds {id,title,parentid} |
Prices
AssignIndividualPriceByProductNumber
Assigns an individual price to a given product identified by product number, to a given customer identified by a customer id.
If several products exists with the given product number, only one of these (unpredicted) will be assigned the individual price.
If the product or the customer doesn't exists, the command will still succeed, but nothing will happen.
Input
productnumber | string | Product number |
customerid | number | Id of the customer for which to assign the price |
price | number | Individual price pr. unit in lowest local currency. (Typical danish ører) |
Output
None | - | - |
RemoveIndividualPriceByProductNumber
Removes an individual price to a given product identified by product number, from a given customer identified by a customer id.
If neither the product, the customer nor the individual price exists, the command will still succeed, but nothing will happen.
Input
productnumber | string | Product number |
customerid | number | Id of the customer for which to remove any individual price. If this is omitted, then individual pricing will be removed for all customers. |
Output
None | - | - |
CreateUpdateIndividualPricesByCustomerID
Update (or create) existing individual prices for a customer.
Input
prices | set | New prices per unit (in pence/cent/øre) hashed by product numbers |
customerid | number | Id of the customer for which to update individual prices. |
allow_create | bool | Set to 1 to create individual prices that do not already exist |
Output
stats | set | Information about the number of prices created/updated/skipped/not changed |