/api/invoices/

 

Parameters for GET Queries

PARAMETER NAMETYPEDESCRIPTIONREQUIRED
dateFromStringFormat: 2012-12-29T00:00:00
dateToStringFormat: 2012-12-29T00:00:00
transactionDateFromStringFormat: 2012-12-29T00:00:00
transactionDateToStringFormat: 2012-12-29T00:00:00
customerIdlong
keywordString
userIdlong
descriptionString
documentTypeStringDOCUMENT_TYPE
projectIdlong
numberString
sortString
isPaidInvolvedboolean
isOverdueInvolvedboolean
preventWaybillsboolean
searchUnpaidWithCertainDateboolean
dontCalculateToLocalCurrencyboolean
showOnlyPrepaymentsboolean
documentStatusTypeStringDOCUMENT_STATUS_TYPE
startint
limitintby default 100

Response

FIELD NAMETYPEDESCRIPTIONREQUIRED
InvoiceInfoidlong
InvoiceInfonumberStringInvoice Number
InvoiceInfocustomerIdlongCustomer id
InvoiceInfocustomerNameStringCustomer Name
InvoiceInfodateDateInvoice Date
InvoiceInfocurrencyCodeStringCURRENCY
InvoiceInfodiscountPercentBigDecimalDiscount Percent
InvoiceInfolanguageCodeStringLanguage Code
InvoiceInfovatPercentBigDecimalVAT Percent (20, not 0.2)
InvoiceInforeferenceNumberStringReference Number
InvoiceInfodeadlineDateDateDeadline Date
InvoiceInfocreatorNameStringCreator Name
InvoiceInfomodifierNameStringModifier Name
InvoiceInfosumNoVatBigDecimalSum without VAT
InvoiceInfotaxSumBigDecimalVAT Sum
InvoiceInfosumWithVatBigDecimalSum with VAT
InvoiceInfosumPaidBigDecimalSum Paid
InvoiceInfosumLeftToPayBigDecimalSum left to pay
InvoiceInfoinvoiceTextsInfoIdlongTemplate id
InvoiceInfopenaltyPercentBigDecimalPenalty Percent
InvoiceInforoundedSumBigDecimalRounded Sum
InvoiceInfovatTotalRoundedSumBigDecimalVAT rounded sum
InvoiceInfocurrencyRateBigDecimalCurrency Rate
InvoiceInfotypeCodeStringDOCUMENT_TYPE
InvoiceInfohashStringHash that can be used to query for invoice from third parties
InvoiceInfoprojectIdlongProject ID (Margn internal ID)
InvoiceInfocodeStringCode. For sales invoice S14…, for purchase P14…
InvoiceInfotransactionDateDateDate of Transactio
InvoiceInfonoteStringAdditional note for the invoice
InvoiceInfoprintedInfoStringPrinted Info
InvoiceInforeferringIdentifierStringExternal link or other identifier
InvoiceInfoactionId
InvoiceInfopartnerDocumentIdlongDocument ID from ERPLY
InvoiceInfoactivityIdlong
InvoiceInfodocumentStatusTypeCodeStringDOCUMENT_STATUS_TYPE
InvoiceInfovatTotalsByTaxRate
InvoiceInfodiscountSum
InvoiceInforowsList <InvoiceArticleInfo>Array of invoice rows (InvoiceArticleInfo)
InvoiceInfopaymentsList <PaymentInfo>
InvoiceInfocustomerCustomerInfo

 

API examples

GET

Either id or documentType is always required!
Using id: https://api.erplybooks.com/api/invoices/2575151
Returns a “rows” array that contains all of the articles from this id.
Using documentType: https://api.erplybooks.com/api/invoices
In this case, “rows”=null.

DELETE

Id is required!
https://api.erplybooks.com/api/invoices/2575151

PUT

Used to replace data. All previous data is deleted and replaced with data from AccountEntryInfo.
Must have an id at the end of the URL!
https://api.erplybooks.com/api/invoices/2575151

JSON: {"id":2575151, "number":"3", "customerId":720951, "customerName":null, "date":"2015-02-25T11:42:08", "currencyCode":"CURRENCY_EUR", "discountPercent":0.000000, "languageCode":"LANGUAGE_ET", "vatPercent":0.0000, "referenceNumber":"", "deadlineDate":"2015-03-04T11:42:08", "creatorName":null, "modifierName":null, "sumNoVat":0.77, "taxSum":null, "sumWithVat":0.92400000, "sumPaid":1.200000000000, "sumLeftToPay":null, "invoiceTextsInfoId":31516, "penaltyPercent":0.5000, "roundedSum":0, "vatTotalRoundedSum":0, "currencyRate":null, "typeCode":"DOCUMENT_SELL", "hash":"444d22ca30249a93b2db424ba976299a", "projectId":0, "code":"S15020002", "transactionDate":"2015-02-25T12:00:00", "note":"", "printedInfo":"", "referringIdentifier":"", "actionId":0, "partnerDocumentId":0, "activityId":0, "documentStatusTypeCode":"STATUS_CONFIRMED", "vatTotalsByTaxRate":null, "discountSum":null, "rows":[{"id":0, "articleId":118240, "articleName":"Kohv", "unitCode":null, "code":"", "quantity":1.000000, "price":1.000000, "discount":23.300000, "extraCharge":0.000000, "vatPercent":20.000000, "vatAccountId":583312, "expenseAccountId":583344, "revenueAccountId":583335, "debtAccountId":583291, "transactionEntryId":7710727, "transactionDate":"2015-02-25T12:00:00", "invoiceId":2575151, "customerId":0, "customerName":null, "invoiceNumber":null, "registrationCode":null, "referringIdentifier":null, "typeCode":"ARTICLE_ROW_SELL", "projectId":0, "taxRateId":31949, "activityItemId":0, "residualValue":0.000000}], "payments":null, "customer":null}

