get https://apiprod.fattlabs.com/invoice/
Retrieves the invoice matching the given id.
Retrieves the details of a specific invoice by its ID. This endpoint allows you to view all relevant information about the invoice, including customer details, items, amounts, and metadata. The retrieved invoice can also be used with the PUT /invoice/{id}
endpoint for further updates.
Key Features
- Fetches detailed information about an invoice by its unique ID.
- Displays invoice attributes, including:
- Customer information (e.g., name, email, address).
- Items and associated costs.
- Payment status and method (if applicable).
- Any metadata or additional fields associated with the invoice.
- Supports keyword-based filtering to find invoices tied to specific criteria.
Usage Notes
Filtering by Keywords
Use the keywords[]
parameter to search for invoices based on specific attributes. Supported keywords include:
Parameter | Description | Example |
---|---|---|
name | Search by the customer's name. | keywords[]=John |
company_name | Search by the company name. | keywords[]=ABC Corp |
email | Search by email address. | keywords[][email protected] |
address | Search by address. | keywords[]=123 Main St |
price | Search by price range or exact price. | keywords[]=100.00 |
schedule_id | Search for invoices tied to a specific schedule. | keywords[]=schedule12345 |
payment_method | Search by the payment method used (card or bank ). If an invoice is unpaid, payment_method will return null . |
Integration with Update
- The retrieved invoice data can be passed to the
PUT /invoice/{id}
endpoint for modifications.
Response Structure
Code | Response | Reason |
---|---|---|
200 | Success | Invoice details were successfully retrieved. |
400 | Bad Request | Invalid or missing parameters in the request. |
401 | Unauthorized | Authentication failed. |
404 | Not Found | An invoice with the specified ID does not exist. |
500 | Internal Server Error | Unexpected server error. |
Important Considerations
- Keyword Search: Utilize the
keywords[]
parameter to streamline your invoice searches by specific criteria. This feature is especially useful for large datasets. - Payment Method Visibility: If the invoice has not been paid, the
payment_method
field will benull
. - Audit Trail: Ensure proper handling of retrieved invoice data for compliance and record-keeping purposes.