EntityInvoice

Get All

GET
Get invoices for an entity with the given filters.

Path parameters

entityIdstringRequired

Query parameters

excludePayablesbooleanOptional
Return only invoices that are receivable by the entity.
excludeReceivablesbooleanOptional
Return only invoices that are payable by the entity.
startDatedatetimeOptional
Start date for invoice created on date filter.
endDatedatetimeOptional
End date for invoice created date filter.
orderByenumOptional

Field to order invoices by. Defaults to CREATED_AT.

orderDirectionenumOptional
Direction to order invoices by. Defaults to asc.
Allowed values: ASCDESC
limitintegerOptional
Number of invoices to return. Limit can range between 1 and 100, and the default is 10.
startingAfterstringOptional
The ID of the invoice to start after. If not provided, the first page of invoices will be returned.
metadataobjectOptional
Filter invoices by metadata. Each filter will be applied as an AND condition. Duplicate keys will be ignored.
searchstringOptional
Find invoices by vendor name, invoice number, or amount. Partial matches are supported.
payerIdstringOptional
Filter invoices by payer ID.
vendorIdstringOptional
Filter invoices by vendor ID.
approverIdstringOptional
Filter invoices by assigned approver user ID.
approverActionenumOptional
Filter invoices by approver action. Needs to be used with approverId. For example, if you want to find all invoices that have been approved by a specific user, you would use approverId and approverAction=APPROVE.
Allowed values: NONEAPPROVEREJECT
invoiceIdstringOptional
Filter invoices by invoice ID.
statusenumOptional
Invoice status to filter on.
includeFeesbooleanOptional
Deprecated
DEPRECATED. Fees are now included by default in the response.

Response