POST

Id must be 0 in all cases! All id’s are automatically generated.https://api.erplybooks.com/api/invoices
JSON: {"id":0, "number":null, "customerId":0, "customerName":"NEW CUSTOMER NAME LTD", "date":"2015-02-25T11:42:08", "currencyCode":"CURRENCY_EUR", "discountPercent":0.000000, "languageCode":"LANGUAGE_ET", "vatPercent":0.0000, "referenceNumber":"", "deadlineDate":"2015-03-04T11:42:08", "creatorName":null, "modifierName":null, "sumNoVat":0.77, "taxSum":null, "sumWithVat":0.92400000, "sumPaid":1.200000000000, "sumLeftToPay":null, "invoiceTextsInfoId":31516, "penaltyPercent":0.5000, "roundedSum":0, "vatTotalRoundedSum":0, "currencyRate":null, "typeCode":"DOCUMENT_SELL", "hash":"444d22ca30249a93b2db424ba976299a", "projectId":0, "code":"S15020002", "transactionDate":"2015-02-25T12:00:00", "note":"", "printedInfo":"", "referringIdentifier":"", "actionId":0, "partnerDocumentId":0, "activityId":0, "documentStatusTypeCode":"STATUS_CONFIRMED", "vatTotalsByTaxRate":null, "discountSum":null, "rows":[{"id":0, "articleId":118240, "articleName":"Kohv", "unitCode":null, "code":"", "quantity":1.000000, "price":1.000000, "discount":23.300000, "extraCharge":0.000000, "vatPercent":20.000000, "vatAccountId":0, "expenseAccountId":0, "revenueAccountId":583335, "debtAccountId":0, "transactionEntryId":0, "transactionDate":"2015-02-25T12:00:00", "invoiceId":2575151, "customerId":0, "customerName":null, "invoiceNumber":null, "registrationCode":null, "referringIdentifier":null, "typeCode":"ARTICLE_ROW_SELL", "projectId":0, "taxRateId":31949, "activityItemId":0, "residualValue":0.000000}], "payments":null, "customer":null}

InvoiceArticleInfo

Parameters for GET Queries

PARAMETER NAMETYPEDESCRIPTIONREQUIRED
documentIdlong
expenseAccountIdlong
dateFromDateFormat: 2012-12-29T00:00:00
dateToDateFormat: 2012-12-29T00:00:00
projectIdlong
userIdlong
customerIdlong
descriptionString
documentTypeStringDOCUMENT_TYPE
articleIdlong
rowTypeString
articleTypeString
getReimbursementboolean
getFixedAssetsboolean
sortString
startint
limitint

Response

FIELD NAMETYPEDESCRIPTIONREQUIRED
InvoiceArticleInfoidlong
InvoiceArticleInfoarticleIdlongArticle ID (internal)
InvoiceArticleInfoarticleNameStringArticle Name
InvoiceArticleInfounitCodeStringUNIT
InvoiceArticleInfocodeString
InvoiceArticleInfoquantityBigDecimalQuantity
InvoiceArticleInfopriceBigDecimalPrice of Article
InvoiceArticleInfodiscountBigDecimalDiscount Percent
InvoiceArticleInfoextraChargeBigDecimalExtra Charge Percent
InvoiceArticleInfovatPercentBigDecimalVAT Percent (20, not 0.2)
InvoiceArticleInfovatAccountIdlongVAT Account ID (internal)
InvoiceArticleInfoexpenseAccountIdlongExpense Account ID (internal)
InvoiceArticleInforevenueAccountIdlongRevenue Account ID (internal)
InvoiceArticleInfodebtAccountIdlongDebt Account ID (internal)
InvoiceArticleInfotransactionEntryIdlongTransaction ID (internal)
InvoiceArticleInfotransactionDateDateFormat: 2012-12-29T00:00:00
InvoiceArticleInfoinvoiceIdlongInvoice ID (internal)
InvoiceArticleInfocustomerIdlongCustomer ID (internal)
InvoiceArticleInfocustomerNameStringCustomer Name
InvoiceArticleInfoinvoiceNumberStringInvoice Nr
InvoiceArticleInforegistrationCodeStringRegistration Code
InvoiceArticleInforeferringIdentifierString
InvoiceArticleInfotypeCodeStringARTICLE_ROW_TYPE
InvoiceArticleInfoprojectIdlongProject ID (internal)
InvoiceArticleInfotaxRateIdlongTax Rate ID (internal)