OverviewPlatformsAPI ReferenceResources
Commerce

Create a metaobject

POSThttps://zernio.com/api/v1/commerce/metaobjects

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

Authentication

AuthorizationBearer tokenRequired

API key authentication: send your Zernio API key in the Authorization header, prefixed with Bearer.

Body

application/json

What every request needs

accountIdstringRequired
typestringRequired
fieldsarray of objectRequired
keystringRequired
valuestringRequired
Optional parameters1 field
handlestring

Responses

Success· the request worked

Errors· the request failed

POST/v1/commerce/metaobjects
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"      }    ]  }}
OpenAPI specification
Was this page helpful?