{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/aftership/main/json-schema/aftership-pickup-location-v1-schema.json",
  "title": "PickupLocation",
  "description": "The location information where the fulfillment is designated to be pickup from. Mandatory when the delivery method of the fulfillment is `pickup`.",
  "x-generated": "2026-10-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/aftership-fulfillments-api-openapi.yml#/components/schemas/Pickup_location.v1",
  "x-stoplight": {
    "id": "ou78lfdhqjx26"
  },
  "type": "object",
  "x-tags": [
    "Primitive"
  ],
  "properties": {
    "location_id": {
      "type": "string",
      "x-stoplight": {
        "id": "o6v7ot5p5owq0"
      },
      "description": "The unique identifier for the address. You can find or create the corresponding value [here](https://organization.automizely.com/warehouses)."
    },
    "address": {
      "$ref": "#/$defs/Address_with_coordinate.v1",
      "x-stoplight": {
        "id": "xd0n6n4djzcml"
      },
      "description": "Address of the pickup location."
    },
    "opening_hours": {
      "$ref": "#/$defs/Opening_hours.v1",
      "x-stoplight": {
        "id": "xwxu19pd0nc0h"
      },
      "description": "Opening hours information of the pickup location."
    }
  },
  "$defs": {
    "Address_with_coordinate.v1": {
      "description": "The physical address and contact information of the location. For Location resources, `first_name` and `last_name` are joined into one contact name on write; on read, the full contact name is returned as `first_name` and `last_name` is empty. The `type` field is accepted by the schema but not used for Location resources — omit it on write; on read it is always empty.",
      "type": "object",
      "x-stoplight": {
        "id": "nu2sh0erm8041"
      },
      "title": "AddressWithCoordinate",
      "x-tags": [
        "Primitive"
      ],
      "additionalProperties": false,
      "required": [
        "street_1",
        "state",
        "country_region"
      ],
      "properties": {
        "type": {
          "type": "string",
          "title": "The Type Schema",
          "description": "The type of address.",
          "enum": [
            "business",
            "residential"
          ]
        },
        "street_1": {
          "type": "string",
          "title": "The Street_1 Schema",
          "description": "First line of the street address.",
          "maxLength": 256
        },
        "street_2": {
          "type": [
            "string",
            "null"
          ],
          "title": "The Street_2 Schema",
          "description": "Second line of the street address.",
          "maxLength": 256
        },
        "street_3": {
          "type": [
            "string",
            "null"
          ],
          "title": "The Street_3 Schema",
          "description": "Third line of the street address.",
          "maxLength": 256
        },
        "city": {
          "type": "string",
          "title": "The City Schema",
          "description": "The location's city, town, or village.",
          "maxLength": 256
        },
        "state": {
          "type": "string",
          "title": "The State Schema",
          "description": "The state or region of the location, such as a province, state, or prefecture.",
          "maxLength": 256
        },
        "postal_code": {
          "type": "string",
          "title": "The Postal_code Schema",
          "description": "The postal code of the location (also known as zip code, postcode, Eircode, etc.).",
          "maxLength": 256
        },
        "country_region": {
          "type": "string",
          "title": "The Country Schema",
          "description": "The address country/region in [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) format.",
          "pattern": "^[A-Z]{3}$"
        },
        "company": {
          "type": "string",
          "title": "The Company Schema",
          "description": "The name of the company associated to the address.",
          "maxLength": 256
        },
        "first_name": {
          "type": "string",
          "title": "The First_name Schema",
          "description": "The first name of the person associated to the address.",
          "maxLength": 256
        },
        "last_name": {
          "type": "string",
          "title": "The Last_name Schema",
          "description": "The last name of the person associated to the address.",
          "maxLength": 256
        },
        "email": {
          "type": "string",
          "title": "The Email Schema",
          "description": "The email address of the person associated to the address.",
          "maxLength": 256
        },
        "phone": {
          "type": "string",
          "description": "The phone number of the person associated to the address.",
          "maxLength": 256
        },
        "coordinate": {
          "type": "object",
          "description": "The coordinate of the address.",
          "properties": {
            "longitude": {
              "type": "number",
              "description": "The longitude of the address."
            },
            "latitude": {
              "type": "number",
              "description": "The latitude of the address."
            }
          }
        }
      }
    },
    "Opening_hour_period.v1": {
      "title": "OpeningHourPeriod",
      "x-stoplight": {
        "id": "2g4w1syylsphw"
      },
      "type": "object",
      "additionalProperties": false,
      "description": "The `OpeningHourPeriod` model provides detailed information about a location's operating hours for a specific day. It includes the start and end times, and indicates whether the location is open on that particular day.",
      "x-tags": [
        "Primitive"
      ],
      "properties": {
        "open": {
          "type": "boolean",
          "default": false,
          "x-stoplight": {
            "id": "qbb3rmmdfdhxy"
          },
          "description": "Indicate whether the store is open on this day. For locations that operate 24 hours, please set the value to `true`."
        },
        "from": {
          "type": [
            "string",
            "null"
          ],
          "x-stoplight": {
            "id": "fvyfkui68t3gt"
          },
          "description": "The start time of the opening hour period in YY:MM format. For locations that operate 24 hours, please set the value to `null`."
        },
        "to": {
          "type": [
            "string",
            "null"
          ],
          "x-stoplight": {
            "id": "sk5yjthy1achl"
          },
          "description": "The end time of the opening hour period in YY:MM format. For locations that operate 24 hours, please set the value to `null`."
        }
      }
    },
    "Opening_hours.v1": {
      "description": "The regular opening hours of the location.",
      "title": "OpeningHours",
      "x-stoplight": {
        "id": "n7s4wz0dwk5ai"
      },
      "type": "object",
      "properties": {
        "sunday": {
          "$ref": "#/$defs/Opening_hour_period.v1"
        },
        "monday": {
          "$ref": "#/$defs/Opening_hour_period.v1"
        },
        "tuesday": {
          "$ref": "#/$defs/Opening_hour_period.v1"
        },
        "wednesday": {
          "$ref": "#/$defs/Opening_hour_period.v1"
        },
        "thursday": {
          "$ref": "#/$defs/Opening_hour_period.v1"
        },
        "friday": {
          "$ref": "#/$defs/Opening_hour_period.v1"
        },
        "saturday": {
          "$ref": "#/$defs/Opening_hour_period.v1"
        }
      },
      "x-tags": [
        "Primitive"
      ]
    }
  }
}