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.

Destination configuration​

Configure a Shopify destination and associate it with the flow, in addition to the basic data flow configuration.

FieldValueNotes
Destination TypeShopify
OperationSync customerPOST /egress/sync-customer-to-shopify
GraphQL endpoint URLhttps://SHOPIFYURL.myshopify.com/Shopify Admin GraphQL endpoint URL
Admin API access tokenshpat_CODICEALFANUMERICOOr Client ID (API key) + Client secret — see Authentication
Client ID (API key)YOUR_CLIENT_ID
Client secretYOUR_CLIENT_SECRET

Deprecated — previous configuration (HTTP Adapter)​

Deprecated

Configuration via HTTP Adapter with Base Url, Resource Path, and x-api-key header in Settings Override is deprecated. Use the Shopify destination configuration described above.

In addition to the basic data flow configuration, the following Settings Override settings were required:

FieldValueNotes
Base Urlhttps://adapter.flowlyze.ioAdapter URL
Resource Pathapi/adp/shopify/egress/sync-customer-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"