This endpoint returns 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
1curl -G https://api.mercoa.com/entity/:entityId/invoices \
2 -H "Authorization: Bearer <token>" \
3 -d excludePayables=true \
4 -d excludeReceivables=true
200
Retrieved
1{
2 "count": 0,
3 "hasMore": true,
4 "data": [
5 {
6 "id": "string",
7 "status": "DRAFT",
8 "paymentDestinationConfirmed": true,
9 "hasDocuments": true,
10 "hasSourceEmail": true,
11 "approvers": [
12 {
13 "approvalPolicyId": "string",
14 "approvalSlotId": "string",
15 "action": "NONE",
16 "eligibleRoles": [
17 "string"
18 ],
19 "eligibleUserIds": [
20 "string"
21 ],
22 "date": "2023-01-01T00:00:00Z",
23 "assignedUserId": "string"
24 }
25 ],
26 "approvalPolicy": [
27 {
28 "id": "string",
29 "trigger": [
30 {
31 "type": "amount",
32 "amount": 1,
33 "currency": "AED"
34 }
35 ],
36 "rule": {
37 "type": "approver",
38 "identifierList": {
39 "type": "rolesList",
40 "value": [
41 "string"
42 ]
43 },
44 "numApprovers": 0
45 },
46 "upstreamPolicyId": "string"
47 }
48 ],
49 "metadata": {
50 "string": "string"
51 },
52 "createdAt": "2023-01-01T00:00:00Z",
53 "updatedAt": "2023-01-01T00:00:00Z",
54 "amount": 1,
55 "currency": "AED",
56 "invoiceDate": "2023-01-01T00:00:00Z",
57 "deductionDate": "2023-01-01T00:00:00Z",
58 "settlementDate": "2023-01-01T00:00:00Z",
59 "dueDate": "2023-01-01T00:00:00Z",
60 "invoiceNumber": "string",
61 "noteToSelf": "string",
62 "serviceStartDate": "2023-01-01T00:00:00Z",
63 "serviceEndDate": "2023-01-01T00:00:00Z",
64 "payerId": "string",
65 "payer": {
66 "id": "string",
67 "name": "string",
68 "email": "string",
69 "isCustomer": true,
70 "accountType": "business",
71 "profile": {
72 "business": {
73 "legalBusinessName": "string",
74 "taxIDProvided": true,
75 "email": "string",
76 "businessType": "soleProprietorship",
77 "phone": {
78 "countryCode": "string",
79 "number": "string"
80 },
81 "doingBusinessAs": "string",
82 "website": "string",
83 "description": "string",
84 "address": {
85 "addressLine1": "string",
86 "city": "string",
87 "stateOrProvince": "string",
88 "postalCode": "string",
89 "addressLine2": "string",
90 "country": "string"
91 },
92 "ownersProvided": true
93 },
94 "individual": {
95 "name": {
96 "firstName": "string",
97 "lastName": "string",
98 "middleName": "string",
99 "suffix": "string"
100 },
101 "birthDateProvided": true,
102 "governmentIDProvided": true,
103 "email": "string",
104 "phone": {
105 "countryCode": "string",
106 "number": "string"
107 },
108 "address": {
109 "addressLine1": "string",
110 "city": "string",
111 "stateOrProvince": "string",
112 "postalCode": "string",
113 "addressLine2": "string",
114 "country": "string"
115 }
116 }
117 },
118 "status": "unverified",
119 "acceptedTos": true,
120 "isPayor": true,
121 "isPayee": true,
122 "createdAt": "2023-01-01T00:00:00Z",
123 "updatedAt": "2023-01-01T00:00:00Z",
124 "foreignId": "string",
125 "emailTo": "string",
126 "emailToAlias": [
127 "string"
128 ]
129 },
130 "paymentSource": {
131 "type": "bankAccount",
132 "accountName": "string",
133 "accountNumber": "string",
134 "accountType": "CHECKING",
135 "bankName": "string",
136 "createdAt": "2023-01-01T00:00:00Z",
137 "id": "string",
138 "isDefaultDestination": true,
139 "isDefaultSource": true,
140 "routingNumber": "string",
141 "status": "NEW",
142 "supportedCurrencies": [
143 "AED"
144 ],
145 "updatedAt": "2023-01-01T00:00:00Z",
146 "checkOptions": {
147 "signatoryName": "string",
148 "enabled": true,
149 "initialCheckNumber": 0,
150 "routingNumberOverride": "string",
151 "accountNumberOverride": "string",
152 "signatureImage": "string",
153 "useSignatureImage": true
154 }
155 },
156 "paymentSourceId": "string",
157 "vendorId": "string",
158 "vendor": {
159 "id": "string",
160 "name": "string",
161 "email": "string",
162 "isCustomer": true,
163 "accountType": "business",
164 "profile": {
165 "business": {
166 "legalBusinessName": "string",
167 "taxIDProvided": true,
168 "email": "string",
169 "businessType": "soleProprietorship",
170 "phone": {
171 "countryCode": "string",
172 "number": "string"
173 },
174 "doingBusinessAs": "string",
175 "website": "string",
176 "description": "string",
177 "address": {
178 "addressLine1": "string",
179 "city": "string",
180 "stateOrProvince": "string",
181 "postalCode": "string",
182 "addressLine2": "string",
183 "country": "string"
184 },
185 "ownersProvided": true
186 },
187 "individual": {
188 "name": {
189 "firstName": "string",
190 "lastName": "string",
191 "middleName": "string",
192 "suffix": "string"
193 },
194 "birthDateProvided": true,
195 "governmentIDProvided": true,
196 "email": "string",
197 "phone": {
198 "countryCode": "string",
199 "number": "string"
200 },
201 "address": {
202 "addressLine1": "string",
203 "city": "string",
204 "stateOrProvince": "string",
205 "postalCode": "string",
206 "addressLine2": "string",
207 "country": "string"
208 }
209 }
210 },
211 "status": "unverified",
212 "acceptedTos": true,
213 "isPayor": true,
214 "isPayee": true,
215 "createdAt": "2023-01-01T00:00:00Z",
216 "updatedAt": "2023-01-01T00:00:00Z",
217 "foreignId": "string",
218 "emailTo": "string",
219 "emailToAlias": [
220 "string"
221 ]
222 },
223 "paymentDestination": {
224 "type": "bankAccount",
225 "accountName": "string",
226 "accountNumber": "string",
227 "accountType": "CHECKING",
228 "bankName": "string",
229 "createdAt": "2023-01-01T00:00:00Z",
230 "id": "string",
231 "isDefaultDestination": true,
232 "isDefaultSource": true,
233 "routingNumber": "string",
234 "status": "NEW",
235 "supportedCurrencies": [
236 "AED"
237 ],
238 "updatedAt": "2023-01-01T00:00:00Z",
239 "checkOptions": {
240 "signatoryName": "string",
241 "enabled": true,
242 "initialCheckNumber": 0,
243 "routingNumberOverride": "string",
244 "accountNumberOverride": "string",
245 "signatureImage": "string",
246 "useSignatureImage": true
247 }
248 },
249 "paymentDestinationId": "string",
250 "paymentDestinationOptions": {
251 "type": "check",
252 "delivery": "PRINT"
253 },
254 "comments": [
255 {
256 "id": "string",
257 "text": "string",
258 "createdAt": "2023-01-01T00:00:00Z",
259 "updatedAt": "2023-01-01T00:00:00Z",
260 "user": {
261 "id": "string",
262 "roles": [
263 "string"
264 ],
265 "createdAt": "2023-01-01T00:00:00Z",
266 "updatedAt": "2023-01-01T00:00:00Z",
267 "foreignId": "string",
268 "email": "string",
269 "name": "string"
270 },
271 "associatedApprovalAction": {
272 "userId": "string",
273 "action": "NONE"
274 }
275 }
276 ],
277 "lineItems": [
278 {
279 "id": "string",
280 "currency": "AED",
281 "createdAt": "2023-01-01T00:00:00Z",
282 "updatedAt": "2023-01-01T00:00:00Z",
283 "amount": 1,
284 "description": "string",
285 "name": "string",
286 "quantity": 0,
287 "unitPrice": 1,
288 "serviceStartDate": "2023-01-01T00:00:00Z",
289 "serviceEndDate": "2023-01-01T00:00:00Z",
290 "metadata": {
291 "string": "string"
292 },
293 "glAccountId": "string"
294 }
295 ],
296 "foreignId": "string",
297 "creatorUser": {
298 "id": "string",
299 "roles": [
300 "string"
301 ],
302 "createdAt": "2023-01-01T00:00:00Z",
303 "updatedAt": "2023-01-01T00:00:00Z",
304 "foreignId": "string",
305 "email": "string",
306 "name": "string"
307 },
308 "failureType": "SOURCE_PAYMENT_ERROR",
309 "processedAt": "2023-01-01T00:00:00Z",
310 "fees": {
311 "sourcePaymentMethodFee": 1,
312 "sourcePlatformMarkupFee": 1,
313 "destinationPaymentMethodFee": 1,
314 "destinationPlatformMarkupFee": 1
315 }
316 }
317 ]
318}