Create Purchase Invoice

Endpoints

Estonia:    https://aktiva.merit.ee/api/v1/sendpurchinvoice
Poland:     https://program.360ksiegowosc.pl/api/v1/sendpurchinvoice  

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

Example payload1: Example create

Example payload2: Example with proportional vat

PurchaseInvoice

FieldTypeComment 
VendorVendorObject
ExpenseClaimboolIf false, it indicates a normal purchase invoice. If true, the purchase invoice is handled as presented by responsible employee for expense claim.
DocDateDate
DueDateDate
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 InvoiceRowObjects
TaxAmountArray of TaxObjectsRequired
RoundingAmountDecimal 18.2
TotalAmountDecimal 18.2Amount without VAT
PaymentPayment object
HcommentString 4KComment before invoice rows
FcommentString 4KComment after invoice rows
AttachmentAttachmentObject
PolDocTypeint 1Poland only
1-purchmk
2-purchvatrr
3-purchwe
0-nochoise

VendorObject

FieldTypeComment 
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.
Name Str 150Required when vendor is added
RegNoStr 30
VatAccountableBoolRequired when vendor is added. Allowed true or false (lowercase).
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 adding
PhoneNoStr 50
PhoneNo2Str 50
HomePageStr 80
EmailStr 80

ItemObject

FieldTypeComment 
CodeStr 20Required. Must be found in company database.
DescriptionStr 100Required
TypeInt1 = stock item, 2 = service, 3 = item. Required.
UOMNameStr 64Name for the unit. Required for stock item
DefLocationCodeStr 20 If company has more than one (default) stock, stock code in this field is required if the item is a stock item and does not exist yet.

InvoiceRowObject

FieldTypeComment 
ItemItemObject
QuantityDecimal 18.3
PriceDecimal 18.7
TaxIdGuidRequired. Use gettaxes endpoint to detect the guid needed
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

TaxObject

FieldTypeComment 
TaxIdGuidRequired. Use gettaxes endpoint to detect the guid needed
AmountDecimal 18.2

PaymentObject

FieldTypeComment 
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

AttachmentObject

FieldTypeComment 
FileNameStr
FileContentStrPDF In Base64 format

Endpoints

Estonia:    https://aktiva.merit.ee/api/v2/sendpurchinvoice
Poland:     https://program.360ksiegowosc.pl/api/v2/sendpurchinvoice  

Query Payload

FieldTypeComment 
VendorVendorObject
ExpenseClaimboolIf false, it indicates a normal purchase invoice. If true, the purchase invoice is handled as presented by responsible employee for expense claim.
DocDateDate
DueDateDate
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 InvoiceRowObjects
TotalAmountDecimal 18.2Amount without VAT
RoundingAmountDecimal 18.2
TaxAmountArray of TaxObjectsRequired
PaymentPayment object
HcommentString 4KComment before invoice rows
FcommentString 4KComment after invoice rows
AttachmentAttachmentObject
BankAccountStr 50
ReceiverReceiverObject

Vendor Object

FieldTypeComment 
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.
Name Str 150Required when vendor is added
RegNoStr 30
VatAccountableBoolRequired when vendor is added. Allowed true or false (lowercase).
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 adding
PhoneNoStr 50
PhoneNo2Str 50
HomePageStr 80
EmailStr 80

InvoiceRowObject

FieldTypeComment 
ItemItem Object
QuantityDecimal 18.3
PriceDecimal 18.7
TaxIdGuidRequired. Use gettaxes endpoint to detect the guid needed
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

ItemObject

FieldTypeComment 
CodeStr 20Required. Must be found in company database.
DescriptionStr 100Required
TypeInt1 = stock item, 2 = service, 3 = item. Required.
UOMNameStr 64Name for the unit. Required for stock item
DefLocationCodeStr 20 If company has more than one (default) stock, stock code in this field is required if the item is a stock item and does not exist yet.

DimensionsObject

FieldTypeComment
DimIdInt
DimValueIdGuid
DimCodeStr

TaxObject

FieldTypeComment 
TaxIdGuidRequired. Use gettaxes endpoint to detect the guid needed
AmountDecimal 18.2

PaymentObject

FieldTypeComment 
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

AttachmentObject

FieldTypeComment 
FileNameStr
FileContentStrPDF In Base64 format

ReceiverObject

FieldTypeComment 
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.
Name Str 150Required when receiver is added
RegNoStr 30
VatAccountableBoolRequired when receiver is added. Allowed “true” or “false” (lowercase).
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 adding
PhoneNoStr 50
PhoneNo2Str 50
HomePageStr 80
EmailStr 80

Successful Result

  • VendorId
  • BillId
  • BillNo
  • RefNo
  • BatcInfo