{
  "openapi": "3.0.3",
  "info": {
    "title": "RollStamp API (sandbox)",
    "version": "1.0.0",
    "description": "REST API for building firearm-industry storefronts and integrations on a distributor network: distributor configuration, your restricted product catalog (search, detail, history, bulk parquet export), analytics, an FFL dealer directory, destination restriction checks, cost-optimized fulfillment quotes, order placement and tracking, and a crowdsourced fraud database.\n\nEvery endpoint except the documentation needs your key in the x-api-key header, and the caller IP must be on the key's allowlist. This sandbox runs entirely on sample data: no real distributor receives an order.\n\nAI coding agents: read /v1/llms.txt."
  },
  "servers": [
    {
      "url": "/",
      "description": "This server"
    }
  ],
  "security": [
    {
      "ApiKeyAuth": []
    }
  ],
  "tags": [
    {
      "name": "Account"
    },
    {
      "name": "Configuration"
    },
    {
      "name": "Products"
    },
    {
      "name": "Analytics"
    },
    {
      "name": "FFL directory"
    },
    {
      "name": "Restrictions"
    },
    {
      "name": "Orders"
    },
    {
      "name": "Fraud"
    },
    {
      "name": "Routing"
    },
    {
      "name": "Carrier rates"
    },
    {
      "name": "Vetting"
    },
    {
      "name": "Webhooks"
    },
    {
      "name": "EDI and ERP"
    },
    {
      "name": "Vendors"
    },
    {
      "name": "Vendor portal"
    },
    {
      "name": "Support chat"
    },
    {
      "name": "MCP connector"
    },
    {
      "name": "Compliance"
    },
    {
      "name": "Manufacturing"
    },
    {
      "name": "Documentation"
    }
  ],
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key",
        "description": "Your API key (also accepted as \"Authorization: Bearer <key>\"). Vendor portal routes take the vendor's portal token as a Bearer token instead. Calls must also come from one of the key's registered server IPs (403 ip_whitelist_required / ip_not_allowed)."
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "example": false
          },
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "description": "Machine-readable code.",
                "example": "invalid_parameter"
              },
              "message": {
                "type": "string",
                "description": "Human-readable text."
              },
              "details": {
                "description": "Optional structured details (e.g. the {path, message} list of schema_validation_failed)."
              }
            }
          }
        }
      },
      "Product": {
        "type": "object",
        "description": "One distributor offer from your restricted catalog. Search omits short_description, description and product_class_description; detail and the bulk export carry them.",
        "properties": {
          "distid": {
            "type": "string",
            "description": "Alphanumeric distributor abbreviation (e.g. RSR, LIP); never numeric."
          },
          "distsku": {
            "type": "string",
            "description": "Distributor SKU."
          },
          "stockid": {
            "type": "string",
            "description": "Stable stock id (hash of the UPC)."
          },
          "upc": {
            "type": "string",
            "description": "UPC"
          },
          "name": {
            "type": "string",
            "description": "Short product name."
          },
          "short_description": {
            "type": "string",
            "description": "Detail/export only.",
            "nullable": true
          },
          "description": {
            "type": "string",
            "description": "HTML description. Detail/export only.",
            "nullable": true
          },
          "mfg_name": {
            "type": "string",
            "description": "Manufacturer/brand."
          },
          "mpn": {
            "type": "string",
            "description": "Manufacturer part number."
          },
          "product_class": {
            "type": "string",
            "description": "Two-letter product class code."
          },
          "product_class_description": {
            "type": "string",
            "description": "Detail/export only.",
            "nullable": true
          },
          "item_cat": {
            "type": "string",
            "description": "Distributor's own category.",
            "nullable": true
          },
          "item_gb_cat": {
            "type": "integer",
            "description": "Numeric category id (matches analytics category_id).",
            "nullable": true
          },
          "item_gb_cat_name": {
            "type": "string",
            "description": "Category name."
          },
          "ffl_req": {
            "type": "integer",
            "description": "1 = must ship to an FFL; pass into order items[].ffl_req."
          },
          "unit_price": {
            "type": "number",
            "description": "Your cost with custom catalog pricing applied."
          },
          "shipping_cost": {
            "type": "number",
            "description": "Modeled per-item shipping.",
            "nullable": true
          },
          "total_cost": {
            "type": "number",
            "description": "unit_price + shipping_cost.",
            "nullable": true
          },
          "retail_price": {
            "type": "number",
            "description": "Retail price from the main pricing settings (MAP respected).",
            "nullable": true
          },
          "map_price": {
            "type": "number",
            "description": "Minimum advertised price.",
            "nullable": true
          },
          "dist_map_price": {
            "type": "number",
            "description": "Distributor-reported MAP.",
            "nullable": true
          },
          "msrp": {
            "type": "number",
            "description": "MSRP",
            "nullable": true
          },
          "qty_on_hand": {
            "type": "integer",
            "description": "Quantity available."
          },
          "drop_ship_flg": {
            "type": "integer",
            "description": "1 = drop-shippable."
          },
          "images": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "src": {
                  "type": "string"
                }
              }
            }
          },
          "product_url": {
            "type": "string",
            "description": "Product page/image URL."
          }
        }
      },
      "FulfillmentOption": {
        "type": "object",
        "properties": {
          "distid": {
            "type": "string",
            "description": "Distributor abbreviation."
          },
          "distributor": {
            "type": "string",
            "description": "Distributor name."
          },
          "distsku": {
            "type": "string",
            "description": "Distributor SKU."
          },
          "qty_on_hand": {
            "type": "integer",
            "description": "Stock."
          },
          "unit_price": {
            "type": "number",
            "description": "Your cost."
          },
          "shipping_cost": {
            "type": "number",
            "description": "Estimated shipping."
          },
          "map_price": {
            "type": "number",
            "description": "MAP",
            "nullable": true
          },
          "msrp": {
            "type": "number",
            "description": "MSRP",
            "nullable": true
          },
          "drop_ship_flg": {
            "type": "integer",
            "description": "1 = drop-shippable."
          },
          "line_total": {
            "type": "number",
            "description": "unit_price x qty + estimated shipping."
          }
        }
      },
      "FFL": {
        "type": "object",
        "properties": {
          "license_number": {
            "type": "string",
            "description": "License number.",
            "example": "4-37-201-01-8K-70207"
          },
          "list_name": {
            "type": "string",
            "description": "Display name."
          },
          "business_name": {
            "type": "string",
            "description": "Business name.",
            "nullable": true
          },
          "license_name": {
            "type": "string",
            "description": "Licensee name."
          },
          "premise_street": {
            "type": "string",
            "description": ""
          },
          "premise_city": {
            "type": "string",
            "description": ""
          },
          "premise_county": {
            "type": "string",
            "description": "County of the licensed premises.",
            "nullable": true
          },
          "premise_state": {
            "type": "string",
            "description": ""
          },
          "premise_zip_code": {
            "type": "string",
            "description": ""
          },
          "voice_phone": {
            "type": "string",
            "description": "",
            "nullable": true
          },
          "email": {
            "type": "string",
            "description": "",
            "nullable": true
          },
          "lat": {
            "type": "number",
            "description": "",
            "nullable": true
          },
          "lng": {
            "type": "number",
            "description": "",
            "nullable": true
          },
          "ffl_on_file": {
            "type": "integer",
            "description": "1 = license copy on file (fastest transfers)."
          },
          "sot_on_file": {
            "type": "integer",
            "description": "1 = SOT on file (NFA-capable)."
          },
          "expiration_date": {
            "type": "string",
            "description": "YYYY-MM-DD"
          },
          "active": {
            "type": "integer",
            "description": "1 = license current."
          },
          "transfer_fee_longgun": {
            "type": "number",
            "description": "Detail only.",
            "nullable": true
          },
          "transfer_fee_handgun": {
            "type": "number",
            "description": "Detail only.",
            "nullable": true
          },
          "residential": {
            "type": "integer",
            "description": "Detail only: 1 = home-based.",
            "nullable": true
          },
          "contact_required": {
            "type": "integer",
            "description": "Detail only: 1 = call before shipping.",
            "nullable": true
          }
        }
      },
      "FulfillmentOrder": {
        "type": "object",
        "properties": {
          "order_date": {
            "type": "string",
            "description": "",
            "format": "date-time"
          },
          "order_id": {
            "type": "integer",
            "description": "Your order id.",
            "minimum": 1,
            "maximum": 2147483647
          },
          "distid": {
            "type": "string",
            "description": "Distributor abbreviation."
          },
          "distributor_order_id": {
            "type": "string",
            "description": "Distributor order number."
          },
          "ffl": {
            "type": "string",
            "description": "Destination license.",
            "nullable": true
          },
          "customer_name": {
            "type": "string",
            "description": ""
          },
          "order_status": {
            "type": "string",
            "description": "submitted, submitted_by_email, processing or shipped."
          },
          "order_source": {
            "type": "string",
            "description": "rollstamp_api for API orders."
          },
          "po_number": {
            "type": "string",
            "description": "",
            "nullable": true
          },
          "ship_date": {
            "type": "string",
            "description": "",
            "nullable": true
          },
          "ship_company": {
            "type": "string",
            "description": "",
            "nullable": true
          },
          "ship_method": {
            "type": "string",
            "description": "",
            "nullable": true
          },
          "ship_status": {
            "type": "string",
            "description": "awaiting_shipment, in_transit or delivered.",
            "nullable": true
          },
          "ship_tracking_number": {
            "type": "string",
            "description": "",
            "nullable": true
          },
          "ship_tracking_url": {
            "type": "string",
            "description": "",
            "nullable": true
          },
          "ship_to_store": {
            "type": "integer",
            "description": ""
          },
          "ffl_required": {
            "type": "integer",
            "description": ""
          },
          "dist_order_items": {
            "type": "string",
            "description": "JSON string of the items on this distributor order."
          }
        }
      },
      "FraudResult": {
        "type": "object",
        "properties": {
          "matched": {
            "type": "boolean",
            "description": ""
          },
          "matched_on": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "shipping_address, billing_address, email, phone, name, ip, items"
          },
          "report_count": {
            "type": "integer",
            "description": "Distinct dealers who reported this identity."
          },
          "evidence_counts": {
            "type": "object",
            "additionalProperties": {
              "type": "integer"
            }
          },
          "item_overlap_count": {
            "type": "integer",
            "description": ""
          },
          "item_similarity_count": {
            "type": "integer",
            "description": ""
          },
          "reported_by_you": {
            "type": "boolean",
            "description": ""
          },
          "first_reported": {
            "type": "string",
            "description": "",
            "format": "date-time",
            "nullable": true
          },
          "last_reported": {
            "type": "string",
            "description": "",
            "format": "date-time",
            "nullable": true
          }
        }
      },
      "DistributorConfig2ndAmendmentWholesale": {
        "title": "2nd Amendment Wholesale",
        "description": "Configuration entry for 2nd Amendment Wholesale (distid 2AW).",
        "type": "object",
        "properties": {
          "distid": {
            "type": "string",
            "enum": [
              "2AW"
            ]
          },
          "active": {
            "type": "boolean"
          },
          "shipping": {
            "title": "Shipping",
            "type": "object",
            "properties": {
              "flat_rate": {
                "type": "object",
                "properties": {
                  "cost": {
                    "type": "number",
                    "minimum": 0
                  },
                  "shipping_class": {
                    "type": "string"
                  }
                },
                "required": [
                  "cost",
                  "shipping_class"
                ],
                "additionalProperties": false
              },
              "price_based_shipping_levels": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "flat_rate": {
                      "type": "object",
                      "properties": {
                        "cost": {
                          "type": "number",
                          "minimum": 0
                        },
                        "shipping_class": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "cost",
                        "shipping_class"
                      ],
                      "additionalProperties": false
                    },
                    "min_unit_cost": {
                      "type": "number",
                      "minimum": 0
                    },
                    "max_unit_cost": {
                      "type": "number",
                      "minimum": 0
                    },
                    "product_class": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "AC",
                          "AG",
                          "AO",
                          "AP",
                          "AR",
                          "BP",
                          "BS",
                          "FA",
                          "FI",
                          "FP",
                          "HS",
                          "HT",
                          "HZ",
                          "KN",
                          "LL",
                          "MG",
                          "MZ",
                          "OP",
                          "OT",
                          "RC",
                          "RL",
                          "SF",
                          "SO"
                        ]
                      }
                    }
                  },
                  "required": [
                    "flat_rate",
                    "min_unit_cost"
                  ],
                  "additionalProperties": false
                }
              },
              "insurance": {
                "type": "object",
                "properties": {
                  "include": {
                    "type": "boolean"
                  },
                  "cost_per_hundred": {
                    "type": "number",
                    "minimum": 0
                  }
                },
                "required": [
                  "include"
                ],
                "additionalProperties": false
              },
              "handling": {
                "type": "object",
                "properties": {
                  "amount": {
                    "type": "number",
                    "minimum": 0
                  },
                  "order_threshold": {
                    "type": "number",
                    "minimum": 0
                  },
                  "add_handling_to_unit_cost": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "amount",
                  "order_threshold",
                  "add_handling_to_unit_cost"
                ],
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          },
          "drop_ship_only_items": {
            "type": "boolean"
          },
          "product_restrictions": {
            "title": "Product Restrictions",
            "type": "object",
            "properties": {
              "min_quantity_to_list": {
                "type": "integer",
                "minimum": 0
              },
              "include_uncategorized_product": {
                "type": "boolean"
              },
              "purchase_limit": {
                "type": "integer",
                "minimum": 0
              },
              "brand": {
                "title": "Brands (see GET /v1/products/facets)",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "category": {
                "title": "Categories (see GET /v1/products/facets)",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "product_class": {
                "title": "Product classes",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "upc": {
                "title": "UPCs",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "sku": {
                "title": "Distributor SKUs",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "cost": {
                "type": "object",
                "properties": {
                  "global_restrictions": {
                    "type": "object",
                    "properties": {
                      "min_distributor_cost": {
                        "type": "number",
                        "minimum": 0
                      },
                      "max_distributor_cost": {
                        "type": "number",
                        "minimum": 0
                      }
                    },
                    "required": [
                      "min_distributor_cost",
                      "max_distributor_cost"
                    ],
                    "additionalProperties": false
                  },
                  "product_class_restrictions": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "product_class": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "enum": [
                              "AC",
                              "AG",
                              "AO",
                              "AP",
                              "AR",
                              "BP",
                              "BS",
                              "FA",
                              "FI",
                              "FP",
                              "HS",
                              "HT",
                              "HZ",
                              "KN",
                              "LL",
                              "MG",
                              "MZ",
                              "OP",
                              "OT",
                              "RC",
                              "RL",
                              "SF",
                              "SO"
                            ]
                          }
                        },
                        "min_distributor_cost": {
                          "type": "number",
                          "minimum": 0
                        },
                        "max_distributor_cost": {
                          "type": "number",
                          "minimum": 0
                        }
                      },
                      "required": [
                        "product_class",
                        "min_distributor_cost",
                        "max_distributor_cost"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          },
          "product_feed": {
            "type": "object",
            "properties": {
              "active": {
                "type": "boolean"
              }
            },
            "additionalProperties": false
          },
          "fulfillment": {
            "type": "object",
            "properties": {
              "API_TOKEN": {
                "type": "string"
              },
              "ffl_recipient_emails": {
                "type": "array",
                "items": {
                  "type": "string",
                  "format": "email"
                }
              },
              "billing_address": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "street": {
                    "type": "string"
                  },
                  "city": {
                    "type": "string"
                  },
                  "state": {
                    "type": "string",
                    "enum": [
                      "",
                      "AL",
                      "AK",
                      "AZ",
                      "AR",
                      "CA",
                      "CO",
                      "CT",
                      "DE",
                      "DC",
                      "FL",
                      "GA",
                      "HI",
                      "ID",
                      "IL",
                      "IN",
                      "IA",
                      "KS",
                      "KY",
                      "LA",
                      "ME",
                      "MD",
                      "MA",
                      "MI",
                      "MN",
                      "MS",
                      "MO",
                      "MT",
                      "NE",
                      "NV",
                      "NH",
                      "NJ",
                      "NM",
                      "NY",
                      "NC",
                      "ND",
                      "OH",
                      "OK",
                      "OR",
                      "PA",
                      "RI",
                      "SC",
                      "SD",
                      "TN",
                      "TX",
                      "UT",
                      "VT",
                      "VA",
                      "WA",
                      "WV",
                      "WI",
                      "WY"
                    ]
                  },
                  "zip": {
                    "type": "string"
                  }
                },
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          }
        },
        "required": [
          "distid",
          "active"
        ],
        "additionalProperties": false
      },
      "DistributorConfigAmChar": {
        "title": "AmChar",
        "description": "Configuration entry for AmChar (distid AMC).",
        "type": "object",
        "properties": {
          "distid": {
            "type": "string",
            "enum": [
              "AMC"
            ]
          },
          "active": {
            "type": "boolean"
          },
          "shipping": {
            "title": "Shipping",
            "type": "object",
            "properties": {
              "flat_rate": {
                "type": "object",
                "properties": {
                  "cost": {
                    "type": "number",
                    "minimum": 0
                  },
                  "shipping_class": {
                    "type": "string"
                  }
                },
                "required": [
                  "cost",
                  "shipping_class"
                ],
                "additionalProperties": false
              },
              "price_based_shipping_levels": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "flat_rate": {
                      "type": "object",
                      "properties": {
                        "cost": {
                          "type": "number",
                          "minimum": 0
                        },
                        "shipping_class": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "cost",
                        "shipping_class"
                      ],
                      "additionalProperties": false
                    },
                    "min_unit_cost": {
                      "type": "number",
                      "minimum": 0
                    },
                    "max_unit_cost": {
                      "type": "number",
                      "minimum": 0
                    },
                    "product_class": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "AC",
                          "AG",
                          "AO",
                          "AP",
                          "AR",
                          "BP",
                          "BS",
                          "FA",
                          "FI",
                          "FP",
                          "HS",
                          "HT",
                          "HZ",
                          "KN",
                          "LL",
                          "MG",
                          "MZ",
                          "OP",
                          "OT",
                          "RC",
                          "RL",
                          "SF",
                          "SO"
                        ]
                      }
                    }
                  },
                  "required": [
                    "flat_rate",
                    "min_unit_cost"
                  ],
                  "additionalProperties": false
                }
              },
              "insurance": {
                "type": "object",
                "properties": {
                  "include": {
                    "type": "boolean"
                  },
                  "cost_per_hundred": {
                    "type": "number",
                    "minimum": 0
                  }
                },
                "required": [
                  "include"
                ],
                "additionalProperties": false
              },
              "handling": {
                "type": "object",
                "properties": {
                  "amount": {
                    "type": "number",
                    "minimum": 0
                  },
                  "order_threshold": {
                    "type": "number",
                    "minimum": 0
                  },
                  "add_handling_to_unit_cost": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "amount",
                  "order_threshold",
                  "add_handling_to_unit_cost"
                ],
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          },
          "drop_ship_only_items": {
            "type": "boolean"
          },
          "product_restrictions": {
            "title": "Product Restrictions",
            "type": "object",
            "properties": {
              "min_quantity_to_list": {
                "type": "integer",
                "minimum": 0
              },
              "include_uncategorized_product": {
                "type": "boolean"
              },
              "purchase_limit": {
                "type": "integer",
                "minimum": 0
              },
              "brand": {
                "title": "Brands (see GET /v1/products/facets)",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "category": {
                "title": "Categories (see GET /v1/products/facets)",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "product_class": {
                "title": "Product classes",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "upc": {
                "title": "UPCs",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "sku": {
                "title": "Distributor SKUs",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "cost": {
                "type": "object",
                "properties": {
                  "global_restrictions": {
                    "type": "object",
                    "properties": {
                      "min_distributor_cost": {
                        "type": "number",
                        "minimum": 0
                      },
                      "max_distributor_cost": {
                        "type": "number",
                        "minimum": 0
                      }
                    },
                    "required": [
                      "min_distributor_cost",
                      "max_distributor_cost"
                    ],
                    "additionalProperties": false
                  },
                  "product_class_restrictions": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "product_class": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "enum": [
                              "AC",
                              "AG",
                              "AO",
                              "AP",
                              "AR",
                              "BP",
                              "BS",
                              "FA",
                              "FI",
                              "FP",
                              "HS",
                              "HT",
                              "HZ",
                              "KN",
                              "LL",
                              "MG",
                              "MZ",
                              "OP",
                              "OT",
                              "RC",
                              "RL",
                              "SF",
                              "SO"
                            ]
                          }
                        },
                        "min_distributor_cost": {
                          "type": "number",
                          "minimum": 0
                        },
                        "max_distributor_cost": {
                          "type": "number",
                          "minimum": 0
                        }
                      },
                      "required": [
                        "product_class",
                        "min_distributor_cost",
                        "max_distributor_cost"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          },
          "product_feed": {
            "type": "object",
            "properties": {
              "active": {
                "type": "boolean"
              }
            },
            "additionalProperties": false
          },
          "fulfillment": {
            "type": "object",
            "properties": {
              "api_key": {
                "type": "string"
              }
            },
            "additionalProperties": false
          }
        },
        "required": [
          "distid",
          "active"
        ],
        "additionalProperties": false
      },
      "DistributorConfigBillHicks": {
        "title": "Bill Hicks",
        "description": "Configuration entry for Bill Hicks (distid BILL).",
        "type": "object",
        "properties": {
          "distid": {
            "type": "string",
            "enum": [
              "BILL"
            ]
          },
          "active": {
            "type": "boolean"
          },
          "shipping": {
            "title": "Shipping",
            "type": "object",
            "properties": {
              "flat_rate": {
                "type": "object",
                "properties": {
                  "cost": {
                    "type": "number",
                    "minimum": 0
                  },
                  "shipping_class": {
                    "type": "string"
                  }
                },
                "required": [
                  "cost",
                  "shipping_class"
                ],
                "additionalProperties": false
              },
              "price_based_shipping_levels": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "flat_rate": {
                      "type": "object",
                      "properties": {
                        "cost": {
                          "type": "number",
                          "minimum": 0
                        },
                        "shipping_class": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "cost",
                        "shipping_class"
                      ],
                      "additionalProperties": false
                    },
                    "min_unit_cost": {
                      "type": "number",
                      "minimum": 0
                    },
                    "max_unit_cost": {
                      "type": "number",
                      "minimum": 0
                    },
                    "product_class": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "AC",
                          "AG",
                          "AO",
                          "AP",
                          "AR",
                          "BP",
                          "BS",
                          "FA",
                          "FI",
                          "FP",
                          "HS",
                          "HT",
                          "HZ",
                          "KN",
                          "LL",
                          "MG",
                          "MZ",
                          "OP",
                          "OT",
                          "RC",
                          "RL",
                          "SF",
                          "SO"
                        ]
                      }
                    }
                  },
                  "required": [
                    "flat_rate",
                    "min_unit_cost"
                  ],
                  "additionalProperties": false
                }
              },
              "insurance": {
                "type": "object",
                "properties": {
                  "include": {
                    "type": "boolean"
                  },
                  "cost_per_hundred": {
                    "type": "number",
                    "minimum": 0
                  }
                },
                "required": [
                  "include"
                ],
                "additionalProperties": false
              },
              "handling": {
                "type": "object",
                "properties": {
                  "amount": {
                    "type": "number",
                    "minimum": 0
                  },
                  "order_threshold": {
                    "type": "number",
                    "minimum": 0
                  },
                  "add_handling_to_unit_cost": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "amount",
                  "order_threshold",
                  "add_handling_to_unit_cost"
                ],
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          },
          "drop_ship_only_items": {
            "type": "boolean"
          },
          "product_restrictions": {
            "title": "Product Restrictions",
            "type": "object",
            "properties": {
              "min_quantity_to_list": {
                "type": "integer",
                "minimum": 0
              },
              "include_uncategorized_product": {
                "type": "boolean"
              },
              "purchase_limit": {
                "type": "integer",
                "minimum": 0
              },
              "brand": {
                "title": "Brands (see GET /v1/products/facets)",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "category": {
                "title": "Categories (see GET /v1/products/facets)",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "product_class": {
                "title": "Product classes",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "upc": {
                "title": "UPCs",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "sku": {
                "title": "Distributor SKUs",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "cost": {
                "type": "object",
                "properties": {
                  "global_restrictions": {
                    "type": "object",
                    "properties": {
                      "min_distributor_cost": {
                        "type": "number",
                        "minimum": 0
                      },
                      "max_distributor_cost": {
                        "type": "number",
                        "minimum": 0
                      }
                    },
                    "required": [
                      "min_distributor_cost",
                      "max_distributor_cost"
                    ],
                    "additionalProperties": false
                  },
                  "product_class_restrictions": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "product_class": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "enum": [
                              "AC",
                              "AG",
                              "AO",
                              "AP",
                              "AR",
                              "BP",
                              "BS",
                              "FA",
                              "FI",
                              "FP",
                              "HS",
                              "HT",
                              "HZ",
                              "KN",
                              "LL",
                              "MG",
                              "MZ",
                              "OP",
                              "OT",
                              "RC",
                              "RL",
                              "SF",
                              "SO"
                            ]
                          }
                        },
                        "min_distributor_cost": {
                          "type": "number",
                          "minimum": 0
                        },
                        "max_distributor_cost": {
                          "type": "number",
                          "minimum": 0
                        }
                      },
                      "required": [
                        "product_class",
                        "min_distributor_cost",
                        "max_distributor_cost"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          },
          "product_feed": {
            "type": "object",
            "properties": {
              "active": {
                "type": "boolean"
              }
            },
            "additionalProperties": false
          },
          "fulfillment": {
            "type": "object",
            "properties": {
              "customer_number": {
                "type": "string"
              },
              "ship_to": {
                "type": "string"
              },
              "default_ship_method": {
                "type": "string"
              },
              "ffl_recipient_emails": {
                "type": "array",
                "items": {
                  "type": "string",
                  "format": "email"
                }
              }
            },
            "additionalProperties": false
          }
        },
        "required": [
          "distid",
          "active"
        ],
        "additionalProperties": false
      },
      "DistributorConfigCamFour": {
        "title": "CamFour",
        "description": "Configuration entry for CamFour (distid CAM4).",
        "type": "object",
        "properties": {
          "distid": {
            "type": "string",
            "enum": [
              "CAM4"
            ]
          },
          "active": {
            "type": "boolean"
          },
          "shipping": {
            "title": "Shipping",
            "type": "object",
            "properties": {
              "flat_rate": {
                "type": "object",
                "properties": {
                  "cost": {
                    "type": "number",
                    "minimum": 0
                  },
                  "shipping_class": {
                    "type": "string"
                  }
                },
                "required": [
                  "cost",
                  "shipping_class"
                ],
                "additionalProperties": false
              },
              "price_based_shipping_levels": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "flat_rate": {
                      "type": "object",
                      "properties": {
                        "cost": {
                          "type": "number",
                          "minimum": 0
                        },
                        "shipping_class": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "cost",
                        "shipping_class"
                      ],
                      "additionalProperties": false
                    },
                    "min_unit_cost": {
                      "type": "number",
                      "minimum": 0
                    },
                    "max_unit_cost": {
                      "type": "number",
                      "minimum": 0
                    },
                    "product_class": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "AC",
                          "AG",
                          "AO",
                          "AP",
                          "AR",
                          "BP",
                          "BS",
                          "FA",
                          "FI",
                          "FP",
                          "HS",
                          "HT",
                          "HZ",
                          "KN",
                          "LL",
                          "MG",
                          "MZ",
                          "OP",
                          "OT",
                          "RC",
                          "RL",
                          "SF",
                          "SO"
                        ]
                      }
                    }
                  },
                  "required": [
                    "flat_rate",
                    "min_unit_cost"
                  ],
                  "additionalProperties": false
                }
              },
              "insurance": {
                "type": "object",
                "properties": {
                  "include": {
                    "type": "boolean"
                  },
                  "cost_per_hundred": {
                    "type": "number",
                    "minimum": 0
                  }
                },
                "required": [
                  "include"
                ],
                "additionalProperties": false
              },
              "handling": {
                "type": "object",
                "properties": {
                  "amount": {
                    "type": "number",
                    "minimum": 0
                  },
                  "order_threshold": {
                    "type": "number",
                    "minimum": 0
                  },
                  "add_handling_to_unit_cost": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "amount",
                  "order_threshold",
                  "add_handling_to_unit_cost"
                ],
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          },
          "drop_ship_only_items": {
            "type": "boolean"
          },
          "product_restrictions": {
            "title": "Product Restrictions",
            "type": "object",
            "properties": {
              "min_quantity_to_list": {
                "type": "integer",
                "minimum": 0
              },
              "include_uncategorized_product": {
                "type": "boolean"
              },
              "purchase_limit": {
                "type": "integer",
                "minimum": 0
              },
              "brand": {
                "title": "Brands (see GET /v1/products/facets)",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "category": {
                "title": "Categories (see GET /v1/products/facets)",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "product_class": {
                "title": "Product classes",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "upc": {
                "title": "UPCs",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "sku": {
                "title": "Distributor SKUs",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "cost": {
                "type": "object",
                "properties": {
                  "global_restrictions": {
                    "type": "object",
                    "properties": {
                      "min_distributor_cost": {
                        "type": "number",
                        "minimum": 0
                      },
                      "max_distributor_cost": {
                        "type": "number",
                        "minimum": 0
                      }
                    },
                    "required": [
                      "min_distributor_cost",
                      "max_distributor_cost"
                    ],
                    "additionalProperties": false
                  },
                  "product_class_restrictions": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "product_class": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "enum": [
                              "AC",
                              "AG",
                              "AO",
                              "AP",
                              "AR",
                              "BP",
                              "BS",
                              "FA",
                              "FI",
                              "FP",
                              "HS",
                              "HT",
                              "HZ",
                              "KN",
                              "LL",
                              "MG",
                              "MZ",
                              "OP",
                              "OT",
                              "RC",
                              "RL",
                              "SF",
                              "SO"
                            ]
                          }
                        },
                        "min_distributor_cost": {
                          "type": "number",
                          "minimum": 0
                        },
                        "max_distributor_cost": {
                          "type": "number",
                          "minimum": 0
                        }
                      },
                      "required": [
                        "product_class",
                        "min_distributor_cost",
                        "max_distributor_cost"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          },
          "product_feed": {
            "type": "object",
            "properties": {
              "active": {
                "type": "boolean"
              }
            },
            "additionalProperties": false
          },
          "fulfillment": {
            "type": "object",
            "properties": {
              "ftp_user": {
                "type": "string"
              },
              "ftp_password": {
                "type": "string"
              },
              "customer_number": {
                "type": "string"
              }
            },
            "additionalProperties": false
          }
        },
        "required": [
          "distid",
          "active"
        ],
        "additionalProperties": false
      },
      "DistributorConfigChattanoogaShootingSupplies": {
        "title": "Chattanooga Shooting Supplies",
        "description": "Configuration entry for Chattanooga Shooting Supplies (distid CSSI).",
        "type": "object",
        "properties": {
          "distid": {
            "type": "string",
            "enum": [
              "CSSI"
            ]
          },
          "active": {
            "type": "boolean"
          },
          "shipping": {
            "title": "Shipping",
            "type": "object",
            "properties": {
              "flat_rate": {
                "type": "object",
                "properties": {
                  "cost": {
                    "type": "number",
                    "minimum": 0
                  },
                  "shipping_class": {
                    "type": "string"
                  }
                },
                "required": [
                  "cost",
                  "shipping_class"
                ],
                "additionalProperties": false
              },
              "price_based_shipping_levels": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "flat_rate": {
                      "type": "object",
                      "properties": {
                        "cost": {
                          "type": "number",
                          "minimum": 0
                        },
                        "shipping_class": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "cost",
                        "shipping_class"
                      ],
                      "additionalProperties": false
                    },
                    "min_unit_cost": {
                      "type": "number",
                      "minimum": 0
                    },
                    "max_unit_cost": {
                      "type": "number",
                      "minimum": 0
                    },
                    "product_class": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "AC",
                          "AG",
                          "AO",
                          "AP",
                          "AR",
                          "BP",
                          "BS",
                          "FA",
                          "FI",
                          "FP",
                          "HS",
                          "HT",
                          "HZ",
                          "KN",
                          "LL",
                          "MG",
                          "MZ",
                          "OP",
                          "OT",
                          "RC",
                          "RL",
                          "SF",
                          "SO"
                        ]
                      }
                    }
                  },
                  "required": [
                    "flat_rate",
                    "min_unit_cost"
                  ],
                  "additionalProperties": false
                }
              },
              "insurance": {
                "type": "object",
                "properties": {
                  "include": {
                    "type": "boolean"
                  },
                  "cost_per_hundred": {
                    "type": "number",
                    "minimum": 0
                  }
                },
                "required": [
                  "include"
                ],
                "additionalProperties": false
              },
              "handling": {
                "type": "object",
                "properties": {
                  "amount": {
                    "type": "number",
                    "minimum": 0
                  },
                  "order_threshold": {
                    "type": "number",
                    "minimum": 0
                  },
                  "add_handling_to_unit_cost": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "amount",
                  "order_threshold",
                  "add_handling_to_unit_cost"
                ],
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          },
          "drop_ship_only_items": {
            "type": "boolean"
          },
          "product_restrictions": {
            "title": "Product Restrictions",
            "type": "object",
            "properties": {
              "min_quantity_to_list": {
                "type": "integer",
                "minimum": 0
              },
              "include_uncategorized_product": {
                "type": "boolean"
              },
              "purchase_limit": {
                "type": "integer",
                "minimum": 0
              },
              "brand": {
                "title": "Brands (see GET /v1/products/facets)",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "category": {
                "title": "Categories (see GET /v1/products/facets)",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "product_class": {
                "title": "Product classes",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "upc": {
                "title": "UPCs",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "sku": {
                "title": "Distributor SKUs",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "cost": {
                "type": "object",
                "properties": {
                  "global_restrictions": {
                    "type": "object",
                    "properties": {
                      "min_distributor_cost": {
                        "type": "number",
                        "minimum": 0
                      },
                      "max_distributor_cost": {
                        "type": "number",
                        "minimum": 0
                      }
                    },
                    "required": [
                      "min_distributor_cost",
                      "max_distributor_cost"
                    ],
                    "additionalProperties": false
                  },
                  "product_class_restrictions": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "product_class": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "enum": [
                              "AC",
                              "AG",
                              "AO",
                              "AP",
                              "AR",
                              "BP",
                              "BS",
                              "FA",
                              "FI",
                              "FP",
                              "HS",
                              "HT",
                              "HZ",
                              "KN",
                              "LL",
                              "MG",
                              "MZ",
                              "OP",
                              "OT",
                              "RC",
                              "RL",
                              "SF",
                              "SO"
                            ]
                          }
                        },
                        "min_distributor_cost": {
                          "type": "number",
                          "minimum": 0
                        },
                        "max_distributor_cost": {
                          "type": "number",
                          "minimum": 0
                        }
                      },
                      "required": [
                        "product_class",
                        "min_distributor_cost",
                        "max_distributor_cost"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          },
          "product_feed": {
            "type": "object",
            "properties": {
              "active": {
                "type": "boolean"
              }
            },
            "additionalProperties": false
          },
          "fulfillment": {
            "type": "object",
            "properties": {
              "API_SID": {
                "type": "string"
              },
              "API_TOKEN": {
                "type": "string"
              },
              "ffl_recipient_emails": {
                "type": "array",
                "items": {
                  "type": "string",
                  "format": "email"
                }
              }
            },
            "additionalProperties": false
          }
        },
        "required": [
          "distid",
          "active"
        ],
        "additionalProperties": false
      },
      "DistributorConfigCountrywideSports": {
        "title": "Countrywide Sports",
        "description": "Configuration entry for Countrywide Sports (distid CWS).",
        "type": "object",
        "properties": {
          "distid": {
            "type": "string",
            "enum": [
              "CWS"
            ]
          },
          "active": {
            "type": "boolean"
          },
          "shipping": {
            "title": "Shipping",
            "type": "object",
            "properties": {
              "flat_rate": {
                "type": "object",
                "properties": {
                  "cost": {
                    "type": "number",
                    "minimum": 0
                  },
                  "shipping_class": {
                    "type": "string"
                  }
                },
                "required": [
                  "cost",
                  "shipping_class"
                ],
                "additionalProperties": false
              },
              "price_based_shipping_levels": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "flat_rate": {
                      "type": "object",
                      "properties": {
                        "cost": {
                          "type": "number",
                          "minimum": 0
                        },
                        "shipping_class": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "cost",
                        "shipping_class"
                      ],
                      "additionalProperties": false
                    },
                    "min_unit_cost": {
                      "type": "number",
                      "minimum": 0
                    },
                    "max_unit_cost": {
                      "type": "number",
                      "minimum": 0
                    },
                    "product_class": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "AC",
                          "AG",
                          "AO",
                          "AP",
                          "AR",
                          "BP",
                          "BS",
                          "FA",
                          "FI",
                          "FP",
                          "HS",
                          "HT",
                          "HZ",
                          "KN",
                          "LL",
                          "MG",
                          "MZ",
                          "OP",
                          "OT",
                          "RC",
                          "RL",
                          "SF",
                          "SO"
                        ]
                      }
                    }
                  },
                  "required": [
                    "flat_rate",
                    "min_unit_cost"
                  ],
                  "additionalProperties": false
                }
              },
              "insurance": {
                "type": "object",
                "properties": {
                  "include": {
                    "type": "boolean"
                  },
                  "cost_per_hundred": {
                    "type": "number",
                    "minimum": 0
                  }
                },
                "required": [
                  "include"
                ],
                "additionalProperties": false
              },
              "handling": {
                "type": "object",
                "properties": {
                  "amount": {
                    "type": "number",
                    "minimum": 0
                  },
                  "order_threshold": {
                    "type": "number",
                    "minimum": 0
                  },
                  "add_handling_to_unit_cost": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "amount",
                  "order_threshold",
                  "add_handling_to_unit_cost"
                ],
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          },
          "drop_ship_only_items": {
            "type": "boolean"
          },
          "product_restrictions": {
            "title": "Product Restrictions",
            "type": "object",
            "properties": {
              "min_quantity_to_list": {
                "type": "integer",
                "minimum": 0
              },
              "include_uncategorized_product": {
                "type": "boolean"
              },
              "purchase_limit": {
                "type": "integer",
                "minimum": 0
              },
              "brand": {
                "title": "Brands (see GET /v1/products/facets)",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "category": {
                "title": "Categories (see GET /v1/products/facets)",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "product_class": {
                "title": "Product classes",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "upc": {
                "title": "UPCs",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "sku": {
                "title": "Distributor SKUs",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "cost": {
                "type": "object",
                "properties": {
                  "global_restrictions": {
                    "type": "object",
                    "properties": {
                      "min_distributor_cost": {
                        "type": "number",
                        "minimum": 0
                      },
                      "max_distributor_cost": {
                        "type": "number",
                        "minimum": 0
                      }
                    },
                    "required": [
                      "min_distributor_cost",
                      "max_distributor_cost"
                    ],
                    "additionalProperties": false
                  },
                  "product_class_restrictions": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "product_class": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "enum": [
                              "AC",
                              "AG",
                              "AO",
                              "AP",
                              "AR",
                              "BP",
                              "BS",
                              "FA",
                              "FI",
                              "FP",
                              "HS",
                              "HT",
                              "HZ",
                              "KN",
                              "LL",
                              "MG",
                              "MZ",
                              "OP",
                              "OT",
                              "RC",
                              "RL",
                              "SF",
                              "SO"
                            ]
                          }
                        },
                        "min_distributor_cost": {
                          "type": "number",
                          "minimum": 0
                        },
                        "max_distributor_cost": {
                          "type": "number",
                          "minimum": 0
                        }
                      },
                      "required": [
                        "product_class",
                        "min_distributor_cost",
                        "max_distributor_cost"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          },
          "product_feed": {
            "type": "object",
            "properties": {
              "active": {
                "type": "boolean"
              }
            },
            "additionalProperties": false
          },
          "fulfillment": {
            "type": "object",
            "properties": {
              "order_email": {
                "type": "string"
              },
              "firearms": {
                "type": "string"
              },
              "accessories": {
                "type": "string"
              },
              "ffl_recipient_emails": {
                "type": "array",
                "items": {
                  "type": "string",
                  "format": "email"
                }
              }
            },
            "additionalProperties": false
          }
        },
        "required": [
          "distid",
          "active"
        ],
        "additionalProperties": false
      },
      "DistributorConfigCrow": {
        "title": "Crow",
        "description": "Configuration entry for Crow (distid CROW).",
        "type": "object",
        "properties": {
          "distid": {
            "type": "string",
            "enum": [
              "CROW"
            ]
          },
          "active": {
            "type": "boolean"
          },
          "shipping": {
            "title": "Shipping",
            "type": "object",
            "properties": {
              "flat_rate": {
                "type": "object",
                "properties": {
                  "cost": {
                    "type": "number",
                    "minimum": 0
                  },
                  "shipping_class": {
                    "type": "string"
                  }
                },
                "required": [
                  "cost",
                  "shipping_class"
                ],
                "additionalProperties": false
              },
              "price_based_shipping_levels": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "flat_rate": {
                      "type": "object",
                      "properties": {
                        "cost": {
                          "type": "number",
                          "minimum": 0
                        },
                        "shipping_class": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "cost",
                        "shipping_class"
                      ],
                      "additionalProperties": false
                    },
                    "min_unit_cost": {
                      "type": "number",
                      "minimum": 0
                    },
                    "max_unit_cost": {
                      "type": "number",
                      "minimum": 0
                    },
                    "product_class": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "AC",
                          "AG",
                          "AO",
                          "AP",
                          "AR",
                          "BP",
                          "BS",
                          "FA",
                          "FI",
                          "FP",
                          "HS",
                          "HT",
                          "HZ",
                          "KN",
                          "LL",
                          "MG",
                          "MZ",
                          "OP",
                          "OT",
                          "RC",
                          "RL",
                          "SF",
                          "SO"
                        ]
                      }
                    }
                  },
                  "required": [
                    "flat_rate",
                    "min_unit_cost"
                  ],
                  "additionalProperties": false
                }
              },
              "insurance": {
                "type": "object",
                "properties": {
                  "include": {
                    "type": "boolean"
                  },
                  "cost_per_hundred": {
                    "type": "number",
                    "minimum": 0
                  }
                },
                "required": [
                  "include"
                ],
                "additionalProperties": false
              },
              "handling": {
                "type": "object",
                "properties": {
                  "amount": {
                    "type": "number",
                    "minimum": 0
                  },
                  "order_threshold": {
                    "type": "number",
                    "minimum": 0
                  },
                  "add_handling_to_unit_cost": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "amount",
                  "order_threshold",
                  "add_handling_to_unit_cost"
                ],
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          },
          "drop_ship_only_items": {
            "type": "boolean"
          },
          "product_restrictions": {
            "title": "Product Restrictions",
            "type": "object",
            "properties": {
              "min_quantity_to_list": {
                "type": "integer",
                "minimum": 0
              },
              "include_uncategorized_product": {
                "type": "boolean"
              },
              "purchase_limit": {
                "type": "integer",
                "minimum": 0
              },
              "brand": {
                "title": "Brands (see GET /v1/products/facets)",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "category": {
                "title": "Categories (see GET /v1/products/facets)",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "product_class": {
                "title": "Product classes",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "upc": {
                "title": "UPCs",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "sku": {
                "title": "Distributor SKUs",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "cost": {
                "type": "object",
                "properties": {
                  "global_restrictions": {
                    "type": "object",
                    "properties": {
                      "min_distributor_cost": {
                        "type": "number",
                        "minimum": 0
                      },
                      "max_distributor_cost": {
                        "type": "number",
                        "minimum": 0
                      }
                    },
                    "required": [
                      "min_distributor_cost",
                      "max_distributor_cost"
                    ],
                    "additionalProperties": false
                  },
                  "product_class_restrictions": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "product_class": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "enum": [
                              "AC",
                              "AG",
                              "AO",
                              "AP",
                              "AR",
                              "BP",
                              "BS",
                              "FA",
                              "FI",
                              "FP",
                              "HS",
                              "HT",
                              "HZ",
                              "KN",
                              "LL",
                              "MG",
                              "MZ",
                              "OP",
                              "OT",
                              "RC",
                              "RL",
                              "SF",
                              "SO"
                            ]
                          }
                        },
                        "min_distributor_cost": {
                          "type": "number",
                          "minimum": 0
                        },
                        "max_distributor_cost": {
                          "type": "number",
                          "minimum": 0
                        }
                      },
                      "required": [
                        "product_class",
                        "min_distributor_cost",
                        "max_distributor_cost"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          },
          "product_feed": {
            "type": "object",
            "properties": {
              "active": {
                "type": "boolean"
              }
            },
            "additionalProperties": false
          },
          "fulfillment": {
            "type": "object",
            "properties": {
              "security_code": {
                "type": "string"
              },
              "payment_method": {
                "type": "string"
              },
              "ffl_recipient_emails": {
                "type": "array",
                "items": {
                  "type": "string",
                  "format": "email"
                }
              }
            },
            "additionalProperties": false
          }
        },
        "required": [
          "distid",
          "active"
        ],
        "additionalProperties": false
      },
      "DistributorConfigDavidsons": {
        "title": "Davidsons",
        "description": "Configuration entry for Davidsons (distid DAV).",
        "type": "object",
        "properties": {
          "distid": {
            "type": "string",
            "enum": [
              "DAV"
            ]
          },
          "active": {
            "type": "boolean"
          },
          "shipping": {
            "title": "Shipping",
            "type": "object",
            "properties": {
              "flat_rate": {
                "type": "object",
                "properties": {
                  "cost": {
                    "type": "number",
                    "minimum": 0
                  },
                  "shipping_class": {
                    "type": "string"
                  }
                },
                "required": [
                  "cost",
                  "shipping_class"
                ],
                "additionalProperties": false
              },
              "price_based_shipping_levels": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "flat_rate": {
                      "type": "object",
                      "properties": {
                        "cost": {
                          "type": "number",
                          "minimum": 0
                        },
                        "shipping_class": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "cost",
                        "shipping_class"
                      ],
                      "additionalProperties": false
                    },
                    "min_unit_cost": {
                      "type": "number",
                      "minimum": 0
                    },
                    "max_unit_cost": {
                      "type": "number",
                      "minimum": 0
                    },
                    "product_class": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "AC",
                          "AG",
                          "AO",
                          "AP",
                          "AR",
                          "BP",
                          "BS",
                          "FA",
                          "FI",
                          "FP",
                          "HS",
                          "HT",
                          "HZ",
                          "KN",
                          "LL",
                          "MG",
                          "MZ",
                          "OP",
                          "OT",
                          "RC",
                          "RL",
                          "SF",
                          "SO"
                        ]
                      }
                    }
                  },
                  "required": [
                    "flat_rate",
                    "min_unit_cost"
                  ],
                  "additionalProperties": false
                }
              },
              "insurance": {
                "type": "object",
                "properties": {
                  "include": {
                    "type": "boolean"
                  },
                  "cost_per_hundred": {
                    "type": "number",
                    "minimum": 0
                  }
                },
                "required": [
                  "include"
                ],
                "additionalProperties": false
              },
              "handling": {
                "type": "object",
                "properties": {
                  "amount": {
                    "type": "number",
                    "minimum": 0
                  },
                  "order_threshold": {
                    "type": "number",
                    "minimum": 0
                  },
                  "add_handling_to_unit_cost": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "amount",
                  "order_threshold",
                  "add_handling_to_unit_cost"
                ],
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          },
          "drop_ship_only_items": {
            "type": "boolean"
          },
          "product_restrictions": {
            "title": "Product Restrictions",
            "type": "object",
            "properties": {
              "min_quantity_to_list": {
                "type": "integer",
                "minimum": 0
              },
              "include_uncategorized_product": {
                "type": "boolean"
              },
              "purchase_limit": {
                "type": "integer",
                "minimum": 0
              },
              "brand": {
                "title": "Brands (see GET /v1/products/facets)",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "category": {
                "title": "Categories (see GET /v1/products/facets)",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "product_class": {
                "title": "Product classes",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "upc": {
                "title": "UPCs",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "sku": {
                "title": "Distributor SKUs",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "cost": {
                "type": "object",
                "properties": {
                  "global_restrictions": {
                    "type": "object",
                    "properties": {
                      "min_distributor_cost": {
                        "type": "number",
                        "minimum": 0
                      },
                      "max_distributor_cost": {
                        "type": "number",
                        "minimum": 0
                      }
                    },
                    "required": [
                      "min_distributor_cost",
                      "max_distributor_cost"
                    ],
                    "additionalProperties": false
                  },
                  "product_class_restrictions": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "product_class": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "enum": [
                              "AC",
                              "AG",
                              "AO",
                              "AP",
                              "AR",
                              "BP",
                              "BS",
                              "FA",
                              "FI",
                              "FP",
                              "HS",
                              "HT",
                              "HZ",
                              "KN",
                              "LL",
                              "MG",
                              "MZ",
                              "OP",
                              "OT",
                              "RC",
                              "RL",
                              "SF",
                              "SO"
                            ]
                          }
                        },
                        "min_distributor_cost": {
                          "type": "number",
                          "minimum": 0
                        },
                        "max_distributor_cost": {
                          "type": "number",
                          "minimum": 0
                        }
                      },
                      "required": [
                        "product_class",
                        "min_distributor_cost",
                        "max_distributor_cost"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          },
          "product_feed": {
            "type": "object",
            "properties": {
              "active": {
                "type": "boolean"
              }
            },
            "additionalProperties": false
          },
          "fulfillment": {
            "type": "object",
            "properties": {
              "dealer_customer_number": {
                "type": "string"
              }
            },
            "additionalProperties": false
          }
        },
        "required": [
          "distid",
          "active"
        ],
        "additionalProperties": false
      },
      "DistributorConfigGunAccessorySupply": {
        "title": "Gun Accessory Supply",
        "description": "Configuration entry for Gun Accessory Supply (distid GAS).",
        "type": "object",
        "properties": {
          "distid": {
            "type": "string",
            "enum": [
              "GAS"
            ]
          },
          "active": {
            "type": "boolean"
          },
          "shipping": {
            "title": "Shipping",
            "type": "object",
            "properties": {
              "flat_rate": {
                "type": "object",
                "properties": {
                  "cost": {
                    "type": "number",
                    "minimum": 0
                  },
                  "shipping_class": {
                    "type": "string"
                  }
                },
                "required": [
                  "cost",
                  "shipping_class"
                ],
                "additionalProperties": false
              },
              "price_based_shipping_levels": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "flat_rate": {
                      "type": "object",
                      "properties": {
                        "cost": {
                          "type": "number",
                          "minimum": 0
                        },
                        "shipping_class": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "cost",
                        "shipping_class"
                      ],
                      "additionalProperties": false
                    },
                    "min_unit_cost": {
                      "type": "number",
                      "minimum": 0
                    },
                    "max_unit_cost": {
                      "type": "number",
                      "minimum": 0
                    },
                    "product_class": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "AC",
                          "AG",
                          "AO",
                          "AP",
                          "AR",
                          "BP",
                          "BS",
                          "FA",
                          "FI",
                          "FP",
                          "HS",
                          "HT",
                          "HZ",
                          "KN",
                          "LL",
                          "MG",
                          "MZ",
                          "OP",
                          "OT",
                          "RC",
                          "RL",
                          "SF",
                          "SO"
                        ]
                      }
                    }
                  },
                  "required": [
                    "flat_rate",
                    "min_unit_cost"
                  ],
                  "additionalProperties": false
                }
              },
              "insurance": {
                "type": "object",
                "properties": {
                  "include": {
                    "type": "boolean"
                  },
                  "cost_per_hundred": {
                    "type": "number",
                    "minimum": 0
                  }
                },
                "required": [
                  "include"
                ],
                "additionalProperties": false
              },
              "handling": {
                "type": "object",
                "properties": {
                  "amount": {
                    "type": "number",
                    "minimum": 0
                  },
                  "order_threshold": {
                    "type": "number",
                    "minimum": 0
                  },
                  "add_handling_to_unit_cost": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "amount",
                  "order_threshold",
                  "add_handling_to_unit_cost"
                ],
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          },
          "drop_ship_only_items": {
            "type": "boolean"
          },
          "product_restrictions": {
            "title": "Product Restrictions",
            "type": "object",
            "properties": {
              "min_quantity_to_list": {
                "type": "integer",
                "minimum": 0
              },
              "include_uncategorized_product": {
                "type": "boolean"
              },
              "purchase_limit": {
                "type": "integer",
                "minimum": 0
              },
              "brand": {
                "title": "Brands (see GET /v1/products/facets)",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "category": {
                "title": "Categories (see GET /v1/products/facets)",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "product_class": {
                "title": "Product classes",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "upc": {
                "title": "UPCs",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "sku": {
                "title": "Distributor SKUs",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "cost": {
                "type": "object",
                "properties": {
                  "global_restrictions": {
                    "type": "object",
                    "properties": {
                      "min_distributor_cost": {
                        "type": "number",
                        "minimum": 0
                      },
                      "max_distributor_cost": {
                        "type": "number",
                        "minimum": 0
                      }
                    },
                    "required": [
                      "min_distributor_cost",
                      "max_distributor_cost"
                    ],
                    "additionalProperties": false
                  },
                  "product_class_restrictions": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "product_class": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "enum": [
                              "AC",
                              "AG",
                              "AO",
                              "AP",
                              "AR",
                              "BP",
                              "BS",
                              "FA",
                              "FI",
                              "FP",
                              "HS",
                              "HT",
                              "HZ",
                              "KN",
                              "LL",
                              "MG",
                              "MZ",
                              "OP",
                              "OT",
                              "RC",
                              "RL",
                              "SF",
                              "SO"
                            ]
                          }
                        },
                        "min_distributor_cost": {
                          "type": "number",
                          "minimum": 0
                        },
                        "max_distributor_cost": {
                          "type": "number",
                          "minimum": 0
                        }
                      },
                      "required": [
                        "product_class",
                        "min_distributor_cost",
                        "max_distributor_cost"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          },
          "product_feed": {
            "type": "object",
            "properties": {
              "active": {
                "type": "boolean"
              }
            },
            "additionalProperties": false
          },
          "fulfillment": {
            "type": "object",
            "properties": {
              "ffl_recipient_emails": {
                "type": "array",
                "items": {
                  "type": "string",
                  "format": "email"
                }
              }
            },
            "additionalProperties": false
          }
        },
        "required": [
          "distid",
          "active"
        ],
        "additionalProperties": false
      },
      "DistributorConfigHicksInc": {
        "title": "Hicks Inc",
        "description": "Configuration entry for Hicks Inc (distid HCKS).",
        "type": "object",
        "properties": {
          "distid": {
            "type": "string",
            "enum": [
              "HCKS"
            ]
          },
          "active": {
            "type": "boolean"
          },
          "shipping": {
            "title": "Shipping",
            "type": "object",
            "properties": {
              "flat_rate": {
                "type": "object",
                "properties": {
                  "cost": {
                    "type": "number",
                    "minimum": 0
                  },
                  "shipping_class": {
                    "type": "string"
                  }
                },
                "required": [
                  "cost",
                  "shipping_class"
                ],
                "additionalProperties": false
              },
              "price_based_shipping_levels": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "flat_rate": {
                      "type": "object",
                      "properties": {
                        "cost": {
                          "type": "number",
                          "minimum": 0
                        },
                        "shipping_class": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "cost",
                        "shipping_class"
                      ],
                      "additionalProperties": false
                    },
                    "min_unit_cost": {
                      "type": "number",
                      "minimum": 0
                    },
                    "max_unit_cost": {
                      "type": "number",
                      "minimum": 0
                    },
                    "product_class": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "AC",
                          "AG",
                          "AO",
                          "AP",
                          "AR",
                          "BP",
                          "BS",
                          "FA",
                          "FI",
                          "FP",
                          "HS",
                          "HT",
                          "HZ",
                          "KN",
                          "LL",
                          "MG",
                          "MZ",
                          "OP",
                          "OT",
                          "RC",
                          "RL",
                          "SF",
                          "SO"
                        ]
                      }
                    }
                  },
                  "required": [
                    "flat_rate",
                    "min_unit_cost"
                  ],
                  "additionalProperties": false
                }
              },
              "insurance": {
                "type": "object",
                "properties": {
                  "include": {
                    "type": "boolean"
                  },
                  "cost_per_hundred": {
                    "type": "number",
                    "minimum": 0
                  }
                },
                "required": [
                  "include"
                ],
                "additionalProperties": false
              },
              "handling": {
                "type": "object",
                "properties": {
                  "amount": {
                    "type": "number",
                    "minimum": 0
                  },
                  "order_threshold": {
                    "type": "number",
                    "minimum": 0
                  },
                  "add_handling_to_unit_cost": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "amount",
                  "order_threshold",
                  "add_handling_to_unit_cost"
                ],
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          },
          "drop_ship_only_items": {
            "type": "boolean"
          },
          "product_restrictions": {
            "title": "Product Restrictions",
            "type": "object",
            "properties": {
              "min_quantity_to_list": {
                "type": "integer",
                "minimum": 0
              },
              "include_uncategorized_product": {
                "type": "boolean"
              },
              "purchase_limit": {
                "type": "integer",
                "minimum": 0
              },
              "brand": {
                "title": "Brands (see GET /v1/products/facets)",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "category": {
                "title": "Categories (see GET /v1/products/facets)",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "product_class": {
                "title": "Product classes",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "upc": {
                "title": "UPCs",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "sku": {
                "title": "Distributor SKUs",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "cost": {
                "type": "object",
                "properties": {
                  "global_restrictions": {
                    "type": "object",
                    "properties": {
                      "min_distributor_cost": {
                        "type": "number",
                        "minimum": 0
                      },
                      "max_distributor_cost": {
                        "type": "number",
                        "minimum": 0
                      }
                    },
                    "required": [
                      "min_distributor_cost",
                      "max_distributor_cost"
                    ],
                    "additionalProperties": false
                  },
                  "product_class_restrictions": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "product_class": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "enum": [
                              "AC",
                              "AG",
                              "AO",
                              "AP",
                              "AR",
                              "BP",
                              "BS",
                              "FA",
                              "FI",
                              "FP",
                              "HS",
                              "HT",
                              "HZ",
                              "KN",
                              "LL",
                              "MG",
                              "MZ",
                              "OP",
                              "OT",
                              "RC",
                              "RL",
                              "SF",
                              "SO"
                            ]
                          }
                        },
                        "min_distributor_cost": {
                          "type": "number",
                          "minimum": 0
                        },
                        "max_distributor_cost": {
                          "type": "number",
                          "minimum": 0
                        }
                      },
                      "required": [
                        "product_class",
                        "min_distributor_cost",
                        "max_distributor_cost"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          },
          "product_feed": {
            "type": "object",
            "properties": {
              "active": {
                "type": "boolean"
              }
            },
            "additionalProperties": false
          },
          "fulfillment": {
            "type": "object",
            "properties": {
              "ffl_recipient_emails": {
                "type": "array",
                "items": {
                  "type": "string",
                  "format": "email"
                }
              }
            },
            "additionalProperties": false
          }
        },
        "required": [
          "distid",
          "active"
        ],
        "additionalProperties": false
      },
      "DistributorConfigIronValley": {
        "title": "Iron Valley",
        "description": "Configuration entry for Iron Valley (distid IRV).",
        "type": "object",
        "properties": {
          "distid": {
            "type": "string",
            "enum": [
              "IRV"
            ]
          },
          "active": {
            "type": "boolean"
          },
          "shipping": {
            "title": "Shipping",
            "type": "object",
            "properties": {
              "flat_rate": {
                "type": "object",
                "properties": {
                  "cost": {
                    "type": "number",
                    "minimum": 0
                  },
                  "shipping_class": {
                    "type": "string"
                  }
                },
                "required": [
                  "cost",
                  "shipping_class"
                ],
                "additionalProperties": false
              },
              "price_based_shipping_levels": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "flat_rate": {
                      "type": "object",
                      "properties": {
                        "cost": {
                          "type": "number",
                          "minimum": 0
                        },
                        "shipping_class": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "cost",
                        "shipping_class"
                      ],
                      "additionalProperties": false
                    },
                    "min_unit_cost": {
                      "type": "number",
                      "minimum": 0
                    },
                    "max_unit_cost": {
                      "type": "number",
                      "minimum": 0
                    },
                    "product_class": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "AC",
                          "AG",
                          "AO",
                          "AP",
                          "AR",
                          "BP",
                          "BS",
                          "FA",
                          "FI",
                          "FP",
                          "HS",
                          "HT",
                          "HZ",
                          "KN",
                          "LL",
                          "MG",
                          "MZ",
                          "OP",
                          "OT",
                          "RC",
                          "RL",
                          "SF",
                          "SO"
                        ]
                      }
                    }
                  },
                  "required": [
                    "flat_rate",
                    "min_unit_cost"
                  ],
                  "additionalProperties": false
                }
              },
              "insurance": {
                "type": "object",
                "properties": {
                  "include": {
                    "type": "boolean"
                  },
                  "cost_per_hundred": {
                    "type": "number",
                    "minimum": 0
                  }
                },
                "required": [
                  "include"
                ],
                "additionalProperties": false
              },
              "handling": {
                "type": "object",
                "properties": {
                  "amount": {
                    "type": "number",
                    "minimum": 0
                  },
                  "order_threshold": {
                    "type": "number",
                    "minimum": 0
                  },
                  "add_handling_to_unit_cost": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "amount",
                  "order_threshold",
                  "add_handling_to_unit_cost"
                ],
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          },
          "drop_ship_only_items": {
            "type": "boolean"
          },
          "product_restrictions": {
            "title": "Product Restrictions",
            "type": "object",
            "properties": {
              "min_quantity_to_list": {
                "type": "integer",
                "minimum": 0
              },
              "include_uncategorized_product": {
                "type": "boolean"
              },
              "purchase_limit": {
                "type": "integer",
                "minimum": 0
              },
              "brand": {
                "title": "Brands (see GET /v1/products/facets)",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "category": {
                "title": "Categories (see GET /v1/products/facets)",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "product_class": {
                "title": "Product classes",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "upc": {
                "title": "UPCs",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "sku": {
                "title": "Distributor SKUs",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "cost": {
                "type": "object",
                "properties": {
                  "global_restrictions": {
                    "type": "object",
                    "properties": {
                      "min_distributor_cost": {
                        "type": "number",
                        "minimum": 0
                      },
                      "max_distributor_cost": {
                        "type": "number",
                        "minimum": 0
                      }
                    },
                    "required": [
                      "min_distributor_cost",
                      "max_distributor_cost"
                    ],
                    "additionalProperties": false
                  },
                  "product_class_restrictions": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "product_class": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "enum": [
                              "AC",
                              "AG",
                              "AO",
                              "AP",
                              "AR",
                              "BP",
                              "BS",
                              "FA",
                              "FI",
                              "FP",
                              "HS",
                              "HT",
                              "HZ",
                              "KN",
                              "LL",
                              "MG",
                              "MZ",
                              "OP",
                              "OT",
                              "RC",
                              "RL",
                              "SF",
                              "SO"
                            ]
                          }
                        },
                        "min_distributor_cost": {
                          "type": "number",
                          "minimum": 0
                        },
                        "max_distributor_cost": {
                          "type": "number",
                          "minimum": 0
                        }
                      },
                      "required": [
                        "product_class",
                        "min_distributor_cost",
                        "max_distributor_cost"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          },
          "product_feed": {
            "type": "object",
            "properties": {
              "active": {
                "type": "boolean"
              }
            },
            "additionalProperties": false
          },
          "fulfillment": {
            "type": "object",
            "properties": {
              "customer_number": {
                "type": "string"
              },
              "ffl_recipient_emails": {
                "type": "array",
                "items": {
                  "type": "string",
                  "format": "email"
                }
              }
            },
            "additionalProperties": false
          }
        },
        "required": [
          "distid",
          "active"
        ],
        "additionalProperties": false
      },
      "DistributorConfigKinseys": {
        "title": "Kinseys",
        "description": "Configuration entry for Kinseys (distid KIN).",
        "type": "object",
        "properties": {
          "distid": {
            "type": "string",
            "enum": [
              "KIN"
            ]
          },
          "active": {
            "type": "boolean"
          },
          "shipping": {
            "title": "Shipping",
            "type": "object",
            "properties": {
              "flat_rate": {
                "type": "object",
                "properties": {
                  "cost": {
                    "type": "number",
                    "minimum": 0
                  },
                  "shipping_class": {
                    "type": "string"
                  }
                },
                "required": [
                  "cost",
                  "shipping_class"
                ],
                "additionalProperties": false
              },
              "price_based_shipping_levels": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "flat_rate": {
                      "type": "object",
                      "properties": {
                        "cost": {
                          "type": "number",
                          "minimum": 0
                        },
                        "shipping_class": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "cost",
                        "shipping_class"
                      ],
                      "additionalProperties": false
                    },
                    "min_unit_cost": {
                      "type": "number",
                      "minimum": 0
                    },
                    "max_unit_cost": {
                      "type": "number",
                      "minimum": 0
                    },
                    "product_class": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "AC",
                          "AG",
                          "AO",
                          "AP",
                          "AR",
                          "BP",
                          "BS",
                          "FA",
                          "FI",
                          "FP",
                          "HS",
                          "HT",
                          "HZ",
                          "KN",
                          "LL",
                          "MG",
                          "MZ",
                          "OP",
                          "OT",
                          "RC",
                          "RL",
                          "SF",
                          "SO"
                        ]
                      }
                    }
                  },
                  "required": [
                    "flat_rate",
                    "min_unit_cost"
                  ],
                  "additionalProperties": false
                }
              },
              "insurance": {
                "type": "object",
                "properties": {
                  "include": {
                    "type": "boolean"
                  },
                  "cost_per_hundred": {
                    "type": "number",
                    "minimum": 0
                  }
                },
                "required": [
                  "include"
                ],
                "additionalProperties": false
              },
              "handling": {
                "type": "object",
                "properties": {
                  "amount": {
                    "type": "number",
                    "minimum": 0
                  },
                  "order_threshold": {
                    "type": "number",
                    "minimum": 0
                  },
                  "add_handling_to_unit_cost": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "amount",
                  "order_threshold",
                  "add_handling_to_unit_cost"
                ],
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          },
          "drop_ship_only_items": {
            "type": "boolean"
          },
          "product_restrictions": {
            "title": "Product Restrictions",
            "type": "object",
            "properties": {
              "min_quantity_to_list": {
                "type": "integer",
                "minimum": 0
              },
              "include_uncategorized_product": {
                "type": "boolean"
              },
              "purchase_limit": {
                "type": "integer",
                "minimum": 0
              },
              "brand": {
                "title": "Brands (see GET /v1/products/facets)",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "category": {
                "title": "Categories (see GET /v1/products/facets)",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "product_class": {
                "title": "Product classes",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "upc": {
                "title": "UPCs",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "sku": {
                "title": "Distributor SKUs",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "cost": {
                "type": "object",
                "properties": {
                  "global_restrictions": {
                    "type": "object",
                    "properties": {
                      "min_distributor_cost": {
                        "type": "number",
                        "minimum": 0
                      },
                      "max_distributor_cost": {
                        "type": "number",
                        "minimum": 0
                      }
                    },
                    "required": [
                      "min_distributor_cost",
                      "max_distributor_cost"
                    ],
                    "additionalProperties": false
                  },
                  "product_class_restrictions": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "product_class": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "enum": [
                              "AC",
                              "AG",
                              "AO",
                              "AP",
                              "AR",
                              "BP",
                              "BS",
                              "FA",
                              "FI",
                              "FP",
                              "HS",
                              "HT",
                              "HZ",
                              "KN",
                              "LL",
                              "MG",
                              "MZ",
                              "OP",
                              "OT",
                              "RC",
                              "RL",
                              "SF",
                              "SO"
                            ]
                          }
                        },
                        "min_distributor_cost": {
                          "type": "number",
                          "minimum": 0
                        },
                        "max_distributor_cost": {
                          "type": "number",
                          "minimum": 0
                        }
                      },
                      "required": [
                        "product_class",
                        "min_distributor_cost",
                        "max_distributor_cost"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          },
          "product_feed": {
            "type": "object",
            "properties": {
              "active": {
                "type": "boolean"
              }
            },
            "additionalProperties": false
          },
          "fulfillment": {
            "type": "object",
            "properties": {
              "api_key": {
                "type": "string"
              },
              "dealer_api_key": {
                "type": "string"
              },
              "ffl_recipient_emails": {
                "type": "array",
                "items": {
                  "type": "string",
                  "format": "email"
                }
              }
            },
            "additionalProperties": false
          }
        },
        "required": [
          "distid",
          "active"
        ],
        "additionalProperties": false
      },
      "DistributorConfigKroll": {
        "title": "Kroll",
        "description": "Configuration entry for Kroll (distid KRL).",
        "type": "object",
        "properties": {
          "distid": {
            "type": "string",
            "enum": [
              "KRL"
            ]
          },
          "active": {
            "type": "boolean"
          },
          "shipping": {
            "title": "Shipping",
            "type": "object",
            "properties": {
              "flat_rate": {
                "type": "object",
                "properties": {
                  "cost": {
                    "type": "number",
                    "minimum": 0
                  },
                  "shipping_class": {
                    "type": "string"
                  }
                },
                "required": [
                  "cost",
                  "shipping_class"
                ],
                "additionalProperties": false
              },
              "price_based_shipping_levels": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "flat_rate": {
                      "type": "object",
                      "properties": {
                        "cost": {
                          "type": "number",
                          "minimum": 0
                        },
                        "shipping_class": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "cost",
                        "shipping_class"
                      ],
                      "additionalProperties": false
                    },
                    "min_unit_cost": {
                      "type": "number",
                      "minimum": 0
                    },
                    "max_unit_cost": {
                      "type": "number",
                      "minimum": 0
                    },
                    "product_class": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "AC",
                          "AG",
                          "AO",
                          "AP",
                          "AR",
                          "BP",
                          "BS",
                          "FA",
                          "FI",
                          "FP",
                          "HS",
                          "HT",
                          "HZ",
                          "KN",
                          "LL",
                          "MG",
                          "MZ",
                          "OP",
                          "OT",
                          "RC",
                          "RL",
                          "SF",
                          "SO"
                        ]
                      }
                    }
                  },
                  "required": [
                    "flat_rate",
                    "min_unit_cost"
                  ],
                  "additionalProperties": false
                }
              },
              "insurance": {
                "type": "object",
                "properties": {
                  "include": {
                    "type": "boolean"
                  },
                  "cost_per_hundred": {
                    "type": "number",
                    "minimum": 0
                  }
                },
                "required": [
                  "include"
                ],
                "additionalProperties": false
              },
              "handling": {
                "type": "object",
                "properties": {
                  "amount": {
                    "type": "number",
                    "minimum": 0
                  },
                  "order_threshold": {
                    "type": "number",
                    "minimum": 0
                  },
                  "add_handling_to_unit_cost": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "amount",
                  "order_threshold",
                  "add_handling_to_unit_cost"
                ],
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          },
          "drop_ship_only_items": {
            "type": "boolean"
          },
          "product_restrictions": {
            "title": "Product Restrictions",
            "type": "object",
            "properties": {
              "min_quantity_to_list": {
                "type": "integer",
                "minimum": 0
              },
              "include_uncategorized_product": {
                "type": "boolean"
              },
              "purchase_limit": {
                "type": "integer",
                "minimum": 0
              },
              "brand": {
                "title": "Brands (see GET /v1/products/facets)",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "category": {
                "title": "Categories (see GET /v1/products/facets)",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "product_class": {
                "title": "Product classes",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "upc": {
                "title": "UPCs",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "sku": {
                "title": "Distributor SKUs",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "cost": {
                "type": "object",
                "properties": {
                  "global_restrictions": {
                    "type": "object",
                    "properties": {
                      "min_distributor_cost": {
                        "type": "number",
                        "minimum": 0
                      },
                      "max_distributor_cost": {
                        "type": "number",
                        "minimum": 0
                      }
                    },
                    "required": [
                      "min_distributor_cost",
                      "max_distributor_cost"
                    ],
                    "additionalProperties": false
                  },
                  "product_class_restrictions": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "product_class": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "enum": [
                              "AC",
                              "AG",
                              "AO",
                              "AP",
                              "AR",
                              "BP",
                              "BS",
                              "FA",
                              "FI",
                              "FP",
                              "HS",
                              "HT",
                              "HZ",
                              "KN",
                              "LL",
                              "MG",
                              "MZ",
                              "OP",
                              "OT",
                              "RC",
                              "RL",
                              "SF",
                              "SO"
                            ]
                          }
                        },
                        "min_distributor_cost": {
                          "type": "number",
                          "minimum": 0
                        },
                        "max_distributor_cost": {
                          "type": "number",
                          "minimum": 0
                        }
                      },
                      "required": [
                        "product_class",
                        "min_distributor_cost",
                        "max_distributor_cost"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          },
          "product_feed": {
            "type": "object",
            "properties": {
              "active": {
                "type": "boolean"
              }
            },
            "additionalProperties": false
          },
          "fulfillment": {
            "type": "object",
            "properties": {
              "dealer_account_number": {
                "type": "string"
              },
              "api_user": {
                "type": "string"
              },
              "api_key": {
                "type": "string"
              },
              "payment_method": {
                "type": "string"
              },
              "credit_card_last_four": {
                "type": "string"
              },
              "ffl_recipient_emails": {
                "type": "array",
                "items": {
                  "type": "string",
                  "format": "email"
                }
              }
            },
            "additionalProperties": false
          }
        },
        "required": [
          "distid",
          "active"
        ],
        "additionalProperties": false
      },
      "DistributorConfigLibertyMountain": {
        "title": "Liberty Mountain",
        "description": "Configuration entry for Liberty Mountain (distid LIB).",
        "type": "object",
        "properties": {
          "distid": {
            "type": "string",
            "enum": [
              "LIB"
            ]
          },
          "active": {
            "type": "boolean"
          },
          "shipping": {
            "title": "Shipping",
            "type": "object",
            "properties": {
              "flat_rate": {
                "type": "object",
                "properties": {
                  "cost": {
                    "type": "number",
                    "minimum": 0
                  },
                  "shipping_class": {
                    "type": "string"
                  }
                },
                "required": [
                  "cost",
                  "shipping_class"
                ],
                "additionalProperties": false
              },
              "price_based_shipping_levels": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "flat_rate": {
                      "type": "object",
                      "properties": {
                        "cost": {
                          "type": "number",
                          "minimum": 0
                        },
                        "shipping_class": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "cost",
                        "shipping_class"
                      ],
                      "additionalProperties": false
                    },
                    "min_unit_cost": {
                      "type": "number",
                      "minimum": 0
                    },
                    "max_unit_cost": {
                      "type": "number",
                      "minimum": 0
                    },
                    "product_class": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "AC",
                          "AG",
                          "AO",
                          "AP",
                          "AR",
                          "BP",
                          "BS",
                          "FA",
                          "FI",
                          "FP",
                          "HS",
                          "HT",
                          "HZ",
                          "KN",
                          "LL",
                          "MG",
                          "MZ",
                          "OP",
                          "OT",
                          "RC",
                          "RL",
                          "SF",
                          "SO"
                        ]
                      }
                    }
                  },
                  "required": [
                    "flat_rate",
                    "min_unit_cost"
                  ],
                  "additionalProperties": false
                }
              },
              "insurance": {
                "type": "object",
                "properties": {
                  "include": {
                    "type": "boolean"
                  },
                  "cost_per_hundred": {
                    "type": "number",
                    "minimum": 0
                  }
                },
                "required": [
                  "include"
                ],
                "additionalProperties": false
              },
              "handling": {
                "type": "object",
                "properties": {
                  "amount": {
                    "type": "number",
                    "minimum": 0
                  },
                  "order_threshold": {
                    "type": "number",
                    "minimum": 0
                  },
                  "add_handling_to_unit_cost": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "amount",
                  "order_threshold",
                  "add_handling_to_unit_cost"
                ],
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          },
          "drop_ship_only_items": {
            "type": "boolean"
          },
          "product_restrictions": {
            "title": "Product Restrictions",
            "type": "object",
            "properties": {
              "min_quantity_to_list": {
                "type": "integer",
                "minimum": 0
              },
              "include_uncategorized_product": {
                "type": "boolean"
              },
              "purchase_limit": {
                "type": "integer",
                "minimum": 0
              },
              "brand": {
                "title": "Brands (see GET /v1/products/facets)",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "category": {
                "title": "Categories (see GET /v1/products/facets)",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "product_class": {
                "title": "Product classes",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "upc": {
                "title": "UPCs",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "sku": {
                "title": "Distributor SKUs",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "cost": {
                "type": "object",
                "properties": {
                  "global_restrictions": {
                    "type": "object",
                    "properties": {
                      "min_distributor_cost": {
                        "type": "number",
                        "minimum": 0
                      },
                      "max_distributor_cost": {
                        "type": "number",
                        "minimum": 0
                      }
                    },
                    "required": [
                      "min_distributor_cost",
                      "max_distributor_cost"
                    ],
                    "additionalProperties": false
                  },
                  "product_class_restrictions": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "product_class": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "enum": [
                              "AC",
                              "AG",
                              "AO",
                              "AP",
                              "AR",
                              "BP",
                              "BS",
                              "FA",
                              "FI",
                              "FP",
                              "HS",
                              "HT",
                              "HZ",
                              "KN",
                              "LL",
                              "MG",
                              "MZ",
                              "OP",
                              "OT",
                              "RC",
                              "RL",
                              "SF",
                              "SO"
                            ]
                          }
                        },
                        "min_distributor_cost": {
                          "type": "number",
                          "minimum": 0
                        },
                        "max_distributor_cost": {
                          "type": "number",
                          "minimum": 0
                        }
                      },
                      "required": [
                        "product_class",
                        "min_distributor_cost",
                        "max_distributor_cost"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          },
          "product_feed": {
            "type": "object",
            "properties": {
              "active": {
                "type": "boolean"
              }
            },
            "additionalProperties": false
          },
          "fulfillment": {
            "type": "object",
            "properties": {
              "ftp_user": {
                "type": "string"
              },
              "ftp_password": {
                "type": "string"
              },
              "order_email": {
                "type": "string"
              }
            },
            "additionalProperties": false
          }
        },
        "required": [
          "distid",
          "active"
        ],
        "additionalProperties": false
      },
      "DistributorConfigLipseys": {
        "title": "Lipseys",
        "description": "Configuration entry for Lipseys (distid LIP).",
        "type": "object",
        "properties": {
          "distid": {
            "type": "string",
            "enum": [
              "LIP"
            ]
          },
          "active": {
            "type": "boolean"
          },
          "shipping": {
            "title": "Shipping",
            "type": "object",
            "properties": {
              "flat_rate": {
                "type": "object",
                "properties": {
                  "cost": {
                    "type": "number",
                    "minimum": 0
                  },
                  "shipping_class": {
                    "type": "string"
                  }
                },
                "required": [
                  "cost",
                  "shipping_class"
                ],
                "additionalProperties": false
              },
              "price_based_shipping_levels": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "flat_rate": {
                      "type": "object",
                      "properties": {
                        "cost": {
                          "type": "number",
                          "minimum": 0
                        },
                        "shipping_class": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "cost",
                        "shipping_class"
                      ],
                      "additionalProperties": false
                    },
                    "min_unit_cost": {
                      "type": "number",
                      "minimum": 0
                    },
                    "max_unit_cost": {
                      "type": "number",
                      "minimum": 0
                    },
                    "product_class": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "AC",
                          "AG",
                          "AO",
                          "AP",
                          "AR",
                          "BP",
                          "BS",
                          "FA",
                          "FI",
                          "FP",
                          "HS",
                          "HT",
                          "HZ",
                          "KN",
                          "LL",
                          "MG",
                          "MZ",
                          "OP",
                          "OT",
                          "RC",
                          "RL",
                          "SF",
                          "SO"
                        ]
                      }
                    }
                  },
                  "required": [
                    "flat_rate",
                    "min_unit_cost"
                  ],
                  "additionalProperties": false
                }
              },
              "insurance": {
                "type": "object",
                "properties": {
                  "include": {
                    "type": "boolean"
                  },
                  "cost_per_hundred": {
                    "type": "number",
                    "minimum": 0
                  }
                },
                "required": [
                  "include"
                ],
                "additionalProperties": false
              },
              "handling": {
                "type": "object",
                "properties": {
                  "amount": {
                    "type": "number",
                    "minimum": 0
                  },
                  "order_threshold": {
                    "type": "number",
                    "minimum": 0
                  },
                  "add_handling_to_unit_cost": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "amount",
                  "order_threshold",
                  "add_handling_to_unit_cost"
                ],
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          },
          "drop_ship_only_items": {
            "type": "boolean"
          },
          "product_restrictions": {
            "title": "Product Restrictions",
            "type": "object",
            "properties": {
              "min_quantity_to_list": {
                "type": "integer",
                "minimum": 0
              },
              "include_uncategorized_product": {
                "type": "boolean"
              },
              "purchase_limit": {
                "type": "integer",
                "minimum": 0
              },
              "brand": {
                "title": "Brands (see GET /v1/products/facets)",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "category": {
                "title": "Categories (see GET /v1/products/facets)",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "product_class": {
                "title": "Product classes",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "upc": {
                "title": "UPCs",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "sku": {
                "title": "Distributor SKUs",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "cost": {
                "type": "object",
                "properties": {
                  "global_restrictions": {
                    "type": "object",
                    "properties": {
                      "min_distributor_cost": {
                        "type": "number",
                        "minimum": 0
                      },
                      "max_distributor_cost": {
                        "type": "number",
                        "minimum": 0
                      }
                    },
                    "required": [
                      "min_distributor_cost",
                      "max_distributor_cost"
                    ],
                    "additionalProperties": false
                  },
                  "product_class_restrictions": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "product_class": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "enum": [
                              "AC",
                              "AG",
                              "AO",
                              "AP",
                              "AR",
                              "BP",
                              "BS",
                              "FA",
                              "FI",
                              "FP",
                              "HS",
                              "HT",
                              "HZ",
                              "KN",
                              "LL",
                              "MG",
                              "MZ",
                              "OP",
                              "OT",
                              "RC",
                              "RL",
                              "SF",
                              "SO"
                            ]
                          }
                        },
                        "min_distributor_cost": {
                          "type": "number",
                          "minimum": 0
                        },
                        "max_distributor_cost": {
                          "type": "number",
                          "minimum": 0
                        }
                      },
                      "required": [
                        "product_class",
                        "min_distributor_cost",
                        "max_distributor_cost"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          },
          "product_feed": {
            "type": "object",
            "properties": {
              "active": {
                "type": "boolean"
              }
            },
            "additionalProperties": false
          },
          "fulfillment": {
            "type": "object",
            "properties": {
              "API_HOST": {
                "type": "string"
              },
              "API_USER": {
                "type": "string"
              },
              "API_PASSWORD": {
                "type": "string"
              },
              "ffl_recipient_emails": {
                "type": "array",
                "items": {
                  "type": "string",
                  "format": "email"
                }
              },
              "ship_to_store": {
                "type": "object",
                "properties": {
                  "API_USER": {
                    "type": "string"
                  },
                  "API_PASSWORD": {
                    "type": "string"
                  }
                },
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          }
        },
        "required": [
          "distid",
          "active"
        ],
        "additionalProperties": false
      },
      "DistributorConfigMGE": {
        "title": "MGE",
        "description": "Configuration entry for MGE (distid MGE).",
        "type": "object",
        "properties": {
          "distid": {
            "type": "string",
            "enum": [
              "MGE"
            ]
          },
          "active": {
            "type": "boolean"
          },
          "shipping": {
            "title": "Shipping",
            "type": "object",
            "properties": {
              "flat_rate": {
                "type": "object",
                "properties": {
                  "cost": {
                    "type": "number",
                    "minimum": 0
                  },
                  "shipping_class": {
                    "type": "string"
                  }
                },
                "required": [
                  "cost",
                  "shipping_class"
                ],
                "additionalProperties": false
              },
              "price_based_shipping_levels": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "flat_rate": {
                      "type": "object",
                      "properties": {
                        "cost": {
                          "type": "number",
                          "minimum": 0
                        },
                        "shipping_class": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "cost",
                        "shipping_class"
                      ],
                      "additionalProperties": false
                    },
                    "min_unit_cost": {
                      "type": "number",
                      "minimum": 0
                    },
                    "max_unit_cost": {
                      "type": "number",
                      "minimum": 0
                    },
                    "product_class": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "AC",
                          "AG",
                          "AO",
                          "AP",
                          "AR",
                          "BP",
                          "BS",
                          "FA",
                          "FI",
                          "FP",
                          "HS",
                          "HT",
                          "HZ",
                          "KN",
                          "LL",
                          "MG",
                          "MZ",
                          "OP",
                          "OT",
                          "RC",
                          "RL",
                          "SF",
                          "SO"
                        ]
                      }
                    }
                  },
                  "required": [
                    "flat_rate",
                    "min_unit_cost"
                  ],
                  "additionalProperties": false
                }
              },
              "insurance": {
                "type": "object",
                "properties": {
                  "include": {
                    "type": "boolean"
                  },
                  "cost_per_hundred": {
                    "type": "number",
                    "minimum": 0
                  }
                },
                "required": [
                  "include"
                ],
                "additionalProperties": false
              },
              "handling": {
                "type": "object",
                "properties": {
                  "amount": {
                    "type": "number",
                    "minimum": 0
                  },
                  "order_threshold": {
                    "type": "number",
                    "minimum": 0
                  },
                  "add_handling_to_unit_cost": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "amount",
                  "order_threshold",
                  "add_handling_to_unit_cost"
                ],
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          },
          "drop_ship_only_items": {
            "type": "boolean"
          },
          "product_restrictions": {
            "title": "Product Restrictions",
            "type": "object",
            "properties": {
              "min_quantity_to_list": {
                "type": "integer",
                "minimum": 0
              },
              "include_uncategorized_product": {
                "type": "boolean"
              },
              "purchase_limit": {
                "type": "integer",
                "minimum": 0
              },
              "brand": {
                "title": "Brands (see GET /v1/products/facets)",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "category": {
                "title": "Categories (see GET /v1/products/facets)",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "product_class": {
                "title": "Product classes",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "upc": {
                "title": "UPCs",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "sku": {
                "title": "Distributor SKUs",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "cost": {
                "type": "object",
                "properties": {
                  "global_restrictions": {
                    "type": "object",
                    "properties": {
                      "min_distributor_cost": {
                        "type": "number",
                        "minimum": 0
                      },
                      "max_distributor_cost": {
                        "type": "number",
                        "minimum": 0
                      }
                    },
                    "required": [
                      "min_distributor_cost",
                      "max_distributor_cost"
                    ],
                    "additionalProperties": false
                  },
                  "product_class_restrictions": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "product_class": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "enum": [
                              "AC",
                              "AG",
                              "AO",
                              "AP",
                              "AR",
                              "BP",
                              "BS",
                              "FA",
                              "FI",
                              "FP",
                              "HS",
                              "HT",
                              "HZ",
                              "KN",
                              "LL",
                              "MG",
                              "MZ",
                              "OP",
                              "OT",
                              "RC",
                              "RL",
                              "SF",
                              "SO"
                            ]
                          }
                        },
                        "min_distributor_cost": {
                          "type": "number",
                          "minimum": 0
                        },
                        "max_distributor_cost": {
                          "type": "number",
                          "minimum": 0
                        }
                      },
                      "required": [
                        "product_class",
                        "min_distributor_cost",
                        "max_distributor_cost"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          },
          "product_feed": {
            "type": "object",
            "properties": {
              "active": {
                "type": "boolean"
              }
            },
            "additionalProperties": false
          },
          "fulfillment": {
            "type": "object",
            "properties": {
              "special_instructions": {
                "type": "string"
              },
              "ffl_recipient_emails": {
                "type": "array",
                "items": {
                  "type": "string",
                  "format": "email"
                }
              }
            },
            "additionalProperties": false
          }
        },
        "required": [
          "distid",
          "active"
        ],
        "additionalProperties": false
      },
      "DistributorConfigMSR": {
        "title": "MSR",
        "description": "Configuration entry for MSR (distid MSR).",
        "type": "object",
        "properties": {
          "distid": {
            "type": "string",
            "enum": [
              "MSR"
            ]
          },
          "active": {
            "type": "boolean"
          },
          "shipping": {
            "title": "Shipping",
            "type": "object",
            "properties": {
              "flat_rate": {
                "type": "object",
                "properties": {
                  "cost": {
                    "type": "number",
                    "minimum": 0
                  },
                  "shipping_class": {
                    "type": "string"
                  }
                },
                "required": [
                  "cost",
                  "shipping_class"
                ],
                "additionalProperties": false
              },
              "price_based_shipping_levels": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "flat_rate": {
                      "type": "object",
                      "properties": {
                        "cost": {
                          "type": "number",
                          "minimum": 0
                        },
                        "shipping_class": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "cost",
                        "shipping_class"
                      ],
                      "additionalProperties": false
                    },
                    "min_unit_cost": {
                      "type": "number",
                      "minimum": 0
                    },
                    "max_unit_cost": {
                      "type": "number",
                      "minimum": 0
                    },
                    "product_class": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "AC",
                          "AG",
                          "AO",
                          "AP",
                          "AR",
                          "BP",
                          "BS",
                          "FA",
                          "FI",
                          "FP",
                          "HS",
                          "HT",
                          "HZ",
                          "KN",
                          "LL",
                          "MG",
                          "MZ",
                          "OP",
                          "OT",
                          "RC",
                          "RL",
                          "SF",
                          "SO"
                        ]
                      }
                    }
                  },
                  "required": [
                    "flat_rate",
                    "min_unit_cost"
                  ],
                  "additionalProperties": false
                }
              },
              "insurance": {
                "type": "object",
                "properties": {
                  "include": {
                    "type": "boolean"
                  },
                  "cost_per_hundred": {
                    "type": "number",
                    "minimum": 0
                  }
                },
                "required": [
                  "include"
                ],
                "additionalProperties": false
              },
              "handling": {
                "type": "object",
                "properties": {
                  "amount": {
                    "type": "number",
                    "minimum": 0
                  },
                  "order_threshold": {
                    "type": "number",
                    "minimum": 0
                  },
                  "add_handling_to_unit_cost": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "amount",
                  "order_threshold",
                  "add_handling_to_unit_cost"
                ],
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          },
          "drop_ship_only_items": {
            "type": "boolean"
          },
          "product_restrictions": {
            "title": "Product Restrictions",
            "type": "object",
            "properties": {
              "min_quantity_to_list": {
                "type": "integer",
                "minimum": 0
              },
              "include_uncategorized_product": {
                "type": "boolean"
              },
              "purchase_limit": {
                "type": "integer",
                "minimum": 0
              },
              "brand": {
                "title": "Brands (see GET /v1/products/facets)",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "category": {
                "title": "Categories (see GET /v1/products/facets)",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "product_class": {
                "title": "Product classes",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "upc": {
                "title": "UPCs",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "sku": {
                "title": "Distributor SKUs",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "cost": {
                "type": "object",
                "properties": {
                  "global_restrictions": {
                    "type": "object",
                    "properties": {
                      "min_distributor_cost": {
                        "type": "number",
                        "minimum": 0
                      },
                      "max_distributor_cost": {
                        "type": "number",
                        "minimum": 0
                      }
                    },
                    "required": [
                      "min_distributor_cost",
                      "max_distributor_cost"
                    ],
                    "additionalProperties": false
                  },
                  "product_class_restrictions": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "product_class": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "enum": [
                              "AC",
                              "AG",
                              "AO",
                              "AP",
                              "AR",
                              "BP",
                              "BS",
                              "FA",
                              "FI",
                              "FP",
                              "HS",
                              "HT",
                              "HZ",
                              "KN",
                              "LL",
                              "MG",
                              "MZ",
                              "OP",
                              "OT",
                              "RC",
                              "RL",
                              "SF",
                              "SO"
                            ]
                          }
                        },
                        "min_distributor_cost": {
                          "type": "number",
                          "minimum": 0
                        },
                        "max_distributor_cost": {
                          "type": "number",
                          "minimum": 0
                        }
                      },
                      "required": [
                        "product_class",
                        "min_distributor_cost",
                        "max_distributor_cost"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          },
          "product_feed": {
            "type": "object",
            "properties": {
              "active": {
                "type": "boolean"
              }
            },
            "additionalProperties": false
          },
          "fulfillment": {
            "type": "object",
            "properties": {
              "API_USER": {
                "type": "string"
              },
              "API_PASSWORD": {
                "type": "string"
              },
              "ffl_recipient_emails": {
                "type": "array",
                "items": {
                  "type": "string",
                  "format": "email"
                }
              }
            },
            "additionalProperties": false
          }
        },
        "required": [
          "distid",
          "active"
        ],
        "additionalProperties": false
      },
      "DistributorConfigOrionWholesale": {
        "title": "Orion Wholesale",
        "description": "Configuration entry for Orion Wholesale (distid ORI).",
        "type": "object",
        "properties": {
          "distid": {
            "type": "string",
            "enum": [
              "ORI"
            ]
          },
          "active": {
            "type": "boolean"
          },
          "shipping": {
            "title": "Shipping",
            "type": "object",
            "properties": {
              "flat_rate": {
                "type": "object",
                "properties": {
                  "cost": {
                    "type": "number",
                    "minimum": 0
                  },
                  "shipping_class": {
                    "type": "string"
                  }
                },
                "required": [
                  "cost",
                  "shipping_class"
                ],
                "additionalProperties": false
              },
              "price_based_shipping_levels": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "flat_rate": {
                      "type": "object",
                      "properties": {
                        "cost": {
                          "type": "number",
                          "minimum": 0
                        },
                        "shipping_class": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "cost",
                        "shipping_class"
                      ],
                      "additionalProperties": false
                    },
                    "min_unit_cost": {
                      "type": "number",
                      "minimum": 0
                    },
                    "max_unit_cost": {
                      "type": "number",
                      "minimum": 0
                    },
                    "product_class": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "AC",
                          "AG",
                          "AO",
                          "AP",
                          "AR",
                          "BP",
                          "BS",
                          "FA",
                          "FI",
                          "FP",
                          "HS",
                          "HT",
                          "HZ",
                          "KN",
                          "LL",
                          "MG",
                          "MZ",
                          "OP",
                          "OT",
                          "RC",
                          "RL",
                          "SF",
                          "SO"
                        ]
                      }
                    }
                  },
                  "required": [
                    "flat_rate",
                    "min_unit_cost"
                  ],
                  "additionalProperties": false
                }
              },
              "insurance": {
                "type": "object",
                "properties": {
                  "include": {
                    "type": "boolean"
                  },
                  "cost_per_hundred": {
                    "type": "number",
                    "minimum": 0
                  }
                },
                "required": [
                  "include"
                ],
                "additionalProperties": false
              },
              "handling": {
                "type": "object",
                "properties": {
                  "amount": {
                    "type": "number",
                    "minimum": 0
                  },
                  "order_threshold": {
                    "type": "number",
                    "minimum": 0
                  },
                  "add_handling_to_unit_cost": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "amount",
                  "order_threshold",
                  "add_handling_to_unit_cost"
                ],
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          },
          "drop_ship_only_items": {
            "type": "boolean"
          },
          "product_restrictions": {
            "title": "Product Restrictions",
            "type": "object",
            "properties": {
              "min_quantity_to_list": {
                "type": "integer",
                "minimum": 0
              },
              "include_uncategorized_product": {
                "type": "boolean"
              },
              "purchase_limit": {
                "type": "integer",
                "minimum": 0
              },
              "brand": {
                "title": "Brands (see GET /v1/products/facets)",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "category": {
                "title": "Categories (see GET /v1/products/facets)",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "product_class": {
                "title": "Product classes",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "upc": {
                "title": "UPCs",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "sku": {
                "title": "Distributor SKUs",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "cost": {
                "type": "object",
                "properties": {
                  "global_restrictions": {
                    "type": "object",
                    "properties": {
                      "min_distributor_cost": {
                        "type": "number",
                        "minimum": 0
                      },
                      "max_distributor_cost": {
                        "type": "number",
                        "minimum": 0
                      }
                    },
                    "required": [
                      "min_distributor_cost",
                      "max_distributor_cost"
                    ],
                    "additionalProperties": false
                  },
                  "product_class_restrictions": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "product_class": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "enum": [
                              "AC",
                              "AG",
                              "AO",
                              "AP",
                              "AR",
                              "BP",
                              "BS",
                              "FA",
                              "FI",
                              "FP",
                              "HS",
                              "HT",
                              "HZ",
                              "KN",
                              "LL",
                              "MG",
                              "MZ",
                              "OP",
                              "OT",
                              "RC",
                              "RL",
                              "SF",
                              "SO"
                            ]
                          }
                        },
                        "min_distributor_cost": {
                          "type": "number",
                          "minimum": 0
                        },
                        "max_distributor_cost": {
                          "type": "number",
                          "minimum": 0
                        }
                      },
                      "required": [
                        "product_class",
                        "min_distributor_cost",
                        "max_distributor_cost"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          },
          "product_feed": {
            "type": "object",
            "properties": {
              "active": {
                "type": "boolean"
              }
            },
            "additionalProperties": false
          },
          "fulfillment": {
            "type": "object",
            "properties": {
              "api_key": {
                "type": "string"
              },
              "ffl_recipient_emails": {
                "type": "array",
                "items": {
                  "type": "string",
                  "format": "email"
                }
              }
            },
            "additionalProperties": false
          }
        },
        "required": [
          "distid",
          "active"
        ],
        "additionalProperties": false
      },
      "DistributorConfigRSRGroup": {
        "title": "RSR Group",
        "description": "Configuration entry for RSR Group (distid RSR).",
        "type": "object",
        "properties": {
          "distid": {
            "type": "string",
            "enum": [
              "RSR"
            ]
          },
          "active": {
            "type": "boolean"
          },
          "shipping": {
            "title": "Shipping",
            "type": "object",
            "properties": {
              "flat_rate": {
                "type": "object",
                "properties": {
                  "cost": {
                    "type": "number",
                    "minimum": 0
                  },
                  "shipping_class": {
                    "type": "string"
                  }
                },
                "required": [
                  "cost",
                  "shipping_class"
                ],
                "additionalProperties": false
              },
              "price_based_shipping_levels": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "flat_rate": {
                      "type": "object",
                      "properties": {
                        "cost": {
                          "type": "number",
                          "minimum": 0
                        },
                        "shipping_class": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "cost",
                        "shipping_class"
                      ],
                      "additionalProperties": false
                    },
                    "min_unit_cost": {
                      "type": "number",
                      "minimum": 0
                    },
                    "max_unit_cost": {
                      "type": "number",
                      "minimum": 0
                    },
                    "product_class": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "AC",
                          "AG",
                          "AO",
                          "AP",
                          "AR",
                          "BP",
                          "BS",
                          "FA",
                          "FI",
                          "FP",
                          "HS",
                          "HT",
                          "HZ",
                          "KN",
                          "LL",
                          "MG",
                          "MZ",
                          "OP",
                          "OT",
                          "RC",
                          "RL",
                          "SF",
                          "SO"
                        ]
                      }
                    }
                  },
                  "required": [
                    "flat_rate",
                    "min_unit_cost"
                  ],
                  "additionalProperties": false
                }
              },
              "insurance": {
                "type": "object",
                "properties": {
                  "include": {
                    "type": "boolean"
                  },
                  "cost_per_hundred": {
                    "type": "number",
                    "minimum": 0
                  }
                },
                "required": [
                  "include"
                ],
                "additionalProperties": false
              },
              "handling": {
                "type": "object",
                "properties": {
                  "amount": {
                    "type": "number",
                    "minimum": 0
                  },
                  "order_threshold": {
                    "type": "number",
                    "minimum": 0
                  },
                  "add_handling_to_unit_cost": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "amount",
                  "order_threshold",
                  "add_handling_to_unit_cost"
                ],
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          },
          "drop_ship_only_items": {
            "type": "boolean"
          },
          "product_restrictions": {
            "title": "Product Restrictions",
            "type": "object",
            "properties": {
              "min_quantity_to_list": {
                "type": "integer",
                "minimum": 0
              },
              "include_uncategorized_product": {
                "type": "boolean"
              },
              "purchase_limit": {
                "type": "integer",
                "minimum": 0
              },
              "brand": {
                "title": "Brands (see GET /v1/products/facets)",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "category": {
                "title": "Categories (see GET /v1/products/facets)",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "product_class": {
                "title": "Product classes",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "upc": {
                "title": "UPCs",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "sku": {
                "title": "Distributor SKUs",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "cost": {
                "type": "object",
                "properties": {
                  "global_restrictions": {
                    "type": "object",
                    "properties": {
                      "min_distributor_cost": {
                        "type": "number",
                        "minimum": 0
                      },
                      "max_distributor_cost": {
                        "type": "number",
                        "minimum": 0
                      }
                    },
                    "required": [
                      "min_distributor_cost",
                      "max_distributor_cost"
                    ],
                    "additionalProperties": false
                  },
                  "product_class_restrictions": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "product_class": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "enum": [
                              "AC",
                              "AG",
                              "AO",
                              "AP",
                              "AR",
                              "BP",
                              "BS",
                              "FA",
                              "FI",
                              "FP",
                              "HS",
                              "HT",
                              "HZ",
                              "KN",
                              "LL",
                              "MG",
                              "MZ",
                              "OP",
                              "OT",
                              "RC",
                              "RL",
                              "SF",
                              "SO"
                            ]
                          }
                        },
                        "min_distributor_cost": {
                          "type": "number",
                          "minimum": 0
                        },
                        "max_distributor_cost": {
                          "type": "number",
                          "minimum": 0
                        }
                      },
                      "required": [
                        "product_class",
                        "min_distributor_cost",
                        "max_distributor_cost"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          },
          "product_feed": {
            "type": "object",
            "properties": {
              "active": {
                "type": "boolean"
              }
            },
            "additionalProperties": false
          },
          "fulfillment": {
            "type": "object",
            "properties": {
              "API_HOST": {
                "type": "string"
              },
              "API_USER": {
                "type": [
                  "number",
                  "string"
                ]
              },
              "API_PASSWORD": {
                "type": "string"
              },
              "ffl_recipient_emails": {
                "type": "array",
                "items": {
                  "type": "string",
                  "format": "email"
                }
              },
              "ship_to_store": {
                "type": "object",
                "properties": {
                  "store_account": {
                    "type": [
                      "number",
                      "string"
                    ]
                  },
                  "password": {
                    "type": "string"
                  }
                },
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          }
        },
        "required": [
          "distid",
          "active"
        ],
        "additionalProperties": false
      },
      "DistributorConfigSportsSouth": {
        "title": "Sports South",
        "description": "Configuration entry for Sports South (distid TSW).",
        "type": "object",
        "properties": {
          "distid": {
            "type": "string",
            "enum": [
              "TSW"
            ]
          },
          "active": {
            "type": "boolean"
          },
          "shipping": {
            "title": "Shipping",
            "type": "object",
            "properties": {
              "flat_rate": {
                "type": "object",
                "properties": {
                  "cost": {
                    "type": "number",
                    "minimum": 0
                  },
                  "shipping_class": {
                    "type": "string"
                  }
                },
                "required": [
                  "cost",
                  "shipping_class"
                ],
                "additionalProperties": false
              },
              "price_based_shipping_levels": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "flat_rate": {
                      "type": "object",
                      "properties": {
                        "cost": {
                          "type": "number",
                          "minimum": 0
                        },
                        "shipping_class": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "cost",
                        "shipping_class"
                      ],
                      "additionalProperties": false
                    },
                    "min_unit_cost": {
                      "type": "number",
                      "minimum": 0
                    },
                    "max_unit_cost": {
                      "type": "number",
                      "minimum": 0
                    },
                    "product_class": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "AC",
                          "AG",
                          "AO",
                          "AP",
                          "AR",
                          "BP",
                          "BS",
                          "FA",
                          "FI",
                          "FP",
                          "HS",
                          "HT",
                          "HZ",
                          "KN",
                          "LL",
                          "MG",
                          "MZ",
                          "OP",
                          "OT",
                          "RC",
                          "RL",
                          "SF",
                          "SO"
                        ]
                      }
                    }
                  },
                  "required": [
                    "flat_rate",
                    "min_unit_cost"
                  ],
                  "additionalProperties": false
                }
              },
              "insurance": {
                "type": "object",
                "properties": {
                  "include": {
                    "type": "boolean"
                  },
                  "cost_per_hundred": {
                    "type": "number",
                    "minimum": 0
                  }
                },
                "required": [
                  "include"
                ],
                "additionalProperties": false
              },
              "handling": {
                "type": "object",
                "properties": {
                  "amount": {
                    "type": "number",
                    "minimum": 0
                  },
                  "order_threshold": {
                    "type": "number",
                    "minimum": 0
                  },
                  "add_handling_to_unit_cost": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "amount",
                  "order_threshold",
                  "add_handling_to_unit_cost"
                ],
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          },
          "drop_ship_only_items": {
            "type": "boolean"
          },
          "product_restrictions": {
            "title": "Product Restrictions",
            "type": "object",
            "properties": {
              "min_quantity_to_list": {
                "type": "integer",
                "minimum": 0
              },
              "include_uncategorized_product": {
                "type": "boolean"
              },
              "purchase_limit": {
                "type": "integer",
                "minimum": 0
              },
              "brand": {
                "title": "Brands (see GET /v1/products/facets)",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "category": {
                "title": "Categories (see GET /v1/products/facets)",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "product_class": {
                "title": "Product classes",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "upc": {
                "title": "UPCs",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "sku": {
                "title": "Distributor SKUs",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "cost": {
                "type": "object",
                "properties": {
                  "global_restrictions": {
                    "type": "object",
                    "properties": {
                      "min_distributor_cost": {
                        "type": "number",
                        "minimum": 0
                      },
                      "max_distributor_cost": {
                        "type": "number",
                        "minimum": 0
                      }
                    },
                    "required": [
                      "min_distributor_cost",
                      "max_distributor_cost"
                    ],
                    "additionalProperties": false
                  },
                  "product_class_restrictions": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "product_class": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "enum": [
                              "AC",
                              "AG",
                              "AO",
                              "AP",
                              "AR",
                              "BP",
                              "BS",
                              "FA",
                              "FI",
                              "FP",
                              "HS",
                              "HT",
                              "HZ",
                              "KN",
                              "LL",
                              "MG",
                              "MZ",
                              "OP",
                              "OT",
                              "RC",
                              "RL",
                              "SF",
                              "SO"
                            ]
                          }
                        },
                        "min_distributor_cost": {
                          "type": "number",
                          "minimum": 0
                        },
                        "max_distributor_cost": {
                          "type": "number",
                          "minimum": 0
                        }
                      },
                      "required": [
                        "product_class",
                        "min_distributor_cost",
                        "max_distributor_cost"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          },
          "product_feed": {
            "type": "object",
            "properties": {
              "active": {
                "type": "boolean"
              }
            },
            "additionalProperties": false
          },
          "fulfillment": {
            "type": "object",
            "properties": {
              "api_user": {
                "type": "string"
              },
              "api_password": {
                "type": "string"
              },
              "api_customer_number": {
                "type": "string"
              },
              "ffl_recipient_emails": {
                "type": "array",
                "items": {
                  "type": "string",
                  "format": "email"
                }
              }
            },
            "additionalProperties": false
          }
        },
        "required": [
          "distid",
          "active"
        ],
        "additionalProperties": false
      },
      "DistributorConfigSportsmansSupply": {
        "title": "Sportsmans Supply",
        "description": "Configuration entry for Sportsmans Supply (distid SSI).",
        "type": "object",
        "properties": {
          "distid": {
            "type": "string",
            "enum": [
              "SSI"
            ]
          },
          "active": {
            "type": "boolean"
          },
          "shipping": {
            "title": "Shipping",
            "type": "object",
            "properties": {
              "flat_rate": {
                "type": "object",
                "properties": {
                  "cost": {
                    "type": "number",
                    "minimum": 0
                  },
                  "shipping_class": {
                    "type": "string"
                  }
                },
                "required": [
                  "cost",
                  "shipping_class"
                ],
                "additionalProperties": false
              },
              "price_based_shipping_levels": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "flat_rate": {
                      "type": "object",
                      "properties": {
                        "cost": {
                          "type": "number",
                          "minimum": 0
                        },
                        "shipping_class": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "cost",
                        "shipping_class"
                      ],
                      "additionalProperties": false
                    },
                    "min_unit_cost": {
                      "type": "number",
                      "minimum": 0
                    },
                    "max_unit_cost": {
                      "type": "number",
                      "minimum": 0
                    },
                    "product_class": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "AC",
                          "AG",
                          "AO",
                          "AP",
                          "AR",
                          "BP",
                          "BS",
                          "FA",
                          "FI",
                          "FP",
                          "HS",
                          "HT",
                          "HZ",
                          "KN",
                          "LL",
                          "MG",
                          "MZ",
                          "OP",
                          "OT",
                          "RC",
                          "RL",
                          "SF",
                          "SO"
                        ]
                      }
                    }
                  },
                  "required": [
                    "flat_rate",
                    "min_unit_cost"
                  ],
                  "additionalProperties": false
                }
              },
              "insurance": {
                "type": "object",
                "properties": {
                  "include": {
                    "type": "boolean"
                  },
                  "cost_per_hundred": {
                    "type": "number",
                    "minimum": 0
                  }
                },
                "required": [
                  "include"
                ],
                "additionalProperties": false
              },
              "handling": {
                "type": "object",
                "properties": {
                  "amount": {
                    "type": "number",
                    "minimum": 0
                  },
                  "order_threshold": {
                    "type": "number",
                    "minimum": 0
                  },
                  "add_handling_to_unit_cost": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "amount",
                  "order_threshold",
                  "add_handling_to_unit_cost"
                ],
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          },
          "drop_ship_only_items": {
            "type": "boolean"
          },
          "product_restrictions": {
            "title": "Product Restrictions",
            "type": "object",
            "properties": {
              "min_quantity_to_list": {
                "type": "integer",
                "minimum": 0
              },
              "include_uncategorized_product": {
                "type": "boolean"
              },
              "purchase_limit": {
                "type": "integer",
                "minimum": 0
              },
              "brand": {
                "title": "Brands (see GET /v1/products/facets)",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "category": {
                "title": "Categories (see GET /v1/products/facets)",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "product_class": {
                "title": "Product classes",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "upc": {
                "title": "UPCs",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "sku": {
                "title": "Distributor SKUs",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "cost": {
                "type": "object",
                "properties": {
                  "global_restrictions": {
                    "type": "object",
                    "properties": {
                      "min_distributor_cost": {
                        "type": "number",
                        "minimum": 0
                      },
                      "max_distributor_cost": {
                        "type": "number",
                        "minimum": 0
                      }
                    },
                    "required": [
                      "min_distributor_cost",
                      "max_distributor_cost"
                    ],
                    "additionalProperties": false
                  },
                  "product_class_restrictions": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "product_class": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "enum": [
                              "AC",
                              "AG",
                              "AO",
                              "AP",
                              "AR",
                              "BP",
                              "BS",
                              "FA",
                              "FI",
                              "FP",
                              "HS",
                              "HT",
                              "HZ",
                              "KN",
                              "LL",
                              "MG",
                              "MZ",
                              "OP",
                              "OT",
                              "RC",
                              "RL",
                              "SF",
                              "SO"
                            ]
                          }
                        },
                        "min_distributor_cost": {
                          "type": "number",
                          "minimum": 0
                        },
                        "max_distributor_cost": {
                          "type": "number",
                          "minimum": 0
                        }
                      },
                      "required": [
                        "product_class",
                        "min_distributor_cost",
                        "max_distributor_cost"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          },
          "product_feed": {
            "type": "object",
            "properties": {
              "active": {
                "type": "boolean"
              }
            },
            "additionalProperties": false
          },
          "fulfillment": {
            "type": "object",
            "properties": {
              "ftp_user": {
                "type": "string"
              },
              "ftp_password": {
                "type": "string"
              }
            },
            "additionalProperties": false
          }
        },
        "required": [
          "distid",
          "active"
        ],
        "additionalProperties": false
      },
      "DistributorConfigTGD": {
        "title": "TGD",
        "description": "Configuration entry for TGD (distid TGD).",
        "type": "object",
        "properties": {
          "distid": {
            "type": "string",
            "enum": [
              "TGD"
            ]
          },
          "active": {
            "type": "boolean"
          },
          "shipping": {
            "title": "Shipping",
            "type": "object",
            "properties": {
              "flat_rate": {
                "type": "object",
                "properties": {
                  "cost": {
                    "type": "number",
                    "minimum": 0
                  },
                  "shipping_class": {
                    "type": "string"
                  }
                },
                "required": [
                  "cost",
                  "shipping_class"
                ],
                "additionalProperties": false
              },
              "price_based_shipping_levels": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "flat_rate": {
                      "type": "object",
                      "properties": {
                        "cost": {
                          "type": "number",
                          "minimum": 0
                        },
                        "shipping_class": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "cost",
                        "shipping_class"
                      ],
                      "additionalProperties": false
                    },
                    "min_unit_cost": {
                      "type": "number",
                      "minimum": 0
                    },
                    "max_unit_cost": {
                      "type": "number",
                      "minimum": 0
                    },
                    "product_class": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "AC",
                          "AG",
                          "AO",
                          "AP",
                          "AR",
                          "BP",
                          "BS",
                          "FA",
                          "FI",
                          "FP",
                          "HS",
                          "HT",
                          "HZ",
                          "KN",
                          "LL",
                          "MG",
                          "MZ",
                          "OP",
                          "OT",
                          "RC",
                          "RL",
                          "SF",
                          "SO"
                        ]
                      }
                    }
                  },
                  "required": [
                    "flat_rate",
                    "min_unit_cost"
                  ],
                  "additionalProperties": false
                }
              },
              "insurance": {
                "type": "object",
                "properties": {
                  "include": {
                    "type": "boolean"
                  },
                  "cost_per_hundred": {
                    "type": "number",
                    "minimum": 0
                  }
                },
                "required": [
                  "include"
                ],
                "additionalProperties": false
              },
              "handling": {
                "type": "object",
                "properties": {
                  "amount": {
                    "type": "number",
                    "minimum": 0
                  },
                  "order_threshold": {
                    "type": "number",
                    "minimum": 0
                  },
                  "add_handling_to_unit_cost": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "amount",
                  "order_threshold",
                  "add_handling_to_unit_cost"
                ],
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          },
          "drop_ship_only_items": {
            "type": "boolean"
          },
          "product_restrictions": {
            "title": "Product Restrictions",
            "type": "object",
            "properties": {
              "min_quantity_to_list": {
                "type": "integer",
                "minimum": 0
              },
              "include_uncategorized_product": {
                "type": "boolean"
              },
              "purchase_limit": {
                "type": "integer",
                "minimum": 0
              },
              "brand": {
                "title": "Brands (see GET /v1/products/facets)",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "category": {
                "title": "Categories (see GET /v1/products/facets)",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "product_class": {
                "title": "Product classes",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "upc": {
                "title": "UPCs",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "sku": {
                "title": "Distributor SKUs",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "cost": {
                "type": "object",
                "properties": {
                  "global_restrictions": {
                    "type": "object",
                    "properties": {
                      "min_distributor_cost": {
                        "type": "number",
                        "minimum": 0
                      },
                      "max_distributor_cost": {
                        "type": "number",
                        "minimum": 0
                      }
                    },
                    "required": [
                      "min_distributor_cost",
                      "max_distributor_cost"
                    ],
                    "additionalProperties": false
                  },
                  "product_class_restrictions": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "product_class": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "enum": [
                              "AC",
                              "AG",
                              "AO",
                              "AP",
                              "AR",
                              "BP",
                              "BS",
                              "FA",
                              "FI",
                              "FP",
                              "HS",
                              "HT",
                              "HZ",
                              "KN",
                              "LL",
                              "MG",
                              "MZ",
                              "OP",
                              "OT",
                              "RC",
                              "RL",
                              "SF",
                              "SO"
                            ]
                          }
                        },
                        "min_distributor_cost": {
                          "type": "number",
                          "minimum": 0
                        },
                        "max_distributor_cost": {
                          "type": "number",
                          "minimum": 0
                        }
                      },
                      "required": [
                        "product_class",
                        "min_distributor_cost",
                        "max_distributor_cost"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          },
          "product_feed": {
            "type": "object",
            "properties": {
              "active": {
                "type": "boolean"
              }
            },
            "additionalProperties": false
          },
          "fulfillment": {
            "type": "object",
            "properties": {
              "customer_number": {
                "type": "string"
              },
              "order_email": {
                "type": "string"
              }
            },
            "additionalProperties": false
          }
        },
        "required": [
          "distid",
          "active"
        ],
        "additionalProperties": false
      },
      "DistributorConfigZanders": {
        "title": "Zanders",
        "description": "Configuration entry for Zanders (distid ZND).",
        "type": "object",
        "properties": {
          "distid": {
            "type": "string",
            "enum": [
              "ZND"
            ]
          },
          "active": {
            "type": "boolean"
          },
          "shipping": {
            "title": "Shipping",
            "type": "object",
            "properties": {
              "flat_rate": {
                "type": "object",
                "properties": {
                  "cost": {
                    "type": "number",
                    "minimum": 0
                  },
                  "shipping_class": {
                    "type": "string"
                  }
                },
                "required": [
                  "cost",
                  "shipping_class"
                ],
                "additionalProperties": false
              },
              "price_based_shipping_levels": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "flat_rate": {
                      "type": "object",
                      "properties": {
                        "cost": {
                          "type": "number",
                          "minimum": 0
                        },
                        "shipping_class": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "cost",
                        "shipping_class"
                      ],
                      "additionalProperties": false
                    },
                    "min_unit_cost": {
                      "type": "number",
                      "minimum": 0
                    },
                    "max_unit_cost": {
                      "type": "number",
                      "minimum": 0
                    },
                    "product_class": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "AC",
                          "AG",
                          "AO",
                          "AP",
                          "AR",
                          "BP",
                          "BS",
                          "FA",
                          "FI",
                          "FP",
                          "HS",
                          "HT",
                          "HZ",
                          "KN",
                          "LL",
                          "MG",
                          "MZ",
                          "OP",
                          "OT",
                          "RC",
                          "RL",
                          "SF",
                          "SO"
                        ]
                      }
                    }
                  },
                  "required": [
                    "flat_rate",
                    "min_unit_cost"
                  ],
                  "additionalProperties": false
                }
              },
              "insurance": {
                "type": "object",
                "properties": {
                  "include": {
                    "type": "boolean"
                  },
                  "cost_per_hundred": {
                    "type": "number",
                    "minimum": 0
                  }
                },
                "required": [
                  "include"
                ],
                "additionalProperties": false
              },
              "handling": {
                "type": "object",
                "properties": {
                  "amount": {
                    "type": "number",
                    "minimum": 0
                  },
                  "order_threshold": {
                    "type": "number",
                    "minimum": 0
                  },
                  "add_handling_to_unit_cost": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "amount",
                  "order_threshold",
                  "add_handling_to_unit_cost"
                ],
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          },
          "drop_ship_only_items": {
            "type": "boolean"
          },
          "product_restrictions": {
            "title": "Product Restrictions",
            "type": "object",
            "properties": {
              "min_quantity_to_list": {
                "type": "integer",
                "minimum": 0
              },
              "include_uncategorized_product": {
                "type": "boolean"
              },
              "purchase_limit": {
                "type": "integer",
                "minimum": 0
              },
              "brand": {
                "title": "Brands (see GET /v1/products/facets)",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "category": {
                "title": "Categories (see GET /v1/products/facets)",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "product_class": {
                "title": "Product classes",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "upc": {
                "title": "UPCs",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "sku": {
                "title": "Distributor SKUs",
                "type": "object",
                "properties": {
                  "include_operand": {
                    "type": "string",
                    "enum": [
                      "AND",
                      "OR"
                    ]
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "exclude": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              },
              "cost": {
                "type": "object",
                "properties": {
                  "global_restrictions": {
                    "type": "object",
                    "properties": {
                      "min_distributor_cost": {
                        "type": "number",
                        "minimum": 0
                      },
                      "max_distributor_cost": {
                        "type": "number",
                        "minimum": 0
                      }
                    },
                    "required": [
                      "min_distributor_cost",
                      "max_distributor_cost"
                    ],
                    "additionalProperties": false
                  },
                  "product_class_restrictions": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "product_class": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "enum": [
                              "AC",
                              "AG",
                              "AO",
                              "AP",
                              "AR",
                              "BP",
                              "BS",
                              "FA",
                              "FI",
                              "FP",
                              "HS",
                              "HT",
                              "HZ",
                              "KN",
                              "LL",
                              "MG",
                              "MZ",
                              "OP",
                              "OT",
                              "RC",
                              "RL",
                              "SF",
                              "SO"
                            ]
                          }
                        },
                        "min_distributor_cost": {
                          "type": "number",
                          "minimum": 0
                        },
                        "max_distributor_cost": {
                          "type": "number",
                          "minimum": 0
                        }
                      },
                      "required": [
                        "product_class",
                        "min_distributor_cost",
                        "max_distributor_cost"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          },
          "product_feed": {
            "type": "object",
            "properties": {
              "active": {
                "type": "boolean"
              }
            },
            "additionalProperties": false
          },
          "fulfillment": {
            "type": "object",
            "properties": {
              "firearms": {
                "type": "string"
              },
              "accessories": {
                "type": "string"
              },
              "ffl_recipient_emails": {
                "type": "array",
                "items": {
                  "type": "string",
                  "format": "email"
                }
              },
              "ship_to_store": {
                "type": "object",
                "properties": {
                  "firearms": {
                    "type": "string"
                  },
                  "accessories": {
                    "type": "string"
                  }
                },
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          }
        },
        "required": [
          "distid",
          "active"
        ],
        "additionalProperties": false
      }
    }
  },
  "paths": {
    "/v1/ping": {
      "get": {
        "tags": [
          "Account"
        ],
        "summary": "Check your key",
        "description": "Returns pong with the key name and tier.",
        "operationId": "get_v1_ping",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "pong": {
                          "type": "boolean",
                          "description": ""
                        },
                        "key_name": {
                          "type": "string",
                          "description": ""
                        },
                        "tier": {
                          "type": "string",
                          "description": ""
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/account": {
      "get": {
        "tags": [
          "Account"
        ],
        "summary": "Account, limits and allowlist",
        "description": "Your key name, contact, tier, rate limits, registered server IPs, and configured/active distributors.",
        "operationId": "get_v1_account",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "key_name": {
                          "type": "string",
                          "description": ""
                        },
                        "contact_email": {
                          "type": "string",
                          "description": ""
                        },
                        "tier": {
                          "type": "string",
                          "description": "",
                          "enum": [
                            "standard",
                            "pro",
                            "enterprise"
                          ]
                        },
                        "ip_whitelist": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "limits": {
                          "type": "object",
                          "properties": {
                            "per_minute": {
                              "type": "integer",
                              "description": ""
                            },
                            "per_day": {
                              "type": "integer",
                              "description": ""
                            }
                          }
                        },
                        "configured_distributors": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "active_distributors": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/usage": {
      "get": {
        "tags": [
          "Account"
        ],
        "summary": "Usage",
        "description": "Requests today and this month, per endpoint today and per day for the last 7 days.",
        "operationId": "get_v1_usage",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "tier": {
                          "type": "string",
                          "description": ""
                        },
                        "limits": {
                          "type": "object"
                        },
                        "today": {
                          "type": "integer",
                          "description": ""
                        },
                        "this_month": {
                          "type": "integer",
                          "description": ""
                        },
                        "by_endpoint_today": {
                          "type": "array",
                          "items": {
                            "type": "object"
                          }
                        },
                        "by_day_last_7": {
                          "type": "array",
                          "items": {
                            "type": "object"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/distributors": {
      "get": {
        "tags": [
          "Configuration"
        ],
        "summary": "Distributor registry",
        "description": "Every supported distributor by name: its distid, whether fulfillment is automated, the config_schema field contract (each field has a dash-delimited config_key path into distributors.<Name>) and a default_config entry.",
        "operationId": "get_v1_distributors",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "object",
                        "properties": {
                          "distid": {
                            "type": "string",
                            "description": ""
                          },
                          "automated_fulfillment": {
                            "type": "boolean",
                            "description": ""
                          },
                          "config_schema": {
                            "type": "object"
                          },
                          "default_config": {
                            "type": "object"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/config": {
      "get": {
        "tags": [
          "Configuration"
        ],
        "summary": "Get your configuration",
        "description": "The whole configuration document. Secrets read back as ******** and can be sent back unchanged.",
        "operationId": "get_v1_config",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "configuration": {
                          "type": "object"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Configuration"
        ],
        "summary": "Replace your configuration",
        "description": "Replaces the ENTIRE document (optionally wrapped as {\"configuration\": {...}}). Always GET a fresh copy, edit it and PUT it back. Schema errors return 400 schema_validation_failed with {path, message} details and nothing is saved. ?validate=true also refuses saves that would delete more of the live catalog than delete_threshold_percent (409 validation_failed).",
        "operationId": "put_v1_config",
        "parameters": [
          {
            "name": "validate",
            "in": "query",
            "required": false,
            "description": "Also run product-count validation.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "saved": {
                          "type": "boolean",
                          "description": ""
                        },
                        "configuration": {
                          "type": "object"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "configuration": "<the document from GET /v1/config, edited>"
              }
            }
          }
        }
      }
    },
    "/v1/config/schema": {
      "get": {
        "tags": [
          "Configuration"
        ],
        "summary": "Configuration JSON Schema",
        "description": "The draft-04 JSON Schema the document must satisfy, served raw (no envelope).",
        "operationId": "get_v1_config_schema",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/config/validate": {
      "post": {
        "tags": [
          "Configuration"
        ],
        "summary": "Validate configuration",
        "description": "Empty body: validates the SAVED configuration, checks each active distributor's credentials live (slow) and records which ones passed - product endpoints only serve validated distributors. Body {\"configuration\": {...}}: a dry-run schema check that saves nothing.",
        "operationId": "post_v1_config_validate",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {}
            }
          }
        }
      }
    },
    "/v1/products/search": {
      "get": {
        "tags": [
          "Products"
        ],
        "summary": "Search your catalog",
        "description": "Interactive, offset-paged search of your restricted catalog (max page_size 100, depth 10,000 rows). A q of 8+ digits matches a UPC exactly.",
        "operationId": "get_v1_products_search",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Free text across name, brand, SKU, MPN.",
            "schema": {
              "type": "string"
            },
            "example": "9mm"
          },
          {
            "name": "upc",
            "in": "query",
            "required": false,
            "description": "Exact UPC.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sku",
            "in": "query",
            "required": false,
            "description": "Exact distributor SKU.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "distributor",
            "in": "query",
            "required": false,
            "description": "One distid, e.g. RSR.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "manufacturer",
            "in": "query",
            "required": false,
            "description": "Exact manufacturer.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "product_class",
            "in": "query",
            "required": false,
            "description": "Exact class code.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "category",
            "in": "query",
            "required": false,
            "description": "Exact category name.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "min_price",
            "in": "query",
            "required": false,
            "description": "Cost lower bound.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "max_price",
            "in": "query",
            "required": false,
            "description": "Cost upper bound.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "in_stock",
            "in": "query",
            "required": false,
            "description": "Only qty_on_hand > 0.",
            "schema": {
              "type": "boolean"
            },
            "example": true
          },
          {
            "name": "drop_ship_only",
            "in": "query",
            "required": false,
            "description": "Only drop-shippable.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "ffl_required",
            "in": "query",
            "required": false,
            "description": "Only FFL items.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "ignore_restrictions",
            "in": "query",
            "required": false,
            "description": "Skip your product restrictions and cost filters.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "description": "Sort order.",
            "schema": {
              "type": "string",
              "enum": [
                "price",
                "-price",
                "name",
                "-name",
                "qty",
                "-qty"
              ],
              "default": "name"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "1-based page.",
            "schema": {
              "type": "integer",
              "default": 1
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "description": "Rows per page.",
            "schema": {
              "type": "integer",
              "default": 50,
              "maximum": 100
            },
            "example": 10
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "products": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Product"
                          }
                        },
                        "page": {
                          "type": "integer",
                          "description": ""
                        },
                        "page_size": {
                          "type": "integer",
                          "description": ""
                        },
                        "total": {
                          "type": "integer",
                          "description": ""
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/products/catalog": {
      "get": {
        "tags": [
          "Products"
        ],
        "summary": "Bulk catalog export (parquet)",
        "description": "Your COMPLETE restricted catalog as one snappy parquet file behind a presigned URL that expires (default 1800 s). Send the previous export_version as last_version: unchanged exports return changed:false and do not use up the window. Downloads are limited to one per 20 minutes (429 catalog_request_cooldown, 60 s grace).",
        "operationId": "get_v1_products_catalog",
        "parameters": [
          {
            "name": "last_version",
            "in": "query",
            "required": false,
            "description": "Previous export_version.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "expires_in",
            "in": "query",
            "required": false,
            "description": "URL lifetime in seconds.",
            "schema": {
              "type": "integer",
              "minimum": 1200,
              "maximum": 3600,
              "default": 1800
            }
          },
          {
            "name": "include_attributes",
            "in": "query",
            "required": false,
            "description": "Also presign the attributes feed (csv.gz).",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "ignore_restrictions",
            "in": "query",
            "required": false,
            "description": "Skip your product restrictions.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "changed": {
                          "type": "boolean",
                          "description": ""
                        },
                        "version": {
                          "type": "string",
                          "description": ""
                        },
                        "export_version": {
                          "type": "string",
                          "description": ""
                        },
                        "format": {
                          "type": "string",
                          "description": ""
                        },
                        "compression": {
                          "type": "string",
                          "description": ""
                        },
                        "rows": {
                          "type": "integer",
                          "description": ""
                        },
                        "url": {
                          "type": "string",
                          "description": ""
                        },
                        "expires_in_seconds": {
                          "type": "integer",
                          "description": ""
                        },
                        "next_check_seconds": {
                          "type": "integer",
                          "description": ""
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/products/facets": {
      "get": {
        "tags": [
          "Products"
        ],
        "summary": "Search facets",
        "description": "Sorted distinct manufacturers, categories and product classes across your restricted catalog.",
        "operationId": "get_v1_products_facets",
        "parameters": [
          {
            "name": "ignore_restrictions",
            "in": "query",
            "required": false,
            "description": "",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "manufacturers": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "categories": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "product_classes": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/products/{upc}": {
      "get": {
        "tags": [
          "Products"
        ],
        "summary": "Product detail",
        "description": "Every offer for one UPC (8-14 digits) across your restricted catalog, with descriptions. 404 when not in your catalog.",
        "operationId": "get_v1_products_upc",
        "parameters": [
          {
            "name": "upc",
            "in": "path",
            "required": true,
            "description": "UPC",
            "schema": {
              "type": "string"
            },
            "example": "643740108515"
          },
          {
            "name": "ignore_restrictions",
            "in": "query",
            "required": false,
            "description": "",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "upc": {
                          "type": "string",
                          "description": ""
                        },
                        "offers": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Product"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/products/{upc}/history": {
      "get": {
        "tags": [
          "Products"
        ],
        "summary": "Inventory & cost history",
        "description": "Quantity and cost changes over the preceding 3 months across your active, validated distributors.",
        "operationId": "get_v1_products_upc_history",
        "parameters": [
          {
            "name": "upc",
            "in": "path",
            "required": true,
            "description": "UPC",
            "schema": {
              "type": "string"
            },
            "example": "643740108515"
          },
          {
            "name": "timezone",
            "in": "query",
            "required": false,
            "description": "IANA time zone.",
            "schema": {
              "type": "string",
              "default": "UTC"
            },
            "example": "America/New_York"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "upc": {
                          "type": "string",
                          "description": ""
                        },
                        "timezone": {
                          "type": "string",
                          "description": ""
                        },
                        "window_months": {
                          "type": "integer",
                          "description": ""
                        },
                        "count": {
                          "type": "integer",
                          "description": ""
                        },
                        "history": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "distid": {
                                "type": "string",
                                "description": ""
                              },
                              "changed_on": {
                                "type": "string",
                                "description": ""
                              },
                              "qty_on_hand": {
                                "type": "integer",
                                "description": ""
                              },
                              "qty_change": {
                                "type": "integer",
                                "description": "",
                                "nullable": true
                              },
                              "unit_price": {
                                "type": "number",
                                "description": ""
                              },
                              "price_change": {
                                "type": "number",
                                "description": "",
                                "nullable": true
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/analytics/top-products": {
      "get": {
        "tags": [
          "Analytics"
        ],
        "summary": "Analytics: top-products",
        "description": "Movement leaders (units sold proxy, restocks, movement score). Daily rollups scoped to your active distributors.",
        "operationId": "get_v1_analytics_top_products",
        "parameters": [
          {
            "name": "window",
            "in": "query",
            "required": false,
            "description": "Rollup window.",
            "schema": {
              "type": "string",
              "enum": [
                "7d",
                "30d",
                "60d",
                "90d"
              ],
              "default": "7d"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Rows to return.",
            "schema": {
              "type": "integer",
              "default": 50,
              "maximum": 200
            }
          },
          {
            "name": "product_class",
            "in": "query",
            "required": false,
            "description": "Comma-separated 2-letter class codes.",
            "schema": {
              "type": "string"
            },
            "example": "FA,AO"
          },
          {
            "name": "category_id",
            "in": "query",
            "required": false,
            "description": "Comma-separated numeric category ids.",
            "schema": {
              "type": "string"
            },
            "example": "981,982"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "metric": {
                          "type": "string",
                          "description": ""
                        },
                        "as_of": {
                          "type": "string",
                          "description": ""
                        },
                        "window_days": {
                          "type": "integer",
                          "description": "",
                          "nullable": true
                        },
                        "count": {
                          "type": "integer",
                          "description": ""
                        },
                        "results": {
                          "type": "array",
                          "items": {
                            "type": "object"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/analytics/on-sale": {
      "get": {
        "tags": [
          "Analytics"
        ],
        "summary": "Analytics: on-sale",
        "description": "Meaningful price drops versus the window's reference price. Daily rollups scoped to your active distributors.",
        "operationId": "get_v1_analytics_on_sale",
        "parameters": [
          {
            "name": "window",
            "in": "query",
            "required": false,
            "description": "Rollup window.",
            "schema": {
              "type": "string",
              "enum": [
                "7d",
                "30d",
                "60d",
                "90d"
              ],
              "default": "7d"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Rows to return.",
            "schema": {
              "type": "integer",
              "default": 50,
              "maximum": 200
            }
          },
          {
            "name": "product_class",
            "in": "query",
            "required": false,
            "description": "Comma-separated 2-letter class codes.",
            "schema": {
              "type": "string"
            },
            "example": "FA,AO"
          },
          {
            "name": "category_id",
            "in": "query",
            "required": false,
            "description": "Comma-separated numeric category ids.",
            "schema": {
              "type": "string"
            },
            "example": "981,982"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "metric": {
                          "type": "string",
                          "description": ""
                        },
                        "as_of": {
                          "type": "string",
                          "description": ""
                        },
                        "window_days": {
                          "type": "integer",
                          "description": "",
                          "nullable": true
                        },
                        "count": {
                          "type": "integer",
                          "description": ""
                        },
                        "results": {
                          "type": "array",
                          "items": {
                            "type": "object"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/analytics/margin-opportunities": {
      "get": {
        "tags": [
          "Analytics"
        ],
        "summary": "Analytics: margin-opportunities",
        "description": "Best cost-to-MAP/MSRP spreads. Window is ignored. Daily rollups scoped to your active distributors.",
        "operationId": "get_v1_analytics_margin_opportunities",
        "parameters": [
          {
            "name": "window",
            "in": "query",
            "required": false,
            "description": "Rollup window.",
            "schema": {
              "type": "string",
              "enum": [
                "7d",
                "30d",
                "60d",
                "90d"
              ],
              "default": "7d"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Rows to return.",
            "schema": {
              "type": "integer",
              "default": 50,
              "maximum": 200
            }
          },
          {
            "name": "product_class",
            "in": "query",
            "required": false,
            "description": "Comma-separated 2-letter class codes.",
            "schema": {
              "type": "string"
            },
            "example": "FA,AO"
          },
          {
            "name": "category_id",
            "in": "query",
            "required": false,
            "description": "Comma-separated numeric category ids.",
            "schema": {
              "type": "string"
            },
            "example": "981,982"
          },
          {
            "name": "sort_by",
            "in": "query",
            "required": false,
            "description": "Sort.",
            "schema": {
              "type": "string",
              "enum": [
                "gross_profit",
                "margin_pct"
              ]
            }
          },
          {
            "name": "min_confidence",
            "in": "query",
            "required": false,
            "description": "Minimum confidence.",
            "schema": {
              "type": "number",
              "minimum": 0,
              "maximum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "metric": {
                          "type": "string",
                          "description": ""
                        },
                        "as_of": {
                          "type": "string",
                          "description": ""
                        },
                        "window_days": {
                          "type": "integer",
                          "description": "",
                          "nullable": true
                        },
                        "count": {
                          "type": "integer",
                          "description": ""
                        },
                        "results": {
                          "type": "array",
                          "items": {
                            "type": "object"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/analytics/trending": {
      "get": {
        "tags": [
          "Analytics"
        ],
        "summary": "Analytics: trending",
        "description": "Sales acceleration: 7-day pace versus the prior 23 days (trend_ratio). Daily rollups scoped to your active distributors.",
        "operationId": "get_v1_analytics_trending",
        "parameters": [
          {
            "name": "window",
            "in": "query",
            "required": false,
            "description": "Rollup window.",
            "schema": {
              "type": "string",
              "enum": [
                "7d",
                "30d",
                "60d",
                "90d"
              ],
              "default": "7d"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Rows to return.",
            "schema": {
              "type": "integer",
              "default": 50,
              "maximum": 200
            }
          },
          {
            "name": "product_class",
            "in": "query",
            "required": false,
            "description": "Comma-separated 2-letter class codes.",
            "schema": {
              "type": "string"
            },
            "example": "FA,AO"
          },
          {
            "name": "category_id",
            "in": "query",
            "required": false,
            "description": "Comma-separated numeric category ids.",
            "schema": {
              "type": "string"
            },
            "example": "981,982"
          },
          {
            "name": "min_7d_units",
            "in": "query",
            "required": false,
            "description": "",
            "schema": {
              "type": "integer",
              "default": 3
            }
          },
          {
            "name": "min_30d_units",
            "in": "query",
            "required": false,
            "description": "",
            "schema": {
              "type": "integer",
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "metric": {
                          "type": "string",
                          "description": ""
                        },
                        "as_of": {
                          "type": "string",
                          "description": ""
                        },
                        "window_days": {
                          "type": "integer",
                          "description": "",
                          "nullable": true
                        },
                        "count": {
                          "type": "integer",
                          "description": ""
                        },
                        "results": {
                          "type": "array",
                          "items": {
                            "type": "object"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/analytics/new-arrivals": {
      "get": {
        "tags": [
          "Analytics"
        ],
        "summary": "Analytics: new-arrivals",
        "description": "Products first seen within the window. Daily rollups scoped to your active distributors.",
        "operationId": "get_v1_analytics_new_arrivals",
        "parameters": [
          {
            "name": "window",
            "in": "query",
            "required": false,
            "description": "Rollup window.",
            "schema": {
              "type": "string",
              "enum": [
                "7d",
                "30d",
                "60d",
                "90d"
              ],
              "default": "7d"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Rows to return.",
            "schema": {
              "type": "integer",
              "default": 50,
              "maximum": 200
            }
          },
          {
            "name": "product_class",
            "in": "query",
            "required": false,
            "description": "Comma-separated 2-letter class codes.",
            "schema": {
              "type": "string"
            },
            "example": "FA,AO"
          },
          {
            "name": "category_id",
            "in": "query",
            "required": false,
            "description": "Comma-separated numeric category ids.",
            "schema": {
              "type": "string"
            },
            "example": "981,982"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "metric": {
                          "type": "string",
                          "description": ""
                        },
                        "as_of": {
                          "type": "string",
                          "description": ""
                        },
                        "window_days": {
                          "type": "integer",
                          "description": "",
                          "nullable": true
                        },
                        "count": {
                          "type": "integer",
                          "description": ""
                        },
                        "results": {
                          "type": "array",
                          "items": {
                            "type": "object"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/analytics/newly-available": {
      "get": {
        "tags": [
          "Analytics"
        ],
        "summary": "Analytics: newly-available",
        "description": "Restocks: back in stock after sitting at zero. Daily rollups scoped to your active distributors.",
        "operationId": "get_v1_analytics_newly_available",
        "parameters": [
          {
            "name": "window",
            "in": "query",
            "required": false,
            "description": "Rollup window.",
            "schema": {
              "type": "string",
              "enum": [
                "7d",
                "30d",
                "60d",
                "90d"
              ],
              "default": "7d"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Rows to return.",
            "schema": {
              "type": "integer",
              "default": 50,
              "maximum": 200
            }
          },
          {
            "name": "product_class",
            "in": "query",
            "required": false,
            "description": "Comma-separated 2-letter class codes.",
            "schema": {
              "type": "string"
            },
            "example": "FA,AO"
          },
          {
            "name": "category_id",
            "in": "query",
            "required": false,
            "description": "Comma-separated numeric category ids.",
            "schema": {
              "type": "string"
            },
            "example": "981,982"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "metric": {
                          "type": "string",
                          "description": ""
                        },
                        "as_of": {
                          "type": "string",
                          "description": ""
                        },
                        "window_days": {
                          "type": "integer",
                          "description": "",
                          "nullable": true
                        },
                        "count": {
                          "type": "integer",
                          "description": ""
                        },
                        "results": {
                          "type": "array",
                          "items": {
                            "type": "object"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/analytics/price-gaps": {
      "get": {
        "tags": [
          "Analytics"
        ],
        "summary": "Analytics: price-gaps",
        "description": "One distributor far below the peer average. Window is ignored. Daily rollups scoped to your active distributors.",
        "operationId": "get_v1_analytics_price_gaps",
        "parameters": [
          {
            "name": "window",
            "in": "query",
            "required": false,
            "description": "Rollup window.",
            "schema": {
              "type": "string",
              "enum": [
                "7d",
                "30d",
                "60d",
                "90d"
              ],
              "default": "7d"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Rows to return.",
            "schema": {
              "type": "integer",
              "default": 50,
              "maximum": 200
            }
          },
          {
            "name": "product_class",
            "in": "query",
            "required": false,
            "description": "Comma-separated 2-letter class codes.",
            "schema": {
              "type": "string"
            },
            "example": "FA,AO"
          },
          {
            "name": "category_id",
            "in": "query",
            "required": false,
            "description": "Comma-separated numeric category ids.",
            "schema": {
              "type": "string"
            },
            "example": "981,982"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "metric": {
                          "type": "string",
                          "description": ""
                        },
                        "as_of": {
                          "type": "string",
                          "description": ""
                        },
                        "window_days": {
                          "type": "integer",
                          "description": "",
                          "nullable": true
                        },
                        "count": {
                          "type": "integer",
                          "description": ""
                        },
                        "results": {
                          "type": "array",
                          "items": {
                            "type": "object"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/ffls": {
      "get": {
        "tags": [
          "FFL directory"
        ],
        "summary": "Dealers near a ZIP",
        "description": "Up to 150 dealers within the radius, best first: on-file dealers in the exact ZIP, on-file nearby, then the rest.",
        "operationId": "get_v1_ffls",
        "parameters": [
          {
            "name": "zip",
            "in": "query",
            "required": true,
            "description": "5-digit ZIP.",
            "schema": {
              "type": "string"
            },
            "example": "37201"
          },
          {
            "name": "radius",
            "in": "query",
            "required": false,
            "description": "Miles.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 15
            }
          },
          {
            "name": "name",
            "in": "query",
            "required": false,
            "description": "Name filter (<=60 chars).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "count": {
                          "type": "integer",
                          "description": ""
                        },
                        "ffls": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/FFL"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/ffls/{license_number}": {
      "get": {
        "tags": [
          "FFL directory"
        ],
        "summary": "Validate one FFL",
        "description": "The full record for one license, adding transfer fees, residential and contact_required. X masks a character (e.g. 4-XX-XXX-01-8K-70207).",
        "operationId": "get_v1_ffls_license_number",
        "parameters": [
          {
            "name": "license_number",
            "in": "path",
            "required": true,
            "description": "License number",
            "schema": {
              "type": "string"
            },
            "example": "4-37-201-01-8K-70207"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/FFL"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/ffls/{license_number}/documents/{document_type}": {
      "get": {
        "tags": [
          "FFL directory"
        ],
        "summary": "Order-associated license document",
        "description": "A short-lived URL for the dealer's ffl or sot document. Only for a license used by one of your own fulfillment orders (403 ffl_not_associated_with_order); 404 document_not_on_file; 503 document_file_unavailable.",
        "operationId": "get_v1_ffls_license_number_documents_document_type",
        "parameters": [
          {
            "name": "license_number",
            "in": "path",
            "required": true,
            "description": "License number",
            "schema": {
              "type": "string"
            },
            "example": "4-37-201-01-8K-70207"
          },
          {
            "name": "document_type",
            "in": "path",
            "required": true,
            "description": "ffl or sot",
            "schema": {
              "type": "string"
            },
            "example": "ffl"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "license_number": {
                          "type": "string",
                          "description": ""
                        },
                        "document_type": {
                          "type": "string",
                          "description": ""
                        },
                        "associated_order_id": {
                          "type": "integer",
                          "description": ""
                        },
                        "expires_in_seconds": {
                          "type": "integer",
                          "description": ""
                        },
                        "url": {
                          "type": "string",
                          "description": ""
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/restrictions/check": {
      "post": {
        "tags": [
          "Restrictions"
        ],
        "summary": "Check destination restrictions",
        "description": "Evaluates up to 100 items against the central restriction rules (state/county/city/ZIP x UPC/SKU/class/category/attributes) plus your restriction_overrides. County rules need shipping.county, or shipping.ffl_license (the receiving dealer) so the county is taken from its licence record; when neither is known the rule applies and the hit is marked county_unverified. A BLOCK match means do not sell to that destination.",
        "operationId": "post_v1_restrictions_check",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "approved": {
                          "type": "boolean",
                          "description": ""
                        },
                        "items": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "upc": {
                                "type": "string",
                                "description": ""
                              },
                              "sku": {
                                "type": "string",
                                "description": ""
                              },
                              "approved": {
                                "type": "boolean",
                                "description": ""
                              },
                              "blocking_rules": {
                                "type": "array",
                                "items": {
                                  "type": "object"
                                }
                              },
                              "warnings": {
                                "type": "array",
                                "items": {
                                  "type": "object"
                                }
                              },
                              "manual_review": {
                                "type": "array",
                                "items": {
                                  "type": "object"
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "shipping": {
                  "state": "CA",
                  "zip": "94105"
                },
                "items": [
                  {
                    "upc": "760310155875"
                  },
                  {
                    "product_class": "AO"
                  }
                ]
              }
            }
          }
        }
      }
    },
    "/v1/orders/quote": {
      "post": {
        "tags": [
          "Orders"
        ],
        "summary": "Quote the cheapest fulfillment",
        "description": "For each item: the cheapest in-stock source (unit_price x qty + estimated shipping) and up to five alternatives; plus a per-distributor plan and the items nobody can cover.",
        "operationId": "post_v1_orders_quote",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "fulfillable": {
                          "type": "boolean",
                          "description": ""
                        },
                        "plan": {
                          "type": "object"
                        },
                        "items": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "upc": {
                                "type": "string",
                                "description": ""
                              },
                              "qty": {
                                "type": "integer",
                                "description": ""
                              },
                              "best": {
                                "$ref": "#/components/schemas/FulfillmentOption"
                              },
                              "alternatives": {
                                "type": "array",
                                "items": {
                                  "$ref": "#/components/schemas/FulfillmentOption"
                                }
                              }
                            }
                          }
                        },
                        "unfulfillable": {
                          "type": "array",
                          "items": {
                            "type": "object"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "items": [
                  {
                    "upc": "643740108515",
                    "qty": 1
                  },
                  {
                    "upc": "720868151439",
                    "qty": 2
                  }
                ]
              }
            }
          }
        }
      }
    },
    "/v1/orders": {
      "post": {
        "tags": [
          "Orders"
        ],
        "summary": "Place an order",
        "description": "Places distributor orders (simulated in this sandbox; real placement in production). order_id is the idempotency key (409 duplicate_order). sourcing_mode exact (default) honors each distid/distsku or fails with 409 sourcing_unavailable; optimal picks sources by cost. Mixed carts split per (distributor, FFL group); ship_to_store routes everything to your configured store. Capped at 60/hour and 500/day (429 order_volume_limit).",
        "operationId": "post_v1_orders",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "boolean",
                          "description": ""
                        },
                        "order_id": {
                          "type": "integer",
                          "description": ""
                        },
                        "sourcing_mode": {
                          "type": "string",
                          "description": "",
                          "enum": [
                            "exact",
                            "optimal"
                          ]
                        },
                        "fulfillment_orders": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/FulfillmentOrder"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "order_id": 10021,
                "customer": {
                  "name": "Jane Sample",
                  "email": "jane@example.com",
                  "phone": "555-555-0100",
                  "address1": "1 Main St",
                  "address2": "",
                  "city": "Nashville",
                  "state": "TN",
                  "zip": "37201"
                },
                "items": [
                  {
                    "distid": "LIP",
                    "distsku": "LP108515",
                    "upc": "643740108515",
                    "qty": 1,
                    "ffl_req": true
                  },
                  {
                    "distid": "TSW",
                    "distsku": "61439",
                    "upc": "720868151439",
                    "qty": 1,
                    "ffl_req": false
                  }
                ],
                "ffl": {
                  "licenseNumber": "4-37-201-01-8K-70207"
                },
                "ship_to_store": false
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Orders"
        ],
        "summary": "Order history",
        "description": "Your distributor orders, paged.",
        "operationId": "get_v1_orders",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "",
            "schema": {
              "type": "integer",
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "description": "",
            "schema": {
              "type": "integer",
              "default": 0
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "description": "",
            "schema": {
              "type": "string",
              "enum": [
                "order_date",
                "order_id",
                "ship_date",
                "order_status",
                "order_source"
              ]
            }
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "description": "",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "count": {
                          "type": "integer",
                          "description": ""
                        },
                        "orders": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/FulfillmentOrder"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/orders/{order_id}": {
      "get": {
        "tags": [
          "Orders"
        ],
        "summary": "One order",
        "description": "The distributor orders for one of your order ids (whole number 1-2147483647, else 400 invalid_parameter).",
        "operationId": "get_v1_orders_order_id",
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "required": true,
            "description": "Order id",
            "schema": {
              "type": "string"
            },
            "example": "10021"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "order_id": {
                          "type": "integer",
                          "description": ""
                        },
                        "fulfillment_orders": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/FulfillmentOrder"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/fulfillment/history": {
      "get": {
        "tags": [
          "Orders"
        ],
        "summary": "Fulfillment & tracking lookup",
        "description": "Query fulfillment records (filters are ANDed). reference matches po_number, distributor_order_id or tracking number (and order_id when numeric). errors lists failed placement attempts.",
        "operationId": "get_v1_fulfillment_history",
        "parameters": [
          {
            "name": "reference",
            "in": "query",
            "required": false,
            "description": "",
            "schema": {
              "type": "string"
            },
            "example": "10021"
          },
          {
            "name": "order_id",
            "in": "query",
            "required": false,
            "description": "",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "po_number",
            "in": "query",
            "required": false,
            "description": "",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "distributor_order_id",
            "in": "query",
            "required": false,
            "description": "",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tracking_number",
            "in": "query",
            "required": false,
            "description": "",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "distid",
            "in": "query",
            "required": false,
            "description": "",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "order_source",
            "in": "query",
            "required": false,
            "description": "",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "order_status",
            "in": "query",
            "required": false,
            "description": "",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ship_status",
            "in": "query",
            "required": false,
            "description": "",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "description": "YYYY-MM-DD",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "description": "YYYY-MM-DD",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "",
            "schema": {
              "type": "integer",
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "description": "",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "include_errors",
            "in": "query",
            "required": false,
            "description": "",
            "schema": {
              "type": "boolean",
              "default": true
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "count": {
                          "type": "integer",
                          "description": ""
                        },
                        "orders": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/FulfillmentOrder"
                          }
                        },
                        "errors": {
                          "type": "array",
                          "items": {
                            "type": "object"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/fraud/check": {
      "post": {
        "tags": [
          "Fraud"
        ],
        "summary": "Check an order",
        "description": "Needs at least one strong signal (shipping_address_1, billing_address_1, email, phone). Strong signals match like-for-like only; names, IPs and items only corroborate. Raw PII from other reports is never returned. Treat a match as \"hold for review\".",
        "operationId": "post_v1_fraud_check",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "fraud": {
                          "$ref": "#/components/schemas/FraudResult"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "shipping_name": {
                    "type": "string"
                  },
                  "shipping_address_1": {
                    "type": "string"
                  },
                  "shipping_address_2": {
                    "type": "string"
                  },
                  "shipping_city": {
                    "type": "string"
                  },
                  "shipping_state": {
                    "type": "string"
                  },
                  "shipping_postcode": {
                    "type": "string"
                  },
                  "shipping_country": {
                    "type": "string"
                  },
                  "billing_name": {
                    "type": "string"
                  },
                  "billing_address_1": {
                    "type": "string"
                  },
                  "billing_address_2": {
                    "type": "string"
                  },
                  "billing_city": {
                    "type": "string"
                  },
                  "billing_state": {
                    "type": "string"
                  },
                  "billing_postcode": {
                    "type": "string"
                  },
                  "billing_country": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string"
                  },
                  "phone": {
                    "type": "string"
                  },
                  "ip_address": {
                    "type": "string"
                  },
                  "shipping_is_ffl": {
                    "type": "boolean"
                  },
                  "order_items": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "upc": {
                          "type": "string"
                        },
                        "sku": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "qty": {
                          "type": "integer"
                        },
                        "price": {
                          "type": "number"
                        }
                      }
                    }
                  }
                }
              },
              "example": {
                "shipping_name": "John Doe",
                "shipping_address_1": "123 Main St Apt 4",
                "shipping_postcode": "30301",
                "email": "suspect@example.com"
              }
            }
          }
        }
      }
    },
    "/v1/fraud/reports": {
      "post": {
        "tags": [
          "Fraud"
        ],
        "summary": "Report confirmed fraud",
        "description": "Report a confirmed fraudulent order. shipping_address_1 is required; orders shipped to an FFL (shipping_is_ffl: true) are rejected. Optional order_source, order_id, notes. Only keyed hashes of the identity signals are stored; raw order payloads (order_json) are accepted for compatibility but never kept.",
        "operationId": "post_v1_fraud_reports",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "reported": {
                          "type": "boolean",
                          "description": ""
                        },
                        "created": {
                          "type": "boolean",
                          "description": ""
                        },
                        "report_id": {
                          "type": "string",
                          "description": ""
                        },
                        "fraud": {
                          "$ref": "#/components/schemas/FraudResult"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "shipping_name": {
                    "type": "string"
                  },
                  "shipping_address_1": {
                    "type": "string"
                  },
                  "shipping_address_2": {
                    "type": "string"
                  },
                  "shipping_city": {
                    "type": "string"
                  },
                  "shipping_state": {
                    "type": "string"
                  },
                  "shipping_postcode": {
                    "type": "string"
                  },
                  "shipping_country": {
                    "type": "string"
                  },
                  "billing_name": {
                    "type": "string"
                  },
                  "billing_address_1": {
                    "type": "string"
                  },
                  "billing_address_2": {
                    "type": "string"
                  },
                  "billing_city": {
                    "type": "string"
                  },
                  "billing_state": {
                    "type": "string"
                  },
                  "billing_postcode": {
                    "type": "string"
                  },
                  "billing_country": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string"
                  },
                  "phone": {
                    "type": "string"
                  },
                  "ip_address": {
                    "type": "string"
                  },
                  "shipping_is_ffl": {
                    "type": "boolean"
                  },
                  "order_items": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "upc": {
                          "type": "string"
                        },
                        "sku": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "qty": {
                          "type": "integer"
                        },
                        "price": {
                          "type": "number"
                        }
                      }
                    }
                  }
                }
              },
              "example": {
                "shipping_name": "Sam Example",
                "shipping_address_1": "742 Evergreen Ter",
                "shipping_postcode": "97401",
                "email": "sam.example@gmail.com",
                "phone": "541-555-0175",
                "notes": "Chargeback: stolen card"
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Fraud"
        ],
        "summary": "Remove your report",
        "description": "Removes only YOUR report matching the signals; other dealers' reports remain.",
        "operationId": "delete_v1_fraud_reports",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "removed": {
                          "type": "integer",
                          "description": ""
                        },
                        "fraud": {
                          "$ref": "#/components/schemas/FraudResult"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "shipping_name": {
                    "type": "string"
                  },
                  "shipping_address_1": {
                    "type": "string"
                  },
                  "shipping_address_2": {
                    "type": "string"
                  },
                  "shipping_city": {
                    "type": "string"
                  },
                  "shipping_state": {
                    "type": "string"
                  },
                  "shipping_postcode": {
                    "type": "string"
                  },
                  "shipping_country": {
                    "type": "string"
                  },
                  "billing_name": {
                    "type": "string"
                  },
                  "billing_address_1": {
                    "type": "string"
                  },
                  "billing_address_2": {
                    "type": "string"
                  },
                  "billing_city": {
                    "type": "string"
                  },
                  "billing_state": {
                    "type": "string"
                  },
                  "billing_postcode": {
                    "type": "string"
                  },
                  "billing_country": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string"
                  },
                  "phone": {
                    "type": "string"
                  },
                  "ip_address": {
                    "type": "string"
                  },
                  "shipping_is_ffl": {
                    "type": "boolean"
                  },
                  "order_items": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "upc": {
                          "type": "string"
                        },
                        "sku": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "qty": {
                          "type": "integer"
                        },
                        "price": {
                          "type": "number"
                        }
                      }
                    }
                  }
                }
              },
              "example": {
                "shipping_address_1": "742 Evergreen Ter",
                "shipping_postcode": "97401"
              }
            }
          }
        }
      }
    },
    "/v1/orders/{order_id}/routing": {
      "get": {
        "tags": [
          "Routing"
        ],
        "summary": "Why an order went where it did",
        "description": "For each line of an order: the source chosen, the rule that chose it, a sentence explaining it, and the other sources considered with their stock, price and landed cost.",
        "operationId": "get_v1_orders_order_id_routing",
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "required": true,
            "description": "Your order id.",
            "schema": {
              "type": "string"
            },
            "example": "5001"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "description": "order_id, sourcing_mode, split_across_sources, fulfillment_orders[].lines[] with chosen, rule, reason and candidates."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/inventory/{sku}": {
      "get": {
        "tags": [
          "Routing"
        ],
        "summary": "Stock and cost across every source",
        "description": "Look a product up by UPC or by a source SKU and get every source that carries it: stock, unit price, shipping and landed cost, cheapest first. Vendor stock from the portal is included.",
        "operationId": "get_v1_inventory_sku",
        "parameters": [
          {
            "name": "sku",
            "in": "path",
            "required": true,
            "description": "A UPC or a source SKU.",
            "schema": {
              "type": "string"
            },
            "example": "720868151439"
          },
          {
            "name": "ignore_restrictions",
            "in": "query",
            "required": false,
            "description": "Include offers your product restrictions hide.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "description": "query, products[] with total_qty_on_hand, lowest_unit_price and sources[]."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/shipping/rates": {
      "post": {
        "tags": [
          "Carrier rates"
        ],
        "summary": "Compare carrier services for a parcel",
        "description": "Returns each carrier service with transit days, freight, surcharges and total, cheapest first, plus the services left out and why (for example, handguns need an overnight service). Rates come from sample rate tables, not live carrier accounts. To compare carriers while quoting an order, send carrier_rates: true and destination_zip to POST /v1/orders/quote.",
        "operationId": "post_v1_shipping_rates",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "description": "zone, distance_miles, billable_weight_lb, cheapest, fastest, rates[], excluded[]."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "origin_zip": "37201",
                "destination_zip": "98101",
                "weight_lb": 4,
                "contents": "general",
                "residential": true,
                "declared_value": 250
              }
            }
          }
        }
      }
    },
    "/v1/vetting/checks": {
      "post": {
        "tags": [
          "Vetting"
        ],
        "summary": "Start a dealer, vendor or ship-to check",
        "description": "type is one of ffl_dealer, vendor, ship_to. ffl_dealer: license_number, optional business_name and premise_address. ship_to: license_number and ship_to_address (does the order's destination match the licensed premise?). vendor: business_name and registration_state, optional registration_number. The answer comes back at once with status \"processing\"; the result is ready a few seconds later (poll, or subscribe to vetting.check.completed). Set recheck: true to have the license looked up again daily and get vetting.license.expiring 60 days before it expires.",
        "operationId": "post_v1_vetting_checks",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "description": "id, type, status, reference."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "type": "ffl_dealer",
                "license_number": "4-37-201-01-8K-70207",
                "business_name": "Example Outfitters LLC",
                "premise_address": {
                  "line1": "410 Market St",
                  "city": "Nashville",
                  "state": "TN",
                  "postal_code": "37201"
                },
                "reference": "dealer-8812",
                "recheck": true
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Vetting"
        ],
        "summary": "List checks",
        "description": "Newest first. Filter by status (processing, verified, needs_review, failed) or by your reference.",
        "operationId": "get_v1_vetting_checks",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "processing, verified, needs_review or failed.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "reference",
            "in": "query",
            "required": false,
            "description": "Your own reference.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "1-100, default 25.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "description": "Rows to skip.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "description": "count, checks[]."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/vetting/checks/{id}": {
      "get": {
        "tags": [
          "Vetting"
        ],
        "summary": "Get one check and its evidence",
        "description": "status is verified, needs_review or failed, with a confidence score, flags (for example license_expired, premise_mismatch, name_mismatch) and the sources that matched.",
        "operationId": "get_v1_vetting_checks_id",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The check id.",
            "schema": {
              "type": "string"
            },
            "example": "chk_7Qp2M4vX9aBc"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "description": "id, status, confidence, license, flags[], evidence[], completed_at."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/webhooks": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Subscribe a URL to events",
        "description": "Events: vetting.check.completed, vetting.license.expiring, order.submitted, order.shipped, order.delivered, vendor.inventory.updated, support.message.created. The URL must be https. The response carries the signing secret, shown this once. Every delivery is a POST with a signature header of the form t=<unix seconds>,v1=<hex HMAC-SHA256 of \"t.body\" keyed with the secret>; check it, and reject old timestamps. A delivery that does not get a 2xx answer is retried after 1 minute, 5 minutes, 30 minutes and 2 hours.",
        "operationId": "post_v1_webhooks",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "description": "id, url, events, secret."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "url": "https://example.com/hooks/rollstamp",
                "events": [
                  "vetting.check.completed",
                  "order.shipped"
                ]
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Webhooks"
        ],
        "summary": "List webhooks",
        "description": "Your endpoints (without their secrets) and the event names you can subscribe to.",
        "operationId": "get_v1_webhooks",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "description": "webhooks[], events[]."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/webhooks/{id}": {
      "delete": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Remove a webhook",
        "description": "Deliveries still waiting for it are dropped.",
        "operationId": "delete_v1_webhooks_id",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The webhook id.",
            "schema": {
              "type": "string"
            },
            "example": "wh_..."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "description": "deleted, id."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/webhooks/{id}/deliveries": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Recent deliveries",
        "description": "The last 50 deliveries to one endpoint with status (pending, delivered, failed), attempts, the answer received and the payload.",
        "operationId": "get_v1_webhooks_id_deliveries",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The webhook id.",
            "schema": {
              "type": "string"
            },
            "example": "wh_..."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "description": "deliveries[]."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/webhooks/{id}/test": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Send a test delivery",
        "description": "Queues one delivery with {\"test\": true} so you can check your receiver and signature code.",
        "operationId": "post_v1_webhooks_id_test",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The webhook id.",
            "schema": {
              "type": "string"
            },
            "example": "wh_..."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "description": "queued, delivery_id, event."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/orders/{order_id}/edi": {
      "get": {
        "tags": [
          "EDI and ERP"
        ],
        "summary": "X12 850 purchase orders for an order",
        "description": "One ANSI X12 004010 850 document per distributor or vendor order, ready to hand to a trading partner. Sender and partner ids come from the EDI settings.",
        "operationId": "get_v1_orders_order_id_edi",
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "required": true,
            "description": "Your order id.",
            "schema": {
              "type": "string"
            },
            "example": "5001"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "description": "order_id, documents[] with type, po_number, control_number, x12."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/edi/inbound": {
      "post": {
        "tags": [
          "EDI and ERP"
        ],
        "summary": "Read X12 documents from a partner",
        "description": "Send the document text as {\"x12\": \"...\"}. Handles 855 (acknowledgment: accepted or rejected), 856 (ship notice: carrier and tracking go onto the order), 810 (invoice: recorded and compared with the order) and 846 (inventory advice from a portal vendor). Returns a result per transaction set and the 997 functional acknowledgment to send back.",
        "operationId": "post_v1_edi_inbound",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "description": "received, accepted, results[], acknowledgment_997."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "x12": "ISA*00*          *00*          *ZZ*RSR            *ZZ*MYSTORE        *261118*1500*U*00401*000000042*0*T*>~GS*SH*RSR*MYSTORE*20261118*1500*42*X*004010~ST*856*0001~BSN*00*SHIP1*20261118*1500~TD5*B*2*UPSN*U*UPS Ground~REF*CN*1Z999AA10123456784~PRF*5001-FF4T-010~SE*6*0001~GE*1*42~IEA*1*000000042~"
              }
            }
          }
        }
      }
    },
    "/v1/edi/settings": {
      "get": {
        "tags": [
          "EDI and ERP"
        ],
        "summary": "EDI identifiers",
        "description": "Your interchange sender id and qualifier, per-partner ids, and whether documents are marked test (T) or production (P).",
        "operationId": "get_v1_edi_settings",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "description": "isa_qualifier, isa_sender_id, partners, test_mode."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "EDI and ERP"
        ],
        "summary": "Set EDI identifiers",
        "description": "Any of isa_sender_id, isa_qualifier, test_mode and partners ({\"RSR\": {\"isa_id\": \"...\", \"isa_qualifier\": \"ZZ\"}}).",
        "operationId": "put_v1_edi_settings",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "description": "The saved settings."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "isa_sender_id": "MYSTORE",
                "isa_qualifier": "ZZ",
                "test_mode": true,
                "partners": {
                  "RSR": {
                    "isa_id": "RSRGROUP",
                    "isa_qualifier": "ZZ"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/erp/export": {
      "get": {
        "tags": [
          "EDI and ERP"
        ],
        "summary": "Flat export for an ERP or accounting system",
        "description": "type is orders, purchase_order_lines, shipments or invoices; format is json or csv; since limits rows to those on or after a date. Pull it on a schedule, or combine it with webhooks to be told when to pull.",
        "operationId": "get_v1_erp_export",
        "parameters": [
          {
            "name": "type",
            "in": "query",
            "required": false,
            "description": "orders, purchase_order_lines, shipments or invoices.",
            "schema": {
              "type": "string"
            },
            "example": "purchase_order_lines"
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "description": "json (default) or csv.",
            "schema": {
              "type": "string"
            },
            "example": "json"
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "description": "ISO 8601 date or timestamp.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "description": "type, count, rows[]."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/vendors": {
      "post": {
        "tags": [
          "Vendors"
        ],
        "summary": "Add a vendor",
        "description": "Creates one of your own vendors and returns its portal token (shown this once) and the portal address. The vendor uses the token to upload inventory, see its purchase orders and add tracking. shipping_flat is what you pay the vendor per shipment; edi_id lets the vendor send 846 inventory documents.",
        "operationId": "post_v1_vendors",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "description": "vendor_id, portal_token, portal_url."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "name": "Ridge Line Supply",
                "contact_email": "orders@ridgeline.example",
                "shipping_flat": 4
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Vendors"
        ],
        "summary": "List vendors",
        "description": "Each vendor with its status and how many of its items are listed.",
        "operationId": "get_v1_vendors",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "description": "vendors[]."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/vendors/{id}": {
      "put": {
        "tags": [
          "Vendors"
        ],
        "summary": "Update or disable a vendor",
        "description": "status (active or disabled), shipping_flat or name. A disabled vendor cannot sign in and its stock leaves your catalog.",
        "operationId": "put_v1_vendors_id",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The vendor id.",
            "schema": {
              "type": "string"
            },
            "example": "VEN4K7QZ"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "description": "The vendor."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "status": "disabled"
              }
            }
          }
        }
      }
    },
    "/v1/vendors/{id}/token": {
      "post": {
        "tags": [
          "Vendors"
        ],
        "summary": "Replace a vendor's portal token",
        "description": "The old token stops working at once.",
        "operationId": "post_v1_vendors_id_token",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The vendor id.",
            "schema": {
              "type": "string"
            },
            "example": "VEN4K7QZ"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "description": "vendor_id, portal_token."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/vendors/{id}/inventory": {
      "get": {
        "tags": [
          "Vendors"
        ],
        "summary": "A vendor's uploaded inventory",
        "description": "Every item with whether it matched a UPC in the master catalog.",
        "operationId": "get_v1_vendors_id_inventory",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The vendor id.",
            "schema": {
              "type": "string"
            },
            "example": "VEN4K7QZ"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "description": "items[]."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Vendors"
        ],
        "summary": "Upload inventory for a vendor",
        "description": "Send {\"items\": [{sku, upc, qty, cost, name}]} or {\"csv\": \"<file text>\"}. Replaces the previous upload. Items whose UPC is in the master catalog and that carry a cost join your catalog as one more source, so quotes and optimal routing can choose the vendor.",
        "operationId": "put_v1_vendors_id_inventory",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The vendor id.",
            "schema": {
              "type": "string"
            },
            "example": "VEN4K7QZ"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "description": "accepted, matched, unmatched, rejected[]."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "items": [
                  {
                    "sku": "RL-100",
                    "upc": "720868151439",
                    "qty": 25,
                    "cost": 9.5
                  }
                ]
              }
            }
          }
        }
      }
    },
    "/v1/portal/me": {
      "get": {
        "tags": [
          "Vendor portal"
        ],
        "summary": "The signed-in vendor",
        "description": "Portal routes take the vendor's portal token as \"Authorization: Bearer <token>\", not an API key, and are not tied to the IP allowlist. The portal page at /portal/ uses these routes.",
        "operationId": "get_v1_portal_me",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "description": "vendor_id, name, customer, open_orders."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/portal/orders": {
      "get": {
        "tags": [
          "Vendor portal"
        ],
        "summary": "Purchase orders for the vendor",
        "description": "status=open (waiting to ship) or shipped.",
        "operationId": "get_v1_portal_orders",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "open or shipped.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "description": "count, orders[]."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/portal/orders/{po}/tracking": {
      "post": {
        "tags": [
          "Vendor portal"
        ],
        "summary": "Add tracking to a purchase order",
        "description": "carrier is UPS, FedEx, USPS or Other. The order becomes shipped and order.shipped webhooks fire.",
        "operationId": "post_v1_portal_orders_po_tracking",
        "parameters": [
          {
            "name": "po",
            "in": "path",
            "required": true,
            "description": "The PO number.",
            "schema": {
              "type": "string"
            },
            "example": "8102-FF4T-010"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "description": "The purchase order."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "carrier": "UPS",
                "tracking_number": "1Z999AA10123456784"
              }
            }
          }
        }
      }
    },
    "/v1/portal/inventory": {
      "get": {
        "tags": [
          "Vendor portal"
        ],
        "summary": "The vendor's current inventory",
        "description": "",
        "operationId": "get_v1_portal_inventory",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "description": "items[]."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Vendor portal"
        ],
        "summary": "Upload an inventory file",
        "description": "Send {\"csv\": \"<file text>\"} with columns sku, upc, qty, cost and optionally name, or {\"items\": [...]}.",
        "operationId": "put_v1_portal_inventory",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "description": "accepted, matched, unmatched, rejected[]."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "csv": "sku,upc,qty,cost\nRL-100,720868151439,25,9.50\n"
              }
            }
          }
        }
      }
    },
    "/v1/support/conversations": {
      "post": {
        "tags": [
          "Support chat"
        ],
        "summary": "Start a conversation with support",
        "description": "Opens a thread with your first message. The chat page at /support/ uses these routes. Replies from staff raise support.message.created.",
        "operationId": "post_v1_support_conversations",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "description": "The conversation with its messages."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "subject": "Feed stopped updating",
                "message": "Our RSR feed stopped updating this morning."
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Support chat"
        ],
        "summary": "List conversations",
        "description": "Newest activity first, with a count of staff replies you have not read.",
        "operationId": "get_v1_support_conversations",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "open or closed.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "description": "count, conversations[]."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/support/conversations/{id}": {
      "get": {
        "tags": [
          "Support chat"
        ],
        "summary": "Read a conversation",
        "description": "Reading it marks staff replies as read.",
        "operationId": "get_v1_support_conversations_id",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The conversation id.",
            "schema": {
              "type": "string"
            },
            "example": "cv_..."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "description": "The conversation with its messages."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/support/conversations/{id}/messages": {
      "post": {
        "tags": [
          "Support chat"
        ],
        "summary": "Add a message",
        "description": "",
        "operationId": "post_v1_support_conversations_id_messages",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The conversation id.",
            "schema": {
              "type": "string"
            },
            "example": "cv_..."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "description": "The conversation with its messages."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "message": "It is working again, thank you."
              }
            }
          }
        }
      }
    },
    "/v1/support/conversations/{id}/close": {
      "post": {
        "tags": [
          "Support chat"
        ],
        "summary": "Close a conversation",
        "description": "",
        "operationId": "post_v1_support_conversations_id_close",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The conversation id.",
            "schema": {
              "type": "string"
            },
            "example": "cv_..."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "description": "The conversation summary."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/mcp/settings": {
      "get": {
        "tags": [
          "MCP connector"
        ],
        "summary": "Connector settings and active links",
        "description": "Whether the MCP connector is on, whether bulk changes are allowed, the shipping target used for \"late\" in reports, the connector address, and every assistant currently linked.",
        "operationId": "get_v1_mcp_settings",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "description": "enabled, allow_writes, ship_target_hours, mcp_url, connections[]."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "MCP connector"
        ],
        "summary": "Switch the connector on or off",
        "description": "The connector is off until enabled is true. A link approved in a browser is then used from the assistant's servers, outside this key's IP allowlist, which is why it is opt-in. allow_writes lets linked assistants start bulk changes (each one previewed, then confirmed). Switching the connector off removes every link.",
        "operationId": "put_v1_mcp_settings",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "description": "The saved settings."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "enabled": true,
                "allow_writes": false,
                "ship_target_hours": 48
              }
            }
          }
        }
      }
    },
    "/v1/mcp/connections/{id}": {
      "delete": {
        "tags": [
          "MCP connector"
        ],
        "summary": "Remove one linked assistant",
        "description": "Its tokens stop working at once.",
        "operationId": "delete_v1_mcp_connections_id",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The connection id from the settings.",
            "schema": {
              "type": "string"
            },
            "example": "mcn_..."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "description": "The saved settings."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/compliance/licenses": {
      "post": {
        "tags": [
          "Compliance"
        ],
        "summary": "Add a license and its book",
        "description": "Each license keeps its own acquisition and disposition book. The license type is read from the number. A license starts with FastBound as its legal system of record: every committed change is queued for FastBound and reconciled.",
        "operationId": "post_v1_compliance_licenses",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "description": "id, ffl_number, license_type, system_of_record, next_line_no."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "ffl_number": "5-71-131-07-7A-12345",
                "name": "Example Arms LLC",
                "time_zone": "America/Chicago"
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Compliance"
        ],
        "summary": "List licenses",
        "description": "Every license on the account with its system of record.",
        "operationId": "get_v1_compliance_licenses",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "description": "licenses[]."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/compliance/licenses/{id}/system-of-record": {
      "post": {
        "tags": [
          "Compliance"
        ],
        "summary": "Change the legal system of record",
        "description": "Switch between 'fastbound' and 'rollstamp'. Making RollStamp the legal book needs counsel_signoff from counsel who reviewed it against ATF Rul. 2016-1 (verify), and an empty FastBound queue.",
        "operationId": "post_v1_compliance_licenses_id_system_of_record",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "License id.",
            "schema": {
              "type": "string"
            },
            "example": "lic_1abc123"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "description": "the license."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "system_of_record": "rollstamp",
                "counsel_signoff": {
                  "by": "Jane Doe, Esq.",
                  "signed_at": "2028-07-01T15:00:00Z",
                  "document_ref": "memo-2028-07-01"
                },
                "recorded_by": "owner@example.com"
              }
            }
          }
        }
      }
    },
    "/v1/compliance/acquisitions": {
      "post": {
        "tags": [
          "Compliance"
        ],
        "summary": "Record an acquisition",
        "description": "type is RECEIVE (from a licensee or a person), MANUFACTURE (Type 07 or 10), IMPORT (Type 08 or 11) or FOUND (a line earlier disposed as THEFT_LOSS). item.type is one of: pistol, revolver, rifle, shotgun, receiver, frame, derringer, combination gun, silencer, short-barreled rifle, short-barreled shotgun, any other weapon, machine gun, destructive device, other. A second open line for the same manufacturer and serial is refused. The answer shows the recording deadline and whether this entry was late.",
        "operationId": "post_v1_compliance_acquisitions",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "description": "item, transaction (with deadline and sync)."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "license_id": "lic_1abc123",
                "type": "RECEIVE",
                "acquired_at": "2026-11-19T15:00:00Z",
                "recorded_by": "clerk@example.com",
                "item": {
                  "manufacturer": "Example Firearms",
                  "model": "EX-15",
                  "serial": "EX123456",
                  "type": "rifle",
                  "caliber": "5.56 NATO"
                },
                "source": {
                  "name": "Example Distributing",
                  "ffl_number": "1-23-456-01-7C-01234"
                }
              }
            }
          }
        }
      }
    },
    "/v1/compliance/dispositions": {
      "post": {
        "tags": [
          "Compliance"
        ],
        "summary": "Record a disposition",
        "description": "type is one of: FFL_TRANSFER, RETAIL_4473, EXEMPT_TRANSFER, RETURN_TO_SOURCE, THEFT_LOSS, DESTROYED, NFA_FORM_3, NFA_FORM_4, NFA_FORM_5. Send pending: true to hold the line while a 4473, NICS check or NFA form is in progress, then commit or cancel it. RETAIL_4473 needs form4473_ref to complete, and a NICS status other than proceed blocks it.",
        "operationId": "post_v1_compliance_dispositions",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "description": "item, transaction."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "item_id": "itm_2def456",
                "type": "FFL_TRANSFER",
                "disposed_at": "2026-11-20T16:00:00Z",
                "recorded_by": "clerk@example.com",
                "transferee": {
                  "name": "Example Outfitters",
                  "ffl_number": "1-23-456-01-7C-01234"
                }
              }
            }
          }
        }
      }
    },
    "/v1/compliance/dispositions/{id}/commit": {
      "post": {
        "tags": [
          "Compliance"
        ],
        "summary": "Complete a held disposition",
        "description": "Fields missing at hold time (form4473_ref, nfa_form_ref, nics) can be sent here. disposed_at defaults to now.",
        "operationId": "post_v1_compliance_dispositions_id_commit",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Disposition transaction id.",
            "schema": {
              "type": "string"
            },
            "example": "dtx_..."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "description": "item, transaction."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "form4473_ref": "4473-000981",
                "nics": {
                  "ntn": "100AB12CD",
                  "status": "proceed"
                },
                "recorded_by": "clerk@example.com"
              }
            }
          }
        }
      }
    },
    "/v1/compliance/dispositions/{id}/cancel": {
      "post": {
        "tags": [
          "Compliance"
        ],
        "summary": "Release a held disposition",
        "description": "The line goes back to open.",
        "operationId": "post_v1_compliance_dispositions_id_cancel",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Disposition transaction id.",
            "schema": {
              "type": "string"
            },
            "example": "dtx_..."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "description": "item, transaction."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "recorded_by": "clerk@example.com"
              }
            }
          }
        }
      }
    },
    "/v1/compliance/assemble": {
      "post": {
        "tags": [
          "Compliance"
        ],
        "summary": "Build a firearm from a receiver",
        "description": "Type 07 or 10 only. Closes the receiver line as ASSEMBLED_INTO and opens the finished firearm under the same serial.",
        "operationId": "post_v1_compliance_assemble",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "description": "item, receiver, transactions[]."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "receiver_item_id": "itm_2def456",
                "type": "rifle",
                "model": "EX-15 Carbine",
                "caliber": "5.56 NATO",
                "assembled_at": "2026-11-19T20:00:00Z",
                "recorded_by": "builder@example.com"
              }
            }
          }
        }
      }
    },
    "/v1/compliance/disassemble": {
      "post": {
        "tags": [
          "Compliance"
        ],
        "summary": "Take a firearm back to a receiver",
        "description": "Closes the firearm line as DISASSEMBLED and opens a receiver line under the same serial.",
        "operationId": "post_v1_compliance_disassemble",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "description": "item, previous, transactions[]."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "item_id": "itm_2def456",
                "disassembled_at": "2026-11-19T20:00:00Z",
                "recorded_by": "builder@example.com"
              }
            }
          }
        }
      }
    },
    "/v1/compliance/private-transfers": {
      "post": {
        "tags": [
          "Compliance"
        ],
        "summary": "Start a private-party transfer",
        "description": "Records the acquisition from the seller and holds a RETAIL_4473 disposition to the buyer until the 4473 is complete.",
        "operationId": "post_v1_compliance_private_transfers",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "description": "item, transactions[], next."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "license_id": "lic_1abc123",
                "received_at": "2026-11-19T15:00:00Z",
                "recorded_by": "clerk@example.com",
                "item": {
                  "manufacturer": "Example Firearms",
                  "model": "EX-9",
                  "serial": "P900001",
                  "type": "pistol",
                  "caliber": "9mm"
                },
                "seller": {
                  "name": "Sam Seller",
                  "address": {
                    "line1": "3114 Example Rd",
                    "city": "Fort Smith",
                    "state": "AR",
                    "postal_code": "72901"
                  }
                },
                "buyer": {
                  "name": "Bea Buyer",
                  "address": {
                    "line1": "3114 Example Rd",
                    "city": "Fort Smith",
                    "state": "AR",
                    "postal_code": "72901"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/compliance/items": {
      "get": {
        "tags": [
          "Compliance"
        ],
        "summary": "List book lines",
        "description": "Filter by license, status or serial (look-alike characters such as O and 0 match).",
        "operationId": "get_v1_compliance_items",
        "parameters": [
          {
            "name": "license_id",
            "in": "query",
            "required": false,
            "description": "License id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "open, pending or disposed.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "serial",
            "in": "query",
            "required": false,
            "description": "Serial to look up.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "1-500, default 100.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "description": "Rows to skip.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "description": "count, items[]."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/compliance/items/{id}": {
      "get": {
        "tags": [
          "Compliance"
        ],
        "summary": "Get one line with its history",
        "description": "Every correction is kept with who made it, when and why.",
        "operationId": "get_v1_compliance_items_id",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Item id.",
            "schema": {
              "type": "string"
            },
            "example": "itm_2def456"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "description": "the item with history[]."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/compliance/items/{id}/corrections": {
      "post": {
        "tags": [
          "Compliance"
        ],
        "summary": "Correct a line",
        "description": "Writes a new version; the old values stay in history. A reason and recorded_by are required.",
        "operationId": "post_v1_compliance_items_id_corrections",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Item id.",
            "schema": {
              "type": "string"
            },
            "example": "itm_2def456"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "description": "item with history, transaction."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "changes": {
                  "serial": "EX123465"
                },
                "reason": "Digits transposed at receiving.",
                "recorded_by": "compliance@example.com"
              }
            }
          }
        }
      }
    },
    "/v1/compliance/book": {
      "get": {
        "tags": [
          "Compliance"
        ],
        "summary": "The bound book for a license",
        "description": "Lines in entry order with acquisition, description and disposition columns. Filter by date range.",
        "operationId": "get_v1_compliance_book",
        "parameters": [
          {
            "name": "license_id",
            "in": "query",
            "required": false,
            "description": "License id (required).",
            "schema": {
              "type": "string"
            },
            "example": "lic_1abc123"
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "description": "ISO date-time.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "description": "ISO date-time.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "description": "license, count, rows[]."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/compliance/transactions": {
      "get": {
        "tags": [
          "Compliance"
        ],
        "summary": "Ledger transactions",
        "description": "Newest first.",
        "operationId": "get_v1_compliance_transactions",
        "parameters": [
          {
            "name": "license_id",
            "in": "query",
            "required": false,
            "description": "License id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "item_id",
            "in": "query",
            "required": false,
            "description": "Item id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "1-500.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "description": "count, transactions[]."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/compliance/exceptions": {
      "get": {
        "tags": [
          "Compliance"
        ],
        "summary": "What needs attention",
        "description": "Late entries, holds older than 25 days, changes not in FastBound after 24 hours, look-alike serials, and the same firearm open on two licenses.",
        "operationId": "get_v1_compliance_exceptions",
        "parameters": [
          {
            "name": "license_id",
            "in": "query",
            "required": false,
            "description": "License id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "description": "total, late_entries[], stale_pending[], sync_backlog[], look_alike_serials[], open_on_two_licenses[]."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/compliance/deadlines": {
      "get": {
        "tags": [
          "Compliance"
        ],
        "summary": "Recording rules and open holds",
        "description": "The deadline rules in force, with citations, and every held disposition with its age.",
        "operationId": "get_v1_compliance_deadlines",
        "parameters": [
          {
            "name": "license_id",
            "in": "query",
            "required": false,
            "description": "License id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "description": "rules[], pending_dispositions[]."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/compliance/sync": {
      "get": {
        "tags": [
          "Compliance"
        ],
        "summary": "Changes queued for the legal book",
        "description": "One entry per committed change while FastBound is the system of record.",
        "operationId": "get_v1_compliance_sync",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "queued, synced or failed.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "license_id",
            "in": "query",
            "required": false,
            "description": "License id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "description": "count, entries[]."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/compliance/sync/{id}/ack": {
      "post": {
        "tags": [
          "Compliance"
        ],
        "summary": "Record a sync result",
        "description": "The FastBound adapter reports each result here: ok with the FastBound id, or ok: false with the error.",
        "operationId": "post_v1_compliance_sync_id_ack",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Sync entry id.",
            "schema": {
              "type": "string"
            },
            "example": "sync_..."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "description": "the sync entry."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "ok": true,
                "external_id": "fb-889120"
              }
            }
          }
        }
      }
    },
    "/v1/manufacturing/templates": {
      "post": {
        "tags": [
          "Manufacturing"
        ],
        "summary": "Create a product template",
        "description": "A template holds the regulated description copied onto each book line at build time. marking_lines are the extra lines sent to the laser engraver.",
        "operationId": "post_v1_manufacturing_templates",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "description": "id, manufacturer, model, type, caliber, importer, excise_category, marking_lines."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "manufacturer": "Example Arms",
                "model": "EX-15",
                "type": "rifle",
                "caliber": "5.56 NATO",
                "importer": null,
                "excise_category": "other_firearms",
                "marking_lines": [
                  "Example Arms",
                  "Fort Smith, AR"
                ]
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Manufacturing"
        ],
        "summary": "List product templates",
        "description": "Every template on the account.",
        "operationId": "get_v1_manufacturing_templates",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "description": "count, templates[]."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/manufacturing/templates/{id}": {
      "get": {
        "tags": [
          "Manufacturing"
        ],
        "summary": "Get a product template",
        "description": "One template with its excise category and marking lines.",
        "operationId": "get_v1_manufacturing_templates_id",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Template id.",
            "schema": {
              "type": "string"
            },
            "example": "tpl_2def456"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "description": "the template."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/manufacturing/series": {
      "post": {
        "tags": [
          "Manufacturing"
        ],
        "summary": "Create a serial series",
        "description": "The series belongs to one Type 07 or 10 license. Serial format is prefix, optional four-digit year, zero-padded sequence and suffix. The sequence is never reused, even after a void.",
        "operationId": "post_v1_manufacturing_series",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "description": "the series, including next_seq."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "license_id": "lic_1abc123",
                "prefix": "EX-",
                "width": 4,
                "year": true,
                "suffix": ""
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Manufacturing"
        ],
        "summary": "List serial series",
        "description": "Optionally filter by license.",
        "operationId": "get_v1_manufacturing_series",
        "parameters": [
          {
            "name": "license_id",
            "in": "query",
            "required": false,
            "description": "License id.",
            "schema": {
              "type": "string"
            },
            "example": "lic_1abc123"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "description": "count, series[]."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/manufacturing/series/{id}": {
      "get": {
        "tags": [
          "Manufacturing"
        ],
        "summary": "Get a serial series",
        "description": "The template and the next sequence value without taking it.",
        "operationId": "get_v1_manufacturing_series_id",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Series id.",
            "schema": {
              "type": "string"
            },
            "example": "ser_3ghi789"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "description": "the series."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/manufacturing/series/{id}/next": {
      "get": {
        "tags": [
          "Manufacturing"
        ],
        "summary": "Show the next serial",
        "description": "Does not consume a sequence value.",
        "operationId": "get_v1_manufacturing_series_id_next",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Series id.",
            "schema": {
              "type": "string"
            },
            "example": "ser_3ghi789"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "description": "the series plus year_value and next_serial."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/manufacturing/series/{id}/reservations": {
      "post": {
        "tags": [
          "Manufacturing"
        ],
        "summary": "Reserve serials",
        "description": "Takes count serials for a product template and an optional batch. Values that were already issued, or that clash with an open line for the same manufacturer on that license, are skipped and consumed. The answer lists them in skipped.",
        "operationId": "post_v1_manufacturing_series_id_reservations",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Series id.",
            "schema": {
              "type": "string"
            },
            "example": "ser_3ghi789"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "description": "count, batch, model, series_id, serials[], skipped[]."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "count": 25,
                "model": "tpl_2def456",
                "batch": "batch-2026-11",
                "recorded_by": "maker@example.com"
              }
            }
          }
        }
      }
    },
    "/v1/manufacturing/serials": {
      "get": {
        "tags": [
          "Manufacturing"
        ],
        "summary": "List serials",
        "description": "Filter by license, series, batch, model or state. State is reserved, marked, acquired, disposed or void.",
        "operationId": "get_v1_manufacturing_serials",
        "parameters": [
          {
            "name": "license_id",
            "in": "query",
            "required": false,
            "description": "License id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "series_id",
            "in": "query",
            "required": false,
            "description": "Series id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "batch",
            "in": "query",
            "required": false,
            "description": "Batch label.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "model",
            "in": "query",
            "required": false,
            "description": "Product template id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "description": "reserved, marked, acquired, disposed or void.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "1-1000, default 100.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "description": "Rows to skip.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "description": "count, serials[]."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/manufacturing/serials/{id}": {
      "get": {
        "tags": [
          "Manufacturing"
        ],
        "summary": "Get a serial",
        "description": "A disposed serial is shown as disposed when its book line is disposed.",
        "operationId": "get_v1_manufacturing_serials_id",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Serial id.",
            "schema": {
              "type": "string"
            },
            "example": "sn_4jkl012"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "description": "the serial."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/manufacturing/serials/{id}/void": {
      "post": {
        "tags": [
          "Manufacturing"
        ],
        "summary": "Void a serial",
        "description": "Only a reserved or marked serial can be voided. The reason and recorded_by are required. The value is never issued again.",
        "operationId": "post_v1_manufacturing_serials_id_void",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Serial id.",
            "schema": {
              "type": "string"
            },
            "example": "sn_4jkl012"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "description": "the voided serial."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "reason": "Laser damaged the receiver.",
                "recorded_by": "maker@example.com"
              }
            }
          }
        }
      }
    },
    "/v1/manufacturing/scans": {
      "post": {
        "tags": [
          "Manufacturing"
        ],
        "summary": "Confirm a laser scan",
        "description": "A known reserved serial becomes marked. An unknown serial or a serial in the wrong state is refused and written to the scan log.",
        "operationId": "post_v1_manufacturing_scans",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "description": "scan entry, serial."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "serial": "EX-20260001",
                "license_id": "lic_1abc123",
                "recorded_by": "maker@example.com"
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Manufacturing"
        ],
        "summary": "List scan attempts",
        "description": "Successful and refused scans, newest last. Filter by license, serial or outcome.",
        "operationId": "get_v1_manufacturing_scans",
        "parameters": [
          {
            "name": "license_id",
            "in": "query",
            "required": false,
            "description": "License id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "serial",
            "in": "query",
            "required": false,
            "description": "Scanned serial.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "outcome",
            "in": "query",
            "required": false,
            "description": "marked or refused.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "1-500, default 100.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "description": "Rows to skip.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "description": "count, scans[]."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/manufacturing/laser-jobs/export.csv": {
      "get": {
        "tags": [
          "Manufacturing"
        ],
        "summary": "Export a laser job as CSV",
        "description": "One row per reserved serial with serial, manufacturer, model, caliber and the template marking lines. Select by batch, comma-separated serials or series_id.",
        "operationId": "get_v1_manufacturing_laser_jobs_export_csv",
        "parameters": [
          {
            "name": "batch",
            "in": "query",
            "required": false,
            "description": "Batch label.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "serials",
            "in": "query",
            "required": false,
            "description": "Comma-separated serials.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "series_id",
            "in": "query",
            "required": false,
            "description": "Series id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "license_id",
            "in": "query",
            "required": false,
            "description": "License id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string",
                  "description": "CSV text with a header row and quoted fields."
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/manufacturing/laser-jobs/export.txt": {
      "get": {
        "tags": [
          "Manufacturing"
        ],
        "summary": "Export a laser job as text",
        "description": "One reserved serial per line. Select by batch, comma-separated serials or series_id.",
        "operationId": "get_v1_manufacturing_laser_jobs_export_txt",
        "parameters": [
          {
            "name": "batch",
            "in": "query",
            "required": false,
            "description": "Batch label.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "serials",
            "in": "query",
            "required": false,
            "description": "Comma-separated serials.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "series_id",
            "in": "query",
            "required": false,
            "description": "Series id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "license_id",
            "in": "query",
            "required": false,
            "description": "License id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string",
                  "description": "Plain text, one serial per line."
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/manufacturing/builds": {
      "post": {
        "tags": [
          "Manufacturing"
        ],
        "summary": "Complete a build",
        "description": "The serial must be marked. Writes the MANUFACTURE acquisition with the template fields, then moves the serial to acquired. If the ledger refuses, the serial stays marked.",
        "operationId": "post_v1_manufacturing_builds",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "description": "serial, build, item, transaction."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "serial": "EX-20260001",
                "license_id": "lic_1abc123",
                "completed_at": "2026-11-19T20:00:00Z",
                "recorded_by": "maker@example.com"
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Manufacturing"
        ],
        "summary": "List completed builds",
        "description": "Completed builds counted for the annual excise threshold. Filter by license or year.",
        "operationId": "get_v1_manufacturing_builds",
        "parameters": [
          {
            "name": "license_id",
            "in": "query",
            "required": false,
            "description": "License id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "year",
            "in": "query",
            "required": false,
            "description": "Four-digit calendar year.",
            "schema": {
              "type": "string"
            },
            "example": "2026"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "description": "count, builds[]."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/manufacturing/excise/sales": {
      "post": {
        "tags": [
          "Manufacturing"
        ],
        "summary": "Accrue excise tax on a sale",
        "description": "Send a template_id or an excise_category. unit_price is integer cents and quantity is a positive integer. Tax is rounded half up once per sale line. A supplied exempt_reason records a zero tax claim that needs verification.",
        "operationId": "post_v1_manufacturing_excise_sales",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "description": "sale with gross_cents, tax_cents and citation."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "template_id": "tpl_2def456",
                "quantity": 3,
                "unit_price": 49999,
                "sold_at": "2026-11-19T18:00:00Z",
                "exempt_reason": null,
                "recorded_by": "maker@example.com"
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Manufacturing"
        ],
        "summary": "List excise accruals",
        "description": "Filter by calendar year and quarter.",
        "operationId": "get_v1_manufacturing_excise_sales",
        "parameters": [
          {
            "name": "year",
            "in": "query",
            "required": false,
            "description": "Four-digit year.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "quarter",
            "in": "query",
            "required": false,
            "description": "1, 2, 3 or 4.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "description": "count, sales[]."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/manufacturing/excise/count": {
      "get": {
        "tags": [
          "Manufacturing"
        ],
        "summary": "Manufactured count and thresholds",
        "description": "Counts completed builds across every license on the account for a calendar year. The alert is a product setting at 40. The small manufacturer threshold is data at 50 and still needs verification.",
        "operationId": "get_v1_manufacturing_excise_count",
        "parameters": [
          {
            "name": "year",
            "in": "query",
            "required": false,
            "description": "Four-digit year, default current UTC year.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "description": "year, manufactured, alert, alert_level, threshold_reached, small_manufacturer_rule."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/manufacturing/excise/worksheet": {
      "get": {
        "tags": [
          "Manufacturing"
        ],
        "summary": "Quarterly excise worksheet",
        "description": "Totals per category with units, gross sales and tax, the year to date manufactured count, the filing due date and whether the small manufacturer threshold may apply. Every amount is in integer cents.",
        "operationId": "get_v1_manufacturing_excise_worksheet",
        "parameters": [
          {
            "name": "year",
            "in": "query",
            "required": false,
            "description": "Four-digit year, default current UTC year.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "quarter",
            "in": "query",
            "required": false,
            "description": "1, 2, 3 or 4, default current UTC quarter.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "description": "period, form, filing_citation, rows[], totals, year_to_date_manufactured, small_manufacturer_threshold, notes[]."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key not authorized, no IP allowlist, or caller IP not allowlisted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited (honor Retry-After)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/openapi.json": {
      "get": {
        "tags": [
          "Documentation"
        ],
        "summary": "This document",
        "security": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {}
            }
          }
        }
      }
    },
    "/v1/docs": {
      "get": {
        "tags": [
          "Documentation"
        ],
        "summary": "API explorer",
        "security": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/html": {}
            }
          }
        }
      }
    },
    "/v1/docs/guide": {
      "get": {
        "tags": [
          "Documentation"
        ],
        "summary": "Developer guide",
        "security": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/html": {}
            }
          }
        }
      }
    },
    "/v1/llms.txt": {
      "get": {
        "tags": [
          "Documentation"
        ],
        "summary": "Agent reference",
        "security": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/markdown": {}
            }
          }
        }
      }
    }
  },
  "x-product-classes": {
    "AC": "Accessories",
    "AG": "Air Guns & Accessories",
    "AO": "Ammunition",
    "AP": "Apparel",
    "AR": "Archery",
    "BP": "Black Powder Firearms",
    "BS": "Binoculars & Spotting",
    "FA": "Firearms",
    "FI": "Fishing",
    "FP": "Firearms Parts",
    "HS": "Holsters",
    "HT": "Hunting",
    "HZ": "Hazardous",
    "KN": "Knives",
    "LL": "Lights & Lasers",
    "MG": "Magazines",
    "MZ": "Muzzleloading",
    "OP": "Optics",
    "OT": "Other",
    "RC": "Range Bags & Cases",
    "RL": "Reloading",
    "SF": "Safes",
    "SO": "SOT"
  }
}