Metafield Resource

Metafield Resource

Metafield Resource

  1. Get Metafields
  2. Get Metafield
  3. Create Metafield
  4. Update Metafield
  5. Delete Metafield
  6. Get Metafield Count
  7. Filter Metafields


Get Metfields

GET /api/metafields.json
  • GET /api/metafields.json will return all Metafields. See the Filter Metafields endpoint for more info.
Example:
Status: 200 OK

[
  {
    "metafield": {
      "created_at": "2016-07-20T16:03:38+02:00",
      "description": "Some Metafield description",
      "id": 18,
      "key": "key",
      "metafieldable_id": 42,
      "metafieldable_type": "Product",
      "namespace": "namespace",
      "position": 1,
      "shop_id": 1,
      "updated_at": "2016-07-20T16:03:38+02:00",
      "value": "Some Value",
      "value_type": 0
    }
  }
]


Get Metafield

GET /api/metafields/18.json

  • GET /api/metafields/18.json will return the specified Metafield.
Example:
Status: 200 OK
{
  "metafield": {
    "created_at": "2016-07-20T16:03:38+02:00",
    "description": "Some Metafield description",
    "id": 18,
    "key": "key",
    "metafieldable_id": 42,
    "metafieldable_type": "Product",
    "namespace": "namespace",
    "position": 1,
    "shop_id": 1,
    "updated_at": "2016-07-20T16:03:38+02:00",
    "value": "Some Value",
    "value_type": 0
  }
}


Create Metafield

POST /api/metafields.json

  • POST /api/metafields.json will create a new Metafield from the parameters passed.

This will return 201 Created, with the location of the new Metafield in the Location header along with the current JSON representation of the Metafield if the creation was a success. See the Get Metafield endpoint for more info.

When trying to create a Metafield with an already existing metafieldable_type, metafieldable_id, namespace and key combination, we will update the existing Metafield.



Update Metafield

PUT /api/metafields/18.json

  • PUT /api/metafields/18.json will update the Metafield from the parameters passed.

This will return 200 OK if the update was a success along with the current JSON representation of the Metafield. See the Get Metafield endpoint for more info.



Delete Metafield

DELETE /api/metafields/18.json

  • DELETE /api/metafields/18.json will delete the Metafield specified and return 200 OK if that was successful.


Get Metafield Count

GET /api/metafields/count.json

  • GET /api/metafields/count.json will return the Metafield count.


Filter Metafields

GET /api/metafields.json?filter_name1=filter_value1&filter_name2=filter_value2

  • GET /api/metafields.json?filter_name_1=filter_value_1&filter_name_2=filter_value_2 will return a filtered list of Metafields. See the [Get Metafields] endpoint for more information about the output.

    • Related Articles

    • Product Image Resource

      Product Image Resource Bulk Create Or Update Delete Product Images Bulk Create or Update PUT /api/products/1/.json PUT /api/products/1.json will create or update the product images from the parameters passed. Example: $ curl -s \ -H 'Accept: ...
    • Order Resource

      Attention Order resources are read-only by default. Please contact us for access. ​ Order Statuses Order Status English German open new order Neue Bestellung in_progress in progress, started processing Bearbeitung begonnen cancelled order was ...
    • Product Resource

      Product Associations Product Properties Product Recommendations Create Product POST /api/products.json POST /api/products.json will create a new product from the parameters passed. Example: $ curl -s \ -H 'Accept: application/json' \ -H ...
    • Customer Resource

      Attention Those resources are read-only by default. Get Customers GET /api/customers.json GET /api/customers.json will return the first 150 (default limit) customers. You can increase the limit to a maximum of 250 customers. Example: $ curl -s \ -H ...
    • Item Resource

      Those resources are read-only by default. Please contact us if you need write permissions. Get Items GET /api/items.json GET /api/items.json will return the first 150 (default limit) items. You can increase the limit to a maximum of 250 items. GET ...