Create Metaobject definations

I’ve created a custom Shopify theme that includes several Metaobject definitions used within the theme. I plan to send the theme as a ZIP file to my customers, but since they can’t manually recreate all the metaobject definitions, I want to include something they can easily import to set up those definitions automatically.

What should I provide them so they can import the necessary metaobject definitions along with the theme?

There isn’t anything they can ‘import’, you can only create definitions via the UI in the admin or the Admin API.

I’d suggest providing some clear documentation for the user to follow to create the definitions via the UI.

Can you tell me how we can do using ADMIN API?

You can use the following mutation:

Thanks.. Lemme try this

I have checked this and its going to ask access token and access token will be provided after installing app

so I am unable to create public app as its getting stuck when submission so I am trying to acheive things without app.

Hello @Twins_Team,

For now, your best bet would be to create a custom app via the store admin. Create it, provide the metaobject access scopes, install the app, retrieve the access token and you are set to use the metaobjectDefinitionCreate mutation. This will work until the end of the year (at least for now). After that, you will not be able to create custom apps, everything will be on the partner dev dashboard.

Hope it helps !

But I have to share theme with multiple customers and don’t know who is going to use or not so cant create custom app for each customer.

You will need to do as I said and provide some documentation for them to follow to create the metaobject definitions.

1 Like

There’s nothing like a native CSV import of metaobjects( MOB’s) ,or the definitions.

  1. There’s are several spreadsheet based apps for export/importing such data.
  2. A workaround can be to create a shopify-flow automation with the admin-api request action , to do the series of mutations; or one of the other scriptable automation apps.
  3. If you, or they, are technically proficient you could use shopify’s free graphiQL app to provide the step by step mutations to create the resources; possibly after having built the queries in the tool too. https://shopify.dev/docs/api/usage/api-exploration/admin-graphiql-explorer
  4. If going the custom app route then in some cases maybe see declarative definitions Declarative custom data definitions