0

I'm trying to create an invoice using the Magento REST API (/rest/default/V1/order/{orderId}/invoice) and I'm getting the following error:

"message": "\"%fieldName\" is not supported. Correct the field name and try again.",
"parameters": {
 "fieldName": "AdditionalData"
}

Here's the payload I'm sending:

{
 "appendComment": true,
 "items": [
 {
 "order_item_id": 144,
 "qty": 1.000000,
 "additional_data": "{\"description\":\"HELLOOOOO\",\"um\":\"HELLOOOOO\"}"
 }
 ]
}

I also tried passing the additional_data as an extension attribute, but I received the same error. Can someone help me figure out what I'm missing? Thanks in advance!

Ronak Rathod
6,58020 silver badges46 bronze badges
asked Feb 9 at 23:32
1

1 Answer 1

0

The Item do not have the additional_data

You can try it by code in your Custom module

  • Create file etc/extension_attributes.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd">
 <extension_attributes for="Magento\Sales\Api\Data\InvoiceItemCreationExtensionInterface">
 <attribute code="additional_data" type="string" />
 </extension_attributes>
</config>
  • Run bin\magento s:d:C

Then check

enter image description here

answered Feb 11 at 7:51

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.