Skip to content

Create Purchase Invoice

Endpoints v1

https://app.passelimerit.fi/api/v1/sendpurchinvoice

IMPORTANT

This endpoint creates document and general ledger records without any confirmation. If you need solution where book keepers are approving puchase orders and expanse claims, use different endpoint: sendpurchorder.

Query Payload

json
{
  "Vendor": {
    "Name": "Mingi Firma AS"
  },
  "DocDate": "20200506",
  "DueDate": "20200506",
  "InvoiceRow": [
    {
      "Item": {
        "Code": "ENVOICE_SERVICE"
      },
      "Quantity": 1,
      "TaxId": "b9b25735-6a15-4d4e-8720-25b254ae3d21"
    }
  ],
  "TaxAmount": [
    {
      "TaxId": "b9b25735-6a15-4d4e-8720-25b254ae3d21"
    }
  ]
}
Purchase Invoice
FieldTypeCommentRequired
VendorVendorObjectRequired
ExpenseClaimboolIf false, it indicates a normal purchase invoice. If true, the purchase invoice is handled as presented by responsible employee for expense claim.
DocDateDateRequired
DueDateDateRequired
TransactionDateDate
BillNoStr 35
RefNoStr 36
BankAccountStr 50
CurrencyCodeStr 4
CurrencyRateDecimal 18.7
DepartmentCodeStr 20If used then must be found in the company database.
ProjectCodeStr 20If used then must be found in the company database.
InvoiceRowArray of InvoiceRowObjectsRequired
TaxAmountArray of TaxObjectsRequired
RoundingAmountDecimal 18.2
TotalAmountDecimal 18.2Amount without VAT
PaymentPayment object
HcommentStr 4KComment before invoice rows
FcommentStr 4KComment after invoice rows
AttachmentAttachmentObject
PolDocTypeint 1Poland only.
0 - nochoise
1 - purchmk
2 - purchvatrr
3 - purchwe

Vendor Object

json
{
  "Vendor": {
    "Name": "Mingi Firma AS",
    "RegNo": "123456789",
    "VatRegNo": "EE123456789",
    "CurrencyCode": "EUR",
    "PaymentDeadLine": "7",
    "OverDueCharge": "0",
    "RefNoBase": "1",
    "Address": "Mingi Tänav 5",
    "County": "Estonia",
    "CountryCode": "EE",
    "City": "Keskus, Pealinnas",
    "PostalCode": "75306",
    "PhoneNo": "",
    "PhoneNo2": "",
    "Email": ""
  },
  // ...
}
Vendor Object
FieldTypeCommentRequired
IdGuidIf filled and vendor is found in the database then following fields are not important. If not found, the vendor is added using the following fields.Required, if the following fields are not used
NameStr 150Required, when a vendor is added.
RegNoStr 30
VatAccountableBoolAllowed true or false (lowercase).Required, when a vendor is added.
VatRegNoStr 30
CurrencyCodeStr 4
PaymentDeadLineIntIf missing then taken from default settings.
OverDueChargeDecimal 5.2If missing then taken from default settings.
AddressStr 100
CityStr 30
CountyStr 100
PostalCodeStr 15
CountryCodeStr 2Required, when a vendor is added.
PhoneNoStr 50
PhoneNo2Str 50
HomePageStr 80
EmailStr 80

Item Object

json
{
  // ...
  "InvoiceRow": [
    {
      "Item": {
        "Code": "ENVOICE_SERVICE",
        "Description": "Rehvivahetuse ettemaks",
        "Type": 2,
        "UOMName": null
      },
      // ...
    }
  ],
  // ...
}
Item Object
FieldTypeCommentRequired
CodeStr 20Must be found in company database.Required
DescriptionStr 100Required
TypeInt1 - stock item,
2 - service,
3 - item.
Required
UOMNameStr 64Name for the unit.Required for stock items (type 1)
DefLocationCodeStr 20Required, if the company has more than 1 (default) stocks, if the item is a stock item (type 1) and doesn't exist yet

InvoiceRow Object

json
{
  // ...
  "InvoiceRow": [
    {
      "Item": {
        // ...
      },
      "Quantity": 1,
      "Price": 380.0,
      "TaxId": "b9b25735-6a15-4d4e-8720-25b254ae3d21",
      "GLAccountCode": "1531",
      "CostCenterCode": "testCostCenterCode"
    }
  ],
  // ...
}
InvoiceRow Object
FieldTypeCommentRequired
ItemItemObjectRequired
QuantityDecimal 18.3Required
PriceDecimal 18.7
TaxIdGuidUse gettaxes endpoint to detect the guid neededRequired
LocationCodeStr 20Used for stock items and multiple stocks. If used then must be found in the company database.
DepartmentCodeStr 20If used then must be found in the company database.
GLAccountCodeStr 10General ledger Account code. If used then must be found in the company database
ProjectCodeStr 20If used then must be found in the company database
CostCenterCodeStr 20If used then must be found in the company database

