Can you write to the metafield/metaobject tied to a customer data using the customerAccount api?
Hello @ygpatel As of now, you cannot write to metafields or metaobjects tied to customer data using the Shopify Customer Account API. The Customer Account API is designed primarily for customer-facing operations, such as signing in, creating accounts, viewing orders, and interacting with customer data in a limited, secure way.
Here’s a breakdown:
Feature Customer Account API Admin API (or Storefront AP
Read basic customer data
Update metafields X (via Admin API only)
Read/write metaobjects X (Admin API)
Workaround:
If your goal is to let a logged-in customer update or interact with metafield/metaobject data, you have to:
-
Create a secure proxy app or server function.
-
Let the Customer Account API authenticate the customer.
-
Have your app use the Admin API (with proper permissions) to update the customer metafield or metaobject.
Example Flow:
-
Customer signs in via Hydrogen or custom app (Customer Account API).
-
Frontend collects the metafield/metaobject input.
-
Frontend sends data to your app/backend.
-
Backend (with Admin API access) updates the metafield/metaobject for that customer.
Thank you
Thank you and much appreciated. I will give it a try.