{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/aftership/main/json-schema/aftership-estimated-delivery-date-request-schema.json",
  "title": "Estimated_delivery_date Request",
  "x-generated": "2026-10-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/aftership-estimated-delivery-date-api-openapi.yml#/components/schemas/Estimated_delivery_date_Request",
  "x-stoplight": {
    "id": "buezc13rd1k96"
  },
  "type": "object",
  "required": [
    "slug",
    "origin_address",
    "destination_address"
  ],
  "properties": {
    "slug": {
      "type": "string",
      "description": "AfterShip's unique code of courier. Please refer to https://track.aftership.com/couriers/download.",
      "minLength": 1,
      "x-stoplight": {
        "id": "2fkha2qr7unu4"
      }
    },
    "service_type_name": {
      "type": [
        "string",
        "null"
      ],
      "minLength": 1,
      "x-stoplight": {
        "id": "xf5a54x0eznad"
      },
      "description": "AfterShip’s unique code represents carrier’s shipping and delivery options. Refer to [Download Link](https://assets.aftership.com/downloads/service_type_list.csv)."
    },
    "origin_address": {
      "type": "object",
      "description": "The location from where the package is picked up by the carrier to be delivered to the final destination.",
      "x-stoplight": {
        "id": "3l69kjt8h52rv"
      },
      "required": [
        "country_region"
      ],
      "properties": {
        "country_region": {
          "type": "string",
          "description": "The country/region of the origin location from where the package is picked up by the carrier to be delivered to the final destination. Use 3 letters of ISO 3166-1 country/region code.",
          "minLength": 1,
          "x-stoplight": {
            "id": "e8i3q8cgrao1i"
          }
        },
        "state": {
          "type": [
            "string",
            "null"
          ],
          "description": "State, province, or the equivalent location of the origin address. Use 3 letters of ISO 3166-1 country/region code for countries/regions without state. \n</br><span style=color:#ff6b2b;padding:2px>**Either `origin_address.state` or `origin_address.postal_code` is required.**</span>",
          "minLength": 1,
          "maxLength": 256,
          "x-stoplight": {
            "id": "x45tzbvglk1kb"
          }
        },
        "city": {
          "type": [
            "string",
            "null"
          ],
          "description": "City of the origin address. Use 3 letters of ISO 3166-1 country/region code for countries/regions without City.",
          "minLength": 1,
          "maxLength": 256,
          "x-stoplight": {
            "id": "w2dh3z5iuz66d"
          }
        },
        "postal_code": {
          "type": [
            "string",
            "null"
          ],
          "description": "Postal code of the origin address. Use 3 letters of ISO 3166-1 country/region code for countries/regions without postal code. \n</br><span style=color:#ff6b2b;padding:2px>**Either `origin_address.state` or `origin_address.postal_code` is required.**</span>",
          "minLength": 1,
          "maxLength": 256,
          "x-stoplight": {
            "id": "fnr91dv4wzr7x"
          }
        },
        "raw_location": {
          "type": [
            "string",
            "null"
          ],
          "description": "Raw location of the origin address. A raw address will help AI to identify the accurate location of the origin address.",
          "minLength": 1,
          "maxLength": 512,
          "x-stoplight": {
            "id": "4rdm7ly5rzeix"
          }
        }
      }
    },
    "destination_address": {
      "type": "object",
      "description": "The final destination of the customer where the delivery will be made.",
      "x-stoplight": {
        "id": "8becp8jxtn0kc"
      },
      "required": [
        "country_region"
      ],
      "properties": {
        "country_region": {
          "type": "string",
          "description": "The country/region of the destination location where the package will be delivered. Use 3 letters of ISO 3166-1 country code.",
          "minLength": 1,
          "x-stoplight": {
            "id": "0x042hr28q5rd"
          }
        },
        "state": {
          "type": [
            "string",
            "null"
          ],
          "description": "State, province, or the equivalent location of the destination address where the package will be delivered.\n</br><span style=color:#ff6b2b;padding:2px>**Either `destination_address.state` or `destination_address.postal_code` is required.**</span>",
          "minLength": 1,
          "maxLength": 256,
          "x-stoplight": {
            "id": "6kfy7eftkvxvw"
          }
        },
        "city": {
          "type": [
            "string",
            "null"
          ],
          "description": "City of the destination address where the package will be delivered.",
          "minLength": 1,
          "maxLength": 256,
          "x-stoplight": {
            "id": "88zharfsrag0i"
          }
        },
        "postal_code": {
          "type": [
            "string",
            "null"
          ],
          "description": "Postal code of the destination address.\n</br><span style=color:#ff6b2b;padding:2px>**Either `destination_address.state` or `destination_address.postal_code` is required.**</span>",
          "minLength": 1,
          "maxLength": 256,
          "x-stoplight": {
            "id": "soc4rhu323pph"
          }
        },
        "raw_location": {
          "type": [
            "string",
            "null"
          ],
          "description": "Raw location of the destination address. A raw address will help AI to identify the accurate location of the destination address.",
          "minLength": 1,
          "maxLength": 512,
          "x-stoplight": {
            "id": "5hxma28s9fb5p"
          }
        }
      }
    },
    "weight": {
      "type": [
        "object",
        "null"
      ],
      "description": "AfterShip uses this object to calculate the total weight of the order.",
      "x-stoplight": {
        "id": "r8zixon4yhr9t"
      },
      "required": [
        "unit",
        "value"
      ],
      "properties": {
        "unit": {
          "type": "string",
          "description": "The weight unit of the package. ",
          "x-stoplight": {
            "id": "p70tijbxdtej6"
          }
        },
        "value": {
          "type": "number",
          "description": "The weight of the shipment.",
          "x-stoplight": {
            "id": "33iyg3ulcnbzm"
          }
        }
      }
    },
    "package_count": {
      "type": [
        "integer",
        "null"
      ],
      "description": "The number of packages.",
      "x-stoplight": {
        "id": "gqk68aa256ryf"
      }
    },
    "pickup_time": {
      "type": [
        "string",
        "null"
      ],
      "x-stoplight": {
        "id": "j6yfz7d6yc8n1"
      },
      "description": "The local pickup time in the origin address time zone of the package.\n</br><span style=color:#ff6b2b;padding:2px>**Either `pickup_time` or `estimated_pickup` is required.**</span>"
    },
    "estimated_pickup": {
      "type": [
        "object",
        "null"
      ],
      "description": "The local pickup time of the package.\n</br><span style=color:#ff6b2b;padding:2px>**Either `pickup_time` or `estimated_pickup` is required.**</span>",
      "x-stoplight": {
        "id": "prba2x0eapziz"
      },
      "required": [
        "order_time"
      ],
      "properties": {
        "order_time": {
          "type": "string",
          "description": "The local order time in the origin address time zone of the package.",
          "minLength": 1,
          "x-stoplight": {
            "id": "aweebjla82xtj"
          }
        },
        "order_cutoff_time": {
          "type": [
            "string",
            "null"
          ],
          "minLength": 1,
          "x-stoplight": {
            "id": "abspbd3v6q79o"
          },
          "description": "Order cut off time in the origin address time zone. The default value set by AfterShip is 18:00:00."
        },
        "business_days": {
          "type": [
            "array",
            "null"
          ],
          "description": "Operating days in a week. Number refers to the weekday.\nE.g., [1,2,3,4,5] means operating days are from Monday to Friday.\nAfterShip will set [1,2,3,4,5] as the default value.",
          "x-stoplight": {
            "id": "40m6r0vh76ydy"
          },
          "items": {
            "type": "integer",
            "description": "Operating days in a week. Number refers to the weekday.\nE.g., [1,2,3,4,5] means operating days are from Monday to Friday.\nAfterShip will set [1,2,3,4,5] as the default value.",
            "x-stoplight": {
              "id": "synct2dgbd6ib"
            }
          }
        },
        "order_processing_time": {
          "type": [
            "object",
            "null"
          ],
          "x-stoplight": {
            "id": "56a65mpwjlyye"
          },
          "properties": {
            "unit": {
              "type": "string",
              "minLength": 1,
              "description": "Processing time of an order, from being placed to being picked up. Only support day as value now.\nAfterShip will set day as the default value.",
              "x-stoplight": {
                "id": "raqv0b7k2ikz0"
              }
            },
            "value": {
              "type": "number",
              "description": "Processing time of an order, from being placed to being picked up.\nAfterShip will set 0 as the default value.",
              "x-stoplight": {
                "id": "4rv3pdeeonpjb"
              }
            }
          }
        }
      }
    }
  }
}