shipengine-json-schema
Version:
The official JSON Schemas for ShipEngine™
244 lines • 6 kB
JSON
{
"$id": "estimate_rates_request_body",
"title": "estimate_rates_request_body",
"type": "object",
"required": [
"from_country_code",
"from_postal_code",
"from_city_locality",
"from_state_provinced",
"to_country_code",
"to_postal_code",
"to_city_locality",
"to_state_province",
"weight",
"ship_date"
],
"additionalProperties": false,
"oneOf": [
{
"title": "rate_estimate_by_carrier_id",
"type": "object",
"properties": {
"carrier_id": {
"allOf": [
{
"title": "se_id",
"type": "string",
"minLength": 1,
"maxLength": 25,
"pattern": "^se(-[a-z0-9]+)+$"
}
]
}
}
},
{
"title": "rate_estimate_by_carrier_ids",
"type": "object",
"properties": {
"carrier_ids": {
"type": "array",
"minItems": 1,
"items": {
"type": "string",
"allOf": [
{
"title": "se_id",
"type": "string",
"minLength": 1,
"maxLength": 25,
"pattern": "^se(-[a-z0-9]+)+$"
}
]
}
}
}
}
],
"allOf": [
{
"title": "rate_estimate_options",
"type": "object",
"properties": {
"from_country_code": {
"allOf": [
{
"title": "country_code",
"type": "string",
"minLength": 2,
"maxLength": 2
}
]
},
"from_postal_code": {
"allOf": [
{
"title": "postal_code",
"minLength": 1,
"type": "string"
}
]
},
"from_city_locality": {
"type": "string",
"minLength": 1
},
"from_state_province": {
"type": "string",
"minLength": 1
},
"to_country_code": {
"allOf": [
{
"title": "country_code",
"type": "string",
"minLength": 2,
"maxLength": 2
}
]
},
"to_postal_code": {
"allOf": [
{
"title": "postal_code",
"minLength": 1,
"type": "string"
}
]
},
"to_city_locality": {
"type": "string",
"minLength": 1
},
"to_state_province": {
"type": "string",
"minLength": 1
},
"weight": {
"allOf": [
{
"title": "weight",
"type": "object",
"required": [
"value",
"unit"
],
"additionalProperties": false,
"properties": {
"value": {
"type": "number",
"format": "double",
"exclusiveMinimum": 0
},
"unit": {
"allOf": [
{
"title": "weight_unit",
"type": "string",
"enum": [
"pound",
"ounce",
"gram",
"kilogram"
]
}
]
}
}
}
]
},
"dimensions": {
"allOf": [
{
"title": "dimensions",
"type": "object",
"required": [
"unit",
"length",
"width",
"height"
],
"additionalProperties": false,
"properties": {
"unit": {
"default": "inch",
"allOf": [
{
"title": "dimension_unit",
"type": "string",
"enum": [
"inch",
"centimeter"
]
}
]
},
"length": {
"type": "number",
"format": "double",
"minimum": 0,
"default": 0
},
"width": {
"type": "number",
"format": "double",
"minimum": 0,
"default": 0
},
"height": {
"type": "number",
"format": "double",
"minimum": 0,
"default": 0
}
}
}
]
},
"confirmation": {
"allOf": [
{
"title": "delivery_confirmation",
"type": "string",
"enum": [
"none",
"delivery",
"signature",
"adult_signature",
"direct_signature",
"delivery_mailed",
"verbal_confirmation"
]
}
]
},
"address_residential_indicator": {
"allOf": [
{
"title": "address_residential_indicator",
"type": "string",
"enum": [
"unknown",
"yes",
"no"
]
}
]
},
"ship_date": {
"type": "string",
"allOf": [
{
"title": "date_time",
"type": "string",
"format": "date-time",
"pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(Z|[-+]\\d{2}:\\d{2})$"
}
]
}
}
}
]
}