Skip to main content

Upsert Customer Metaobject

The process performs an upsert of metaobject entities on Shopify, creating or updating the metaobjects associated with a customer. Each entity must include type and handle.

Customer lookup is performed based on one of the three provided fields, in order of priority: idemailphone.

For each metafield:

  • If it is defined as a metaobject reference, the value must be a single object.
  • If it is defined as a list of metaobject references, the value must be a list of objects.
  • If the value is null, the metafield is cleared.
Note

Both the metaobject definitions and the corresponding metafield definitions must already exist.

Payload Example

{
"id": "9300153336115",
"email": "m.rossi@test.com",
"phone": "",
"metaobjects": {
"namespace.metafieldKey1": {
"isPublished": true,
"type": "friends",
"handle": "customer-1",
"fields": {
"full_name": "Customer 1",
"email": "customer1@test.com",
"phone": ""
},
"files": {
"image": "http://example.com/Customer1Logo/678790bb08755-0.jpg"
}
},
"metafieldKey2": [
{
"isPublished": true,
"type": "friends",
"handle": "customer-2",
"fields": {
"full_name": "Customer 2",
"email": "customer2@test.com",
"phone": "+39 2259847569"
},
"files": {
"image": "http://example.com/Customer2Logo/678790bb08755-0.jpg"
}
},
{
"isPublished": true,
"type": "friends",
"handle": "customer-3",
"fields": {
"full_name": "Customer 3",
"email": "customer3@test.com",
"phone": ""
},
"files": {
"image": "http://example.com/Customer3Logo/678790bb08755-0.jpg"
}
}
],
"metafieldKeyToRemove": null
}
}

Flow Configuration

FieldValueNotes
Base Urlhttps://adapt.flowlyze.comURL of the adapters
Resource Path/api/adp/shopify/egress/upsert-customer-metaobjectPath of the adapter for the customer metaobject upsert flow
Headers :: x-api-key**********API key for validating interaction with the endpoint
Headers :: x-shopify-graphql-urlhttps://SHOPIFYURL.myshopify.com/URL of the Shopify store to connect to
Headers :: x-shopify-access-tokenshpat_ALPHANUMERICCODESecret of the custom app created for the integration