EntityInvoice

Get Metrics

GET
Get invoice metrics for an entity with the given filters. Invoices will be grouped by currency. If none of excludePayables, excludeReceivables, payerId, vendorId, or invoiceId status filters are provided, excludeReceivables will be set to true.

Path parameters

entityIdstringRequired

Query parameters

searchstringOptional
Find invoices by vendor name, invoice number, or amount. Partial matches are supported.
excludePayablesbooleanOptional
Only return invoices that are not payable by the entity. This will return only invoices that are receivable by the entity.
excludeReceivablesbooleanOptional
Only return invoices that are not receivable by the entity. This will return only invoices that are payable by the entity.
returnByDateenumOptional
Return invoice metrics grouped by date.
Allowed values: CREATION_DATEDUE_DATEINVOICE_DATEDEDUCTION_DATE
payerIdstringOptional
Filter invoices by payer ID.
vendorIdstringOptional
Filter invoices by vendor ID.
approverIdstringOptional
Filter invoices by assigned approver user ID.
invoiceIdstringOptional
Filter invoices by invoice ID.
statusenumOptional
Invoice status to filter on
dueDateStartdatetimeOptional
Start date for invoice dueDate filter.
dueDateEnddatetimeOptional
End date for invoice dueDate filter.
createdDateStartdatetimeOptional
Start date for invoice created on date filter.
createdDateEnddatetimeOptional
End date for invoice created date filter.
currencyenumOptional
Currency to filter on

Response

This endpoint returns a list of objects
totalAmount
double
totalCount
integer
averageAmount
double
currency
enum
dates
map from strings to objectsOptional
GET
1curl -G https://api.mercoa.com/entity/:entityId/invoice-metrics \
2 -H "Authorization: Bearer <token>" \
3 -d search=string \
4 -d excludePayables=true
200
Retrieved
1[
2 {
3 "totalAmount": 1,
4 "totalCount": 0,
5 "averageAmount": 1,
6 "currency": "AED",
7 "dates": {
8 "string": {
9 "date": "2023-01-01T00:00:00Z",
10 "totalAmount": 1,
11 "totalCount": 0,
12 "averageAmount": 1,
13 "currency": "AED"
14 }
15 }
16 }
17]