EntityInvoice

Get All

GET
https://api.mercoa.com/entity/:entityId/invoices

Get invoices for an entity with the given filters.

Path parameters

entityId
string

Query parameters

excludePayables
optional boolean

Return only invoices that are receivable by the entity.

excludeReceivables
optional boolean

Return only invoices that are payable by the entity.

startDate
optional datetime

Start date for invoice created on date filter.

endDate
optional datetime

End date for invoice created date filter.

orderBy
optional enum

Field to order invoices by. Defaults to CREATED_AT.

orderDirection
optional enum

Direction to order invoices by. Defaults to asc.

Allowed values: ASCDESC
limit
optional integer

Number of invoices to return. Limit can range between 1 and 100, and the default is 10.

startingAfter
optional string

The ID of the invoice to start after. If not provided, the first page of invoices will be returned.

search
optional string

Filter vendors by name. Partial matches are supported.

payerId
optional string

Filter invoices by payer ID.

vendorId
optional string

Filter invoices by vendor ID.

approverId
optional string

Filter invoices by assigned approver user ID.

invoiceId
optional string

Filter invoices by invoice ID.

status
optional enum

Invoice status to filter on.

includeFees
optional boolean

DEPRECATED. Fees are now included by default in the response.

Response

This endpoint return an object.
count
integer

Total number of notifications for the given start and end date filters. This value is not limited by the limit parameter. It is provided so that you can determine how many pages of results are available.

hasMore
boolean

True if there are more notifications available for the given start and end date filters.

