Developer documentation

Create a sales invoice

Using Reeleezee API it is easy to maintain sales and purchase invoices as well. Once you have entities like customers, vendors and products you offer at place under your subscribed Reeleezee administration, you can get going to create invoices instantaneously. In this section, we would look how you can create Sales invoices for your need.

Following steps explained using Postman, would enable Rest API consumers to create a sales invoice.

Get going to create/add your sales invoice:
To get it going, make sure you’ve already added required headers in your postman as suggested in topic Request Headers. To add the new sales invoice, make the PUT request along with passing the GUID. Here globally unique identifier is mandatory to pass. If the passed GUID is new, then a sales invoice will be created otherwise it will update the existing one which is passed in request. The request goes like this:

Request Info

Production base URL   https://apps.reeleezee.nl/api/v1
Operation : PUT
Content type : application/json
Request Option a)   https://apps.reeleezee.nl/api/v1/salesinvoices/{id}
URI Parameter for Option a) : {id} globally unique identifier. New id to create one and use existing one to update any sales invoice information.
Request Option b)   https://apps.reeleezee.nl/api/v1/{adminid}/salesinvoices/{id}
URI Parameter for Option b) : {adminid} is the GUID for an admin you subscribed. To obtain the same append ‘/Administrations’ to above production base url. {id} parameter works same as explained for option a).

 

In Postman (or any tool of your choice) along with setting appropriate headers and forming the request as suggested above with new GUID in the URL, you may create a body by setting required set of body parameters as mentioned in below Request body. Below sample object would create a new sales with specified parameters.

Request Body

{
	"AccruedQuantity": 5,
	"BaseInvoiceAmount": 2500,
	"BasePaidAmount": 2500,
	"BaseRemainingAmount": 0,
	"UnspecifiedAmount": 0,
	"Date": "2017-02-21T00:00:00",
	"Header": "Subject: Sales invoice to H n L Company on purchase of flash drives",
	"Footer": "Please pay within days before ",
	"Status": 1,
	"DocumentType": 10,
	"Type": 1,
	"DueDate": "2017-03-01T00:00:00"
}

For the said request you would receive response as illustrated below.

Request Return

{
	"id": "f200868c-5000-41ea-8fe3-08563887f19b",
	"IsArchived": false,
	"IsFixedAmount": false,
	"IsVatIncluded": false,
	"AccruedQuantity": 5,
	"ExchangeRate": 1,
	"BaseInvoiceAmount": 0,
	"BasePaidAmount": 0,
	"BaseRemainingAmount": 0,
	"CalculatedDiscountAmount": 0,
	"TotalLineAmountWithoutDiscount": 0,
	"TotalNetAmount": 0,
	"TotalPaidAmount": 0,
	"TotalPayableAmount": 0,
	"TotalTaxAmount": 0,
	"UnspecifiedAmount": 0,
	"BookDate": "2017-02-21T00:00:00",
	"Date": "2017-02-21T00:00:00",
	"Bottom": "",
	"DiscountComment": null,
	"CompanyInformation": "",
	"Header": "Subject: Sales invoice to H n L Company on purchase of flash drives",
	"Footer": "Please pay within days before ",
	"PaymentReference": null,
	"ReceiptNumber": "RLZ-01-2016023882",
	"Reference": null,
	"Token": "aZ6Wyw-ec6XDcH2Xr4yadZs8YeQgAQ",
	"Status": 1,
	"DocumentType": 10,
	"Origin": 1,
	"Type": 1,
	"TaxPurposeType": null,
	"DueDate": "2017-03-01T00:00:00",
	"DiscountAmount": null,
	"DiscountPercentage": null,
	"InvoiceNumber": null,
	"OverdueDays": null
}

There are various important attributes involved for any sales invoice. Let us have a look at a few of them for better insight.

PaymentAccount:
Provide the identity of the BankPaymentAccount you want to use. You can get a list with applicable PaymentAccounts bij making the following request:

GET{{url}}/paymentaccounts?$filter=Type eq ‘1’ or Type eq ‘2’ or Type eq ‘3’

PaymentMethod:
This is an optional property. If you don’t provide this property the default PaymentMethod of the PaymentAccount you selected will be used. The PaymentAccount has a list with applicable PaymentMethods you can use

GET {{url}}/paymentaccounts/{paymentAccountId}?$select=PaymentMethodList&$expand=PaymentMethodList

DocumentLineList:
This an array with all the lines you want to add. If you only use Quantity, Price and TaxRate then the server will calculate all the correct amounts for you. We would explore this one elaborately in next topics 'Add an invoice line with product' and 'Add manual invoice line'.

To learn more about each and every attributes of payload please check here.

Like sales invoice, you can also create Offering (proposal) invoices and Proforma invoices as well using our APIs.

NL Select your country