-
-
Notifications
You must be signed in to change notification settings - Fork 313
Metafields
Joshua Harms edited this page Dec 20, 2023
·
1 revision
var service = new MetaFieldService(myShopifyUrl, shopAccessToken);
var metafield = new MetaField()
{
Namespace = "myNamespace",
Key = "myKey",
Value = "5",
ValueType = "integer",
Description = "This is a test meta field. It is an integer value."
};
//Create a new metafield on a product
metafield = await service.CreateAsync(metafield, productId, "products");
var service = new MetaFieldService(myShopifyUrl, shopAccessToken);
var count = await service.CountAsync(productId, "products");
var service = new MetaFieldService(myShopifyUrl, shopAccessToken);
var metafields = await service.ListAsync(productId, "products");
var service = new MetaFieldService(myShopifyUrl, shopAccessToken);
var metafield = await service.GetAsync(metafieldId);
var service = new MetaFieldService(myShopifyUrl, shopAccessToken);
var metafield = await service.UpdateAsync(metafieldId, new MetaField()
{
Value = "45"
});
var service = new MetaFieldService(myShopifyUrl, shopAccessToken);
await service.DeleteAsync(metafieldId);