{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/asendia/main/json-schema/asendia-post-parcel-response-schema.json",
  "title": "postParcelResponse",
  "x-generated": "2026-10-13",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/asendia-a1-parcel-openapi.yml#/components/schemas/postParcelResponse",
  "type": "object",
  "properties": {
    "shippingRates": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/shippingRate"
      }
    },
    "parcelLabels": {
      "allOf": [
        {
          "$ref": "#/$defs/parcelPackageLabel"
        }
      ],
      "nullable": true
    },
    "responseStatus": {
      "allOf": [
        {
          "$ref": "#/$defs/responseStatus"
        }
      ],
      "nullable": true
    },
    "parcelStatus": {
      "type": [
        "string",
        "null"
      ]
    },
    "parcelCode": {
      "type": [
        "string",
        "null"
      ]
    },
    "parcelInbound": {
      "type": [
        "string",
        "null"
      ]
    },
    "parcelOutbound": {
      "type": [
        "string",
        "null"
      ]
    },
    "parcelRouteCode": {
      "type": [
        "string",
        "null"
      ]
    },
    "accountNumber": {
      "type": [
        "string",
        "null"
      ]
    }
  },
  "additionalProperties": false,
  "$defs": {
    "label": {
      "type": "object",
      "properties": {
        "name": {
          "type": [
            "string",
            "null"
          ]
        },
        "type": {
          "type": [
            "string",
            "null"
          ]
        },
        "content": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "additionalProperties": false
    },
    "parcelPackageLabel": {
      "type": "object",
      "properties": {
        "ashid": {
          "type": [
            "string",
            "null"
          ],
          "description": "Asendia Unique Identifier. Applicable when a identifier number range has been pre-assigned to a customer. AHSID allocated to an order parcel can be used to track the parcel. ASHID is printed on label when possible"
        },
        "barcodeReference": {
          "type": [
            "string",
            "null"
          ],
          "description": "Value you get when you scan main barcode on final mile label. For some final labels, barcode can be slightly different from tracking number. It is mandatory to provide value to allow 3rd party systems to scan label properly"
        },
        "packageId": {
          "type": [
            "string",
            "null"
          ]
        },
        "trackingNumber": {
          "type": [
            "string",
            "null"
          ]
        },
        "labels": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/$defs/label"
          }
        }
      },
      "additionalProperties": false
    },
    "responseStatus": {
      "type": "object",
      "properties": {
        "responseStatusCode": {
          "type": "integer",
          "description": "This is used to display the code for the return status.",
          "format": "int32"
        },
        "responseStatusMessage": {
          "type": [
            "string",
            "null"
          ],
          "description": "This is used for a human readable return status message."
        }
      },
      "additionalProperties": false,
      "description": "Displays the status of the Return"
    },
    "shippingRate": {
      "type": "object",
      "properties": {
        "productCode": {
          "type": [
            "string",
            "null"
          ],
          "description": "Service Type codes will be provided on a per-integration basis. This indicates the customer’s preferred service or routing for the package."
        },
        "rate": {
          "type": "number",
          "description": "Total rate for this package in USD.",
          "format": "double"
        },
        "currencyType": {
          "type": [
            "string",
            "null"
          ],
          "description": "The currency for all given values related to the package and items. This is required to be USD."
        },
        "quoteCode": {
          "type": [
            "string",
            "null"
          ]
        },
        "systemMessage": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "additionalProperties": false
    }
  }
}