Document toolboxDocument toolbox

Customer commands

CreateUpdateCustomerByID

Creates or updates a company/customer in Microbizz.

If a company with the given company id already exists, then the company will be overwritten.

If the company provided have a company id of 0, a new company will be created and a new company id will be provided.

Input

customercustomerThe company/customer to create/update

Output

customercustomerThe company/customer object as it is in Microbizz after the update

CreateUpdateCustomerByCustomerNumber

Creates or updates a company/customer in Microbizz.

If a company with the given customer number already exists, then the company will be overwritten.

If several companies exists with the given customer number, only one of these (unpredicted) will be overwritten.

If a customer number isn't provided in the customer object, the command will fail.

The company id in the input customer object will be ignored.

Input

customercustomerThe company/customer to create/update

Output

customercustomerThe company/customer object as it is in Microbizz after the update

GetCustomerByID

Get a customer by their Microbizz customer id

If no such customer exist an empty collection will be returned.

Input

customeridnumberThe microbizz customer id of the customer to fetch

Output

customerscollection[ customer ]A collection either empty if no customer was found, or with exactly one element being the customer.

GetCustomersByParentID

Get the customers that have another customer as "parent".

If no such customers exist an empty collection will be returned.

Input

customeridnumberThe microbizz customer id of the customer to fetch
ignoreclosedbooleanDon't include customers that are closed/deleted
includeallbooleanSet to 1 to also include customers that are grandchildren (or grand-grandchildren etc) of the customer

Output

customerscollection[ customer ]A collection either empty if no customer was found or with the found customers

GetCustomerByCustomerNumber

Get a customer by their customer number.

If no such customer exist an empty collection will be returned.

If several customers exists with the provided customer number, only one of these (unpredicted) is returned.

Input

customernumberstringThe customer number of the customer to fetch

Output

customerscollection[ customer ]A collection either empty if no customer was found, or with exactly one element being the customer.

GetCustomerByName

Get a customer by its name.

If no such customer exist an empty collection will be returned.

If several customers exists with the provided name, only one of these (unpredicted) is returned.

Uppercase/lowercase is ignored, so searching for "VENTU" may find "Ventu".

Input

customernamestringThe name of the customer to fetch

Output

customerscollection[ customer ]A collection either empty if no customer was found, or with exactly one element being the customer.

GetCustomersByLastChange

Get a collection of customers changed since a given date and time.

Input

changedatedateReturn all customers changed on or after the provided date.
changetimetimeIf this is provided only return customers changed after the provided date and time.
resumekeystringIf a partial result is returned, provide the resumekey received along with the partial result, to get the rest of the entries
ignoreclosedboolIf 1 then don't sent customers that current user do not have access to
skip_deletedboolIf 1 then don't send deleted customers

Output

customerscollection[ customer ]A collection of the relevant customers, or an empty collection if no customers was found.
resumekeystringSometimes 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.
qfoncheckoutnumberThe ID of a question form to fill in when checking out from a customer.

GetDepotOrderLinesByLastChange

Get all depot order lines.

Input

changedatedateReturn all depot order lines changed on or after the provided date.
changetimetimeIf this is provided only return depot order lines changed after the provided date and time.
resumekeystringIf a partial result is returned, provide the resumekey received along with the partial result, to get the rest of the entries.

Output

linescollection [ depotorderline ]The depot orderlines

GetDocumentsByCustomerID

Get all documents on a customer by customer id

Input

customeridnumberThe Microbizz customer ID
inclthumbsboolTrue to include thumbnails
inclfoldersboolTrue to include folders

Output

documentscollection [ document ]The documents present on the customer
folderscollection [ folder ]The folders present on the customer

GetCustomerTypes

Get all Microbizz customer types. All customer types are returned, and replaces earlier customer types.

Input

None--

Output

typescollection[ customertype ]A collection of all customer types in the Microbizz system.

GetProceduresByLastChange

Get all proceduress.

Input

changedatedateReturn all procedures changed on or after the provided date.
changetimetimeIf this is provided only return procedures changed after the provided date and time.
resumekeystringIf a partial result is returned, provide the resumekey received along with the partial result, to get the rest of the entries.
skip_deletedboolIf 1 then don't send deleted procedures

Output

procedurescollection[ procedure ]The procedures

AddFileToCustomer

Add a file to a company/customer.

Input

customeridnumberThe ID of the customer to add the file to.
filenamestringThe name of the file, eg. “MyDocument.PDF”
filedatabinaryA binary stream. base64_encode(Required)
titlestringA file title (not a file name)
folderstringThe path of the folder, eg. "FilesFromAPI/Diagrams"


Output

None--

AddPhotoToCustomer

Add a photo file to a company.

Input

customeridnumberThe ID of the customer to add the photo to.
titlestringA file title (not a file name)
imagedatabinaryA binary stream containing photo data in jpeg format.
onxnetboolean1 if the file should be visible on the extranet
createdatedateWhen the photo was taken
createtimetimeWhen the photo was taken
tagscollection [number]An optional collection of tags to attach to this image (tag IDs)
documentidnumberOptional ID of an existing file, to update the file instead of creating a new file

Output

documentdocumentA document object

GetMaingroups

Get all maingroups.

Input

None--

Output

maingroupscollection[ maingroup ]The maingroups, each maingroup contains two fields "id" and "title"

GetCustomerRoles

Gets a list of the customer roles.

Input

Output

customer_rolescollection[ CustomerRole]A collection of customer roles.

GetParentCustomers

Get a all parent customers for a customer.

If no parent customer exist an empty collection will be returned.

Input

customeridnumberThe Microbizz customer ID of the "child" customer
ignoreclosedboolIf set to 1 then closed/deleted customers will not be included

Output

customerscollection[ customer ]A collection of customers, the first is the first parent, the send is the second paremt etc.

Subscription

GetSubscriptionsByCustomerID

Get all subscriptions for a company.

Input

customeridnumberThe Microbizz ID of a company/customer

Output

subscriptionscollection[ subscription ]The subscriptions

GetSubscriptionsBylastChangeID

Get subscriptions that have changed since a date.

Input

changedatedateReturn all subscriptions changed on or after the provided date.
changetimetimeIf this is provided only return subscriptions changed after the provided date and time.

Output

subscriptionscollection[ subscription ]The subscriptions
resumekeystringIf a partial result is returned, provide the resumekey received along with the partial result, to get the rest of the entries.