Create customer shipping address

Hi

create-a-customer

In the example data there is a billing address specified as below:

{
“customer”: {
“email”: Phil+API@veeqo.com,
“phone”: “01792 720740”,
“mobile”: “07329023903”,
“notes”: “This person buys things”,
“billing_address_attributes”: {
“first_name”: “Phil”,
“last_name”: “Reynolds”,
“company”: “Veeqo Ltd”,
“address1”: “Tech Hub”,
“address2”: “221 High Street”,
“city”: “Swansea”,
“country”: “GB”,
“zip”: “SA1 1NW”
}
}
}

I have tried adding in a shipping address by adding the below but this doesn’t seem to work:
{
“customer”: {
“email”: Phil+API@veeqo.com,
“phone”: “01792 720740”,
“mobile”: “07329023903”,
“notes”: “This person buys things”,
“billing_address_attributes”: {
“first_name”: “Phil”,
“last_name”: “Reynolds”,
“company”: “Veeqo Ltd”,
“address1”: “Tech Hub”,
“address2”: “221 High Street”,
“city”: “Swansea”,
“country”: “GB”,
“zip”: “SA1 1NW”
},
“shipping_address_attributes”: [{
“first_name”: “Phil”,
“last_name”: “Reynolds”,
“company”: “Veeqo Ltd”,
“address1”: “Tech Hub”,
“address2”: “221 High Street”,
“city”: “Swansea”,
“country”: “GB”,
“zip”: “SA1 1NW”
}]
}
}

How can I either:
A. Set the billing address as the shipping address default?
B. Explicitly add in a shipping address as with the billing address?

Could anybody share any insight here please?

(I forgot to add, in my JSON example above I added in shipping_address_attributes as a test but that did not work).

Hi @Xuje3

If you create the customer seperately from creating the order, you can create the shipping_address as it states here: API Docs - Veeqo Developers

If you are creating the customer as part of the order creation, it will take the shipping address from the order and create that as a “last used shipping address” for the customer and use that as the default shipping address.

Thanks,
Sam