Skip to main content

Get All Invoices

The GET endpoint retrieves a list of all invoices with optional filtering and pagination.

Endpoint

  • URL: /invoices
  • Method: GET

Authentication

  • Header: accessToken
  • Type: Bearer Token
  • Value: <ACCESS-TOKEN>

Request Headers

HeaderTypeDescription
accessTokenstringAccess token for authentication. (required)

Query Parameters

ParameterTypeDescription
pagenumberPage number for pagination (default: 1).
limitnumberNumber of invoices per page (default: 10).
orderIdstringFilter invoices by order ID.
entityIdstringFilter invoice by entity ID.

Request Body

  • None

Response

  • Status Code: 200 OK

Success Response Fields

FieldTypeDescription
successbooleanIndicates whether the request was successful.
dataarrayArray of invoice objects.
totalnumberTotal number of invoices.
pagenumberCurrent page number.
limitnumberNumber of invoices per page.

Invoice Object Fields

FieldTypeDescription
_idstringUnique identifier of the invoice.
orderstringReference to the associated order ID.
entityIdstringUnique entity identifier for the invoice.
lineItemsarrayArray of line items included in the invoice.
totalnumberTotal amount of the invoice.
mailsSentarrayArray of mail objects tracking sent notifications.
createdByobjectInformation about who created the invoice.
metaFieldsarrayArray of custom metadata fields.
createdAtstringTimestamp when the invoice was created.
updatedAtstringTimestamp when the invoice was last updated.

Line Item Object

FieldTypeDescription
lineItemIdstringReference to the order line item ID.
quantitynumberQuantity of the item in the invoice.

Mails Sent Object

FieldTypeDescription
sentTostringEmail address where the invoice was sent.
sentAtstringTimestamp when the email was sent.

Created By Object

FieldTypeDescription
idstringID of the creator.
namestringName of the creator.
typestringType of creator ("api" or "admin").

Sample Response Body

{
"success": true,
"data": [
{
"order": "6932f96b8cd64c28a4fb5873",
"entityId": "1",
"lineItems": [
{
"lineItemId": "6932f96b8cd64c28a4fb5876",
"quantity": 30,
"id": "693738682fa9114d9af87d2a"
},
{
"lineItemId": "6932f96b8cd64c28a4fb5877",
"quantity": 20,
"id": "693738682fa9114d9af87d2b"
}
],
"total": 3684.78,
"createdBy": {
"id": "6852dc137d290c8e310f258e",
"name": "Sam Nabahani",
"type": "admin"
},
"metaFields": [],
"createdAt": "2025-12-08T20:43:20.608Z",
"updatedAt": "2025-12-08T20:43:20.608Z",
"id": "693738682fa9114d9af87d29"
}
],
"total": 1,
"page": 1,
"limit": 10
}

Example Request

curl --location --request GET '<BASE-URL>/invoices?page=1&limit=10' \
--header 'accessToken: <ACCESS-TOKEN>'

Error Responses

401 Unauthorized

{
"success": false,
"message": "Invalid or missing access token"
}

500 Internal Server Error

{
"success": false,
"message": "An error occurred while fetching invoices"
}