Yes, the REST API supports payloads in XML format, but it turns out they need to be specially wrapped in magento_api
tags. The content-type
will also need to be set to application/xml
. Here's an example on how to create a customer:
<magento_api>
<customer>
<addresses>
<element>
<city>New York</city>
<countryId>US</countryId>
<defaultBilling>true</defaultBilling>
<defaultShipping>true</defaultShipping>
<firstname>Big</firstname>
<lastname>Foot</lastname>
<postcode>10755</postcode>
<region>
<region>New York</region>
<regionCode>NY</regionCode>
</region>
<street>
<element>125 Oak Ave</element>
</street>
<telephone>512-444-1111</telephone>
</element>
</addresses>
<email>[email protected]</email>
<firstname>Big</firstname>
<lastname>Foot</lastname>
</customer>
</magento_api>
Note that array data members will need their own tags, like the element
tags in the example above.
Apologies for this miss in documentation, and we will work on adding this info to the topic!