/api/invoices/
Parameters for GET Queries
PARAMETER NAME | TYPE | DESCRIPTION | REQUIRED |
---|---|---|---|
dateFrom | String | Format: 2012-12-29T00:00:00 | |
dateTo | String | Format: 2012-12-29T00:00:00 | |
transactionDateFrom | String | Format: 2012-12-29T00:00:00 | |
transactionDateTo | String | Format: 2012-12-29T00:00:00 | |
customerId | long | ||
keyword | String | ||
userId | long | ||
description | String | ||
documentType | String | DOCUMENT_TYPE | |
projectId | long | ||
number | String | ||
sort | String | ||
getUnpaid | boolean | ||
isOverdueInvolved | boolean | ||
preventWaybills | boolean | ||
searchUnpaidWithCertainDate | boolean | ||
dontCalculateToLocalCurrency | boolean | ||
showOnlyPrepayments | boolean | ||
documentStatusType | String | DOCUMENT_STATUS_TYPE | |
start | int | ||
limit | int | by default 100 |
Response
FIELD NAME | TYPE | DESCRIPTION | REQUIRED | |
---|---|---|---|---|
InvoiceInfo | id | long | ||
InvoiceInfo | number | String | Invoice Number | |
InvoiceInfo | customerId | long | Customer id | |
InvoiceInfo | customerName | String | Customer Name | |
InvoiceInfo | date | Date | Invoice Date | |
InvoiceInfo | currencyCode | String | CURRENCY | |
InvoiceInfo | discountPercent | BigDecimal | Discount Percent | |
InvoiceInfo | languageCode | String | Language Code | |
InvoiceInfo | vatPercent | BigDecimal | VAT Percent (20, not 0.2) | |
InvoiceInfo | referenceNumber | String | Reference Number | |
InvoiceInfo | deadlineDate | Date | Deadline Date | |
InvoiceInfo | creatorName | String | Creator Name | |
InvoiceInfo | modifierName | String | Modifier Name | |
InvoiceInfo | sumNoVat | BigDecimal | Sum without VAT | |
InvoiceInfo | taxSum | BigDecimal | VAT Sum | |
InvoiceInfo | sumWithVat | BigDecimal | Sum with VAT | |
InvoiceInfo | sumPaid | BigDecimal | Sum Paid | |
InvoiceInfo | sumLeftToPay | BigDecimal | Sum left to pay | |
InvoiceInfo | invoiceTextsInfoId | long | Template id | |
InvoiceInfo | penaltyPercent | BigDecimal | Penalty Percent | |
InvoiceInfo | roundedSum | BigDecimal | Rounded Sum | |
InvoiceInfo | vatTotalRoundedSum | BigDecimal | VAT rounded sum | |
InvoiceInfo | currencyRate | BigDecimal | Currency Rate | |
InvoiceInfo | typeCode | String | DOCUMENT_TYPE | |
InvoiceInfo | hash | String | Hash that can be used to query for invoice from third parties | |
InvoiceInfo | projectId | long | Project ID (Margn internal ID) | |
InvoiceInfo | code | String | Code. For sales invoice S14…, for purchase P14… | |
InvoiceInfo | transactionDate | Date | Date of Transactio | |
InvoiceInfo | note | String | Additional note for the invoice | |
InvoiceInfo | printedInfo | String | Printed Info | |
InvoiceInfo | referringIdentifier | String | External link or other identifier | |
InvoiceInfo | actionId | |||
InvoiceInfo | partnerDocumentId | long | Document ID from ERPLY | |
InvoiceInfo | activityId | long | ||
InvoiceInfo | documentStatusTypeCode | String | DOCUMENT_STATUS_TYPE | |
InvoiceInfo | vatTotalsByTaxRate | |||
InvoiceInfo | discountSum | |||
InvoiceInfo | rows | List <InvoiceArticleInfo> | Array of invoice rows (InvoiceArticleInfo) | |
InvoiceInfo | payments | List <PaymentInfo> | ||
InvoiceInfo | customer | CustomerInfo |
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 NAME | TYPE | DESCRIPTION | REQUIRED |
---|---|---|---|
documentId | long | ||
expenseAccountId | long | ||
dateFrom | Date | Format: 2012-12-29T00:00:00 | |
dateTo | Date | Format: 2012-12-29T00:00:00 | |
projectId | long | ||
userId | long | ||
customerId | long | ||
description | String | ||
documentType | String | DOCUMENT_TYPE | |
articleId | long | ||
rowType | String | ||
articleType | String | ||
getReimbursement | boolean | ||
getFixedAssets | boolean | ||
sort | String | ||
start | int | ||
limit | int |
Response
FIELD NAME | TYPE | DESCRIPTION | REQUIRED | |
---|---|---|---|---|
InvoiceArticleInfo | id | long | ||
InvoiceArticleInfo | articleId | long | Article ID (internal) | |
InvoiceArticleInfo | articleName | String | Article Name | |
InvoiceArticleInfo | unitCode | String | UNIT | |
InvoiceArticleInfo | code | String | ||
InvoiceArticleInfo | quantity | BigDecimal | Quantity | |
InvoiceArticleInfo | price | BigDecimal | Price of Article | |
InvoiceArticleInfo | discount | BigDecimal | Discount Percent | |
InvoiceArticleInfo | extraCharge | BigDecimal | Extra Charge Percent | |
InvoiceArticleInfo | vatPercent | BigDecimal | VAT Percent (20, not 0.2) | |
InvoiceArticleInfo | vatAccountId | long | VAT Account ID (internal) | |
InvoiceArticleInfo | expenseAccountId | long | Expense Account ID (internal) | |
InvoiceArticleInfo | revenueAccountId | long | Revenue Account ID (internal) | |
InvoiceArticleInfo | debtAccountId | long | Debt Account ID (internal) | |
InvoiceArticleInfo | transactionEntryId | long | Transaction ID (internal) | |
InvoiceArticleInfo | transactionDate | Date | Format: 2012-12-29T00:00:00 | |
InvoiceArticleInfo | invoiceId | long | Invoice ID (internal) | |
InvoiceArticleInfo | customerId | long | Customer ID (internal) | |
InvoiceArticleInfo | customerName | String | Customer Name | |
InvoiceArticleInfo | invoiceNumber | String | Invoice Nr | |
InvoiceArticleInfo | registrationCode | String | Registration Code | |
InvoiceArticleInfo | referringIdentifier | String | ||
InvoiceArticleInfo | typeCode | String | ARTICLE_ROW_TYPE | |
InvoiceArticleInfo | projectId | long | Project ID (internal) | |
InvoiceArticleInfo | taxRateId | long | Tax Rate ID (internal) |