TaxAmount Object

json
{
  // ...
  "TaxAmount": [
    {
      "TaxId": "b9b25735-6a15-4d4e-8720-25b254ae3d21",
      "Amount": 0.20
    } 
  ],
  // ...
}
Tax Object
FieldTypeCommentRequired
TaxIdGuidUse gettaxes endpoint to detect the guid neededRequired
AmountDecimal 18.2

Payment Object

json
{
  // ...
  "Payment": {
    "PaymentMethod": "Nordea",
    "PaidAmount": 380.00,
    "PaymDate": "202406031240"
  },
  // ...
}
Payment Object
FieldTypeCommentRequired
PaymentMethodStr 150Name of the payment method. Must be found in the company database.
PaidAmountDecimal 18.2Amount with VAT (not more) or less if partial payment
PaymDateDateYYYYmmddHHii

Attachment Object

json
{
  // ...
  "Attachment": {
    "FileName": "ZmlsZS5wZGY=",
    "FileContent": "YmFzZTY0"
  },
  // ...
}
Attachment Object
FieldTypeCommentRequired
FileNameStr
FileContentStrPDF In Base64 format

Endpoints v2

https://app.passelimerit.fi/api/v2/sendpurchinvoice

Query Payload

json
{
  "Vendor": {
    "Name": "Mingi Firma AS"
  },
  "DocDate": "20200506",
  "DueDate": "20200506",
  "InvoiceRow": [
    {
      "Item": {
        "Code": "ENVOICE_SERVICE"
      },
      "Quantity": 1,
      "TaxId": "b9b25735-6a15-4d4e-8720-25b254ae3d21"
    }
  ],
  "TaxAmount": [
    {
      "TaxId": "b9b25735-6a15-4d4e-8720-25b254ae3d21"
    }
  ]
}
Purchase Invoice
FieldTypeCommentRequired
VendorVendorObjectRequired
ExpenseClaimboolIf false, it indicates a normal purchase invoice. If true, the purchase invoice is handled as presented by responsible employee for expense claim.
DocDateDateRequired
DueDateDateRequired
TransactionDateDate
BillNoStr 35
RefNoStr 36
CurrencyCodeStr 4
CurrencyRateDecimal 18.7
DepartmentCodeStr 20If used then must be found in the company database.
DimensionsArray of dimensions objectsIf used then must be found in the company database.
InvoiceRowArray of InvoiceRowObjectsRequired
TotalAmountDecimal 18.2Amount without VAT
RoundingAmountDecimal 18.2
TaxAmountArray of TaxObjectsRequired
PaymentPayment object
HcommentStr 4KComment before invoice rows
FcommentStr 4KComment after invoice rows
AttachmentAttachmentObject
BankAccountStr 50
ReceiverReceiverObject

Vendor Object

json
{
  "Vendor": {
    "Name": "Mingi Firma AS",
    "RegNo": "123456789",
    "VatRegNo": "EE123456789",
    "CurrencyCode": "EUR",
    "PaymentDeadLine": "7",
    "OverDueCharge": "0",
    "RefNoBase": "1",
    "Address": "Mingi Tänav 5",
    "County": "Estonia",
    "CountryCode": "EE",
    "City": "Keskus, Pealinnas",
    "PostalCode": "75306",
    "PhoneNo": "",
    "PhoneNo2": "",
    "Email": ""
  },
  // ...
}
Vendor Object
FieldTypeCommentRequired
IdGuidIf filled and vendor is found in the database then following fields are not important. If not found, the vendor is added using the following fields.Required, if the following fields are not used
NameStr 150Required when vendor is added
RegNoStr 30
VatAccountableBoolAllowed true or false (lowercase).Required, when a vendor is added.
VatRegNoStr 30
CurrencyCodeStr 4
PaymentDeadLineIntIf missing then taken from default settings.
OverDueChargeDecimal 5.2If missing then taken from default settings.
AddressStr 100
CityStr 30
CountyStr 100
PostalCodeStr 15
CountryCodeStr 2Required, when a vendor is added.
PhoneNoStr 50
PhoneNo2Str 50
HomePageStr 80
EmailStr 80

InvoiceRow Object

