Hello, Magento mates.

Welcome to MageComp’s Magento tutorials.

Today, this tutorial is about getting a custom attribute value of an invoice for your Magento 2 store using REST API.

A custom attribute value of an invoice refers to additional, user-defined information that can be associated with an invoice. This feature allows you to extend the default set of attributes associated with an invoice by adding custom fields or values that meet specific business requirements.

Steps to Get Custom Attribute Value

Step 1 – 

First, we need to create an extension_attributes.xml file inside the etc folder 👇


Using the code given below 👇

Step 2 –

Now, We need to create a di.xml file inside the etc folder.


Step 3 – 

Then, we need to create the InvoiceRepository.php file inside the Plugin folder.


Step 4 –

Now, we need to run

You can see the values ​​of the custom attributes from the URL below.



Custom attribute values of invoices can be beneficial for Magento 2 store admins to display extra information related to an invoice, providing a flexible added feature for multiple Magento store needs and business scenarios.

These attributes can be managed and configured through the Magento 2 admin panel, allowing merchants to tailor their invoicing system to suit their unique needs.

This was it. If you have any queries related to this tutorial or any other Magento feature, kindly contact us, or hire our Magento developers to solve your queries.

MageComp Official Facebook Group

Happy Coding!!!

Click to rate this post!
[Total: 0 Average: 0]