From 782e3b68e6f4a8006f0544dace5cf7e1e159a644 Mon Sep 17 00:00:00 2001 From: Anton Shutik Date: Thu, 7 Nov 2024 09:23:38 +0100 Subject: [PATCH] Updated README --- README.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/README.md b/README.md index 7a2a76a..0e3f704 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,24 @@ deleted = client.products.delete(resource=1234) # Count of products count = client.products.count() +# Get product metafields +metafields = client.products.metafields.all(resource_id=1234) + +# Get product metafield +metafield = client.products.metafields.get(resource_id=1234, sub_resource_id=5678) + +# Create product metafield +data = {"metafield": {"namespace": "warehouse", "key": "foo", "value": 25, "type": "integer"}} +metafield = client.products.metafields.create(resource_id=5678, json=data) + +# Update product metafield +data = {"metafield": {"value": 30}} +metafield = client.products.metafields.update(resource_id=1234, sub_resource_id=5678, json=data) + +# Delete product metafield +deleted = client.products.metafields.delete(resource_id=1234, sub_resource_id=5678) + + # Cancel order order = client.orders.cancel(resource_id=1234)