This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.
Working with Invoices in Billomat
Overview
The following operations allow you to work with invoices. Click an operation name to see details on how to use it.
For a sample proxy service that illustrates how to work with invoices, see Sample configuration.
Operation | Description |
---|---|
Creates an invoice. | |
getInvoice | Retrieves an invoice's details by its ID. |
listInvoices | Retrieves all invoices. |
updateInvoice | Updates the details of the invoice. |
completeInvoice | Completes the created invoice. |
sendInvoice | Sends the completed invoice. |
Operation details
This section provides further details on the operations related to invoices.
Creating an invoice
The
operation creates an invoice.createInvoice
<billomat.createInvoice> <clientId>{$ctx:clientId}</clientId> <contactId>{$ctx:contactId}</contactId> <address>{$ctx:address}</address> <numberPre>{$ctx:numberPre}</numberPre> <number>{$ctx:number}</number> <numberLength>{$ctx:numberLength}</numberLength> <date>{$ctx:date}</date> <supplyDate>{$ctx:supplyDate}</supplyDate> <supplyDateType>{$ctx:supplyDateType}</supplyDateType> <dueDate>{$ctx:dueDate}</dueDate> <discountRate>{$ctx:discountRate}</discountRate> <discountDate>{$ctx:discountDate}</discountDate> <title>{$ctx:title}</title> <label>{$ctx:label}</label> <introduction>{$ctx:introduction}</introduction> <note>{$ctx:note}</note> <reduction>{$ctx:reduction}</reduction> <currencyCode>{$ctx:currencyCode}</currencyCode> <netGross>{$ctx:netGross}</netGross> <quote>{$ctx:quote}</quote> <paymentTypes>{$ctx:paymentTypes}</paymentTypes> <existingInvoiceId>{$ctx:existingInvoiceId}</existingInvoiceId> <offerId>{$ctx:offerId}</offerId> <confirmationId>{$ctx:confirmationId}</confirmationId> <recurringId>{$ctx:recurringId}</recurringId> <invoiceItems>{$ctx:invoiceItems}</invoiceItems> </billomat.createInvoice>
Properties
The ID of the client.clientId:
The ID of the contact.contactId:
Address for the invoice.address:
Invoice number prefix.numberPre:
Serial number for the invoice.number:
Minimum length of the invoice number (to be filled with leading zeros).numberLength:
Invoice date of the invoice.date:
Supply/delivery date of the products of the invoice.supplyDate:
Type of supply/delivery date.supplyDateType:
Due date of the invoice.dueDate:
Cash discount of the invoice.discountRate:
Cash discount date of the invoice.discountDate:
Title of the document.title:
Label text to describe the project.label:
Introductory text of the invoice.introduction:
Explanatory notes of the invoice.note:
Reduction (absolute or percent: 10/10%).reduction:
Currency of the invoice.currencyCode:
Price basis (gross or net prices) of the invoice.netGross:
Currency quote (for conversion into standard currency).quote:
List (separated by comma) of all accepted payment types.paymentTypes:
The ID of the corrected invoice, if it is an invoice correction.existingInvoiceId:
The ID of the estimate, if the invoice was created from an estimate.offerId:
The ID of the confirmation, if the invoice was created from a confirmation.confirmationId:
The ID of the recurring, if the invoice was created from a recurring.recurringId:
Array of invoice items to be added to the invoice.invoiceItems:
Sample request
Following is a sample REST/JSON request that can be handled by the createInvoice
operation.
{ "clientId": "34354", "contactId": "45454", "address": "45,Mulheim, Germany", "numberPre": "in", "number": "12", "numberLength": "1", "date": "2015-06-18", "supplyDate": "2015-06-18", "supplyDateType": "SUPPLY_DATE", "dueDate": "2015-06-18", "discountRate": "23", "discountDate": "2015-06-19", "title": "billomatInvoice", "label": "l1", "introduction": "invoice is started", "note": "due on monday", "reduction": "23", "currencyCode": "UK", "netGross": "0", "quote": "45", "paymentTypes": "CASH", "existingInvoiceId": "23434", "offerId": "3434", "confirmationId": "34", "recurringId": "12", "invoiceItems": [ "invoice-item": { "name":"choco" } ], "apiUrl": "https://mycompany.billomat.net", "apiKey": "735478efc440e219669e243c0fd71840", "format":"xml" }
Related Billomat documentation
http://www.billomat.com/en/api/invoices
Retrieving an invoice's details by its ID
The
operation retrieves an invoice's details by its ID.getInvoice
<billomat.getInvoice> <invoiceId>{$ctx:invoiceId}</invoiceId> </billomat.getInvoice>
Properties
The ID of the invoice whose details would be retrieved.invoiceId:
Sample request
Following is a sample REST/JSON request that can be handled by the getInvoice
operation.
{ "invoiceId": "123343", "apiUrl": "https://mycompany.billomat.net", "apiKey": "735478efc440e219669e243c0fd71840", "format":"xml" }
Related Billomat documentation
http://www.billomat.com/en/api/invoices
Retrieving all invoices
The
operation retrieves all invoices.listInvoices
<billomat.listInvoices> <clientId>{$ctx:clientId}</clientId> <contactId>{$ctx:contactId}</contactId> <invoiceNumber>{$ctx:invoiceNumber}</invoiceNumber> <status>{$ctx:status}</status> <paymentType>{$ctx:paymentType}</paymentType> <from>{$ctx:from}</from> <to>{$ctx:to}</to> <label>{$ctx:label}</label> <introduction>{$ctx:introduction}</introduction> <note>{$ctx:note}</note> <tags>{$ctx:tags}</tags> <articleId>{$ctx:articleId}</articleId> <groupBy>{$ctx:groupBy}</groupBy> <page>{$ctx:page}</page> <perPage>{$ctx:perPage}</perPage> <orderBy>{$ctx:orderBy}</orderBy> </billomat.listInvoices>
Properties
Filter results by ID of the client.clientId:
Filter results by ID of the contact.contactId:
Filter results by invoice number.invoiceNumber:
Filter results by Status (DRAFT, OPEN, PAID, OVERDUE, CANCELED). More than one statuses could be given as a comma separated list. Theses statuses will be logically OR-connected.status:
Filter results by Payment Type (e.g. CASH, BANK_TRANSFER, PAYPAL,). More than one payment type could be given as a comma separated list. Theses payment types will be logically OR-connected.paymentType:
Only show invoices since this date (format YYYY-MM-DD).from:
Only show invoices up to this date (format YYYY-MM-DD).to:
Free text search in label text.label:
Free text search in introductory text.introduction:
Free text search in explanatory notes.note:
Comma separated list of tags.tags:
Filter results by ID of an article.articleId:
Invoices can also be found grouped together based on the provided value.groupBy:
Number of the page to return. Applies for paginated response.page:
Number of entries to return per page when results are paginated.perPage:
Sorting orders to retrieve invoices.orderBy:
Sample request
Following is a sample REST/JSON request that can be handled by the listInvoices
operation.
{ "clientId": "5466878", "contactId": "6767667", "invoiceNumber": "67676", "status": "DRAFT", "paymentType": "CASH", "from": "2014-08-12", "to": "2014-08-18", "label": "shop", "introduction": "invoice in progress", "note": "due on monday", "tags": "shops", "articleId": "233453", "groupBy": "client", "page": "1", "perPage": "1", "apiUrl": "https://mycompany.billomat.net", "apiKey": "735478efc440e219669e243c0fd71840", "format":"xml", "orderBy":"id+DESC" }
Related Billomat documentation
http://www.billomat.com/en/api/invoices
Updating the details of the invoice
The
operation updates the details of the invoice.updateInvoice
<billomat.updateInvoice> <clientId>{$ctx:clientId}</clientId> <contactId>{$ctx:contactId}</contactId> <address>{$ctx:address}</address> <numberPre>{$ctx:numberPre}</numberPre> <number>{$ctx:number}</number> <numberLength>{$ctx:numberLength}</numberLength> <date>{$ctx:date}</date> <supplyDate>{$ctx:supplyDate}</supplyDate> <supplyDateType>{$ctx:supplyDateType}</supplyDateType> <dueDate>{$ctx:dueDate}</dueDate> <discountRate>{$ctx:discountRate}</discountRate> <discountDate>{$ctx:discountDate}</discountDate> <title>{$ctx:title}</title> <label>{$ctx:label}</label> <introduction>{$ctx:introduction}</introduction> <note>{$ctx:note}</note> <reduction>{$ctx:reduction}</reduction> <currencyCode>{$ctx:currencyCode}</currencyCode> <netGross>{$ctx:netGross}</netGross> <quote>{$ctx:quote}</quote> <paymentTypes>{$ctx:paymentTypes}</paymentTypes> <existingInvoiceId>{$ctx:existingInvoiceId}</existingInvoiceId> <offerId>{$ctx:offerId}</offerId> <confirmationId>{$ctx:confirmationId}</confirmationId> <recurringId>{$ctx:recurringId}</recurringId> <invoiceId>{$ctx:invoiceId}</invoiceId> </billomat.updateInvoice>
Properties
The ID of the client.clientId:
The ID of the contact.contactId:
Address for the invoice.address:
Invoice number prefix.numberPre:
Serial number for the invoice.number:
Minimum length of the invoice number (to be filled with leading zeros).numberLength:
Invoice date of the invoice.date:
Supply/delivery date of the products of the invoice.supplyDate:
Type of supply/delivery date.supplyDateType:
Due date of the invoice.dueDate:
Cash discount of the invoice.discountRate:
Cash discount date of the invoice.discountDate:
Title of the document.title:
Label text to describe the project.label:
Introductory text of the invoice.introduction:
Explanatory notes of the invoice.note:
Reduction (absolute or percent: 10/10%).reduction:
Currency of the invoice.currencyCode:
Price basis (gross or net prices) of the invoice.netGross:
Currency quote (for conversion into standard currency).quote:
List (separated by comma) of all accepted payment types.paymentTypes:
The ID of the corrected invoice, if it is an invoice correction.existingInvoiceId:
The ID of the estimate, if the invoice was created from an estimate.offerId:
The ID of the confirmation, if the invoice was created from a confirmation.confirmationId:
The ID of the recurring, if the invoice was created from a recurring.recurringId:
The ID of the invoice to update.invoiceId:
Sample request
Following is a sample REST/JSON request that can be handled by the updateInvoice
operation.
{ "clientId": "34354", "contactId": "45454", "address": "45,Mulheim, Germany", "numberPre": "in", "number": "12", "numberLength": "1", "date": "2015-06-18", "supplyDate": "2015-06-18", "supplyDateType": "SUPPLY_DATE", "dueDate": "2015-06-18", "discountRate": "23", "discountDate": "2015-06-19", "title": "billomatInvoice", "label": "l1", "introduction": "invoice is started", "note": "due on monday", "reduction": "23", "currencyCode": "UK", "netGross": "0", "quote": "45", "paymentTypes": "CASH", "existingInvoiceId": "23434", "offerId": "3434", "confirmationId": "34", "recurringId": "12", "invoiceId": "23232", "apiUrl": "https://mycompany.billomat.net", "apiKey": "735478efc440e219669e243c0fd71840", "format":"xml" }
Related Billomat documentation
http://www.billomat.com/en/api/invoices
Completing the created invoice
The
operation completes the created invoice.completeInvoice
<billomat.completeInvoice> <templateId>{$ctx:templateId}</templateId> <invoiceId>{$ctx:invoiceId}</invoiceId> </billomat.completeInvoice>
Properties
The ID of the template from which the PDF is generated.templateId:
The ID of the invoice which is going to get completed.invoiceId:
Sample request
Following is a sample REST/JSON request that can be handled by the completeInvoice
operation.
{ "apiUrl": "https://mycompany.billomat.net", "apiKey": "735478efc440e219669e243c0fd71840", "invoiceId":"1586475", "templateId":"invalid" }
Related Billomat documentation
http://www.billomat.com/en/api/invoices
Sending the completed invoice
The
operation sends the completed invoice.sendInvoice
<billomat.sendInvoice> <emailBody>{$ctx:emailBody}</emailBody> <recipients>{$ctx:recipients}</recipients> <invoiceId>{$ctx:invoiceId}</invoiceId> <subject>{$ctx:subject}</subject> <fileName>{$ctx:fileName}</fileName> <fromEmail>{$ctx:fromEmail}</fromEmail> <attachments>{$ctx:attachments}</attachments> </billomat.sendInvoice>
Properties
Text body of the e-mail.emailBody:
Recipients of the e-mail. There must be at least one XML note for 'to', 'cc' and/or 'bcc'.recipients:
The ID of the invoice to be sent.invoiceId:
Subject of the e-mail.subject:
Name of the PDF file (without .pdf).fileName:
Sender's email address.fromEmail:
Further files. Attachments can contain as many nodes on the 'attachment' with the elements 'filename', 'mimetype' and 'base64file'.attachments:
Sample request
Following is a sample REST/JSON request that can be handled by the sendInvoice
operation.
{ "apiUrl": "https://mycompany.billomat.net", "apiKey": "735478efc440e219669e243c0fd71840", "invoiceId":"1566418", "recipients":{ "to":"yasasitest@gmail.com" }, "subject":"Reciept for the transaction", "emailBody":"This is a reciepet for the medicines.Thank you", "fileName":"reciept1" }
Related Billomat documentation
http://www.billomat.com/en/api/invoices
Sample configuration
Following is a sample proxy service that illustrates how to connect to Billomat with the init
operation and use the createInvoice
operation. The sample request for this proxy can be found in the createInvoice sample request.
<?xml version="1.0" encoding="UTF-8"?> <proxy name="billomat_createInvoice" startOnLoad="true" statistics="disable" trace="disable" transports="https,http" xmlns="http://ws.apache.org/ns/synapse"> <target> <inSequence onError="faultHandlerSeq"> <property name="apiUrl" expression="json-eval($.apiUrl)"/> <property name="apiKey" expression="json-eval($.apiKey)"/> <property name="clientId" expression="json-eval($.clientId)"/> <property name="contactId" expression="json-eval($.contactId)"/> <property name="address" expression="json-eval($.address)"/> <property name="numberPre" expression="json-eval($.numberPre)"/> <property name="number" expression="json-eval($.number)"/> <property name="numberLength" expression="json-eval($.numberLength)"/> <property name="date" expression="json-eval($.date)"/> <property name="supplyDate" expression="json-eval($.supplyDate)"/> <property name="supplyDateType" expression="json-eval($.supplyDateType)"/> <property name="dueDate" expression="json-eval($.dueDate)"/> <property name="discountRate" expression="json-eval($.discountRate)"/> <property name="discountDate" expression="json-eval($.discountDate)"/> <property name="title" expression="json-eval($.title)"/> <property name="label" expression="json-eval($.label)"/> <property name="introduction" expression="json-eval($.introduction)"/> <property name="note" expression="json-eval($.note)"/> <property name="reduction" expression="json-eval($.reduction)"/> <property name="currencyCode" expression="json-eval($.currencyCode)"/> <property name="netGross" expression="json-eval($.netGross)"/> <property name="quote" expression="json-eval($.quote)"/> <property name="paymentTypes" expression="json-eval($.paymentTypes)"/> <property name="existingInvoiceId" expression="json-eval($.existingInvoiceId)"/> <property name="offerId" expression="json-eval($.offerId)"/> <property name="confirmationId" expression="json-eval($.confirmationId)"/> <property name="recurringId" expression="json-eval($.recurringId)"/> <property name="invoiceItems" expression="json-eval($.invoiceItems)"/> <property name="format" expression="json-eval($.format)"/> <billomat.init> <apiUrl>{$ctx:apiUrl}</apiUrl> <apiKey>{$ctx:apiKey}</apiKey> <format>{$ctx:format}</format> </billomat.init> <billomat.createInvoice> <clientId>{$ctx:clientId}</clientId> <contactId>{$ctx:contactId}</contactId> <address>{$ctx:address}</address> <numberPre>{$ctx:numberPre}</numberPre> <number>{$ctx:number}</number> <numberLength>{$ctx:numberLength}</numberLength> <date>{$ctx:date}</date> <supplyDate>{$ctx:supplyDate}</supplyDate> <supplyDateType>{$ctx:supplyDateType}</supplyDateType> <dueDate>{$ctx:dueDate}</dueDate> <discountRate>{$ctx:discountRate}</discountRate> <discountDate>{$ctx:discountDate}</discountDate> <title>{$ctx:title}</title> <label>{$ctx:label}</label> <introduction>{$ctx:introduction}</introduction> <note>{$ctx:note}</note> <reduction>{$ctx:reduction}</reduction> <currencyCode>{$ctx:currencyCode}</currencyCode> <netGross>{$ctx:netGross}</netGross> <quote>{$ctx:quote}</quote> <paymentTypes>{$ctx:paymentTypes}</paymentTypes> <existingInvoiceId>{$ctx:existingInvoiceId}</existingInvoiceId> <offerId>{$ctx:offerId}</offerId> <confirmationId>{$ctx:confirmationId}</confirmationId> <recurringId>{$ctx:recurringId}</recurringId> <invoiceItems>{$ctx:invoiceItems}</invoiceItems> </billomat.createInvoice> <respond/> </inSequence> <outSequence> <send/> </outSequence> </target> <description/> </proxy>