I'm using magento v2.3.4 and created a Magento 2 rest webapi function like this:

 * POST for create brands api
 * @param mixed $data
 * @return array
public function create($data);

I usually use the API using this URL:


with data like this:

    "data": [
            "name": "Adidas",
            "type": "apparel"
            "name": "Nike",
            "type": "apparel"

The problem arise when I tried to use the async function in the REST Webapi url:


Then I got the following error:

"error_message": "Data in topic "async.vendor.module.api.brandsinterface.create.post" must be of type "mixed". "array" given."

  • Can you change the return type as mixed instead of array and re compile , it might help you Oct 16 '20 at 4:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.