data
list of objects
GET
/entity/:entityId/invoices
curl -G https://api.mercoa.com/entity/:entityId/invoices \
-H "Authorization: Bearer <token>" \
-d excludePayables=true \
-d excludeReceivables=true
Response
{
"count": 0,
"hasMore": true,
"data": [
{
"id": "string",
"status": "DRAFT",
"paymentDestinationConfirmed": true,
"hasDocuments": true,
"approvers": [
{
"approvalPolicyId": "string",
"approvalSlotId": "string",
"action": "NONE",
"eligibleRoles": [
"string"
],
"eligibleUserIds": [
"string"
],
"date": "2023-01-01T00:00:00Z",
"assignedUserId": "string"
}
],
"approvalPolicy": [
{
"id": "string",
"trigger": [
{
"type": "amount",
"amount": 1,
"currency": "AED"
}
],
"rule": {
"type": "approver",
"identifierList": {
"type": "rolesList",
"value": [
"string"
]
},
"numApprovers": 0
},
"upstreamPolicyId": "string"
}
],
"metadata": {
"string": "string"
},
"createdAt": "2023-01-01T00:00:00Z",
"updatedAt": "2023-01-01T00:00:00Z",
"amount": 1,
"currency": "AED",
"invoiceDate": "2023-01-01T00:00:00Z",
"deductionDate": "2023-01-01T00:00:00Z",
"settlementDate": "2023-01-01T00:00:00Z",
"dueDate": "2023-01-01T00:00:00Z",
"invoiceNumber": "string",
"noteToSelf": "string",
"serviceStartDate": "2023-01-01T00:00:00Z",
"serviceEndDate": "2023-01-01T00:00:00Z",
"payerId": "string",
"payer": {
"id": "string",
"name": "string",
"email": "string",
"isCustomer": true,
"accountType": "business",
"profile": {
"business": {
"legalBusinessName": "string",
"taxIDProvided": true,
"email": "string",
"businessType": "soleProprietorship",
"phone": {
"countryCode": "string",
"number": "string"
},
"doingBusinessAs": "string",
"website": "string",
"description": "string",
"address": {
"addressLine1": "string",
"city": "string",
"stateOrProvince": "string",
"postalCode": "string",
"addressLine2": "string",
"country": "string"
},
"ownersProvided": true
},
"individual": {
"email": "string",
"name": {
"firstName": "string",
"lastName": "string",
"middleName": "string",
"suffix": "string"
},
"birthDateProvided": true,
"governmentIDProvided": true,
"phone": {
"countryCode": "string",
"number": "string"
},
"address": {
"addressLine1": "string",
"city": "string",
"stateOrProvince": "string",
"postalCode": "string",
"addressLine2": "string",
"country": "string"
}
}
},
"status": "unverified",
"acceptedTos": true,
"isPayor": true,
"isPayee": true,
"createdAt": "2023-01-01T00:00:00Z",
"updatedAt": "2023-01-01T00:00:00Z",
"foreignId": "string",
"emailTo": "string",
"emailToAlias": [
"string"
]
},
"paymentSource": {
"type": "bankAccount",
"accountName": "string",
"accountNumber": "string",
"accountType": "CHECKING",
"bankName": "string",
"createdAt": "2023-01-01T00:00:00Z",
"id": "string",
"isDefaultDestination": true,
"isDefaultSource": true,
"routingNumber": "string",
"status": "NEW",
"supportedCurrencies": [
"AED"
],
"updatedAt": "2023-01-01T00:00:00Z",
"checkOptions": {
"enabled": true,
"initialCheckNumber": 0,
"routingNumberOverride": "string",
"accountNumberOverride": "string",
"signatoryName": "string",
"signatureImage": "string"
}
},
"paymentSourceId": "string",
"vendorId": "string",
"vendor": {
"id": "string",
"name": "string",
"email": "string",
"isCustomer": true,
"accountType": "business",
"profile": {
"business": {
"legalBusinessName": "string",
"taxIDProvided": true,
"email": "string",
"businessType": "soleProprietorship",
"phone": {
"countryCode": "string",
"number": "string"
},
"doingBusinessAs": "string",
"website": "string",
"description": "string",
"address": {
"addressLine1": "string",
"city": "string",
"stateOrProvince": "string",
"postalCode": "string",
"addressLine2": "string",
"country": "string"
},
"ownersProvided": true
},
"individual": {
"email": "string",
"name": {
"firstName": "string",
"lastName": "string",
"middleName": "string",
"suffix": "string"
},
"birthDateProvided": true,
"governmentIDProvided": true,
"phone": {
"countryCode": "string",
"number": "string"
},
"address": {
"addressLine1": "string",
"city": "string",
"stateOrProvince": "string",
"postalCode": "string",
"addressLine2": "string",
"country": "string"
}
}
},
"status": "unverified",
"acceptedTos": true,
"isPayor": true,
"isPayee": true,
"createdAt": "2023-01-01T00:00:00Z",
"updatedAt": "2023-01-01T00:00:00Z",
"foreignId": "string",
"emailTo": "string",
"emailToAlias": [
"string"
]
},
"paymentDestination": {
"type": "bankAccount",
"accountName": "string",
"accountNumber": "string",
"accountType": "CHECKING",
"bankName": "string",
"createdAt": "2023-01-01T00:00:00Z",
"id": "string",
"isDefaultDestination": true,
"isDefaultSource": true,
"routingNumber": "string",
"status": "NEW",
"supportedCurrencies": [
"AED"
],
"updatedAt": "2023-01-01T00:00:00Z",
"checkOptions": {
"enabled": true,
"initialCheckNumber": 0,
"routingNumberOverride": "string",
"accountNumberOverride": "string",
"signatoryName": "string",
"signatureImage": "string"
}
},
"paymentDestinationId": "string",
"paymentDestinationOptions": {
"type": "check",
"delivery": "PRINT"
},
"comments": [
{
"id": "string",
"text": "string",
"createdAt": "2023-01-01T00:00:00Z",
"updatedAt": "2023-01-01T00:00:00Z",
"user": {
"id": "string",
"roles": [
"string"
],
"createdAt": "2023-01-01T00:00:00Z",
"updatedAt": "2023-01-01T00:00:00Z",
"foreignId": "string",
"email": "string",
"name": "string"
},
"associatedApprovalAction": {
"userId": "string",
"action": "NONE"
}
}
],
"lineItems": [
{
"id": "string",
"currency": "AED",
"createdAt": "2023-01-01T00:00:00Z",
"updatedAt": "2023-01-01T00:00:00Z",
"amount": 1,
"description": "string",
"name": "string",
"quantity": 0,
"unitPrice": 1,
"serviceStartDate": "2023-01-01T00:00:00Z",
"serviceEndDate": "2023-01-01T00:00:00Z",
"metadata": {
"string": "string"
},
"glAccountId": "string"
}
],
"foreignId": "string",
"creatorUser": {
"id": "string",
"roles": [
"string"
],
"createdAt": "2023-01-01T00:00:00Z",
"updatedAt": "2023-01-01T00:00:00Z",
"foreignId": "string",
"email": "string",
"name": "string"
},
"failureType": "SOURCE_PAYMENT_ERROR",
"processedAt": "2023-01-01T00:00:00Z",
"fees": {
"sourcePaymentMethodFee": 1,
"sourcePlatformMarkupFee": 1,
"destinationPaymentMethodFee": 1,
"destinationPlatformMarkupFee": 1
}
}
]
}