Anchor to section titled 'undefined'

fulfillmentConstraintRuleCreate
mutation

Requires write_fulfillment_constraint_rules access scope.

Creates a fulfillment constraint rule and its metafield.


Anchor to functionId
functionId
required

The identifier of the function providing the constraint rule.

Metafields to associate to the fulfillment constraint rule.


Was this section helpful?

The newly created fulfillment constraint rule.

The list of errors that occurred from executing the mutation.


Was this section helpful?
Hide code
Mutation reference
Copy
mutation fulfillmentConstraintRuleCreate($functionId: String!) {
  fulfillmentConstraintRuleCreate(functionId: $functionId) {
    fulfillmentConstraintRule {
      # FulfillmentConstraintRule fields
    }
    userErrors {
      field
      message
    }
  }
}
Hide code
Input
Copy
{
  "functionId": "<your-functionId>",
  "metafields": [
    {
      "id": "gid://shopify/<objectName>/10079785100",
      "key": "<your-key>",
      "namespace": "<your-namespace>",
      "type": "<your-type>",
      "value": "<your-value>"
    }
  ]
}
input MetafieldInput {
  description: String
  id: ID
  key: String
  namespace: String
  type: String
  value: String
}