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.6/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.6/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.6/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.6/sales/invoices
Method POST
Content A new invoice data
Example POST https://api.profit365.eu/1.6/sales/invoices

Authorization: Basic *** hidden credentials ***
ClientID: C7A36D...
ClientSecret: j7896WnI0U1...
CompanyID: da7b2af8-8f3d-4701-8b9d-2988354afb4a
Content-Type: application/json

{
"ordnerID": "cf6eb17b-83d3-4057-82c1-c275a0a23c6f",
"warehouseID": "4dc29234-4045-4d61-a4a5-ed57f23da8dd",
"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.6/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.6/sales/invoices/96109fad-7be1-498c-836e-bb98ba20b282

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

{
"ordnerID": "6f362140-9a31-4c00-bfc0-c047efe04bd8",
"warehouseID": "c372878d-9f34-4d9a-84b4-d8beb9b8d600",
"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 the partner

Type: String

request, response

partnerAddress

optional

Delivery address / info of the partner

Type: String

request, response

partnerCountry

optional

Registration / residency country of the partner. Two letter country code (ISO 3166-1 alpha-2). Case-insensitive.

Type: String (2)

request, response

partnerNumber3

optional

VAT registration number of the partner, if any.

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

vatID

optional

ID of VAT code. Must be of type 'O' - output (sales). If not supplied, code will be selected based on vatCode.
To get a list of VAT codes, see Catalogs > VAT Codes

Type: GUID

request, response

vatCode

optional

Code of VAT code. Must be of type 'O' - output (sales). For regular sales, must be valid for creditor's VAT-administering country, as set in vatNumber. For OSS (One Stop Shop), vatCode must be valid for partnerCountry, which must be set. If vatCode is not supplied, VAT code will be selected based on vatRate. Case-sensitive.
To get a list of VAT codes, see Catalogs > VAT Codes

Type: String

request, response

vatNumber

optional

VAT registration number of creditor. Must start with two-letter country code (ISO 3166-1 alpha-2). If not supplied, VAT registration number of own company will be used, if any.

Type: String

request, response

vatRate

optional

VAT rate in percent. VAT code with supplied rate will be selected, based on vatNumber and partnerNumber3, if any. For OSS (One Stop Shop), partnerCountry must be set. If not supplied, default VAT code will be used.

Type: Decimal

request, response

vatParagraphID

optional

ID of VAT paragraph. Must be valid for supplied VAT code, if any. Otherwise, default paragraph for VAT code will be used.

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

vatID

optional

ID of VAT code. Must be of type 'O' - output (sales). If not supplied, code will be selected based on vatCode.
To get a list of VAT codes, see Catalogs > VAT Codes.

Type: GUID

request, response

vatCode

optional

Code of VAT code. Must be of type 'O' - output (sales). For regular sales, must be valid for creditor's VAT-administering country, as set in invoice vatNumber. For OSS (One Stop Shop), vatCode must be valid for invoice partnerCountry, which must be set. If vatCode is not supplied, VAT code will be selected based on vatRate. Case-sensitive.
To get a list of VAT codes, see Catalogs > VAT Codes.

Type: String

request, response

vatRate

optional

VAT rate in percent. VAT code with supplied rate will be selected, based on invoice vatNumber and partnerNumber3, if any. For OSS (One Stop Shop), invoice partnerCountry must be set. If not supplied, VAT code of invoice will be used.

Type: Decimal

request, response

vatParagraphID

optional

ID of VAT paragraph. Must be valid for supplied VAT code, if any. If not supplied, vatParagraphID of invoice will be used. Otherwise, default paragraph for VAT code will be used.

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.6/reports/{reportId}?output=pdf&{invoiceId}
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
Example https://api.profit365.eu/1.6/reports/3051?output=pdf&recordID=48b8c8f4-1234-4355-98c0-7e04187faf18