{
  "openapi": "3.0.1",
  "info": {
    "title": "Shopify Variant Metafields CSV Validator & Planner",
    "description": "Validate Shopify variant metafields CSV files before import. Detect row errors and duplicates, then generate metafieldsSet GraphQL batches and JSON diagnostics for AI agents. Supports the custom namespace. No Shopify connection, credentials or writes.",
    "version": "0.0",
    "x-build-id": "g9pDuxFehYLHedDsl"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/ministrant_ram~shopify-variant-metafields-planner/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-ministrant_ram-shopify-variant-metafields-planner",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/ministrant_ram~shopify-variant-metafields-planner/runs": {
      "post": {
        "operationId": "runs-sync-ministrant_ram-shopify-variant-metafields-planner",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/ministrant_ram~shopify-variant-metafields-planner/run-sync": {
      "post": {
        "operationId": "run-sync-ministrant_ram-shopify-variant-metafields-planner",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "required": [
          "csv_text",
          "fields"
        ],
        "properties": {
          "csv_text": {
            "title": "Source CSV",
            "minLength": 1,
            "maxLength": 2097152,
            "type": "string",
            "description": "CSV text with a header row, variant identifiers and metafield values. Variant IDs must have the exact form gid://shopify/ProductVariant/123; numeric IDs are not accepted. The planner enforces the 2 MiB UTF-8 byte limit."
          },
          "fields": {
            "title": "Metafield mappings",
            "minItems": 1,
            "maxItems": 20,
            "type": "array",
            "description": "Map 1 to 20 CSV columns to metafields. This version supports only the custom namespace. With compare_digest, every mapping must specify a digest_column containing the current digest for that metafield.",
            "items": {
              "type": "object",
              "properties": {
                "column": {
                  "type": "string",
                  "minLength": 1,
                  "description": "Exact source CSV column name.",
                  "maxLength": 128,
                  "title": "CSV value column",
                  "editor": "textfield"
                },
                "namespace": {
                  "type": "string",
                  "enum": [
                    "custom"
                  ],
                  "description": "Only custom is supported by this version.",
                  "title": "Metafield namespace",
                  "editor": "select"
                },
                "key": {
                  "type": "string",
                  "minLength": 2,
                  "maxLength": 64,
                  "pattern": "^[A-Za-z0-9_-]{2,64}$",
                  "description": "Destination metafield key: 2 to 64 ASCII letters, digits, hyphens or underscores.",
                  "title": "Metafield key",
                  "editor": "textfield"
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "single_line_text_field",
                    "multi_line_text_field",
                    "number_integer",
                    "number_decimal",
                    "boolean",
                    "date"
                  ],
                  "description": "Shopify metafield type.",
                  "title": "Metafield type",
                  "editor": "select"
                },
                "digest_column": {
                  "type": "string",
                  "minLength": 1,
                  "description": "CSV column with current comparison digests; required when write_policy is compare_digest.",
                  "maxLength": 128,
                  "title": "Comparison digest column",
                  "editor": "textfield"
                }
              },
              "required": [
                "column",
                "namespace",
                "key",
                "type"
              ],
              "additionalProperties": false
            }
          },
          "identifier_mode": {
            "title": "Variant identifier mode",
            "enum": [
              "variant_id",
              "sku"
            ],
            "type": "string",
            "description": "Use canonical Shopify ProductVariant GIDs directly, or resolve SKUs from the mapping CSV you provide. No IDs are inferred or fetched.",
            "default": "variant_id"
          },
          "identifier_column": {
            "title": "Identifier column",
            "minLength": 1,
            "maxLength": 128,
            "type": "string",
            "description": "Exact source CSV column name containing the chosen identifier. Set this explicitly to sku when your SKU column is named sku.",
            "default": "variant_id"
          },
          "variant_map_csv": {
            "title": "SKU to variant mapping CSV",
            "maxLength": 2097152,
            "type": "string",
            "description": "Required in sku mode. Supply the exact columns sku and variant_id, with canonical gid://shopify/ProductVariant/... identifiers. Limited to 2 MiB of UTF-8 data and 10,000 data rows. No Shopify lookup is performed."
          },
          "write_policy": {
            "title": "Write policy for generated requests",
            "enum": [
              "create_only",
              "compare_digest",
              "overwrite"
            ],
            "type": "string",
            "description": "create_only emits compareDigest: null. compare_digest requires a digest_column in every field mapping. overwrite omits the comparison guard and adds a warning to the report. No policy executes a request.",
            "default": "create_only"
          },
          "delimiter": {
            "title": "CSV delimiter",
            "enum": [
              ",",
              ";",
              "\t"
            ],
            "type": "string",
            "description": "The delimiter used to parse CSV input.",
            "default": ","
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}