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: id → email → phone.
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
| Field | Value | Notes |
|---|---|---|
Base Url | https://adapt.flowlyze.com | URL of the adapters |
Resource Path | /api/adp/shopify/egress/upsert-customer-metaobject | Path 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-url | https://SHOPIFYURL.myshopify.com/ | URL of the Shopify store to connect to |
Headers :: x-shopify-access-token | shpat_ALPHANUMERICCODE | Secret of the custom app created for the integration |