Anchor to fulfillmentConstraintRuleCreatefulfillment
fulfillmentConstraintRuleCreate
mutation
Requires access scope.
Creates a fulfillment constraint rule and its metafield.
Anchor to Arguments
Arguments
- Anchor to deliveryMethodTypesdelivery•
Method Types [DeliveryMethod requiredType!]! Associate the function with one or multiple delivery method types.
- Anchor to functionIdfunction•
Id String!required The identifier of the function providing the constraint rule.
- Anchor to metafieldsmetafields•[Metafield
Input!] Default:[] Metafields to associate to the fulfillment constraint rule.
Was this section helpful?
Anchor to FulfillmentConstraintRuleCreatePayload returnsFulfillmentConstraintRuleCreatePayload returns
- Anchor to fulfillmentConstraintRulefulfillment•
Constraint Rule The newly created fulfillment constraint rule.
- Anchor to userErrorsuser•
Errors The list of errors that occurred from executing the mutation.
Was this section helpful?
Mutation Reference
mutation fulfillmentConstraintRuleCreate($deliveryMethodTypes: [DeliveryMethodType!]!, $functionId: String!, $metafields: [MetafieldInput!]) {
fulfillmentConstraintRuleCreate(deliveryMethodTypes: $deliveryMethodTypes, functionId: $functionId, metafields: $metafields) {
fulfillmentConstraintRule {
# FulfillmentConstraintRule fields
}
userErrors {
field
message
}
}
}
Input
{
"deliveryMethodTypes": [
"LOCAL"
],
"functionId": "<your-functionId>",
"metafields": [
{
"id": "gid://shopify/<objectName>/10079785100",
"key": "<your-key>",
"namespace": "<your-namespace>",
"type": "<your-type>",
"value": "<your-value>"
}
]
}
{
"deliveryMethodTypes": [
"LOCAL"
],
"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
}