Hello, Magento mates. We meet again.

Welcome to MageComp’s Magento tutorials.

Today, in this Magento tutorial, we will learn to get the custom attribute value of credit memos in the Magento 2 store using REST API.

Custom attribute values in credit memos refer to additional customer information that is associated with a credit memo in the Magento platform. Custom attributes allow Magento admins to collect and store specific data points relevant to their business processes or customer interactions.

Magento, by default, does not provide any predefined attributes for credit memos, but Magento admins can create custom attribute values and configure them as per their specific business needs.

Also Read – How to Get Custom Attribute Value Of Invoice Using Rest API?

Steps to Get Custom Attribute Value

Step 1 –

To begin with the process, we need to create an extension_attributes.xml file inside the etc folder 👇

app\code\Vendor\Extension\etc\

Using the below code 👇

Step 2 –

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

app\code\Vendor\Extension\etc\

Step 3 –

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

app/code/Vendor/Extension/Plugin/Api/

Step 4 –

After completing all the above steps, you need to run

Then you can see the values ​​of the custom attributes from the URL below. 👇

BASE_URL/rest/all/V1/creditmemo/increment_id

Ending Phrase

A credit memo is a document issued by a seller to refund a customer for returned goods or overpaid amounts. These custom attributes can be configured and managed through the Magento 2 admin panel or programmatically in code. They provide a way to store and retrieve extra details related to credit memos, enabling merchants to tailor the system to their specific needs.

Custom attributes can be used for various purposes, such as tracking additional order information, recording specific refund details, or accommodating unique business requirements.

Hope you found this tutorial helpful. If you have any queries regarding this tutorial or any other Magento service, feel free to contact us or get in touch with us on our official Facebook page.

hire magento developers

Happy Coding!!!

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