Commerce
Create a metaobject
Creates a metaobject of type with its fields (key and string value, up to 100) and an optional handle, and returns it with status 201. Shopify only. Needs metaobjects.write.
PlatformsShopify
Authorization
bearerAuth AuthorizationBearer <token>
API key authentication: send your Zernio API key in the Authorization header, prefixed with Bearer.
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
import Zernio from '@zernio/node';const zernio = new Zernio({ apiKey: process.env.ZERNIO_API_KEY });const { data } = await zernio.commerce.createCommerceMetaobject({ body: { accountId: 'account_abc123', type: 'string', fields: [ { key: 'tok_abc123', value: 'string', }, ], },});console.log(data);{ "metaobject": { "id": "string", "type": "string", "handle": "string", "displayName": "string", "fields": [ { "key": "string", "type": "string", "value": "string" } ] }}Was this page helpful?