{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/jumpseller-com/json-schema/jumpseller-com-shipping-method-edit-schema.json",
  "title": "ShippingMethodEdit",
  "x-generated": "2026-11-13",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/jumpseller-com-openapi-openapi.json#/components/schemas/ShippingMethodEdit",
  "type": "object",
  "properties": {
    "shipping_method": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "description": "Type of shipping method ('external' or 'tables')",
          "enum": [
            "external",
            "tables"
          ]
        },
        "name": {
          "type": "string",
          "description": "Name of the Shipping Method"
        }
      },
      "oneOf": [
        {
          "title": "External Shipping Method",
          "properties": {
            "type": {
              "type": "string",
              "enum": [
                "external"
              ]
            },
            "callback_url": {
              "type": "string",
              "description": "URL that receives shipping data and returns rates"
            },
            "fetch_services_url": {
              "type": "string",
              "description": "URL that returns available shipping services"
            },
            "token": {
              "type": "string",
              "description": "Token used to authenticate on fetch_services_url"
            },
            "state": {
              "type": "string",
              "description": "Origin state/region code"
            },
            "city": {
              "type": "string",
              "description": "Origin city or municipality"
            },
            "postal": {
              "type": "string",
              "description": "Origin postal/zip code"
            }
          }
        },
        {
          "title": "Tables Shipping Method",
          "properties": {
            "type": {
              "type": "string",
              "enum": [
                "tables"
              ]
            },
            "tables": {
              "type": "array",
              "description": "List of shipping tables defining pricing and locations",
              "items": {
                "type": "object",
                "properties": {
                  "basedon": {
                    "type": "string",
                    "description": "Criteria for calculating shipping rates",
                    "enum": [
                      "weight",
                      "price",
                      "quantity",
                      "distance"
                    ]
                  },
                  "values": {
                    "type": "array",
                    "description": "Pricing rules for each range",
                    "items": {
                      "type": "object",
                      "properties": {
                        "amount": {
                          "type": "number",
                          "description": "Minimum base value for the rule"
                        },
                        "price": {
                          "type": "number",
                          "description": "Price applied for this rule"
                        }
                      }
                    }
                  },
                  "locations": {
                    "type": "array",
                    "description": "Geographic zones where this table applies",
                    "items": {
                      "type": "object",
                      "properties": {
                        "country": {
                          "type": "string",
                          "description": "Country code"
                        },
                        "region": {
                          "type": "string",
                          "description": "Region or state code"
                        },
                        "municipality": {
                          "type": "string",
                          "description": "Municipality or locality code"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      ]
    }
  }
}