Get Invoice
The GET endpoint retrieves details of a specific invoice by its ID.
Endpoint
- URL:
/invoices/{id} - Method:
GET
Authentication
- Header:
accessToken - Type: Bearer Token
- Value:
<ACCESS-TOKEN>
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | The unique identifier of the invoice. |
Request Headers
| Header | Type | Description |
|---|---|---|
accessToken | string | Access token for authentication. (required) |
Request Body
- None
Response
- Status Code: 200 OK
Success Response Fields
| Field | Type | Description |
|---|---|---|
success | boolean | Indicates whether the request was successful. |
data | object | The invoice object. |
Invoice Object Fields
| Field | Type | Description |
|---|---|---|
_id | string | Unique identifier of the invoice. |
order | string | Reference to the associated order ID. |
entityId | string | Unique entity identifier for the invoice. |
lineItems | array | Array of line items included in the invoice. |
total | number | Total amount of the invoice. |
mailsSent | array | Array of mail objects tracking sent notifications. |
createdBy | object | Information about who created the invoice. |
metaFields | array | Array of custom metadata fields. |
createdAt | string | Timestamp when the invoice was created. |
updatedAt | string | Timestamp when the invoice was last updated. |
Line Item Object
| Field | Type | Description |
|---|---|---|
lineItemId | string | Reference to the order line item ID. |
quantity | number | Quantity of the item in the invoice. |
Mails Sent Object
| Field | Type | Description |
|---|---|---|
sentTo | string | Email address where the invoice was sent. |
sentAt | string | Timestamp when the email was sent. |
Created By Object
| Field | Type | Description |
|---|---|---|
id | string | ID of the creator. |
name | string | Name of the creator. |
type | string | Type 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"
},
{
"lineItemId": "6932f96b8cd64c28a4fb5878",
"quantity": 10,
"id": "693738682fa9114d9af87d2c"
},
{
"lineItemId": "6932f96b8cd64c28a4fb5879",
"quantity": 5,
"id": "693738682fa9114d9af87d2d"
},
{
"lineItemId": "6932f96b8cd64c28a4fb587a",
"quantity": 2,
"id": "693738682fa9114d9af87d2e"
}
],
"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"
}
}
Example Request
curl --location --request GET '<BASE-URL>/invoices/693738682fa9114d9af87d29' \
--header 'accessToken: <ACCESS-TOKEN>'
Error Responses
404 Not Found
{
"success": false,
"message": "Invoice not found"
}
401 Unauthorized
{
"success": false,
"message": "Invalid or missing access token"
}
500 Internal Server Error
{
"success": false,
"message": "An error occurred while fetching the invoice"
}