HI Mpraski,
Your approach of leveraging Shopify’s Admin API to create customer profiles is correct. You can indeed use a POST request via the /admin/api/2023-07/customers.json endpoint to create a new customer.
Here is an example of the request body:
{
"customer": {
"first_name": "Steve",
"last_name": "Lastnameson",
"email": "steve.lastnameson@example.com",
"phone": "+15142546011",
"verified_email": true,
"addresses": [
{
"address1": "123 Oak St",
"city": "Ottawa",
"province": "ON",
"phone": "555-1212",
"zip": "123 ABC",
"last_name": "Lastnameson",
"first_name": "Mother",
"country": "CA"
}
]
}
}
As for custom data fields, Shopify provides the ability to store additional information for resources like products, customers, and orders with Metafields. To add metafields to a customer, you would need to use the POST/admin/api/2023-07/customers/ID/metafields.json endpoint.
Here is an example of how you can create a metafield for a customer:
{
"metafield": {
"namespace": "custom_fields",
"key": "web_address",
"value": "www.example.com",
"value_type": "string",
"owner_resource": "customer",
"owner_id": 207119551
}
}
In the above example you’d replace "web_address" and "[www.example.com](http://www.example.com)" with your custom field key and value respectively.
Where you might have an issue however is around migrating passwords - Shopify does not support importing sensitive information such as passwords due to security and privacy reasons. Your customers would need to reset their passwords upon first log in to the new site and possibly re-enter their billing information. There are some apps such as BAIS that could assist with this part.
Hope this helps and best of luck with the migration!