{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/shipcloud/json-schema/shipcloud-manifest-response-schema.json",
  "title": "manifest_response",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/shipcloud-manifests-api-openapi.yml#/components/schemas/manifest_response",
  "allOf": [
    {
      "$ref": "#/$defs/manifest"
    },
    {
      "properties": {
        "carrier_reference_number": {
          "type": "string",
          "description": "Reference used by the carrier to identify the manifest"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "description": "timestamp of when the manifest was created"
        },
        "documents": {
          "type": "array",
          "items": {
            "type": "object",
            "description": "Array of document objects",
            "properties": {
              "document_url": {
                "type": "string",
                "description": "URL where you can download the manifest in pdf format"
              },
              "identifier": {
                "type": "string",
                "description": "An identifier that specifies the type of the document being returned",
                "enum": [
                  "manifest_document"
                ]
              }
            }
          }
        },
        "id": {
          "type": "string",
          "description": "identifier of a previously created manifest"
        }
      },
      "required": [
        "carrier",
        "carrier_reference_number",
        "created_at",
        "documents",
        "id",
        "posting_hub_address",
        "shipments"
      ]
    }
  ],
  "$defs": {
    "address": {
      "type": "object",
      "properties": {
        "care_of": {
          "type": [
            "string",
            "null"
          ],
          "description": "Additional care of field"
        },
        "city": {
          "type": "string",
          "description": "Name of the city"
        },
        "country": {
          "type": "string",
          "description": "Country as uppercase ISO 3166-1 alpha-2 code"
        },
        "first_name": {
          "type": [
            "string",
            "null"
          ],
          "description": "A persons first name"
        },
        "state": {
          "type": [
            "string",
            "null"
          ],
          "description": "The state the address is in"
        },
        "street": {
          "type": "string",
          "description": "Name of the street. Can hold the house number"
        },
        "street_no": {
          "type": [
            "string",
            "null"
          ],
          "description": "House number of the address (when a carrier requires it separately)"
        },
        "zip_code": {
          "type": "string",
          "description": "Zipcode of the address"
        },
        "phone": {
          "type": "string",
          "description": "Telephone number (mandatory when using UPS and the following terms apply: service is `one_day` or `one_day_early` or ship to country is different than ship from country)"
        },
        "email": {
          "type": "string",
          "description": "Email address for this person. Some carrier are using the email address to send notifications"
        }
      },
      "required": [
        "street",
        "city",
        "zip_code",
        "country"
      ]
    },
    "manifest": {
      "type": "object",
      "properties": {
        "carrier": {
          "type": "string",
          "description": "Carrier for whom the maifest should be created"
        },
        "posting_hub_address": {
          "allOf": [
            {
              "$ref": "#/$defs/address"
            },
            {
              "description": "Address of the hub where the shipments will be overturned to the carrier"
            }
          ]
        },
        "shipments": {
          "type": "array",
          "description": "array of shipment IDs that are send using this manifest",
          "items": {}
        },
        "reference_number": {
          "type": "string",
          "description": "For referencing the manifest at the carrier"
        }
      },
      "required": [
        "carrier",
        "posting_hub_address",
        "shipments"
      ]
    }
  }
}