Sales invoices

The Sales invoices API is a background functionality of a web client at Profit365 > Sales > Invoices.

Content:

Resource information

Url https://api.profit365.eu/1.4/sales/invoices
Authentication required
Access level company
Response JSON / XML
Class Business entity

List invoices

A view is currently only way how to list invoices. Before getting involved, read more about the view. Invoices view contains general data joined with partners, ordners and accounts; also balance to date and some more. A pagination is used.

Url https://api.profit365.eu/1.4/sales/invoices/{page}
Method GET
Params
{page} optional A page number of result set. Default page number is 1 and default page size is 50.
Example https://api.profit365.eu/1.4/sales/invoices/1

Create new invoice

Creating an invoice is a advanced process. Profit 365 has to keep accounting, tax (or legal) and system integrity and consistency of an invoice. It is ensured by several built-in routines which are executed or excluded from execution based on uploaded data.

We have selected two main cases which describe the diference best.

  • Records of invoices. You upload invoices that have already been created, printed and sent to customer in other application or system. In such case Profit 365 only fills missing system and accounting data, and turn uploaded invoice into a full invoice record. This is done without modifying any number, sum, value or tax data. Accounting and system consistency is ensured.
    Example: upload invoices from a standalone invoicing service.
  • Creation of invoices. You create new invoice based on business data (product, amount, invoiced sum). Profit 365 then processes simple data into full invoice record, including sums recalculation, bonuses, pricelists, VAT.  Accounting, TAX and system consisntency is ensured.
    Example: upload orders from eshop, turn them into invoices and get back a printable output for customer.

Both methods are available at same URL (see above). The difference is amount and structure of the data you are sending to API. POST data which include Rows and VAT are considered as Records of invoice.
Parameters for insert are listed here.

Url https://api.profit365.eu/1.4/sales/invoices
Method POST
Content A new invoice data
Example POST https://api.profit365.eu/1.4/sales/invoices

Authorization: Basic *** hidden credentials ***
ClientID: C7A36D...
ClientSecret: j7896WnI0U1...
CompanyID: 229cf356-a797-41f7-af66-e23ccb920238
Content-Type: application/json

{
"ordnerID": "db22bbd5-55f8-4f5f-887a-3c8fa894b7ad",
"warehouseID": "4c4154ff-1311-4aa6-8c47-0005a780aba9",
"partnerAddress": "Milan Vesely\r\nHlavna ulica 4\r\nBratislava",
"dateCreated": "2015-01-01",
"itemsComment": "Fakturujeme Vám za...",
"rows": [{ "code": "PCT-01",
"name": "Project documentation",
"price": 600.50,
"quantity": 1
}, { "code": "MMT-01",
"name": "Project marketing materials",
"price": 12.30,
"quantity": 200
}]
}

Update invoice

An existing invoice can be updated, if its business state allows such operation. When updating an invoice, submit all the data, not just fields that have changed.

Url https://api.profit365.eu/1.4/sales/invoices/{id}
Method PUT
Params
{ID} required A ID of an invoice. Type: GUID
Content An updated invoice data
Example PUT https://api.profit365.eu/1.4/sales/invoices/38c21f44-47b0-419a-b956-70e0253cafe9

Authorization: Basic *** hidden credentials ***
ClientID: C7A36D...
ClientSecret: j7896WnI0U1...
CompanyID: CCA256B...
Content-Type: application/json

{
"ordnerID": "eead3d9b-aec6-4e36-beb7-c802170ae56b",
"warehouseID": "4b9f1f06-b8c1-414d-8c71-2a8d577d5a26",
"partnerAddress": "Milan Smutny\r\nHlavna ulica 4\r\nBratislava",
"dateCreated": "2015-01-01",
"itemsComment": "Fakturujeme Vám za...",
"rows": [{ "code": "PCT-01",
"name": "Project documentation",
"price": 600.50,
"quantity": 1
}, { "code": "MMT-01",
"name": "Project marketing materials",
"price": 12.30,
"quantity": 200
}]
}

Invoice data

ordnerId

required

ID of an ordner where the invoice is stored. (SK: šanón)

Type: GUID

request, response

warehouseId

required

ID of a warehouse.

Type: GUID

request, response

dateCreated

required

Date when invoice was issued (business date not system date)

