{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/dpd-group/main/json-schema/dpd-group-me-schema.json",
  "title": "Me",
  "description": "The first active customer of the user account and their list of addresses",
  "x-generated": "2026-10-13",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/dpd-group-me-api-openapi.yml#/components/schemas/Me",
  "properties": {
    "userAccount": {
      "$ref": "#/$defs/UserAccount"
    },
    "customers": {
      "items": {
        "$ref": "#/$defs/Me_customers_inner"
      },
      "type": "array"
    }
  },
  "required": [
    "customers",
    "userAccount"
  ],
  "type": "object",
  "$defs": {
    "Address": {
      "properties": {
        "street": {
          "$ref": "#/$defs/Street_1"
        },
        "postalCode": {
          "$ref": "#/$defs/PostalCode"
        },
        "city": {
          "$ref": "#/$defs/City_1"
        },
        "houseNumber": {
          "$ref": "#/$defs/HouseNumber"
        },
        "country": {
          "$ref": "#/$defs/CountryIdent"
        }
      },
      "required": [
        "city",
        "country",
        "postalCode",
        "street"
      ],
      "type": "object"
    },
    "City_1": {
      "description": "WARNING: Depending on type of the label, this field will be shortened to fit the label.\n  - PDF/EPL 31 characters for receiver and 28 characters for sender\n  - ZPL 31 characters for receiver and 19 characters for sender\n",
      "maxLength": 35,
      "type": "string"
    },
    "CountryAlpha2": {
      "description": "Country ISO Alpha-2 code",
      "maxLength": 2,
      "minLength": 2,
      "type": "string"
    },
    "CountryAlpha3": {
      "description": "Country ISO Alpha-3 code",
      "maxLength": 3,
      "minLength": 3,
      "type": "string"
    },
    "CountryIdent": {
      "oneOf": [
        {
          "$ref": "#/$defs/CountryIdent_oneOf"
        },
        {
          "$ref": "#/$defs/CountryIdent_oneOf_1"
        },
        {
          "$ref": "#/$defs/CountryIdent_oneOf_2"
        }
      ]
    },
    "CountryIdent_oneOf": {
      "properties": {
        "isoAlpha3": {
          "$ref": "#/$defs/CountryAlpha3"
        }
      },
      "required": [
        "isoAlpha3"
      ],
      "type": "object"
    },
    "CountryIdent_oneOf_1": {
      "properties": {
        "isoAlpha2": {
          "$ref": "#/$defs/CountryAlpha2"
        }
      },
      "required": [
        "isoAlpha2"
      ],
      "type": "object"
    },
    "CountryIdent_oneOf_2": {
      "properties": {
        "isoNumeric": {
          "$ref": "#/$defs/CountryNumeric"
        }
      },
      "required": [
        "isoNumeric"
      ],
      "type": "object"
    },
    "CountryNumeric": {
      "description": "Country ISO numeric code",
      "maxLength": 3,
      "minLength": 3,
      "type": "string"
    },
    "Customer": {
      "description": "For more info about customers see the [Customer DSW](#/CustomerDSW)",
      "properties": {
        "DSW": {
          "$ref": "#/$defs/CustomerDSW"
        },
        "isActive": {
          "type": "boolean"
        },
        "id": {
          "$ref": "#/$defs/CustomerID"
        }
      },
      "required": [
        "DSW",
        "id",
        "isActive"
      ],
      "type": "object"
    },
    "CustomerAddress": {
      "description": "Each user account, can have multiple customers (identified by DSW).  \nAnd each customer can have multiple customer addresses.  \nThese addresses can for instance represent the pickup addresses for pickup services.\n",
      "properties": {
        "it4emId": {
          "$ref": "#/$defs/CustomerAddressIt4emId"
        },
        "info": {
          "$ref": "#/$defs/SubjectInfo"
        },
        "address": {
          "allOf": [
            {
              "$ref": "#/$defs/Address"
            }
          ],
          "description": "Your registered address. \nYou can for instance create (parcel) pickup orders on these addresses.\n"
        },
        "isActive": {
          "type": "boolean"
        }
      },
      "required": [
        "address",
        "info",
        "isActive",
        "it4emId"
      ],
      "type": "object"
    },
    "CustomerAddressIt4emId": {
      "description": "This ID is used DPD wide to uniquely identify a customer address (alternative to GeoAPI specific Customer Address ID)",
      "type": "number"
    },
    "CustomerDSW": {
      "description": "The customer unique global identification number used across multiple DPD services.\n\nA single user account can have multiple customers.  \nThis allows for a single user account to manage multiple branches via this API.\n",
      "maxLength": 12,
      "minLength": 11,
      "type": "string"
    },
    "CustomerID": {
      "description": "The internal GeoAPI customer ID\n\nYou would only use this if there is no other way to identify the customer.\n",
      "type": "number"
    },
    "Email": {
      "type": "string"
    },
    "HouseNumber": {
      "type": "string"
    },
    "Me_customers_inner": {
      "properties": {
        "customer": {
          "$ref": "#/$defs/Customer"
        },
        "addresses": {
          "items": {
            "$ref": "#/$defs/CustomerAddress"
          },
          "type": "array"
        }
      },
      "required": [
        "addresses",
        "customer"
      ],
      "type": "object"
    },
    "PhoneNumber": {
      "description": "Can be with or without the international prefix",
      "maxLength": 31,
      "type": "string"
    },
    "PostalCode": {
      "maxLength": 7,
      "minLength": 3,
      "type": "string"
    },
    "Street_1": {
      "description": "Including the descriptive number\n\nWARNING: Depending on type of the label, this field will be shortened to fit the label.\n  - PDF 31 characters for receiver and 28 characters for sender\n  - ZPL/EPL 31 characters for receiver and 19 characters for sender\n",
      "maxLength": 35,
      "type": "string"
    },
    "SubjectInfo": {
      "properties": {
        "name1": {
          "$ref": "#/$defs/SubjectName"
        },
        "name2": {
          "$ref": "#/$defs/SubjectNameSecondary"
        },
        "contact": {
          "$ref": "#/$defs/SubjectInfo_contact"
        }
      },
      "required": [
        "name1"
      ],
      "title": "Subject information",
      "type": "object"
    },
    "SubjectInfo_contact": {
      "properties": {
        "person": {
          "minLength": 2,
          "type": "string"
        },
        "phone": {
          "$ref": "#/$defs/PhoneNumber"
        },
        "email": {
          "$ref": "#/$defs/Email"
        }
      },
      "type": "object"
    },
    "SubjectName": {
      "description": "The name of the sender/receiver.\n\nUsually this is the full name of the receiver/sender.\nYou can also specify the name of the receiving/sending company (e.g) \n\nIt is up to you to specify all required information, for the delivery to be successfully completed.\n\nWARNING: Depending on type of the label, this field will be shortened to fit the label.\n  - PDF/EPL 31 characters for receiver and 28 characters for sender\n  - ZPL 31 characters for receiver and 19 characters for sender\n",
      "maxLength": 35,
      "type": "string"
    },
    "SubjectNameSecondary": {
      "description": "You can use this property if you need to add some additional information about the receiver/sender.\nOr if the information about the receiver/sender are better expressed in separate fields\n\nFor example, you can specify the name of the company here, or the name of the person who is sending/receiving for the shipment.\n\nWARNING: Depending on type of the label, this field will be shortened to fit the label.\n  - PDF/EPL 31 characters for receiver and 28 characters for sender\n  - ZPL 31 characters for receiver and 19 characters for sender\n",
      "maxLength": 35,
      "type": "string"
    },
    "UserAccount": {
      "description": "User Account of the GeoApi.",
      "properties": {
        "id": {
          "type": "number"
        },
        "apiKey": {
          "type": "string"
        },
        "accountNote": {
          "type": "string"
        }
      },
      "required": [
        "apiKey",
        "id"
      ],
      "type": "object"
    }
  }
}