Skip to main content

Customer Creation

👤 Customer Create/Update Functionality

The endpoint allows you to create or update a customer on Shopify.

🔍 Customer search logic:

  1. If the customer Id is present, a search is performed via Shopify Id.
    • If the customer exists, it is returned to perform the update.
    • If not found and the Id provided in input contains the shopify Id prefix, the search stops and proceeds with customer creation.
    • Otherwise the search continues.
  2. If it was not possible to identify the customer via Id, and the provided email is valid, a search is performed via email.
    • If the customer is found, it is returned.
    • Otherwise, the search continues.
  3. If email is not available (or not valid), but a valid phone number is present, a search is performed via phone number.
    • If a customer is found, it is returned.
  4. If none of the searches return results, an empty customer is returned, and the system will subsequently proceed with creating a new customer.

Customer Creation Flow Configuration

In addition to the base data flow configuration, it is necessary to add the following settings in the destination's Settings Override:

FieldValueNote
Base Urlhttps://adapt.flowlyze.comadapter URL
Resource Pathapi/adp/shopify/egress/sync-customers-to-shopifyAdapter path for customer creation flow.
Headers :: x-api-key**********API key for endpoint interaction verification
Headers :: x-shopify-access-tokenshpat_CODICEALFANUMERICOSecret of the custom app created for integration
Headers :: x-shopify-graphql-urlhttps://SHOPIFYURL.myshopify.com/Shopify shop URL to connect to

Input Message

The endpoint works in upsert mode: it is possible to send partial JSONs and only the specified fields will be updated on Shopify. Fields not included in the request will not be modified.

If it is necessary to clear a field (e.g. remove a previously present value), it must be sent explicitly as an empty string ("").

Input Message Examples

  1. Customer creation/update
{
"id": "123456789",
"email": "mario.bianchi@gmail.com",
"firstName": "Mario",
"lastName": "Bianchi",
"phone": "3342233222",
"tags": ["tag1","tag2"],
"acceptsEmailMarketing": false,
"acceptsSmsMarketing": false
}

💡 Note: If you want to provide the Id in Shopify format, you can use the version with prefix:

"id": "gid://shopify/Customer/123456789"