Customer shipping address not persisting on create Order or create Customer

I am creating a new order, and a new customer at the same time (endpoint), with this request body (ids replaced with 111…):

{
“order”: {
“channel_id”: 111111,
“number”: “”,
“send_notification_email”: true,
“line_items_attributes”: [
{
“price_per_unit”: “10.0”,
“taxless_discount_per_unit”: 0,
“quantity”: “4.0”,
“tax_rate”: “0.0”,
“sellable_id”: 11111111
}
],
“delivery_method_id”: 111111,
“delivery_cost”: “0.0”,
“customer_attributes”: {
“phone”: “”,
“email”: “mrukman@test.test”,
“billing_address_attributes”: {
“id”: “”,
“first_name”: “Mr. UK”,
“last_name”: “Man”,
“company”: “UK Test Company”,
“address1”: “49 Featherstone Street”,
“address2”: “”,
“city”: “London”,
“state”: “”,
“zip”: “EC1Y 8SY”,
“country”: “GB”,
“email”: “mrukman@test.test”
},
“deliver_to_attributes”: {
“id”: “”,
“first_name”: “Mr. UK”,
“last_name”: “Man”,
“company”: “UK Test Company”,
“address1”: “49 Featherstone Street”,
“address2”: “”,
“city”: “London”,
“state”: “”,
“zip”: “EC1Y 8SY”,
“country”: “GB”,
“email”: “mrukman@test.test”,
“phone”: “”
}
},
“customer_note_attributes”: {
“text”: “”
}
}
}

However, in the response, the billing address updates fine, but "deliver_to":null is returned. I have to manually go into Veeqo and update the shipping address for the customer.

How can I get the customer delivery address to populate accordingly when creating an order?

I have tried to create a customer as well in production (endpoint) but the response for shipping_addresses: [] is empty…

The request body looks like:
{
“customer”: {
“email”: “mrukman@test.com”,
“phone”: “01792 720740”,
“mobile”: “07329023903”,
“notes”: “”,
“billing_address_attributes”: {
“first_name”: “Test”,
“last_name”: “Man”,
“company”: “UK Test Company”,
“address1”: “Annex”,
“address2”: “49 Featherstone St”,
“city”: “London”,
“country”: “GB”,
“zip”: “EC1Y 8SY”
}
}
}

And note that your response body has additional parameters that are not included in the response sample. I am guessing there is also something missing from the request body that has not been reflected in the API documentation, hence the failing shipping_addresses attribute.

Note that if I send this request to the mock server I get the response listed in the API documentation and the shipping_addresses array contains addresses as expected. So I am guessing production has received changes not reflected in the mock server, and the API documentation needs to be updated.

Could someone please look into this.

Solved…
Instead of creating a customer when creating the order, I instead queried the customer to see if it exists. If not, then create them, and then provide the customer_id in the create order request along with deliver_to_attributes. This then gives me a response for the order with a ship_to address.
This is not abundantly clear in the API docs, so hopefully this will help someone out in future.