Logo
Sign inBook a demo
HomeGuidesAPI ReferenceGlossary
HomeGuidesAPI ReferenceGlossary
  • API Reference
Sign inBook a demo
API ReferenceEntityInvoice

Get Metrics

GET
https://api.mercoa.com/entity/:entityId/invoice-metrics
GET
/entity/:entityId/invoice-metrics
1curl -G https://api.mercoa.com/entity/ent_8545a84e-a45f-41bf-bdf1-33b42a55812c/invoice-metrics \
2 -H "Authorization: Bearer <token>" \
3 -d returnByDate=CREATION_DATE \
4 -d excludeReceivables=true \
5 --data-urlencode startDate=2021-01-01T00:00:00.000Z \
6 --data-urlencode endDate=2021-01-31T23:59:59.999Z \
7 -d currency=USD \
8 -d status=NEW
Try it
200Default
1[
2 {
3 "totalAmount": 1000,
4 "totalCount": 10,
5 "averageAmount": 100,
6 "currency": "USD",
7 "dates": {
8 "2021-01-01T00:00:00Z": {
9 "date": "2021-01-01T00:00:00Z",
10 "totalAmount": 100,
11 "totalCount": 1,
12 "averageAmount": 100,
13 "currency": "USD"
14 },
15 "2021-01-02T00:00:00Z": {
16 "date": "2021-01-02T00:00:00Z",
17 "totalAmount": 200,
18 "totalCount": 2,
19 "averageAmount": 100,
20 "currency": "USD"
21 },
22 "2021-01-03T00:00:00Z": {
23 "date": "2021-01-03T00:00:00Z",
24 "totalAmount": 400,
25 "totalCount": 2,
26 "averageAmount": 200,
27 "currency": "USD"
28 }
29 }
30 }
31]
Get invoice metrics for an entity with the given filters. Invoices will always 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
Entity ID or Entity ForeignID

Headers

AuthorizationstringRequired
Bearer authentication of the form `Bearer <token>`, where token is your auth token.

Query parameters

searchstringOptional
Find invoices by vendor name, invoice number, check 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:
returnByDateFrequencyenumOptional
Return invoice metrics grouped by date. Defaults to daily.
Allowed values:
groupByenumOptional
Return invoice metrics grouped by.
Allowed values:
payerIdstringOptional
Filter invoices by payer ID.
vendorIdstringOptional
Filter invoices by vendor ID.
approverIdstringOptional
Filter invoices by assigned approver user ID.
approverCountstringOptional
Filter invoices by the number of approvers. Use exact number (e.g., 3) or range (e.g., ">3", "<5", ">=2", "<=4").
invoiceIdstringOptional
Filter invoices by invoice ID or invoice foreign ID.
statusenumOptional
Invoice status to filter on
startDatedatetimeOptional
Start date filter. Defaults to CREATED_AT unless specified the dateType is specified
endDatedatetimeOptional
End date filter. Defaults to CREATED_AT unless specified the dateType is specified
dateTypeenumOptional
Type of date to filter by if startDate and endDate filters are provided. Defaults to CREATED_AT.
currencyenumOptional
Currency to filter on

Response

This endpoint returns a list of objects.
totalAmountdouble
totalCountinteger
averageAmountdouble
currencyenum
grouplist of maps from strings to strings or null
If groupBy is provided, this will be the group by value.
datesmap from strings to objects or null

Errors

Was this page helpful?
Previous

Download Bulk Invoices (Sync)

Next
Built with
Entity ID or Entity ForeignID
Find invoices by vendor name, invoice number, check number, or amount. Partial matches are supported.
Only return invoices that are not payable by the entity. This will return only invoices that are receivable by the entity.
Only return invoices that are not receivable by the entity. This will return only invoices that are payable by the entity.
Return invoice metrics grouped by date.
Return invoice metrics grouped by date. Defaults to daily.
Return invoice metrics grouped by.
Filter invoices by payer ID.
Filter invoices by vendor ID.
Filter invoices by assigned approver user ID.
Filter invoices by invoice ID or invoice foreign ID.
Invoice status to filter on
Currency to filter on

End date filter. Defaults to CREATED_AT unless specified the dateType is specified

Bearer authentication of the form Bearer <token>, where token is your auth token.

Start date filter. Defaults to CREATED_AT unless specified the dateType is specified

Type of date to filter by if startDate and endDate filters are provided. Defaults to CREATED_AT.

Download Bulk Invoices (Sync)