Appearance
Create Sales Invoice
Endpoints v1
https://app.passelimerit.fi/api/v1/sendinvoice
NOTE:
V2 should be used when willow dimensions ase used.
Query Payload
json
{
"Customer": {
"Name": "FirstCustomer Inc",
"RegNo": "1122334755",
"NotTDCustomer": false,
"VatRegNo": "11222344",
"CurrencyCode": "EUR",
"PaymentDeadLine": 7,
"OverDueCharge": 0,
"RefNoBase": 1,
"Address": "Merimiehenkatu 31",
"CountryCode": "FI",
"County": "Finland",
"City": "Helsinki",
"PostalCode": "",
"PhoneNo": "6548765",
"PhoneNo2": "",
"HomePage": "",
"Email": "customermail@gmail.com"
},
"DocDate": "20170113131239",
"DueDate": "20170125131239",
"InvoiceNo": "123",
"RefNo": "1232",
"DepartmentCode": "",
"ProjectCode": "",
"InvoiceRow": [
{
"Item": {
"Code": "1234567",
"Description": "Bag of goldflakes",
"Type": 3,
"UOMName": "kg"
},
"Quantity": 2.00,
"Price": 1000.00,
"DiscountPct": 0,
"DiscountAmount": 0.00,
"TaxId": "b9b25735-6a15-4d4e-8720-25b254ae3d21",
"LocationCode": "1"
}
],
"TotalAmount": 2000.00,
"RoundingAmount": 0.00,
"TaxAmount": [
{
"TaxId": "b9b25735-6a15-4d4e-8720-25b254ae3d21",
"Amount": 400.00
}
],
"Payment": {
"PaymentMethod": "Nordea",
"PaidAmount": "100",
"PaymDate": "20190413202154"
},
"HComment": "",
"FComment": ""
}
Click to see the Query Payload parameters
Field | Type | Comment | Required |
---|---|---|---|
Customer | CustomerObject | ||
AccountingDoc | Int 1 | 1 - faktura, 2 - rachunek, 3 - paragon, 4 - nodoc, 5 - credit, 6 - prepinvoice, 7 - fincchrg, 8 - delivorder, 9 - grpinv | |
ProcCodes | Array of Strings | Poland only. SW, EE, TP, TT_WNT, TT_D, MR_T, MR_UZ, I_42, I_63, B_SPV, B_SPV_DOSTAWA, B_MRV_PROWIZJA, MPP | |
PolDocType | Int | Poland only. 1 - RO, 2 - WEW, 3 - FP, 4 - OJPK | |
DocDate | Date | ||
DueDate | Date | ||
TransactionDate | Date | ||
InvoiceNo | Str 35 | Required | |
RefNo | Str 36 | If not specified, generated automatically. Please validate this number yourself. | |
CurrencyCode | Str 4 | ||
DepartmentCode | Str 20 | If used then must be found in the company database. | |
ProjectCode | Str 20 | If used then must be found in the company database. | |
InvoiceRow | Array of InvoiceRow objects | ||
TaxAmount | Array of VAT objects | Required | |
RoundingAmount | Decimal 18.2 | Use it for getting PDF invoice to round number. Does not affect TotalAmount. | |
TotalAmount | Decimal 18.2 | Amount without VAT | |
Payment | Payment object | ||
Hcomment | Str 4K | If not specified, API will get it from client record, if it is written there. | |
Fcomment | Str 4K | If not specified, API will get it from client record, if it is written there. | |
ContractNo | Str 35 | Contract number with operator | |
Str 4K | Pdf file in Base64 format |
CustomerObject
3 use cases:
- new customer – you will create new client record when this name was not found
- existing customer by name – if this name exists in our system, Merit will take info from client record instead of reading it from the payload.
- customer by ID – every time you add new customer, the CustomerId is returned, you can use this ID instead of name,
the object = { CustomerId: <guid-of-the-customer> }
.
json
{
"Customer": {
"Name": "FirstCustomer Inc",
"RegNo": "1122334755",
"NotTDCustomer": false,
"VatRegNo": "11222344",
"CurrencyCode": "EUR",
"PaymentDeadLine": 7,
"OverDueCharge": 0,
"RefNoBase": 1,
"Address": "Merimiehenkatu 31",
"CountryCode": "FI",
"County": "Finland",
"City": "Helsinki",
"PostalCode": "",
"PhoneNo": "6548765",
"PhoneNo2": "",
"HomePage": "",
"Email": "customermail@gmail.com"
},
}
Click to see the CustomerObject parameters
Parameter | Type | Comment | Required |
---|---|---|---|
Id | Guid | If filled and customer is found in the database then following fields are not important. If not found, the customer is added using the following fields. | |
Name | Str 150 | Required when customer is added | |
RegNo | Str 30 | ||
NotTDCustomer | Bool | - EE True for physical persons and foreign companies. - PL True for physical persons. Allowed "true" or "false" (lowercase). | Required, when adding a new customer |
VatRegNo | Str 30 | ||
CurrencyCode | Str 30 | ||
PaymentDeadLine | Int | If missing then taken from default settings. | |
OverDueCharge | Decimal 5.2 | If missing then taken from default settings. | |
Address | Str 100 | ||
City | Str 30 | ||
County | Str 100 | ||
PostalCode | Str 15 | ||
CountryCode | Str 2 | Required, when adding a new customer | |
PhoneNo | Str 50 | ||
PhoneNo2 | Str 50 | ||
HomePage | Str 80 | ||
Str 80 | |||
SalesInvLang | Str 8 | Invoice language for this specific customer. (ET, EN, RU,FI,PL,SV) | |
RefNoBase | Str 36 | ||
EInvPaymId | Str 20 | ||
EInvOperator | Int | 1 - Doesn't exist, 2 - E-invoices to the bank through Omniva, 3 - Bank ( full extent E-invoice), 4 - Bank (limited extent E-invoice) | |
BankAccount | Str 50 | ||
Contact | Str 35 | ||
ApixEinv | Str 20 | ||
GroupInv | Bool |
InvoiceRowObject
Every invoice has its rows. Row has its quantity and price, it also has its general ledger record and that's why it has its own tax calculation.
json
{
"InvoiceRow": [
{
"Quantity": 2.00,
"Price": 1000.00,
"DiscountPct": 0,
"DiscountAmount": 0.00,
"TaxId": "b9b25735-6a15-4d4e-8720-25b254ae3d21",
"LocationCode": "1"
}
],
}
Click to see the InvoiceRowObject parameters
Field | Type | Comment | Required |
---|---|---|---|
Item | ItemObject | Sometimes the volume of transactions in the sales software is very high and there is no need to duplicate all the data in accounting. In those cases, you could consider using the same item code for the items with the same VAT rate. Items with different VAT rates must have a different item codes. Also, for the VAT declarations to work, goods and services may not be summed up and must have different item codes. | |
Quantity | Decimal 18.3 | ||
Price | Decimal 18.7 | ||
DiscountPct | Decimal 18.2 | ||
DiscountAmount | Decimal 18.2 | Amount * Price * (DiscountPCt / 100). This is not rounded. Will be subtracted from row amount before row roundings. | |
TaxId | Guid | Use gettaxes endpoint to detect the guid needed | Required |
LocationCode | Str 20 | Used for stock items and multiple stocks. If used then must be found in the company database. | |
DepartmentCode | Str 20 | If used then must be found in the company database. | |
ItemCostAmount | Decimal 18.2 | Required for credit invoices when crediting stock items. | |
GLAccountCode | Str 10 | If used, must be found in the company database. | |
ProjectCode | Str 20 | If used, must be found in the company database. | |
CostCenterCode | Str 20 | If used, must be found in the company database. | |
VatDate | Date Str | YYYYMMDD type date. In some countries where you have to specify VatDate. |
ItemObject
json
{
"InvoiceRow": [
{
"Item": {
"Code": "1234567",
"Description": "Bag of goldflakes",
"Type": 3,
"UOMName": "kg"
},
// ...
}
],
}
Click to see the ItemObject parameters
Field | Type | Comment | Required |
---|---|---|---|
Code | Str 20 | Required | |
Description | Str 100 | Required | |
Type | Int | 1 - stock item, 2 - service, 3 - item. | Required |
UOMName | Str 64 | Name for the unit | |
DefLocationCode | Str 20 | If company has more than one (default) stock, stock code in this field is required for all stock items. | |
GTUCode | Int | Poland only, values: 1-13 |
PaymentObject
You can mark the invoice already paid. This is useful when you create invoice only when internet bank payment is successful, or you have received cash.
json
{
"Payment": {
"PaymentMethod": "Nordea",
"PaidAmount": "100",
"PaymDate": "20190413202154"
},
}
Click to see the PaymentObject parameters
Field | Type | Comment |
---|---|---|
PaymentMethod | Str 150 | Name of the payment method. Must be found in the company database. |
PaidAmount | Decimal 18.2 | Amount with VAT (not more) or less if partial payment |
PaymDate | Date | YYYYmmddHHii |
TaxObject
Every invoice has section of taxes. Those taxes have to be calculated grouped and summed by TaxId. Every row has its own tax calculation, you have to group and sum them up.
This is because you can have different tax rates for different articles.
API always counts it as well to assure you have correct calculation.
json
{
"TaxAmount": [
{
"TaxId": "b9b25735-6a15-4d4e-8720-25b254ae3d21",
"Amount": 400.00
}
],
}
Click to see the TaxObject parameters
Field | Type | Comment | Required |
---|---|---|---|
TaxId | Guid | Use gettaxes endpoint to detect the guid needed | Required |
Amount | Decimal 18.2 |
Endpoints v2
https://app.passelimerit.fi/api/v2/sendinvoice
Query Payload
json
{
"Customer": {
"Name": "FirstCustomer Inc",
"RegNo": "1122334755",
"NotTDCustomer": false,
"VatRegNo": "11222344",
"CurrencyCode": "EUR",
"PaymentDeadLine": 7,
"OverDueCharge": 0,
"RefNoBase": 1,
"Address": "Merimiehenkatu 31",
"CountryCode": "FI",
"County": "Finland",
"City": "Helsinki",
"PostalCode": "",
"PhoneNo": "6548765",
"PhoneNo2": "",
"HomePage": "",
"Email": "customermail@gmail.com"
},
"DocDate": "20170113131239",
"DueDate": "20170125131239",
"InvoiceNo": "123",
"RefNo": "1232",
"DepartmentCode": "",
"ProjectCode": "",
"OurReference": "ABC",
"YourReference": "CDE",
"InvoiceRow": [
{
"Item": {
"Code": "1234567",
"Description": "Bag of goldflakes",
"Type": 3,
"UOMName": "kg"
},
"Quantity": 2.00,
"Price": 1000.00,
"DiscountPct": 0,
"DiscountAmount": 0.00,
"TaxId": "b9b25735-6a15-4d4e-8720-25b254ae3d21",
"LocationCode": "1"
}
],
"TotalAmount": 2000.00,
"RoundingAmount": 0.00,
"TaxAmount": [
{
"TaxId": "b9b25735-6a15-4d4e-8720-25b254ae3d21",
"Amount": 400.00
}
],
"Payment": {
"PaymentMethod": "testaus",
"PaidAmount": "100",
"PaymDate": "20190413202154"
},
"Dimensions": [
{
"DimId": 2,
"DimValueId": "7fc5f7f0-0537-4d64-b4cc-a8647bd217ac",
"DimCode": "hfif"
}
],
"HComment": "",
"FComment": "",
"Payer": {
"Name": "FirstCustomer Inc",
"RegNo": "1122334755",
"NotTDCustomer": false,
"VatRegNo": "11222344",
"CurrencyCode": "EUR",
"PaymentDeadLine": 7,
"OverDueCharge": 0,
"RefNoBase": 1,
"Address": "Merimiehenkatu 31",
"CountryCode": "FI",
"County": "Finland",
"City": "Helsinki",
"PostalCode": "",
"PhoneNo": "6548765",
"PhoneNo2": "",
"HomePage": "",
"Email": "",
"SalesInvLang": "EN",
"Contact": "",
"GLNCode": "",
"PartyCode": "",
"EInvOperator": 1,
"EInvPaymId": "",
"BankAccount": "",
"Dimensions": [],
"CustGrCode": "",
"ShowBalance": false
}
}
Click to see the Query Payload parameters
Field | Type | Comment | Required |
---|---|---|---|
Customer | CustomerObject | ||
AccountingDoc | Int 1 | 1 - faktura, 2 - rachunek, 3 - paragon, 4 - nodoc, 5 - credit, 6 - prepinvoice, 7 - fincchrg, 8 - delivorder, 9 - grpinv | |
DocDate | Date | ||
DueDate | Date | ||
TransactionDate | Date | ||
InvoiceNo | Str 35 | Required | |
CurrencyCode | Str 4 | ||
CurrencyRate | Decimal 18.7 | If the exchange rate is not included, we will take it from the EU central bank's request for the respective date | |
DepartmentCode | Str 20 | If used then must be found in the company database. | |
Dimensions | Array of Dimensions objects | ||
InvoiceRow | Array of InvoiceRow objects | ||
TaxAmount | Array of VAT objects | Required | |
RoundingAmount | Decimal 18.2 | Use it for getting PDF invoice to round number. Does not affect TotalAmount. | |
TotalAmount | Decimal 18.2 | Amount without VAT | |
Payment | Payment object | ||
RefNo | Str 36 | If not specified, generated automatically. Please validate this number yourself. | |
Hcomment | Str 4K | If not specified, API will get it from client record, if it is written there. | |
Fcomment | Str 4K | If not specified, API will get it from client record, if it is written there. | |
ReserveItems | Bool | ||
ContractNo | Str 35 | Contract number with operator | |
Str 4K | Pdf file in Base64 format | ||
FileName | Str 100 | Name of PDF file | |
Payer | PayerObject | ||
DeliveryType | Bool | ||
OurReference | Str 70 | ||
YourReference | Str 70 |
CustomerObject
3 use cases:
- new customer – you will create new client record when this name was not found
- existing customer by name – if this name exists in our system, Merit will take info from client record instead of reading it from the payload
- customer by ID – every time you add new customer, the CustomerId is returned, you can use this ID instead of name,
the object = { CustomerId: <guid-of-the-customer> }
.
json
{
"Customer": {
"Name": "FirstCustomer Inc",
"RegNo": "1122334755",
"NotTDCustomer": false,
"VatRegNo": "11222344",
"CurrencyCode": "EUR",
"PaymentDeadLine": 7,
"OverDueCharge": 0,
"RefNoBase": 1,
"Address": "Merimiehenkatu 31",
"CountryCode": "FI",
"County": "Finland",
"City": "Helsinki",
"PostalCode": "",
"PhoneNo": "6548765",
"PhoneNo2": "",
"HomePage": "",
"Email": "customermail@gmail.com"
},
}
Click to see the CustomerObject parameters
Field | Type | Comment | Required |
---|---|---|---|
Id | Guid | If filled and customer is found in the database then following fields are not important. If not found, the customer is added using the following fields. | |
Name | Str 150 | Required, when a new customer is added. | |
RegNo | Str 30 | ||
NotTDCustomer | Bool | - EE True for physical persons and foreign companies. - PL True for physical persons. Allowed "true" or "false" (lowercase). | Required, when a new customer is added. |
VatRegNo | Str 30 | ||
CurrencyCode | Str 30 | ||
PaymentDeadLine | Int | If missing then taken from default settings. | |
OverDueCharge | Decimal 5.2 | If missing then taken from default settings. | |
RefNoBase | Str 36 | ||
Address | Str 100 | ||
CountryCode | Str 2 | Required, when a new customer is added. | |
County | Str 100 | ||
City | Str 30 | ||
PostalCode | Str 15 | ||
PhoneNo | Str 50 | ||
PhoneNo2 | Str 50 | ||
HomePage | Str 80 | ||
Str 80 | |||
SalesInvLang | Str 8 | Invoice language for this specific customer.(ET,EN,RU,FI,PL,SV) | |
Contact | Str 35 | ||
GLNCode | Str 10 | ||
PartyCode | Str 20 | ||
EInvOperator | Int | 1 - Not exist, 2 - E-invoices to the bank through Omniva, 3 - Bank (full extent E-invoice), 4 - Bank (limited extent E-invoice) | |
EInvPaymId | Str 20 | ||
BankAccount | Str 50 | ||
Dimensions | Array of DimensionsObjects | ||
CustGrCode | Str 20 | ||
ShowBalance | Bool | ||
ApixEinv | Str 20 | ||
GroupInv | Bool |
InvoiceRowObject
Every invoice has its rows. Row has its quantity and price, it also has its general ledger record and that's why it has its own tax calculation.
json
{
"InvoiceRow": [
{
"Quantity": 2.00,
"Price": 1000.00,
"DiscountPct": 0,
"DiscountAmount": 0.00,
"TaxId": "b9b25735-6a15-4d4e-8720-25b254ae3d21",
"LocationCode": "1"
}
],
}
Click to see the InvoiceRowObject parameters
Field | Type | Comment | Required |
---|---|---|---|
Item | ItemObject | Sometimes the volume of transactions in the sales software is very high and there is no need to duplicate all the data in accounting. In those cases, you could consider using the same item code for the items with the same VAT rate. Items with different VAT rates must have different item codes. Also, for the VAT declarations to work, goods and services may not be summed up and must have different item codes. | |
Quantity | Decimal 18.3 | ||
Price | Decimal 18.7 | ||
DiscountPct | Decimal 18.2 | ||
DiscountAmount | Decimal 18.2 | Amount * Price * (DiscountPCt / 100). This is not rounded. Will be substracted from row amount before row roundings. | |
TaxId | Guid | Use gettaxes endpoint to detect the guid needed | Required |
LocationCode | Str 20 | Used for stock items and multiple stocks. If used then must be found in the company database. | |
DepartmentCode | Str 20 | If used then must be found in the company database. | |
GLAccountCode | Str 10 | If used, must be found in the company database. | |
Dimensions | Array of DimensionsObjects | ||
ItemCostAmount | Decimal 18.2 | Required for credit invoices when crediting stock items. | |
VatDate | Date Str | YYYYMMDD type date. In some countries where you have to specify VatDate. | |
SalesAccCode | Str 10 | If included GLAccountCode then the SalesAccCode not used | |
PurchaseAccCode | Str 10 | ||
InventoryAccCode | Str 10 | ||
CostAccCode | Str 10 |
ItemObject
json
{
"InvoiceRow": [
{
"Item": {
"Code": "1234567",
"Description": "Bag of goldflakes",
"Type": 3,
"UOMName": "kg"
},
// ...
}
],
}
Click to see the ItemObject parameters
Field | Type | Comment | Required |
---|---|---|---|
Code | Str 20 | Required | |
Description | Str 100 | Required | |
Type | Int | 1 - stock item, 2 - service, 3 - item. | Required |
UOMName | Str 64 | Name for the unit | |
DefLocationCode | Str 20 | If company has more than one (default) stock, stock code in this field is required for all stock items. |
PaymentObject
You can mark the invoice already paid. This is useful when you create invoice only when internet bank payment is successful, or you have received cash
json
{
"Payment": {
"PaymentMethod": "Swedbank",
"PaidAmount": "100",
"PaymDate": "20190413202154"
},
}
Click to see the PaymentObject parameters
Field | Type | Comment | Required |
---|---|---|---|
PaymentMethod | Str 150 | Name of the payment method. Must be found in the company database. | |
PaidAmount | Decimal 18.2 | Amount with VAT (not more) or less if partial payment | |
PaymDate | Date | YYYYmmddHHii |
TaxObject
Every invoice has section of taxes. Those taxes have to be calculated grouped and summed by TaxId. Every row has its own tax calculation, you have to group and sum them up.
This is because you can have different tax rates for different articles.
API always counts it as well to assure you have correct calculation.
json
{
"TaxAmount": [
{
"TaxId": "b9b25735-6a15-4d4e-8720-25b254ae3d21",
"Amount": 400.00
}
],
}
Click to see the TaxObject parameters
Field | Type | Comment | Required |
---|---|---|---|
TaxId | Guid | Use gettaxes endpoint to detect the guid needed | Required |
Amount | Decimal 18.2 |
DimensionsObject
json
{
// ...
"Dimensions": [
{
"DimId": 1,
"DimValueId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx",
"DimCode": "123"
}
],
// ...
}
Click to see the DimensionsObject parameters
Field | Type | Comment | Required |
---|---|---|---|
DimId | Int | ||
DimValueId | Guid | ||
DimCode | Str |
PayerObject
json
{
// ...
"Payer": {
"Name": "FirstCustomer Inc",
"RegNo": "1122334755",
"NotTDCustomer": false,
"VatRegNo": "11222344",
"CurrencyCode": "EUR",
"PaymentDeadLine": 7,
"OverDueCharge": 0,
"RefNoBase": 1,
"Address": "Merimiehenkatu 31",
"CountryCode": "FI",
"County": "Finland",
"City": "Helsinki",
"PostalCode": "",
"PhoneNo": "6548765",
"PhoneNo2": "",
"HomePage": "",
"Email": "",
"SalesInvLang": "EN",
"Contact": "",
"GLNCode": "",
"PartyCode": "",
"EInvOperator": 1,
"EInvPaymId": "",
"BankAccount": "",
"Dimensions": [],
"CustGrCode": "",
"ShowBalance": false
}
}
Click to see the PayerObject parameters
Field | Type | Comment | Required |
---|---|---|---|
Id | Guid | If filled and payer (customer) is found in the database then following fields are not important. If not found, the payer is added using the following fields. | |
Name | Str 150 | Required, when adding a new payer | |
RegNo | Str 30 | ||
NotTDCustomer | Bool | True for physical persons and foreign companies. Allowed "true" or "false" (lowercase). | Required, when adding a new payer |
VatRegNo | Str 30 | ||
CurrencyCode | Str 30 | ||
PaymentDeadLine | Int | If missing then taken from default settings. | |
OverDueCharge | Decimal 5.2 | If missing then taken from default settings. | |
RefNoBase | Str 36 | ||
Address | Str 100 | ||
CountryCode | Str 2 | Required, when adding a new payer | |
County | Str 100 | ||
City | Str 30 | ||
PostalCode | Str 15 | ||
PhoneNo | Str 50 | ||
PhoneNo2 | Str 50 | ||
HomePage | Str 80 | ||
Str 80 | |||
SalesInvLang | Str 8 | Invoice language for this specific payer.(ET,EN,RU,FI,PL,SV) | |
Contact | Str 35 | ||
GLNCode | Str 10 | ||
PartyCode | Str 20 | ||
EInvOperator | Int | 1 - Not exist, 2 - E-invoices to the bank through Omniva, 3 - Bank (full extent E-invoice), 4 - Bank (limited extent E-invoice) | |
EInvPaymId | Str 20 | ||
BankAccount | Str 50 | ||
Dimensions | Array of DimensionsObject | ||
CustGrCode | Str 20 | ||
ShowBalance | Bool |
Successful Result
json
{
"CustomerId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx",
"InvoiceId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"InvoiceNo": "BL942019-PGG",
"RefNo": "xxxxxxx",
"NewCustomer": null
}