Type: DateTime

request, response

rows

required

A collection of invoice's rows. The invoice may contain one or multiple rows. Each row represents exactly one invoiced item. See row data

Type: Array

request, response

recordNumber

optional

A unique number of the invoice. When inserting, empty record number will be generated by the counter. When updating, empty record number wont be generated. Duplicate record number will be denied.

Type: String

request, response

tags

optional

An Array of tags helps to search, group and link invoices

Type: String Array

request, response

partnerId

optional

Customer ID from a business partners list

Type: GUID

request, response

partnerDetail

optional

Billing address / info of a partner

Type: String

request, response

partnerAddress

optional

Delivery address / info of a partner

Type: String

request, response

deliveryTypeId

optional

ID of a delivery type

Type: GUID

request, response

paymentTypeId

optional

ID of a payment type

Type: GUID

request, response

bankAccountId

optional

ID of one of the company bank accounts

Type: GUID

request, response

symbolVariable

optional

Variable symbol for the payment

Type: String

request, response

symbolConstant

optional

Constant symbol for the payment

Type: String

request, response

symbolSpecific

optional

Specific symbol for the payment

Type: String

request, response

dateAccounting

optional

A accounting date for the invoice. A period, when not set, is selected by dateAccounting.

Type: DateTime

request, response

dateDelivery

optional

A delivery date for the invoice. VAT Period is generated by dateDelivery.

Type: DateTime

request, response

periodId

optional

A accounting period for the invoice. If not set, system will find period by date Accounting.

Type: DateTime

request, response

dateValidTo

optional

A due date for the invoice.

Type: DateTime

request, response

commentAboveItems

optional

A comment above items.

Type: string

request, response

commentBelowItems

optional

A comment bellow items.

Type: string

request, response

vatParagraphID

optional

A VAT paragraph ID.

Type: GUID

request, response

bonusPercent

optional

Bonus (discount) for a whole invoice in percent.

Type: Decimal

request, response

orderRecordNo

optional

Record number of the related order.

Type: string

request, response

warehouseRecordNo

optional

Record number of the related warehouse isuue card.

Type: string

request, response

costCenterId

optional

ID of a Cost center.

Type: GUID

request, response

costUnitId

optional

ID of a Cost unit.

Type: GUID

request, response

personId

optional

ID of a Person.

Type: GUID

request, response

projectId

optional

ID of a Project.

Type: GUID

request, response

Invoice row data

quantity

required

A quantity of an invoiced item. Required value, must be other than zero.

Type: Number

request, response

price

required

A price per unit. This property is conditionally required - either price or priceBrutto must have a value.

Type: Number

request, response

priceBrutto

required

A price per unit including taxes (VAT, etc).  This property is conditionally required - either price or priceBrutto must have a value.

Type: Number

request, response

itemId

optional

ID of an item from price list.

Type: GUID

request, response

code

optional

A free text field. If an itemID is used, will be automatically filled by Item's Code. If invoicing an item that is not listed in system, fill manually.

Type: GUID

request, response

name

optional

A free text field. If an itemID is used, will be automatically filled by Item's Name. If invoicing an item that is not listed in system, fill manually.

Type: GUID

request, response

vatParagraphID

optional

A VAT paragraph ID.

Type: GUID

request, response

New invoice data

A new invoice data extends a standard invoice data with custom properties. A new invoice data are available only in case when inserting new invoice.

ordnerCode

optional

Code of an ordner where is the invoice stored, alternative to ordnerID. 

Type: String

request

warehouseCode

optional

Code of a warehouse, alternative to warehouseID.

Type: String

request

New invoice row data

itemCode

optional

Code of an item, alternative to itemID.

Type: String

request

unitCode

optional

Code of a unit, alternative to unitID.

Type: String

request

Get an invoice printout

Url https://api.profit365.eu/1.4/reports/{reportId}/{invoiceId}/{file-name}
Method GET
Headers Accept is required request header. Allowed values are: "application/pdf".
Params
{reportId} required  A ID of a report. See List of reports Type: Int
{invoiceId} required ID of an invoice. Type: GUID
{file-name} required A file name, like invoice.pdf Type: String
Example https://api.profit365.eu/1.4/reports/3051/5c073c07-c547-499e-a8cf-214f39d569ea/invoice.pdf