json
{
  // ...
  "InvoiceRow": [
    {
      "Item": {
        // ...
      },
      "Quantity": 1,
      "Price": 380.0,
      "TaxId": "b9b25735-6a15-4d4e-8720-25b254ae3d21",
      "GLAccountCode": "1531",
      "CostCenterCode": "testCostCenterCode"
    }
  ],
  // ...
}
```json
InvoiceRow Object
FieldTypeCommentRequired
ItemItem Object
QuantityDecimal 18.3Required
PriceDecimal 18.7
TaxIdGuidUse gettaxes endpoint to detect the guid neededRequired
LocationCodeStr 20Used for stock items and multiple stocks. If used then must be found in the company database.
DepartmentCodeStr 20If used then must be found in the company database.
GLAccountCodeStr 10General ledger Account code. If used then must be found in the company database
DimensionsArray of Dimensions objectsIf used then must be found in the company database
VatDateStr 20
SalesAccCodeStr 10
PurchaseAccCodeStr 10If included GLAccountCode then the PurchaseAccCode not be used
InventoryAccCodeStr 10
CostAccCodeStr 10

Item Object

json
{
  // ...
  "InvoiceRow": [
    {
      "Item": {
        "Code": "ENVOICE_SERVICE",
        "Description": "Rehvivahetuse ettemaks",
        "Type": 2,
        "UOMName": null
      },
      // ...
    }
  ],
  // ...
}
Item Object
FieldTypeCommentRequired
CodeStr 20Must be found in company database.Required
DescriptionStr 100Required
TypeInt1 - stock item,
2 - service,
3 - item.
Required
UOMNameStr 64Name for the unit.Required for stock items (type 1)
DefLocationCodeStr 20Required, if the company has more than 1 (default) stocks, if the item is a stock item (type 1) and doesn't exist yet

Dimensions Object

json
{
  // ...
  "InvoiceRow": [
    {
      // ...
      "Dimensions": [
        {
          "DimId": 2,
          "DimValueId": "7fc5f7f0-0537-4d64-b4cc-a8647bd217ac",
          "DimCode": "hfif"
        }
      ],
      // ...
    }
  ],
  // ...
}
Dimensions Object
FieldTypeCommentRequired
DimIdInt
DimValueIdGuid
DimCodeStr

TaxAmount Object

json
{
  // ...
  "TaxAmount": [
    {
      "TaxId": "b9b25735-6a15-4d4e-8720-25b254ae3d21",
      "Amount": 0.20
    }
  ],
  // ...
}
Tax Object
FieldTypeCommentRequired
TaxIdGuidUse gettaxes endpoint to detect the guid neededRequired
AmountDecimal 18.2

Payment Object

json
{
  // ...
  "Payment": {
    "PaymentMethod": "Nordea",
    "PaidAmount": 380.00,
    "PaymDate": "202406031240"
  },
  // ...
}
Payment Object
FieldTypeCommentRequired
PaymentMethodStr 150Name of the payment method. Must be found in the company database.
PaidAmountDecimal 18.2Amount with VAT (not more) or less if partial payment
PaymDateDateYYYYmmddHHii

Attachment Object

json
{
  // ...
  "Attachment": {
    "FileName": "ZmlsZS5wZGY=",
    "FileContent": "YmFzZTY0"
  },
  // ...
}
Attachment Object
FieldTypeCommentRequired
FileNameStr
FileContentStrPDF In Base64 format

Receiver Object

json
{
  // ...
  "Receiver": {
    "Id": "",
    "Name": "Mingi Firma AS",
    "RegNo": "123456789",
    "VatAccountable": true,
    "VatRegNo": "EE123456789",
    "CurrencyCode": "EUR",
    "PaymentDeadLine": 7,
    "OverDueCharge": 0,
    "Address": "Mingi Tänav 5",
    "City": "Keskus, Pealinnas",
    "County": "Estonia",
    "PostalCode": "75306",
    "CountryCode": "EE",
    "PhoneNo": "",
    "PhoneNo2": "",
    "HomePage": "",
    "Email": ""
  },
  // ...
}
Receiver Object
FieldTypeCommentRequired
IdGuidIf filled and receiver (vendor) is found in the database then following fields are not important. If not found, the receiver is added using the following fields.
NameStr 150Required, when a receiver is added.
RegNoStr 30
VatAccountableBoolAllowed "true" or "false" (lowercase).Required, when a receiver is added.
VatRegNoStr 30
CurrencyCodeStr 4
PaymentDeadLineIntIf missing then taken from default settings.
OverDueChargeDecimal 5.2If missing then taken from default settings.
AddressStr 100
CityStr 30
CountyStr 100
PostalCodeStr 15
CountryCodeStr 2Required, when a receiver is added.
PhoneNoStr 50
PhoneNo2Str 50
HomePageStr 80
EmailStr 80

Successful Result

json
{
  "VendorId": "cbd0cd6b-c6ce-42c5-9162-0eb4942f2dd5",
  "BillId": "23b7203d-bcb4-4cf4-963a-8cc30c298c25",
  "BillNo": "987654324",
  "RefNo": null,
  "BatchInfo": "OS-1"
}