diff --git a/api/app/lib/OriginalUtil.scala b/api/app/lib/OriginalUtil.scala index 6e2f0bc9f..9b84c6d51 100644 --- a/api/app/lib/OriginalUtil.scala +++ b/api/app/lib/OriginalUtil.scala @@ -31,6 +31,8 @@ object OriginalUtil { Some(OriginalType.ApiJson) } else if (o.asOpt[Service].isDefined) { Some(OriginalType.ServiceJson) + } else if ((o \ "openapi").asOpt[JsString].exists(_.value.startsWith("3."))) { + Some(OriginalType.UNDEFINED("open_api_3")) } else if ((o \ "swagger").asOpt[JsString].isDefined) { Some(OriginalType.Swagger) } else { @@ -40,6 +42,8 @@ object OriginalUtil { case _ => { if (trimmed.indexOf("protocol ") >= 0 || trimmed.indexOf("@namespace") >= 0) { Some(OriginalType.AvroIdl) + } else if (isOpenApi3Yaml(trimmed)) { + Some(OriginalType.UNDEFINED("open_api_3")) } else if (trimmed.contains("swagger:")) { Some(OriginalType.Swagger) } else { @@ -49,6 +53,11 @@ object OriginalUtil { } } + private val OpenApi3YamlPattern = """(?m)^openapi:\s*["']?3\.""".r + + private def isOpenApi3Yaml(data: String): Boolean = + OpenApi3YamlPattern.findFirstIn(data).isDefined + private def guessApiOrServiceJson(o: JsObject): Option[OriginalType] = { // service.json has these defined as array; api.json as maps val fields = Seq("enums", "interfaces", "unions", "models") diff --git a/build.sbt b/build.sbt index 1f51a04fc..9d673c167 100644 --- a/build.sbt +++ b/build.sbt @@ -61,12 +61,32 @@ lazy val swagger = project ) ) +lazy val openapi = project + .in(file("openapi")) + .dependsOn(lib % "compile->compile;test->test") + .aggregate(lib) + .settings( + scalacOptions ++= allScalacOptions, + resolvers += "jitpack" at "https://jitpack.io", + libraryDependencies ++= Seq( + "com.softwaremill.sttp.apispec" %% "openapi-model" % "0.11.10", + "com.softwaremill.sttp.apispec" %% "openapi-circe" % "0.11.10", + "com.softwaremill.sttp.apispec" %% "openapi-circe-yaml" % "0.11.10", + "com.github.apicollective" % "apibuilder-validation" % "0.5.8", + "org.scalatestplus.play" %% "scalatestplus-play" % "7.0.1" % Test, + ), + Test / javaOptions ++= Seq( + "--add-exports=java.base/sun.security.x509=ALL-UNNAMED", + "--add-opens=java.base/sun.security.ssl=ALL-UNNAMED" + ) + ) + val circeVersion = "0.14.9" lazy val core = project .in(file("core")) .enablePlugins(PlayScala) - .dependsOn(generated, lib, avro, swagger) - .aggregate(generated, lib, avro, swagger) + .dependsOn(generated, lib, avro, swagger, openapi) + .aggregate(generated, lib, avro, swagger, openapi) .settings(commonSettings*) .settings( libraryDependencies ++= Seq( diff --git a/core/app/builder/OriginalValidator.scala b/core/app/builder/OriginalValidator.scala index 93fbb9eaf..8f3187b6c 100644 --- a/core/app/builder/OriginalValidator.scala +++ b/core/app/builder/OriginalValidator.scala @@ -5,6 +5,7 @@ import cats.data.ValidatedNec import core.{ServiceFetcher, VersionMigration} import io.apibuilder.api.v0.models.OriginalType import io.apibuilder.avro.AvroIdlServiceValidator +import io.apibuilder.openapi.OpenApiServiceValidator import io.apibuilder.spec.v0.models.Service import io.apibuilder.swagger.SwaggerServiceValidator import lib.{ServiceConfiguration, ServiceValidator} @@ -23,6 +24,7 @@ object OriginalValidator { case OriginalType.ServiceJson => ServiceJsonServiceValidator case OriginalType.Swagger => SwaggerServiceValidator(config) case OriginalType.UNDEFINED("swagger_json") => SwaggerServiceValidator(config) + case OriginalType.UNDEFINED("open_api_3") => OpenApiServiceValidator(config) case OriginalType.UNDEFINED(other) => sys.error(s"Invalid original type[$other]") } WithServiceSpecValidator(validator) diff --git a/openapi/src/main/scala/io/apibuilder/openapi/Classification.scala b/openapi/src/main/scala/io/apibuilder/openapi/Classification.scala new file mode 100644 index 000000000..7e4d484e1 --- /dev/null +++ b/openapi/src/main/scala/io/apibuilder/openapi/Classification.scala @@ -0,0 +1,95 @@ +package io.apibuilder.openapi + +import io.apibuilder.spec.v0.models.Header +import io.apibuilder.validation.ScalarType +import sttp.apispec.Schema +import sttp.apispec.openapi.OpenAPI + +import scala.collection.immutable.ListMap + +sealed trait SchemaKind +object SchemaKind { + case object Object extends SchemaKind + case object StringEnum extends SchemaKind + case object Array extends SchemaKind + case object Union extends SchemaKind + case object Alias extends SchemaKind + case object Skip extends SchemaKind +} + +sealed trait FieldKind +object FieldKind { + case class Ref(typeName: String) extends FieldKind + case class AllOfRef(typeName: String) extends FieldKind + case object Number extends FieldKind + case class ArrayRef(typeName: String) extends FieldKind + case class ArrayEnum(itemsSchema: Schema) extends FieldKind + case class InlineEnum(enumSchema: Schema) extends FieldKind + case class ArraySimple(scalarType: ScalarType) extends FieldKind + case class MapType(valueType: String) extends FieldKind + case class Primitive(scalarType: ScalarType) extends FieldKind + case object DefaultedString extends FieldKind +} + +case class ClassifiedField( + schemaName: String, + fieldName: String, + kind: Option[FieldKind], + description: Option[String], + required: Boolean, + minimum: Option[Long], + maximum: Option[Long], + annotations: SchemaClassifier.FieldAnnotations, +) + +case class ClassifiedSchema( + name: String, + kind: SchemaKind, + schema: Option[Schema], + fields: Seq[ClassifiedField], +) + +case class SchemaClassification( + schemas: Seq[ClassifiedSchema], +) + +case class Classification( + classification: SchemaClassification, + modelReferences: Map[String, String], + pathResult: PathConversionResult, + securityHeaders: Seq[Header], + unsupportedFeatures: Seq[String], + openApi: OpenAPI, +) + +object Classification { + + def fromOpenApi(openApi: OpenAPI, namingConfig: NamingConfig, filterHeaders: Set[String]): Classification = { + val schemas = openApi.components + .map(_.schemas) + .getOrElse(ListMap.empty) + + val modelReferences = SchemaResolver.buildModelReferences(schemas) + val classification = SchemaClassifier.classify(schemas) + + val requestBodies = openApi.components + .map(_.requestBodies) + .getOrElse(ListMap.empty) + + val securitySchemes = openApi.components + .map(_.securitySchemes) + .getOrElse(ListMap.empty) + + val convertibleSchemeNames = securitySchemes.collect { + case (name, Right(scheme)) if SecurityConverter.isConvertible(scheme) => name + }.toSet + + val pathConverter = new PathConverter(modelReferences, namingConfig, filterHeaders, requestBodies, convertibleSchemeNames) + val pathResult = pathConverter.convertPaths(openApi.paths) + + val securityResult = SecurityConverter.convertSecuritySchemes(securitySchemes) + val unsupportedFeatures = ConversionReport.detectUnsupportedFeatures(openApi) ++ securityResult.degradedNotes + + Classification(classification, modelReferences, pathResult, securityResult.headers, unsupportedFeatures, openApi) + } +} diff --git a/openapi/src/main/scala/io/apibuilder/openapi/ConversionReport.scala b/openapi/src/main/scala/io/apibuilder/openapi/ConversionReport.scala new file mode 100644 index 000000000..964d2b002 --- /dev/null +++ b/openapi/src/main/scala/io/apibuilder/openapi/ConversionReport.scala @@ -0,0 +1,122 @@ +package io.apibuilder.openapi + +import sttp.apispec.openapi.OpenAPI + +case class SchemaReport(name: String, kind: SchemaKind) +case class FieldReport(schemaName: String, fieldName: String, kind: Option[FieldKind], ignoredFormat: Option[String] = None) +case class PathReport(path: String, methods: Seq[String], unsupported: Seq[String]) + +case class ConversionReport( + schemas: Seq[SchemaReport], + fields: Seq[FieldReport], + paths: Seq[PathReport], + unsupportedFeatures: Seq[String], +) { + + def models: Seq[String] = schemas.collect { case SchemaReport(n, SchemaKind.Object) => n } + def enums: Seq[String] = schemas.collect { case SchemaReport(n, SchemaKind.StringEnum) => n } + def arrays: Seq[String] = schemas.collect { case SchemaReport(n, SchemaKind.Array) => n } + def unions: Seq[String] = schemas.collect { case SchemaReport(n, SchemaKind.Union) => n } + def aliases: Seq[String] = schemas.collect { case SchemaReport(n, SchemaKind.Alias) => n } + def skipped: Seq[String] = schemas.collect { case SchemaReport(n, SchemaKind.Skip) => n } + + def unmappedFields: Seq[String] = fields.collect { case FieldReport(schema, field, None, _) => s"$schema.$field" } + + def defaultedFields: Seq[String] = fields.collect { + case FieldReport(schema, field, Some(FieldKind.DefaultedString), _) => s"$schema.$field" + } + + def ignoredFormats: Seq[String] = fields.collect { case FieldReport(schema, field, _, Some(fmt)) => + s"$schema.$field (format: $fmt)" + } + + def briefSummary: String = { + val pathIssueCount = paths.flatMap(_.unsupported).size + val parts = Seq( + Option.when(unmappedFields.nonEmpty)(s"${unmappedFields.size} unmapped fields"), + Option.when(defaultedFields.nonEmpty)(s"${defaultedFields.size} fields defaulted to string"), + Option.when(ignoredFormats.nonEmpty)(s"${ignoredFormats.size} ignored formats"), + Option.when(pathIssueCount > 0)(s"$pathIssueCount path issues"), + Option.when(unsupportedFeatures.nonEmpty)(s"${unsupportedFeatures.size} unsupported features"), + ).flatten + if (parts.isEmpty) "Imported from OpenAPI." + else s"Imported from OpenAPI. Conversion issues: ${parts.mkString(", ")}." + } + + def summary: String = { + val lines = Seq.newBuilder[String] + lines += s"=== Conversion Report ===" + lines += s"Schemas: ${schemas.size} total" + lines += s" Models: ${models.size}" + lines += s" Enums: ${enums.size}" + lines += s" Arrays: ${arrays.size}" + lines += s" Unions: ${unions.size}" + lines += s" Aliases: ${aliases.size} (resolved, not emitted)" + lines += s" Skipped: ${skipped.size}" + if (unmappedFields.nonEmpty) { + lines += s"Unmapped fields: ${unmappedFields.size}" + unmappedFields.foreach(f => lines += s" - $f") + } + if (defaultedFields.nonEmpty) { + lines += s"Defaulted to string (no type in spec): ${defaultedFields.size}" + defaultedFields.foreach(f => lines += s" - $f") + } + if (ignoredFormats.nonEmpty) { + lines += s"Ignored formats: ${ignoredFormats.size}" + ignoredFormats.foreach(f => lines += s" - $f") + } + lines += s"Paths: ${paths.size}" + val pathIssues = paths.flatMap(_.unsupported) + if (pathIssues.nonEmpty) { + lines += s"Path issues: ${pathIssues.size}" + pathIssues.foreach(i => lines += s" - $i") + } + if (unsupportedFeatures.nonEmpty) { + lines += s"Unsupported features: ${unsupportedFeatures.size}" + unsupportedFeatures.foreach(f => lines += s" - $f") + } + lines.result().mkString("\n") + } +} + +object ConversionReport { + + def fromClassification(c: Classification): ConversionReport = { + val schemaReports = c.classification.schemas.map(cs => SchemaReport(cs.name, cs.kind)) + val fieldReports = c.classification.schemas.flatMap(_.fields.map { cf => + FieldReport(cf.schemaName, cf.fieldName, cf.kind, cf.annotations.ignoredFormat) + }) + ConversionReport(schemaReports, fieldReports, c.pathResult.pathReports, c.unsupportedFeatures) + } + + def detectUnsupportedFeatures(openApi: OpenAPI): Seq[String] = { + val features = Seq.newBuilder[String] + + openApi.components.foreach { c => + c.securitySchemes.foreach { + case (name, Right(scheme)) if !SecurityConverter.isConvertible(scheme) => + features += s"securityScheme '$name': type '${scheme.`type`}' (not converted)" + case (name, Left(_)) => + features += s"securityScheme '$name': reference (not resolved)" + case _ => () + } + if (c.requestBodies.nonEmpty) + features += s"requestBodies: ${c.requestBodies.size} defined (not converted as standalone)" + if (c.headers.nonEmpty) + features += s"headers: ${c.headers.size} defined (not converted)" + if (c.links.nonEmpty) + features += s"links: ${c.links.size} defined (not converted)" + if (c.callbacks.nonEmpty) + features += s"callbacks: ${c.callbacks.size} defined (not converted)" + } + + if (openApi.security.nonEmpty) + features += s"global security: ${openApi.security.size} requirements (not converted)" + if (openApi.tags.nonEmpty) + features += s"tags: ${openApi.tags.size} defined (not converted)" + if (openApi.extensions.nonEmpty) + features += s"extensions: ${openApi.extensions.size} vendor extensions (not converted)" + + features.result() + } +} diff --git a/openapi/src/main/scala/io/apibuilder/openapi/Converter.scala b/openapi/src/main/scala/io/apibuilder/openapi/Converter.scala new file mode 100644 index 000000000..adef37ca1 --- /dev/null +++ b/openapi/src/main/scala/io/apibuilder/openapi/Converter.scala @@ -0,0 +1,58 @@ +package io.apibuilder.openapi + +import io.apibuilder.spec.v0.models._ +import lib.{ServiceConfiguration, UrlKey} +import play.api.libs.json.Json + +object Converter { + + def convert( + openApi: sttp.apispec.openapi.OpenAPI, + config: ServiceConfiguration, + filterHeaders: Set[String] = Set.empty, + nameOverride: Option[String] = None, + ): Service = { + val namingConfig = NamingConfig() + val c = Classification.fromOpenApi(openApi, namingConfig, filterHeaders) + val schemaConverter = new SchemaConverter(c.modelReferences, namingConfig) + val schemaResult = schemaConverter.convert(c.classification) + + val apiName = nameOverride.getOrElse(UrlKey.generate(openApi.info.title)) + val report = ConversionReport.fromClassification(c) + val description = Seq(openApi.info.description, Some(report.briefSummary)).flatten.mkString("\n\n") + val conversionAttribute = buildConversionAttribute(report) + + Service( + apidoc = None, + name = openApi.info.title, + organization = Organization(key = config.orgKey), + application = Application(key = apiName), + namespace = config.applicationNamespace(apiName), + version = config.version, + baseUrl = openApi.servers.headOption.map(_.url), + description = Some(description), + info = Info(license = None, contact = None), + headers = c.securityHeaders, + imports = Seq.empty, + enums = schemaResult.enums, + interfaces = Seq.empty, + unions = schemaResult.unions, + models = schemaResult.models, + resources = c.pathResult.resources, + attributes = Seq(conversionAttribute), + annotations = Seq.empty, + ) + } + + private def buildConversionAttribute(report: ConversionReport): Attribute = { + val pathIssues = report.paths.flatMap(_.unsupported) + val value = Json.obj( + "unmapped_fields" -> report.unmappedFields, + "defaulted_fields" -> report.defaultedFields, + "ignored_formats" -> report.ignoredFormats, + "path_issues" -> pathIssues, + "unsupported_features" -> report.unsupportedFeatures, + ) + Attribute(name = "openapi_conversion", value = value) + } +} diff --git a/openapi/src/main/scala/io/apibuilder/openapi/ConverterMain.scala b/openapi/src/main/scala/io/apibuilder/openapi/ConverterMain.scala new file mode 100644 index 000000000..7ad087dc5 --- /dev/null +++ b/openapi/src/main/scala/io/apibuilder/openapi/ConverterMain.scala @@ -0,0 +1,193 @@ +package io.apibuilder.openapi + +import io.apibuilder.spec.v0.models.json._ +import lib.{ServiceConfiguration, UrlKey} +import play.api.libs.json.Json +import sttp.apispec.openapi.OpenAPI + +import java.io.PrintWriter +import java.net.URI +import java.nio.file.{Files, Paths} +import scala.annotation.tailrec +import scala.util.Using + +sealed trait OutputMode +object OutputMode { + case object Report extends OutputMode + case class Json(outputFile: Option[String] = None) extends OutputMode +} + +object ConverterMain { + + private[openapi] case class ParsedOptions( + input: Option[String] = None, + organization: Option[String] = None, + name: Option[String] = None, + namespace: Option[String] = None, + version: String = "0.0.1-dev", + filterHeaders: Set[String] = Set.empty, + outputMode: OutputMode = OutputMode.Report, + ) + + def main(args: Array[String]): Unit = + parseArgs(args.toList) match { + case Left(err) => + System.err.println(s"Error: $err") + System.err.println() + printUsage() + sys.exit(1) + case Right(opts) => + run(opts) + } + + private def run(opts: ParsedOptions): Unit = { + val uri = resolveInput(opts.input.getOrElse(sys.error("missing required option: input"))) match { + case Left(err) => System.err.println(s"Error: $err"); sys.exit(1) + case Right(u) => u + } + + val openApi = load(uri) match { + case Left(err) => System.err.println(s"Error: $err"); sys.exit(1) + case Right(a) => a + } + + val apiName = opts.name.getOrElse(UrlKey.generate(openApi.info.title)) + val orgNamespace = opts.namespace.getOrElse(inferNamespace(openApi, apiName)) + val config = ServiceConfiguration( + orgKey = opts.organization.getOrElse(sys.error("missing required option: organization")), + orgNamespace = orgNamespace, + version = opts.version, + ) + + val classification = Classification.fromOpenApi(openApi, NamingConfig(), opts.filterHeaders) + val report = ConversionReport.fromClassification(classification) + val service = Converter.convert(openApi, config, opts.filterHeaders, opts.name) + + opts.outputMode match { + case OutputMode.Json(outputFile) => + System.err.println(report.summary) + System.err.println() + val json = Json.prettyPrint(Json.toJson(service)) + outputFile match { + case Some(path) => + Using(new PrintWriter(path)) { _.write(json) } match { + case scala.util.Success(_) => System.err.println(s"Written: $path") + case scala.util.Failure(e) => + System.err.println(s"Failed to write $path: ${e.getMessage}") + sys.exit(1) + } + case None => + println(json) + } + + case OutputMode.Report => + println(s"Config: apiName=$apiName, namespace=${config.applicationNamespace(apiName)}") + if (opts.filterHeaders.nonEmpty) + println(s"Filtering headers: ${opts.filterHeaders.mkString(", ")}") + println() + println(report.summary) + println() + println(s"Converted: ${service.models.size} models, ${service.enums.size} enums, ${service.unions.size} unions, ${service.resources.size} resources") + val totalParams = service.resources.flatMap(_.operations).map(_.parameters.size).sum + println(s"Total parameters across all operations: $totalParams") + } + } + + private[openapi] def parseArgs(args: List[String]): Either[String, ParsedOptions] = + doParse(args).flatMap { + case p if p.input.isEmpty => Left("input is required") + case p if p.organization.isEmpty => Left("--organization is required") + case p => Right(p) + } + + @tailrec + private def doParse(args: List[String], acc: ParsedOptions = ParsedOptions()): Either[String, ParsedOptions] = + args match { + case Nil => Right(acc) + case "--organization" :: org :: tail if acc.organization.isEmpty => + doParse(tail, acc.copy(organization = Some(org))) + case "--organization" :: _ :: _ => Left("--organization specified more than once") + case "--organization" :: Nil => Left("--organization requires a value") + case "--name" :: name :: tail if acc.name.isEmpty => + doParse(tail, acc.copy(name = Some(name))) + case "--name" :: _ :: _ => Left("--name specified more than once") + case "--name" :: Nil => Left("--name requires a value") + case "--namespace" :: ns :: tail if acc.namespace.isEmpty => + doParse(tail, acc.copy(namespace = Some(ns))) + case "--namespace" :: _ :: _ => Left("--namespace specified more than once") + case "--namespace" :: Nil => Left("--namespace requires a value") + case "--version" :: v :: tail => + doParse(tail, acc.copy(version = v)) + case "--version" :: Nil => Left("--version requires a value") + case "--filter-header" :: h :: tail => + doParse(tail, acc.copy(filterHeaders = acc.filterHeaders + h)) + case "--filter-header" :: Nil => Left("--filter-header requires a value") + case "--json" :: file :: tail if !file.startsWith("--") => + doParse(tail, acc.copy(outputMode = OutputMode.Json(Some(file)))) + case "--json" :: tail => + doParse(tail, acc.copy(outputMode = OutputMode.Json())) + case s :: _ if s.startsWith("--") => Left(s"Unknown flag '$s'") + case input :: tail if acc.input.isEmpty => + doParse(tail, acc.copy(input = Some(input))) + case input :: _ => + Left(s"Unexpected argument '$input' (input already set to '${acc.input.get}')") + } + + private def resolveInput(input: String): Either[String, URI] = + if (input.startsWith("http://") || input.startsWith("https://")) + Right(URI.create(input)) + else { + val path = Paths.get(input) + if (Files.exists(path)) Right(path.toAbsolutePath.toUri) + else Left(s"Not a URL or existing file: $input") + } + + private def load(uri: URI): Either[String, OpenAPI] = uri.getScheme match { + case "http" | "https" => OpenApiParser.fromUrl(uri.toString) + case "file" => OpenApiParser.fromFile(Paths.get(uri)) + case other => Left(s"Unsupported URI scheme: $other") + } + + private[openapi] def inferNamespace(openApi: OpenAPI, apiName: String): String = { + val domainParts = openApi.servers.headOption + .flatMap { server => + try { + val host = URI.create(server.url).getHost + if (host == null) None + else { + val parts = host.split("\\.").toSeq + val meaningful = parts.filterNot(p => p.startsWith("api") || p == "www" || p == "sandbox") + val reversed = (if (meaningful.nonEmpty) meaningful else parts).reverse + Some(reversed) + } + } catch { + case e: IllegalArgumentException => + System.err.println(s"Warning: could not parse server URL '${server.url}' for namespace inference: ${e.getMessage}") + None + } + } + .getOrElse(Seq("io", "apibuilder")) + (domainParts :+ apiName).mkString(".") + } + + private def printUsage(): Unit = { + println("Usage: openapi --organization [options]") + println() + println("Input can be:") + println(" A URL: https://example.com/openapi.json") + println(" A file path: /path/to/openapi.json") + println() + println("Required:") + println(" --organization The apibuilder organization key") + println() + println("Options:") + println(" --json [file] Output APIBuilder JSON (to file or stdout)") + println(" --name Override the inferred API name") + println(" --namespace Override the inferred API namespace") + println(" --version API version (default: 0.0.1-dev)") + println(" --filter-header
Exclude a header parameter (repeatable)") + println() + println("Run via sbt:") + println(""" sbt "openapi/runMain io.apibuilder.openapi.ConverterMain ./openapi.json --organization myorg --json"""") + } +} diff --git a/openapi/src/main/scala/io/apibuilder/openapi/NamingUtils.scala b/openapi/src/main/scala/io/apibuilder/openapi/NamingUtils.scala new file mode 100644 index 000000000..3a8ac6814 --- /dev/null +++ b/openapi/src/main/scala/io/apibuilder/openapi/NamingUtils.scala @@ -0,0 +1,66 @@ +package io.apibuilder.openapi + +import io.apibuilder.validation.ScalarType + +import java.nio.charset.StandardCharsets +import java.security.MessageDigest + +case class NamingConfig( + uniqueNames: Boolean = false, + suffixLength: Int = 4, +) + +object NamingUtils { + + val ApibuilderPrimitiveTypes: Set[String] = ScalarType.all.map(_.name).toSet + + def toSnakeCase(str: String): String = + str.trim + .replaceAll("[\\s\\-.]+", "_") + .replaceAll("([a-z0-9])([A-Z])", "$1_$2") + .replaceAll("([A-Z]+)([A-Z][a-z])", "$1_$2") + .toLowerCase + + def uniqueSnakeCase(str: String, config: NamingConfig): String = { + if (ApibuilderPrimitiveTypes.contains(str)) str + else if (isArray(str)) arrayType(uniqueSnakeCase(extractFromArray(str), config)) + else if (isMap(str)) mapType(uniqueSnakeCase(extractFromMap(str), config)) + else if (config.uniqueNames) { + val snake = toSnakeCase(str) + s"${snake}_${hashString(snake).take(config.suffixLength)}" + } else { + toSnakeCase(str) + } + } + + def sanitizeEnumName(s: String): String = + s.trim + .replaceAll("\"", "") + .replaceAll("\\s+", "_") + + def hashString(input: String): String = { + val letters = 'a' to 'z' + val digest = MessageDigest.getInstance("SHA-256") + val hashBytes = digest.digest(input.getBytes(StandardCharsets.UTF_8)) + hashBytes.map { b => letters((b & 0xff) % letters.length) }.mkString + } + + def arrayType(typeName: String): String = s"[$typeName]" + def mapType(typeName: String): String = s"map[$typeName]" + + private def isArray(str: String): Boolean = + str.startsWith("[") && str.endsWith("]") + + private def extractFromArray(str: String): String = { + assert(isArray(str), s"$str is not an array (missing '[]')") + str.drop(1).dropRight(1) + } + + private def isMap(str: String): Boolean = + str.startsWith("map[") && str.endsWith("]") + + private def extractFromMap(str: String): String = { + assert(isMap(str), s"$str is not a map (missing 'map[]')") + str.drop(4).dropRight(1) + } +} diff --git a/openapi/src/main/scala/io/apibuilder/openapi/OpenApiParser.scala b/openapi/src/main/scala/io/apibuilder/openapi/OpenApiParser.scala new file mode 100644 index 000000000..9e27e4a85 --- /dev/null +++ b/openapi/src/main/scala/io/apibuilder/openapi/OpenApiParser.scala @@ -0,0 +1,58 @@ +package io.apibuilder.openapi + +import io.circe.{parser => circeParser} +import io.circe.yaml.{parser => yamlParser} +import sttp.apispec.openapi.OpenAPI +import sttp.apispec.openapi.circe._ + +import java.nio.file.{Files, Path} +import scala.io.Source +import scala.util.Using + +object OpenApiParser { + + def fromFile(path: Path): Either[String, OpenAPI] = + Using(Source.fromFile(path.toFile, "UTF-8"))(_.mkString).toEither + .left.map(e => s"${e.getClass.getSimpleName}: ${e.getMessage}") + .flatMap(fromString) + + def fromUrl(url: String): Either[String, OpenAPI] = + Using(Source.fromURL(url, "UTF-8"))(_.mkString).toEither + .left.map(e => s"${e.getClass.getSimpleName}: ${e.getMessage}") + .flatMap(fromString) + + def fromString(input: String): Either[String, OpenAPI] = { + val trimmed = input.trim + if (looksLikeYaml(trimmed)) + fromYaml(trimmed).left.map(e => s"Failed to parse input as YAML: $e") + else + fromJson(trimmed).left.map(e => s"Failed to parse input as JSON: $e") + } + + def fromResource(resourcePath: String): Either[String, OpenAPI] = { + val stream = Option(getClass.getClassLoader.getResourceAsStream(resourcePath)) + .toRight(s"Resource not found: $resourcePath") + stream.flatMap { is => + Using(Source.fromInputStream(is, "UTF-8"))(_.mkString).toEither + .left.map(_.getMessage) + .flatMap(fromString) + } + } + + def fromJson(jsonString: String): Either[String, OpenAPI] = + circeParser + .parse(jsonString) + .flatMap(_.as[OpenAPI]) + .left + .map(_.getMessage) + + def fromYaml(yamlString: String): Either[String, OpenAPI] = + yamlParser + .parse(yamlString) + .flatMap(_.as[OpenAPI]) + .left + .map(_.getMessage) + + private def looksLikeYaml(input: String): Boolean = + !input.startsWith("{") && !input.startsWith("[") +} diff --git a/openapi/src/main/scala/io/apibuilder/openapi/OpenApiServiceValidator.scala b/openapi/src/main/scala/io/apibuilder/openapi/OpenApiServiceValidator.scala new file mode 100644 index 000000000..c0e813fd6 --- /dev/null +++ b/openapi/src/main/scala/io/apibuilder/openapi/OpenApiServiceValidator.scala @@ -0,0 +1,18 @@ +package io.apibuilder.openapi + +import cats.data.ValidatedNec +import cats.implicits._ +import io.apibuilder.spec.v0.models.Service +import lib.{ServiceConfiguration, ServiceValidator} + +case class OpenApiServiceValidator(config: ServiceConfiguration) extends ServiceValidator[Service] { + + override def validate(rawInput: String): ValidatedNec[String, Service] = + OpenApiParser.fromString(rawInput) match { + case Left(err) => err.invalidNec + case Right(openApi) => + scala.util.Try(Converter.convert(openApi, config)).toEither + .left.map(e => s"Conversion failed: ${e.getMessage}") + .toValidatedNec + } +} diff --git a/openapi/src/main/scala/io/apibuilder/openapi/PathConverter.scala b/openapi/src/main/scala/io/apibuilder/openapi/PathConverter.scala new file mode 100644 index 000000000..b892c6f54 --- /dev/null +++ b/openapi/src/main/scala/io/apibuilder/openapi/PathConverter.scala @@ -0,0 +1,307 @@ +package io.apibuilder.openapi + +import io.apibuilder.spec.v0.{models => ab} +import io.apibuilder.validation.ScalarType +import sttp.apispec.{ExampleSingleValue, Schema, SchemaLike} +import sttp.apispec.openapi._ + +import scala.collection.immutable.ListMap + +case class PathConversionResult( + resources: Seq[ab.Resource], + pathReports: Seq[PathReport], +) + +class PathConverter( + modelReferences: Map[String, String], + config: NamingConfig, + filterHeaders: Set[String] = Set.empty, + requestBodies: ListMap[String, Either[Reference, RequestBody]] = ListMap.empty, + convertibleSchemeNames: Set[String] = Set.empty, +) { + + private val filterHeadersLower: Set[String] = filterHeaders.map(_.toLowerCase) + + import NamingUtils._ + import SchemaResolver._ + + private val HttpMethods: Seq[(String, PathItem => Option[Operation])] = Seq( + "GET" -> (_.get), + "PUT" -> (_.put), + "POST" -> (_.post), + "DELETE" -> (_.delete), + "PATCH" -> (_.patch), + "HEAD" -> (_.head), + "OPTIONS" -> (_.options), + "TRACE" -> (_.trace), + ) + + def convertPaths(paths: Paths): PathConversionResult = { + val allResources = Seq.newBuilder[ab.Resource] + val pathReports = Seq.newBuilder[PathReport] + + paths.pathItems.toSeq.foreach { case (path, pathItem) => + val (resourceOpt, report) = convertPathItem(path, pathItem) + resourceOpt.foreach(allResources += _) + pathReports += report + } + + val merged = allResources + .result() + .filterNot(r => NamingUtils.ApibuilderPrimitiveTypes.contains(r.`type`)) + .groupBy(_.`type`) + .toSeq + .sortBy(_._1) + .map { case (_, group) => + val first = group.head + first.copy(operations = group.flatMap(_.operations)) + } + + PathConversionResult( + resources = merged, + pathReports = pathReports.result(), + ) + } + + private def convertPathItem(path: String, pathItem: PathItem): (Option[ab.Resource], PathReport) = { + val issues = Seq.newBuilder[String] + val methods = HttpMethods.flatMap { case (method, extract) => + extract(pathItem).map(method -> _) + } + + pathItem.parameters.foreach { + case Left(ref) => + issues += s"$path: parameter reference '${ref.$ref}' (not resolved)" + case Right(p) if p.in == ParameterIn.Cookie => + issues += s"$path: cookie parameter '${p.name}' (not supported)" + case _ => () + } + + val pathLevelParams = extractParams(pathItem.parameters) + + val operations = methods.flatMap { case (method, op) => + op.parameters.foreach { + case Left(ref) => + issues += s"$method $path: parameter reference '${ref.$ref}' (not resolved)" + case Right(p) if p.in == ParameterIn.Cookie => + issues += s"$method $path: cookie parameter '${p.name}' (not supported)" + case _ => () + } + + op.requestBody.foreach { + case Right(rb) if !rb.content.contains("application/json") && formSchemaRef(rb.content).isEmpty => + val nonJsonTypes = rb.content.keys.toSeq + if (nonJsonTypes.nonEmpty) + issues += s"$method $path: no JSON request body (${nonJsonTypes.mkString(", ")})" + case _ => () + } + + op.responses.responses.foreach { case (key, respOrRef) => + respOrRef.foreach { resp => + if (!resp.content.contains("application/json")) { + val nonJsonTypes = resp.content.keys.toSeq + if (nonJsonTypes.nonEmpty) + issues += s"$method $path response ${formatResponseKey(key)}: no JSON content (${nonJsonTypes.mkString(", ")})" + } + } + } + + val unconvertibleSecurity = op.security.flatMap(_.keys).filterNot(convertibleSchemeNames).distinct.sorted + if (unconvertibleSecurity.nonEmpty) + issues += s"$method $path: security requirements not converted: ${unconvertibleSecurity.mkString(", ")}" + if (op.callbacks.nonEmpty) issues += s"$method $path: callbacks (not converted)" + + val opParams = extractParams(op.parameters) + val merged = mergeParameters(pathLevelParams, opParams) + Some(convertOperation(path, method, op, merged)) + } + + val nonUnitResponses = operations.view + .flatMap(_.responses) + .filter(_.`type` != ScalarType.UnitType.name) + + val primaryResponse = nonUnitResponses + .collectFirst { case r if is2xx(r.code) => r } + .orElse(nonUnitResponses.headOption) + + val resource = primaryResponse.map { firstResponse => + ab.Resource( + `type` = firstResponse.`type`, + plural = firstResponse.`type` + "s", + path = Some(""), + description = None, + deprecation = None, + operations = operations, + attributes = Seq.empty, + ) + } + + if (operations.nonEmpty && resource.isEmpty) + issues += s"$path: no typed response found; path excluded from resources" + + val report = PathReport( + path = path, + methods = methods.map(_._1), + unsupported = issues.result(), + ) + + (resource, report) + } + + private def convertOperation( + path: String, + httpMethod: String, + op: Operation, + mergedParams: Seq[Parameter], + ): ab.Operation = + ab.Operation( + method = ab.Method.fromString(httpMethod).getOrElse(ab.Method.UNDEFINED(httpMethod)), + path = toApibuilderPath(path), + description = op.description, + deprecation = None, + body = op.requestBody.flatMap(extractBody), + parameters = mergedParams.flatMap(convertParameter), + responses = op.responses.responses.toSeq.map(convertResponse), + attributes = Seq.empty, + ) + + private def convertResponse(entry: (ResponsesKey, Either[Reference, Response])): ab.Response = { + val (key, responseOrRef) = entry + val code: ab.ResponseCode = key match { + case ResponsesCodeKey(c) => ab.ResponseCodeInt(c) + case ResponsesDefaultKey => ab.ResponseCodeOption.Default + case ResponsesRangeKey(r) => ab.ResponseCodeInt(r * 100) + } + val (desc, typeName) = responseOrRef match { + case Right(r) => + ( + Option(r.description).filter(_.nonEmpty), + jsonSchemaRef(r.content).map(resolve).getOrElse(ScalarType.UnitType.name), + ) + case Left(ref) => + val t = + if (ref.$ref.startsWith("#/components/schemas/")) resolve(refName(ref.$ref)) + else ScalarType.UnitType.name + (None, t) + } + ab.Response( + code = code, + `type` = sn(typeName), + headers = None, + description = desc, + deprecation = None, + attributes = None, + ) + } + + private def extractBody(bodyOrRef: Either[Reference, RequestBody]): Option[ab.Body] = + bodyOrRef match { + case Right(rb) => + (jsonSchemaRef(rb.content) orElse formSchemaRef(rb.content)) + .map(t => ab.Body(`type` = sn(resolve(t)))) + case Left(ref) => + resolveRequestBodyRef(ref.$ref).map(t => ab.Body(`type` = sn(resolve(t)))) + } + + private def resolveRequestBodyRef(ref: String, seen: Set[String] = Set.empty): Option[String] = { + if (seen.contains(ref)) return None + val prefix = "#/components/requestBodies/" + if (ref.startsWith(prefix)) { + val name = ref.stripPrefix(prefix) + requestBodies.get(name).flatMap { + case Right(rb) => jsonSchemaRef(rb.content) + case Left(nestedRef) => resolveRequestBodyRef(nestedRef.$ref, seen + ref) + } + } else if (ref.startsWith("#/components/schemas/")) { + Some(refName(ref)) + } else { + System.err.println(s"Warning: cannot resolve requestBody reference '$ref'; operation will have no body") + None + } + } + + private def jsonSchemaRef(content: ListMap[String, MediaType]): Option[String] = + content.get("application/json").flatMap(_.schema.flatMap(schemaRef)) + + private def formSchemaRef(content: ListMap[String, MediaType]): Option[String] = + Seq("multipart/form-data", "application/x-www-form-urlencoded") + .flatMap(content.get) + .flatMap(_.schema.flatMap(schemaRef)) + .headOption + + private def schemaRef(sl: SchemaLike): Option[String] = sl match { + case s: Schema if s.$ref.isDefined => Some(refName(s.$ref.get)) + case s: Schema if s.oneOf.nonEmpty => + s.oneOf.collectFirst { case r: Schema if r.$ref.isDefined => refName(r.$ref.get) } + case _ => None + } + + private def extractParams(params: List[Either[Reference, Parameter]]): Seq[Parameter] = + params.collect { case Right(p) => p } + + private def mergeParameters(pathLevel: Seq[Parameter], opLevel: Seq[Parameter]): Seq[Parameter] = { + val opKeys = opLevel.map(p => (p.name, p.in)).toSet + val inherited = pathLevel.filterNot(p => opKeys.contains((p.name, p.in))) + inherited ++ opLevel + } + + private[openapi] def convertParameter(p: Parameter): Option[ab.Parameter] = { + if (p.in == ParameterIn.Header && filterHeadersLower.contains(p.name.toLowerCase)) return None + mapLocation(p.in).map { location => + val schemaOpt = p.schema.collect { case s: Schema => s } + + val typeName = schemaOpt + .map { s => + if (s.$ref.isDefined) resolve(refName(s.$ref.get)) + else SchemaConverter.simpleType(s).map(_.name).getOrElse(ScalarType.StringType.name) + } + .getOrElse(ScalarType.StringType.name) + + val (min, max) = schemaOpt.map(SchemaClassifier.extractBounds).getOrElse((None, None)) + val isRequired = p.required.getOrElse(p.in == ParameterIn.Path) + val example = p.example.collect { case ExampleSingleValue(v) => v.toString } + + ab.Parameter( + name = p.name, + `type` = sn(typeName), + location = location, + description = p.description, + deprecation = None, + required = isRequired, + default = None, + minimum = min, + maximum = max, + example = example, + ) + } + } + + private def mapLocation(in: ParameterIn): Option[ab.ParameterLocation] = in match { + case ParameterIn.Query => Some(ab.ParameterLocation.Query) + case ParameterIn.Header => Some(ab.ParameterLocation.Header) + case ParameterIn.Path => Some(ab.ParameterLocation.Path) + case ParameterIn.Cookie => None // callers pre-filter and report cookie params + } + + private def is2xx(code: ab.ResponseCode): Boolean = code match { + case ab.ResponseCodeInt(c) => c >= 200 && c < 300 + case _ => false + } + + private def formatResponseKey(key: ResponsesKey): String = key match { + case ResponsesCodeKey(c) => c.toString + case ResponsesDefaultKey => "default" + case ResponsesRangeKey(r) => s"${r}xx" + } + + private def toApibuilderPath(path: String): String = + path.replaceAll("\\{([^}]+)\\}", ":$1") + + private def sn(str: String): String = uniqueSnakeCase(str, config) + private def resolve(name: String): String = resolveReference(name, modelReferences) match { + case Right(resolved) => resolved + case Left(err) => + System.err.println(s"Warning: $err") + name + } +} diff --git a/openapi/src/main/scala/io/apibuilder/openapi/SchemaClassifier.scala b/openapi/src/main/scala/io/apibuilder/openapi/SchemaClassifier.scala new file mode 100644 index 000000000..a085892f9 --- /dev/null +++ b/openapi/src/main/scala/io/apibuilder/openapi/SchemaClassifier.scala @@ -0,0 +1,211 @@ +package io.apibuilder.openapi + +import io.apibuilder.spec.v0.models.Deprecation +import io.apibuilder.validation.ScalarType +import sttp.apispec.{AnySchema, ExampleSingleValue, Schema, SchemaLike, SchemaType} + +import scala.collection.immutable.ListMap + +object SchemaClassifier { + + def classify(schemas: ListMap[String, SchemaLike]): SchemaClassification = { + val classified = schemas.toSeq.map { + case (name, s: Schema) => + val kind = classifySchema(s) + val fields = kind match { + case SchemaKind.Object => classifyFields(name, s) + case _ => Seq.empty + } + ClassifiedSchema(name, kind, Some(s), fields) + case (name, _) => + ClassifiedSchema(name, SchemaKind.Skip, None, Seq.empty) + } + SchemaClassification(classified) + } + + private[openapi] def classifySchema(s: Schema): SchemaKind = { + val members = unionMembers(s) + if (SchemaResolver.detectMapType(s).isDefined) SchemaKind.Alias + else if (s.properties.nonEmpty || hasType(s, SchemaType.Object)) SchemaKind.Object + else if (hasType(s, SchemaType.String) && s.`enum`.isDefined) SchemaKind.StringEnum + else if (hasType(s, SchemaType.Array)) SchemaKind.Array + else if (members.nonEmpty && s.properties.isEmpty && collectRefs(members).nonEmpty) SchemaKind.Union + else if ( + s.$ref.isDefined || + (s.allOf.nonEmpty && s.properties.isEmpty) || + (hasType(s, SchemaType.String) && s.`enum`.isEmpty) + ) SchemaKind.Alias + else SchemaKind.Skip + } + + private[openapi] def classifyField(s: Schema): Option[FieldKind] = { + import SchemaResolver.refName + + lazy val fromRef: Option[FieldKind] = + s.$ref.map(ref => FieldKind.Ref(refName(ref))) + + lazy val fromAllOf: Option[FieldKind] = Option + .when(s.allOf.nonEmpty) { + s.allOf + .collectFirst { case r: Schema if r.$ref.isDefined => refName(r.$ref.get) } + .map(FieldKind.AllOfRef(_)) + } + .flatten + + lazy val fromNumber: Option[FieldKind] = + Option.when(hasType(s, SchemaType.Number))(FieldKind.Number) + + lazy val fromOneOfAnyOf: Option[FieldKind] = { + val members = unionMembers(s) + Option + .when(members.nonEmpty && s.properties.isEmpty) { + val nonNullMembers = members.collect { case m: Schema if !hasType(m, SchemaType.Null) => m } + collectRefs(nonNullMembers).headOption.map(FieldKind.Ref(_)) + .orElse { + nonNullMembers match { + case List(single) => SchemaConverter.simpleType(single).map(FieldKind.Primitive.apply) + case _ => None + } + } + } + .flatten + } + + lazy val fromArrayRef: Option[FieldKind] = + Option + .when(hasType(s, SchemaType.Array)) { + s.items.collectFirst { + case items: Schema if items.$ref.isDefined => Some(FieldKind.ArrayRef(refName(items.$ref.get))) + case items: Schema if unionMembers(items).nonEmpty => + collectRefs(unionMembers(items)).headOption.map(FieldKind.ArrayRef(_)) + }.flatten + } + .flatten + + lazy val fromArrayEnum: Option[FieldKind] = + Option + .when(hasType(s, SchemaType.Array)) { + s.items.collectFirst { + case items: Schema if hasType(items, SchemaType.String) && items.`enum`.isDefined => + FieldKind.ArrayEnum(items) + } + } + .flatten + + lazy val fromEnum: Option[FieldKind] = + Option.when(hasType(s, SchemaType.String) && s.`enum`.isDefined)(FieldKind.InlineEnum(s)) + + lazy val fromMap: Option[FieldKind] = + s.additionalProperties.map(ap => FieldKind.MapType(SchemaResolver.mapValueType(ap))) + + lazy val fromArraySimple: Option[FieldKind] = + Option + .when(hasType(s, SchemaType.Array)) { + s.items.collectFirst { + case items: Schema if items.`enum`.isEmpty => + SchemaConverter.simpleType(items).map(FieldKind.ArraySimple.apply) + }.flatten + } + .flatten + + lazy val fromSimple: Option[FieldKind] = + Option.when(s.`enum`.isEmpty)(SchemaConverter.simpleType(s).map(FieldKind.Primitive.apply)).flatten + + lazy val fromDefault: Option[FieldKind] = + Option.when(s.description.isDefined || s.properties.nonEmpty)(FieldKind.DefaultedString) + + fromRef orElse fromAllOf orElse fromOneOfAnyOf orElse fromNumber orElse fromArrayRef orElse + fromArrayEnum orElse fromEnum orElse fromMap orElse fromArraySimple orElse fromSimple orElse fromDefault + } + + case class FieldAnnotations( + default: Option[String], + deprecation: Option[Deprecation], + example: Option[String], + ignoredFormat: Option[String], + ) + + object FieldAnnotations { + val empty: FieldAnnotations = FieldAnnotations(None, None, None, None) + + def fromSchema(s: Schema): FieldAnnotations = FieldAnnotations( + default = s.default.collect { case ExampleSingleValue(v) => v.toString }, + deprecation = s.deprecated.collect { case true => Deprecation() }, + example = s.examples + .flatMap(_.collectFirst { case ExampleSingleValue(v) => v.toString }), + ignoredFormat = SchemaConverter.ignoredFormat(s), + ) + } + + def extractBounds(s: Schema): (Option[Long], Option[Long]) = { + val min = s.minimum + .map(_.toLong) + .orElse(s.minLength.map(_.toLong)) + .orElse(s.minItems.map(_.toLong)) + val max = s.maximum + .map(_.toLong) + .orElse(s.maxLength.map(_.toLong)) + .orElse(s.maxItems.map(_.toLong)) + (min, max) + } + + private[openapi] def collectRefs(schemas: List[SchemaLike]): Seq[String] = + schemas.collect { case s: Schema if s.$ref.isDefined => SchemaResolver.refName(s.$ref.get) } + + private[openapi] def unionMembers(s: Schema): List[SchemaLike] = + s.oneOf ++ s.anyOf + + private def hasType(s: Schema, st: SchemaType): Boolean = + SchemaResolver.hasType(s, st) + + private def classifyFields(schemaName: String, schema: Schema): Seq[ClassifiedField] = { + val required = schema.required + schema.properties.toSeq.map { case (fieldName, sl) => + classifyFieldEntry(schemaName, fieldName, sl, required) + } + } + + private def classifyFieldEntry( + schemaName: String, + fieldName: String, + sl: SchemaLike, + required: List[String], + ): ClassifiedField = sl match { + case s: Schema => + val kind = classifyField(s) + val (min, max) = extractBounds(s) + val ann = FieldAnnotations.fromSchema(s) + ClassifiedField( + schemaName = schemaName, + fieldName = fieldName, + kind = kind, + description = s.description, + required = required.contains(fieldName), + minimum = min, + maximum = max, + annotations = ann, + ) + case AnySchema.Anything => + ClassifiedField( + schemaName = schemaName, + fieldName = fieldName, + kind = Some(FieldKind.Primitive(ScalarType.JsonType)), + description = None, + required = required.contains(fieldName), + minimum = None, + maximum = None, + annotations = FieldAnnotations.empty, + ) + case AnySchema.Nothing => + ClassifiedField( + schemaName = schemaName, + fieldName = fieldName, + kind = None, + description = None, + required = required.contains(fieldName), + minimum = None, + maximum = None, + annotations = FieldAnnotations.empty, + ) + } +} diff --git a/openapi/src/main/scala/io/apibuilder/openapi/SchemaConverter.scala b/openapi/src/main/scala/io/apibuilder/openapi/SchemaConverter.scala new file mode 100644 index 000000000..74a7a81d5 --- /dev/null +++ b/openapi/src/main/scala/io/apibuilder/openapi/SchemaConverter.scala @@ -0,0 +1,339 @@ +package io.apibuilder.openapi + +import io.apibuilder.spec.v0.models.{Attribute, Enum, EnumValue, Field, Model, Union, UnionType} +import io.apibuilder.validation.ScalarType +import play.api.libs.json.Json +import sttp.apispec.{ExampleSingleValue, Schema, SchemaType} + +import scala.collection.immutable.ListMap + +class SchemaConverter( + modelReferences: Map[String, String], + config: NamingConfig, +) { + + import NamingUtils._ + import SchemaClassifier.{collectRefs, unionMembers} + import SchemaConverter._ + import SchemaResolver._ + + def convert(classification: SchemaClassification): SchemaConversionResult = { + val models = Seq.newBuilder[Model] + val enums = Seq.newBuilder[Enum] + val unions = Seq.newBuilder[Union] + + val skippedNames = classification.schemas.collect { case cs if cs.kind == SchemaKind.Skip => cs.name }.toSet + + classification.schemas.foreach { cs => + cs.kind match { + case SchemaKind.Object => + cs.schema.foreach { s => + val (model, objectEnums) = convertObjectSchema(cs.name, s, cs.fields) + model.foreach(models += _) + enums ++= objectEnums + } + case SchemaKind.StringEnum => + cs.schema.foreach(s => enums += convertTopLevelEnum(cs.name, s)) + case SchemaKind.Array => + cs.schema.foreach(s => models += convertArraySchema(cs.name, s)) + case SchemaKind.Union => + cs.schema.foreach(s => unions += convertUnionSchema(cs.name, s, skippedNames)) + case SchemaKind.Alias | SchemaKind.Skip => () + } + } + + SchemaConversionResult( + models = models.result(), + enums = enums.result(), + unions = unions.result(), + ) + } + + private def convertObjectSchema( + name: String, + schema: Schema, + fields: Seq[ClassifiedField], + ): (Option[Model], Seq[Enum]) = { + val converted = fields.flatMap(convertClassifiedField) + val model = Model( + name = sn(name), + plural = sn(name) + "s", + description = schema.description, + deprecation = None, + fields = converted.map(_._1), + attributes = Seq.empty, + interfaces = Seq.empty, + ) + (Some(model), converted.flatMap(_._2)) + } + + private def convertTopLevelEnum(name: String, schema: Schema): Enum = + Enum( + name = sn(name), + plural = sn(name) + "s", + description = schema.description, + deprecation = None, + values = enumStrings(schema).map(v => EnumValue(name = v)), + attributes = Seq.empty, + ) + + private def convertArraySchema(name: String, schema: Schema): Model = { + val itemType = schema.items + .map { + case s: Schema if s.$ref.isDefined => refName(s.$ref.get) + case s: Schema => + simpleType(s).map(_.name).getOrElse { + System.err.println(s"Warning: could not resolve array item type for schema '$name'; defaulting to string") + ScalarType.StringType.name + } + case _ => + System.err.println(s"Warning: unrecognised array items schema type for '$name'; defaulting to string") + ScalarType.StringType.name + } + .getOrElse { + System.err.println(s"Warning: array schema '$name' has no items definition; defaulting to string") + ScalarType.StringType.name + } + + Model( + name = sn(name), + plural = sn(name) + "s", + description = schema.description, + deprecation = None, + fields = Seq( + Field( + name = sn(name) + "_items", + `type` = sn(arrayType(itemType)), + description = schema.description, + deprecation = None, + default = None, + required = true, + minimum = None, + maximum = None, + example = None, + attributes = Seq.empty, + annotations = Seq.empty, + ), + ), + attributes = Seq.empty, + interfaces = Seq.empty, + ) + } + + private def convertClassifiedField(cf: ClassifiedField): Option[(Field, Seq[Enum])] = { + if (cf.kind.isEmpty) + System.err.println(s"Warning: could not classify field '${cf.fieldName}' in schema '${cf.schemaName}'; field will be omitted") + cf.kind.map { + case FieldKind.Ref(target) => + (makeField(cf, resolve(target)), Nil) + + case FieldKind.AllOfRef(target) => + (makeField(cf, resolve(target)), Nil) + + case FieldKind.Number => + (makeField(cf, ScalarType.DoubleType.name), Nil) + + case FieldKind.ArrayRef(target) => + (makeField(cf, arrayType(resolve(target))), Nil) + + case FieldKind.ArrayEnum(itemsSchema) => + val (field, enumDef) = inlineEnum(cf, itemsSchema) + (field, Seq(enumDef)) + + case FieldKind.InlineEnum(enumSchema) => + val (field, enumDef) = inlineEnum(cf, enumSchema) + (field, Seq(enumDef)) + + case FieldKind.MapType(valueType) => + (makeField(cf, NamingUtils.mapType(resolve(valueType))), Nil) + + case FieldKind.ArraySimple(scalarType) => + (makeField(cf, arrayType(scalarType.name)), Nil) + + case FieldKind.Primitive(scalarType) => + (makeField(cf, scalarType.name), Nil) + + case FieldKind.DefaultedString => + (makeField(cf, ScalarType.StringType.name), Nil) + } + } + + private def inlineEnum(cf: ClassifiedField, schema: Schema): (Field, Enum) = { + val enumName = cf.schemaName + "_" + cf.fieldName + "_enum" + val enumDef = Enum( + name = sn(enumName), + plural = sn(enumName) + "s", + description = None, + deprecation = None, + values = enumStrings(schema).map(v => + EnumValue( + name = NamingUtils.sanitizeEnumName(v), + description = None, + deprecation = None, + attributes = Seq.empty, + value = None, + ), + ), + attributes = Seq.empty, + ) + (makeField(cf, enumName), enumDef) + } + + private def makeField(cf: ClassifiedField, typeName: String): Field = + SchemaConverter.makeField( + cf.fieldName, + sn(typeName), + cf.description, + cf.required, + cf.minimum, + cf.maximum, + cf.annotations, + ) + + private def convertUnionSchema(name: String, schema: Schema, skippedNames: Set[String]): Union = { + val refs = collectRefs(unionMembers(schema)).filterNot(skippedNames.contains) + val discriminatorName = schema.discriminator.map(_.propertyName) + val mapping = schema.discriminator.flatMap(_.mapping).getOrElse(ListMap.empty) + + val refToValue: Map[String, String] = mapping.map { case (value, ref) => + refName(ref) -> value + }.toMap + + val types = refs.map { typeName => + val resolved = resolve(typeName) + UnionType( + `type` = sn(resolved), + description = None, + deprecation = None, + attributes = Seq.empty, + default = None, + discriminatorValue = refToValue.get(typeName), + ) + } + + Union( + name = sn(name), + plural = sn(name) + "s", + discriminator = discriminatorName, + description = schema.description, + deprecation = None, + types = types, + attributes = Seq.empty, + interfaces = Seq.empty, + ) + } + + private def sn(str: String): String = uniqueSnakeCase(str, config) + private def resolve(name: String): String = resolveReference(name, modelReferences) match { + case Right(resolved) => resolved + case Left(err) => + System.err.println(s"Warning: $err") + name + } +} + +case class SchemaConversionResult( + models: Seq[Model], + enums: Seq[Enum], + unions: Seq[Union], +) + +object SchemaConverter { + + def makeField( + name: String, + typeName: String, + description: Option[String], + required: Boolean, + minimum: Option[Long] = None, + maximum: Option[Long] = None, + annotations: SchemaClassifier.FieldAnnotations = SchemaClassifier.FieldAnnotations.empty, + ): Field = { + val attributes = annotations.ignoredFormat.toSeq.map { fmt => + Attribute( + name = "openapi_format", + value = Json.obj("format" -> fmt), + ) + } + Field( + name = name, + `type` = typeName, + description = description, + deprecation = annotations.deprecation, + default = annotations.default, + required = required, + minimum = minimum, + maximum = maximum, + example = annotations.example, + attributes = attributes, + annotations = Seq.empty, + ) + } + + def enumStrings(s: Schema): Seq[String] = + s.`enum`.toList.flatten.collect { case ExampleSingleValue(v) => v.toString } + + // https://spec.openapis.org/registry/format/ + private val FormatMap: Map[String, ScalarType] = Map( + "int8" -> ScalarType.IntegerType, + "int16" -> ScalarType.IntegerType, + "int32" -> ScalarType.IntegerType, + "int64" -> ScalarType.LongType, + "uint8" -> ScalarType.IntegerType, + "uint16" -> ScalarType.IntegerType, + "uint32" -> ScalarType.LongType, + "uint64" -> ScalarType.LongType, + "double-int" -> ScalarType.LongType, + "float" -> ScalarType.FloatType, + "double" -> ScalarType.DoubleType, + "decimal" -> ScalarType.DecimalType, + "decimal128" -> ScalarType.DecimalType, + "date" -> ScalarType.DateIso8601Type, + "date-time" -> ScalarType.DateTimeIso8601Type, + "date-time-local" -> ScalarType.StringType, + "http-date" -> ScalarType.StringType, + "duration" -> ScalarType.StringType, + "unixtime" -> ScalarType.LongType, + "uuid" -> ScalarType.UuidType, + "uri" -> ScalarType.StringType, + "uri-reference" -> ScalarType.StringType, + "uri-template" -> ScalarType.StringType, + "iri" -> ScalarType.StringType, + "iri-reference" -> ScalarType.StringType, + "email" -> ScalarType.StringType, + "idn-email" -> ScalarType.StringType, + "hostname" -> ScalarType.StringType, + "idn-hostname" -> ScalarType.StringType, + "byte" -> ScalarType.StringType, + "binary" -> ScalarType.StringType, + "base64url" -> ScalarType.StringType, + "sf-binary" -> ScalarType.StringType, + "password" -> ScalarType.StringType, + "html" -> ScalarType.StringType, + "commonmark" -> ScalarType.StringType, + "media-range" -> ScalarType.StringType, + "json-pointer" -> ScalarType.StringType, + "relative-json-pointer" -> ScalarType.StringType, + "regex" -> ScalarType.StringType, + "char" -> ScalarType.StringType, + ) + + def simpleType(s: Schema): Option[ScalarType] = { + lazy val fromFormat: Option[ScalarType] = s.format.flatMap(FormatMap.get) + + lazy val fromType: Option[ScalarType] = Seq( + SchemaType.Boolean -> ScalarType.BooleanType, + SchemaType.String -> ScalarType.StringType, + SchemaType.Integer -> ScalarType.IntegerType, + SchemaType.Number -> ScalarType.DecimalType, + ).collectFirst { case (st, scalarType) if hasType(s, st) => scalarType } + + fromFormat.orElse(fromType) + } + + def ignoredFormat(s: Schema): Option[String] = + s.format.filterNot(FormatMap.contains) + + private def hasType(s: Schema, st: SchemaType): Boolean = + SchemaResolver.hasType(s, st) +} diff --git a/openapi/src/main/scala/io/apibuilder/openapi/SchemaResolver.scala b/openapi/src/main/scala/io/apibuilder/openapi/SchemaResolver.scala new file mode 100644 index 000000000..744d5c302 --- /dev/null +++ b/openapi/src/main/scala/io/apibuilder/openapi/SchemaResolver.scala @@ -0,0 +1,74 @@ +package io.apibuilder.openapi + +import io.apibuilder.validation.ScalarType +import sttp.apispec.{Schema, SchemaLike, SchemaType} + +import scala.annotation.tailrec +import scala.collection.immutable.ListMap + +object SchemaResolver { + + def refName(ref: String): String = { + val prefix = "#/components/schemas/" + if (ref.startsWith(prefix)) ref.stripPrefix(prefix) + else { + System.err.println(s"Warning: unrecognised $$ref format '$ref'; using raw value as type name") + ref + } + } + + def buildModelReferences(schemas: ListMap[String, SchemaLike]): Map[String, String] = { + schemas.toSeq.flatMap { + case (name, s: Schema) if s.$ref.isDefined => + Some(name -> refName(s.$ref.get)) + + case (name, s: Schema) if s.allOf.nonEmpty && s.properties.isEmpty => + findFirstRef(s.allOf).map(name -> _) + + case (name, s: Schema) if hasType(s, SchemaType.String) && s.`enum`.isEmpty && s.properties.isEmpty => + Some(name -> ScalarType.StringType.name) + + case (name, s: Schema) => + detectMapType(s).map(name -> _) + + case _ => None + }.toMap + } + + def resolveReference(name: String, refs: Map[String, String]): Either[String, String] = + resolveReference(name, refs, Set.empty) + + @tailrec + private def resolveReference(name: String, refs: Map[String, String], seen: Set[String]): Either[String, String] = { + if (seen.contains(name)) + Left(s"Cycle detected while resolving schema alias: ${seen.mkString(" -> ")} -> $name") + else + refs.get(name) match { + case None => Right(name) + case Some(target) => resolveReference(target, refs, seen + name) + } + } + + private[openapi] def mapValueType(ap: SchemaLike): String = ap match { + case s: Schema if s.$ref.isDefined => refName(s.$ref.get) + case s: Schema => SchemaConverter.simpleType(s).map(_.name).getOrElse(ScalarType.JsonType.name) + case _ => ScalarType.JsonType.name + } + + private[openapi] def detectMapType(s: Schema): Option[String] = { + if (hasType(s, SchemaType.Object) && s.properties.isEmpty) { + s.additionalProperties.map(ap => NamingUtils.mapType(mapValueType(ap))) + } else { + None + } + } + + private def findFirstRef(schemas: List[SchemaLike]): Option[String] = { + schemas.collectFirst { + case s: Schema if s.$ref.isDefined => refName(s.$ref.get) + } + } + + private[openapi] def hasType(schema: Schema, schemaType: SchemaType): Boolean = + schema.`type`.exists(_.contains(schemaType)) +} diff --git a/openapi/src/main/scala/io/apibuilder/openapi/SecurityConverter.scala b/openapi/src/main/scala/io/apibuilder/openapi/SecurityConverter.scala new file mode 100644 index 000000000..dc9d4f3c4 --- /dev/null +++ b/openapi/src/main/scala/io/apibuilder/openapi/SecurityConverter.scala @@ -0,0 +1,136 @@ +package io.apibuilder.openapi + +import io.apibuilder.spec.v0.models.{Attribute, Header} +import io.apibuilder.validation.ScalarType +import play.api.libs.json.{JsObject, Json} +import sttp.apispec.{OAuthFlow, OAuthFlows, SecurityScheme} +import sttp.apispec.openapi.Reference + +import scala.collection.immutable.ListMap + +case class SecurityConversionResult( + headers: Seq[Header], + degradedNotes: Seq[String], +) + +object SecurityConverter { + + def convertSecuritySchemes( + schemes: ListMap[String, Either[Reference, SecurityScheme]], + ): SecurityConversionResult = { + val results = schemes.toSeq.flatMap { case (name, schemeOrRef) => + schemeOrRef match { + case Right(scheme) => convertScheme(name, scheme) + case Left(_) => None + } + } + SecurityConversionResult( + headers = results.map(_._1).distinctBy(_.name), + degradedNotes = results.flatMap(_._2), + ) + } + + private def convertScheme(name: String, scheme: SecurityScheme): Option[(Header, Option[String])] = + scheme.`type` match { + case "apiKey" if scheme.in.contains("header") => + scheme.name.map(n => (makeHeader(n, scheme.description), None)) + + case "http" => + val desc = scheme.description.orElse { + scheme.scheme.map { + case "bearer" => "Bearer token" + case "basic" => "Basic authentication" + case other => s"HTTP $other authentication" + } + } + Some((makeHeader("Authorization", desc), None)) + + case "oauth2" => + val flowDesc = oauthFlowDescription(scheme.flows) + val desc = Seq(scheme.description, flowDesc).flatten match { + case Nil => Some("OAuth2 authentication") + case parts => Some(parts.mkString(". ")) + } + val attr = oauth2Attribute(scheme.flows) + val note = s"securityScheme '$name': oauth2 converted to Authorization header; flow details preserved in 'oauth2' attribute" + Some((makeHeader("Authorization", desc, Seq(attr)), Some(note))) + + case "openIdConnect" => + val discoveryDesc = scheme.openIdConnectUrl.map(u => s"OpenID Connect discovery: $u") + val desc = Seq(scheme.description, discoveryDesc).flatten match { + case Nil => Some("OpenID Connect authentication") + case parts => Some(parts.mkString(". ")) + } + val attr = oidcAttribute(scheme.openIdConnectUrl) + val note = s"securityScheme '$name': openIdConnect converted to Authorization header; discovery URL preserved in 'openid_connect' attribute" + Some((makeHeader("Authorization", desc, Seq(attr)), Some(note))) + + case _ => None + } + + private def oauth2Attribute(flowsOpt: Option[OAuthFlows]): Attribute = { + val flowsJson = flowsOpt.fold(Json.obj()) { flows => + Seq( + flows.`implicit`.map(f => "implicit" -> flowJson(f, authUrl = true)), + flows.password.map(f => "password" -> flowJson(f, authUrl = false)), + flows.clientCredentials.map(f => "client_credentials" -> flowJson(f, authUrl = false)), + flows.authorizationCode.map(f => "authorization_code" -> flowJson(f, authUrl = true)), + ).flatten.foldLeft(Json.obj()) { case (acc, (k, v)) => acc + (k -> v) } + } + Attribute(name = "oauth2", value = Json.obj("flows" -> flowsJson)) + } + + private def flowJson(flow: OAuthFlow, authUrl: Boolean): JsObject = { + val stringFields = Seq( + Option.when(authUrl)(flow.authorizationUrl).flatten.map("authorization_url" -> _), + flow.tokenUrl.map("token_url" -> _), + flow.refreshUrl.map("refresh_url" -> _), + ).flatten + val base = stringFields.foldLeft(Json.obj()) { case (acc, (k, v)) => acc + (k -> Json.toJson(v)) } + if (flow.scopes.nonEmpty) base + ("scopes" -> Json.toJson(flow.scopes.toMap)) else base + } + + private def oidcAttribute(discoveryUrl: Option[String]): Attribute = + Attribute( + name = "openid_connect", + value = discoveryUrl.fold(Json.obj())(u => Json.obj("discovery_url" -> u)), + ) + + private def oauthFlowDescription(flowsOpt: Option[OAuthFlows]): Option[String] = + flowsOpt.map { flows => + val parts = Seq( + flows.`implicit`.map(f => + s"implicit (authorizationUrl: ${f.authorizationUrl.getOrElse("?")}; scopes: ${f.scopes.keys.mkString(", ")})" + ), + flows.password.map(f => + s"password (tokenUrl: ${f.tokenUrl.getOrElse("?")}; scopes: ${f.scopes.keys.mkString(", ")})" + ), + flows.clientCredentials.map(f => + s"clientCredentials (tokenUrl: ${f.tokenUrl.getOrElse("?")}; scopes: ${f.scopes.keys.mkString(", ")})" + ), + flows.authorizationCode.map(f => + s"authorizationCode (authorizationUrl: ${f.authorizationUrl.getOrElse("?")}; tokenUrl: ${f.tokenUrl.getOrElse("?")}; scopes: ${f.scopes.keys.mkString(", ")})" + ), + ).flatten + if (parts.isEmpty) "OAuth2" else s"OAuth2 flows: ${parts.mkString("; ")}" + } + + def isConvertible(scheme: SecurityScheme): Boolean = scheme.`type` match { + case "apiKey" => scheme.in.contains("header") + case "http" => true + case "oauth2" => true + case "openIdConnect" => true + case _ => false + } + + private def makeHeader(name: String, description: Option[String], attributes: Seq[Attribute] = Seq.empty): Header = + Header( + name = name, + `type` = ScalarType.StringType.name, + description = description, + deprecation = None, + required = true, + default = None, + attributes = attributes, + ) +} diff --git a/openapi/src/test/resources/fedex-eei-filing.json b/openapi/src/test/resources/fedex-eei-filing.json new file mode 100644 index 000000000..4f6b9defc --- /dev/null +++ b/openapi/src/test/resources/fedex-eei-filing.json @@ -0,0 +1,3583 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "EEI Filing API", + "version": "1.0" + }, + "servers": [ + { + "url": "https://apis-sandbox.fedex.com", + "description": "Sandbox Server" + }, + { + "url": "https://apis.fedex.com", + "description": "Production Server" + } + ], + "paths": { + "/globaltrade/v1/shipments/itn/retrieve": { + "post": { + "summary": "Retrieve ITN", + "description": "Use this endpoint to retrieve the ITN(internal tracking number) of an EEI(Electronic Export Information) which was already filed with US Customs.", + "operationId": "RetrieveITN", + "parameters": [ + { + "name": "x-locale", + "in": "header", + "description": "This indicates the combination of language code and country code.", + "schema": { + "type": "string" + }, + "example": "en_US" + }, + { + "name": "content-type", + "in": "header", + "description": "This is used to indicate the media type of the resource. The media type is a string sent along with the file indicating format of the file.", + "schema": { + "type": "string", + "example": "application/json" + } + }, + { + "name": "authorization", + "in": "header", + "description": "This indicates the authorization token for the input request", + "required": true, + "schema": { + "type": "string" + }, + "example": "Bearer XXXXX" + }, + { + "name": "x-customer-transaction-id", + "in": "header", + "description": "This element allows you to assign a unique identifier to your transaction. This element is also returned in the reply and helps you match the request to the reply.", + "schema": { + "type": "string", + "example": "0e671149-016f-1000-941f-ef4dbabadd2e" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrieveITNInputVO" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GticResponseVO_1" + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CXSError400" + }, + "example": { + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "errors": [ + { + "code": "EEI.SHIPMENTREFERENCENUMBER.INVALID", + "message": "Shipment reference number is missing or invalid. Please update and try again.", + "parameterList": { + "value": "ULTIMATE_CONSIGNEE", + "key": "EEI.SHIPMENTREFERENCENUMBER.INVALID" + } + } + ] + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CXSError401_1" + }, + "example": { + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "errors": [ + { + "code": "LOGIN.REAUTHENTICATE.ERROR", + "message": "Your session is expired. Please enter your user ID and password to log in again" + } + ] + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CXSError403" + }, + "example": { + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "errors": [ + { + "code": "FORBIDDEN.ERROR", + "message": "We could not authorize your credentials. Please check your permissions and try again." + } + ] + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CXSError404_1" + }, + "example": { + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "errors": { + "code": "NOT.FOUND.ERROR", + "message": "The resource you requested is no longer available. Please modify your request and try again." + } + } + } + } + }, + "500": { + "description": "Failure", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CXSError500_1" + }, + "example": { + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "errors": [ + { + "code": "INTERNAL.SERVER.ERROR", + "message": "We encountered an unexpected error and are working to resolve the issue.We apologize for any inconvenience.Please check back at a later time." + } + ] + } + } + } + }, + "503": { + "description": "Service Unavailable", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CXSError503" + }, + "example": { + "transactionId": "08f37269-2fcf-4a52-8f02-01c8349d143f", + "errors": { + "code": "SERVICE.UNAVAILABLE.ERROR", + "message": "The service is currently unavailable and we are working to resolve the issue. We apologize for any inconvenience.Please check back at a later time" + } + } + } + } + } + }, + "x-code-samples": [ + { + "lang": "C#", + "source": "var client = new RestClient(\"https://apis-sandbox.fedex.com/globaltrade/v1/shipments/itn/retrieve\");\nvar request = new RestRequest(Method.POST);\nrequest.AddHeader(\"Authorization\", \"Bearer \");\nrequest.AddHeader(\"X-locale\", \"en_US\");\nrequest.AddHeader(\"Content-Type\", \"application/json\");\n// 'input' refers to JSON Payload\nrequest.AddParameter(\"application/x-www-form-urlencoded\", input, ParameterType.RequestBody);\nIRestResponse response = client.Execute(request);\n\n\n\n\n" + }, + { + "lang": "JAVA", + "source": "OkHttpClient client = new OkHttpClient();\n\nMediaType mediaType = MediaType.parse(\"application/json\");\n// 'input' refers to JSON Payload\nRequestBody body = RequestBody.create(mediaType, input);\nRequest request = new Request.Builder()\n .url(\"https://apis-sandbox.fedex.com/globaltrade/v1/shipments/itn/retrieve\")\n .post(body)\n .addHeader(\"Content-Type\", \"application/json\")\n .addHeader(\"X-locale\", \"en_US\")\n .addHeader(\"Authorization\", \"Bearer \")\n .build();\n \nResponse response = client.newCall(request).execute();" + }, + { + "lang": "JAVASCRIPT", + "source": "// 'input' refers to JSON Payload\nvar data = JSON.stringify(input);\n \n var xhr = new XMLHttpRequest();\n xhr.withCredentials = true;\n \n xhr.addEventListener(\"readystatechange\", function () {\n if (this.readyState === 4) {\n console.log(this.responseText);\n }\n });\n \n xhr.open(\"POST\", \"https://apis-sandbox.fedex.com/globaltrade/v1/shipments/itn/retrieve\");\n xhr.setRequestHeader(\"Content-Type\", \"application/json\");\n xhr.setRequestHeader(\"X-locale\", \"en_US\");\n xhr.setRequestHeader(\"Authorization\", \"Bearer \");\n \n xhr.send(data);" + }, + { + "lang": "PHP", + "source": "setUrl('https://apis-sandbox.fedex.com/globaltrade/v1/shipments/itn/retrieve');\n$request->setMethod(HTTP_METH_POST);\n\n$request->setHeaders(array(\n 'Authorization' => 'Bearer ',\n 'X-locale' => 'en_US',\n 'Content-Type' => 'application/json'\n));\n\n$request->setBody(input); // 'input' refers to JSON Payload\n\ntry {\n $response = $request->send();\n\n echo $response->getBody();\n} catch (HttpException $ex) {\n echo $ex;\n}" + }, + { + "lang": "PYTHON", + "source": "import requests\n\nurl = \"https://apis-sandbox.fedex.com/globaltrade/v1/shipments/itn/retrieve\"\n\npayload = input # 'input' refers to JSON Payload\nheaders = {\n 'Content-Type': \"application/json\",\n 'X-locale': \"en_US\",\n 'Authorization': \"Bearer \"\n }\n\nresponse = requests.post(url, data=payload, headers=headers)\n\nprint(response.text)" + }, + { + "lang": "RUST", + "source": "extern crate reqwest;\n\nuse std::io::Read;\n\nfn construct_headers() -> HeaderMap {\n let mut headers = HeaderMap::new();\n headers.insert(\"Content-Type\", \"application/json\");\n headers.insert(\"X-locale\", \"en_US\");\n headers.insert(\"Authorization\", \"Bearer \");\n headers\n}\n\nfn run() -> Result<()> {\n let client = reqwest::Client::new();\n let mut res = client.post(\"https://apis-sandbox.fedex.com/globaltrade/v1/shipments/itn/retrieve\")\n .body(input) // 'input' refers to JSON Payload\n .headers(construct_headers())\n .send()?;\n let mut body = String::new();\n res.read_to_string(&mut body)?;\n\n println!(\"Status: {}\", res.status());\n println!(\"Headers:\\n{:#?}\", res.headers());\n println!(\"Body:\\n{}\", body);\n\n Ok(())\n}" + }, + { + "lang": "SWIFT", + "source": "import Foundation\n\nlet headers = [\n \"Content-Type\": \"application/json\",\n \"X-locale\": \"en_US\",\n \"Authorization\": \"Bearer \"\n]\nlet parameters = [\n input // 'input' refers to JSON Payload\n] as [String : Any]\n\nlet postData = JSONSerialization.data(withJSONObject: parameters, options: [])\n\nlet request = NSMutableURLRequest(url: NSURL(string: \"https://apis-sandbox.fedex.com/globaltrade/v1/shipments/itn/retrieve\")! as URL,\n cachePolicy: .useProtocolCachePolicy,\n timeoutInterval: 10.0)\nrequest.httpMethod = \"POST\"\nrequest.allHTTPHeaderFields = headers\nrequest.httpBody = postData as Data\n\nlet session = URLSession.shared\nlet dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in\n if (error != nil) {\n print(error)\n } else {\n let httpResponse = response as? HTTPURLResponse\n print(httpResponse)\n }\n})\n\ndataTask.resume()" + } + ] + } + }, + "/globaltrade/v1/shipments/eei/file": { + "post": { + "summary": "File EEI", + "description": "Use this endpoint to file an Electronic Export Information(EEI) with US Customs.", + "operationId": "FileEEI V1", + "parameters": [ + { + "name": "x-locale", + "in": "header", + "description": "This indicates the combination of language code and country code.", + "schema": { + "type": "string" + }, + "example": "en_US" + }, + { + "name": "authorization", + "in": "header", + "description": "This indicates the authorization token for the input request.", + "required": true, + "schema": { + "type": "string" + }, + "example": "Bearer XXXXX" + }, + { + "name": "x-customer-transaction-id", + "in": "header", + "description": "This element allows you to assign a unique identifier to your transaction. This element is also returned in the reply and helps you match the request to the reply.", + "schema": { + "type": "string", + "example": "0e671149-016f-1000-941f-ef4dbabadd2e" + } + }, + { + "in": "header", + "name": "content-type", + "description": "This is used to indicate the media type of the resource. The media type is a string sent along with the file indicating format of the file.", + "required": true, + "schema": { + "type": "string", + "example": "application/json" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/eei_file_body" + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GticResponseVO_2" + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CXSError400" + }, + "example": { + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "customerTransactionId": "0e671149-016f-1000-941f-ef4dbabadd2e", + "errors": [ + { + "code": "EEI.SHIPMENTREFERENCENUMBER.INVALID", + "message": "Shipment reference number is missing or invalid. Please update and try again.", + "parameterList": { + "value": "ULTIMATE_CONSIGNEE", + "key": "EEI.SHIPMENTREFERENCENUMBER.INVALID" + } + } + ] + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CXSError401_2" + }, + "example": { + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "errors": [ + { + "code": "NOT.AUTHORIZED.ERROR", + "message": "RESOURCESERVER.TOKEN.EXPIRED" + } + ] + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CXSError403_1" + }, + "example": { + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "errors": [ + { + "code": "FORBIDDEN.ERROR", + "message": "We could not authorize your credentials. Please check your permissions and try again." + } + ] + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CXSError404_2" + }, + "example": { + "error": "NOT.FOUND.ERROR", + "error_detail": "The resource you requested is no longer available. Please modify your request and try again." + } + } + } + }, + "500": { + "description": "Failure", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CXSError500_2" + }, + "example": { + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "errors": [ + { + "code": "INTERNAL.SERVER.ERROR", + "message": "We encountered an unexpected error and are working to resolve the issue. We apologize for any inconvenience. Please check back at a later time." + } + ] + } + } + } + } + }, + "x-code-samples": [ + { + "lang": "C#", + "source": "var client = new RestClient(\"https://apis-sandbox.fedex.com/globaltrade/v1/shipments/eei/file\");\nvar request = new RestRequest(Method.POST);\nrequest.AddHeader(\"Authorization\", \"Bearer \");\nrequest.AddHeader(\"X-locale\", \"en_US\");\nrequest.AddHeader(\"Content-Type\", \"application/json\");\n// 'input' refers to JSON Payload\nrequest.AddParameter(\"application/x-www-form-urlencoded\", input, ParameterType.RequestBody);\nIRestResponse response = client.Execute(request);\n\n\n\n\n" + }, + { + "lang": "JAVA", + "source": "OkHttpClient client = new OkHttpClient();\n\nMediaType mediaType = MediaType.parse(\"application/json\");\n// 'input' refers to JSON Payload\nRequestBody body = RequestBody.create(mediaType, input);\nRequest request = new Request.Builder()\n .url(\"https://apis-sandbox.fedex.com/globaltrade/v1/shipments/eei/file\")\n .post(body)\n .addHeader(\"Content-Type\", \"application/json\")\n .addHeader(\"X-locale\", \"en_US\")\n .addHeader(\"Authorization\", \"Bearer \")\n .build();\n \nResponse response = client.newCall(request).execute();" + }, + { + "lang": "JAVASCRIPT", + "source": "// 'input' refers to JSON Payload\nvar data = JSON.stringify(input);\n \n var xhr = new XMLHttpRequest();\n xhr.withCredentials = true;\n \n xhr.addEventListener(\"readystatechange\", function () {\n if (this.readyState === 4) {\n console.log(this.responseText);\n }\n });\n \n xhr.open(\"POST\", \"https://apis-sandbox.fedex.com/globaltrade/v1/shipments/eei/file\");\n xhr.setRequestHeader(\"Content-Type\", \"application/json\");\n xhr.setRequestHeader(\"X-locale\", \"en_US\");\n xhr.setRequestHeader(\"Authorization\", \"Bearer \");\n \n xhr.send(data);" + }, + { + "lang": "PHP", + "source": "setUrl('https://apis-sandbox.fedex.com/globaltrade/v1/shipments/eei/file');\n$request->setMethod(HTTP_METH_POST);\n\n$request->setHeaders(array(\n 'Authorization' => 'Bearer ',\n 'X-locale' => 'en_US',\n 'Content-Type' => 'application/json'\n));\n\n$request->setBody(input); // 'input' refers to JSON Payload\n\ntry {\n $response = $request->send();\n\n echo $response->getBody();\n} catch (HttpException $ex) {\n echo $ex;\n}" + }, + { + "lang": "PYTHON", + "source": "import requests\n\nurl = \"https://apis-sandbox.fedex.com/globaltrade/v1/shipments/eei/file\"\n\npayload = input # 'input' refers to JSON Payload\nheaders = {\n 'Content-Type': \"application/json\",\n 'X-locale': \"en_US\",\n 'Authorization': \"Bearer \"\n }\n\nresponse = requests.post(url, data=payload, headers=headers)\n\nprint(response.text)" + }, + { + "lang": "RUST", + "source": "extern crate reqwest;\n\nuse std::io::Read;\n\nfn construct_headers() -> HeaderMap {\n let mut headers = HeaderMap::new();\n headers.insert(\"Content-Type\", \"application/json\");\n headers.insert(\"X-locale\", \"en_US\");\n headers.insert(\"Authorization\", \"Bearer \");\n headers\n}\n\nfn run() -> Result<()> {\n let client = reqwest::Client::new();\n let mut res = client.post(\"https://apis-sandbox.fedex.com/globaltrade/v1/shipments/eei/file\")\n .body(input) // 'input' refers to JSON Payload\n .headers(construct_headers())\n .send()?;\n let mut body = String::new();\n res.read_to_string(&mut body)?;\n\n println!(\"Status: {}\", res.status());\n println!(\"Headers:\\n{:#?}\", res.headers());\n println!(\"Body:\\n{}\", body);\n\n Ok(())\n}" + }, + { + "lang": "SWIFT", + "source": "import Foundation\n\nlet headers = [\n \"Content-Type\": \"application/json\",\n \"X-locale\": \"en_US\",\n \"Authorization\": \"Bearer \"\n]\nlet parameters = [\n input // 'input' refers to JSON Payload\n] as [String : Any]\n\nlet postData = JSONSerialization.data(withJSONObject: parameters, options: [])\n\nlet request = NSMutableURLRequest(url: NSURL(string: \"https://apis-sandbox.fedex.com/globaltrade/v1/shipments/eei/file\")! as URL,\n cachePolicy: .useProtocolCachePolicy,\n timeoutInterval: 10.0)\nrequest.httpMethod = \"POST\"\nrequest.allHTTPHeaderFields = headers\nrequest.httpBody = postData as Data\n\nlet session = URLSession.shared\nlet dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in\n if (error != nil) {\n print(error)\n } else {\n let httpResponse = response as? HTTPURLResponse\n print(httpResponse)\n }\n})\n\ndataTask.resume()" + } + ] + } + }, + "/globaltrade/v1/regulatorycompliance/lookup": { + "post": { + "summary": "Regulatory Compliance Lookup", + "description": "This endpoint is to determine the compliance regulations applied for Shipment for EEI Filings.", + "operationId": "regulatoryComplianceLookup", + "parameters": [ + { + "name": "X-locale", + "in": "header", + "description": "ISO locale ", + "schema": { + "type": "string" + }, + "example": "en_US" + }, + { + "name": "content-type", + "in": "header", + "description": "This is used to indicate the media type of the resource. The media type is a string sent along with the file indicating format of the file.", + "required": true, + "schema": { + "type": "string" + }, + "example": "application/json" + }, + { + "name": "Authorization", + "in": "header", + "description": "Specifies the authorization token.", + "required": true, + "schema": { + "type": "string" + }, + "example": "Bearer XXX" + }, + { + "in": "header", + "name": "x-customer-transaction-id", + "description": "This element allows you to assign a unique identifier to your transaction. This element is also returned in the reply and helps you match the request to the reply.", + "required": false, + "schema": { + "type": "string", + "example": "624deea6-b709-470c-8c39-4b5511281492" + } + } + ], + "requestBody": { + "description": "Contains the Materials Input object to be applied.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RequestVO" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GticResponseVO_3" + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseVO_1" + }, + "example": { + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "errors": [ + { + "code": "COMMODITY.CODE.REQUIRED", + "message": "Harmonized code or scheduleBCode is required." + }, + { + "code": "REGULATORYCOMPLIANCE.COMMODITIES.NOTALLOWED", + "message": "The HTS code(s) are not allowed by AES." + }, + { + "code": "COMMODITY.CODE.INVALID", + "message": "Harmonized code or scheduleBCode is invalid. Please Verify." + }, + { + "code": "REGULATORYCOMPLIANCE.SHIPDATE.INVALID", + "message": "Shipment date can’t be greater than 120 days." + } + ] + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseVO_1" + }, + "example": { + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "errors": [ + { + "code": "NOT.AUTHORIZED.ERROR", + "message": "No access token provided. Please modify your request and try again." + } + ] + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseVO_1" + }, + "example": { + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "errors": [ + { + "code": "FORBIDDEN.ERROR", + "message": "We could not authorize your credentials. Please check your permissions and try again." + } + ] + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseVO_1" + }, + "example": { + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "errors": [ + { + "code": "NOT.FOUND.ERROR", + "message": "The resource you requested is no longer available. Please modify your request and try again." + } + ] + } + } + } + }, + "500": { + "description": "Failure", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseVO_1" + }, + "example": { + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "customerTransactionId": "AnyCo_order123456789", + "errors": [ + { + "code": "INTERNAL.SERVER.ERROR", + "message": "We encountered an unexpected error and are working to resolve the issue. We apologize for any inconvenience. Please check back at a later time." + } + ] + } + } + } + } + }, + "x-code-samples": [ + { + "lang": "C#", + "source": "var client = new RestClient(\"https://apis-sandbox.fedex.com/globaltrade/v1/regulatorycompliance/lookup\");\nvar request = new RestRequest(Method.POST);\nrequest.AddHeader(\"Authorization\", \"Bearer \");\nrequest.AddHeader(\"X-locale\", \"en_US\");\nrequest.AddHeader(\"Content-Type\", \"application/json\");\n// 'input' refers to JSON Payload\nrequest.AddParameter(\"application/x-www-form-urlencoded\", input, ParameterType.RequestBody);\nIRestResponse response = client.Execute(request);\n\n\n\n\n" + }, + { + "lang": "JAVA", + "source": "OkHttpClient client = new OkHttpClient();\n\nMediaType mediaType = MediaType.parse(\"application/json\");\n// 'input' refers to JSON Payload\nRequestBody body = RequestBody.create(mediaType, input);\nRequest request = new Request.Builder()\n .url(\"https://apis-sandbox.fedex.com/globaltrade/v1/regulatorycompliance/lookup\")\n .post(body)\n .addHeader(\"Content-Type\", \"application/json\")\n .addHeader(\"X-locale\", \"en_US\")\n .addHeader(\"Authorization\", \"Bearer \")\n .build();\n \nResponse response = client.newCall(request).execute();" + }, + { + "lang": "JAVASCRIPT", + "source": "// 'input' refers to JSON Payload\nvar data = JSON.stringify(input);\n \n var xhr = new XMLHttpRequest();\n xhr.withCredentials = true;\n \n xhr.addEventListener(\"readystatechange\", function () {\n if (this.readyState === 4) {\n console.log(this.responseText);\n }\n });\n \n xhr.open(\"POST\", \"https://apis-sandbox.fedex.com/globaltrade/v1/regulatorycompliance/lookup\");\n xhr.setRequestHeader(\"Content-Type\", \"application/json\");\n xhr.setRequestHeader(\"X-locale\", \"en_US\");\n xhr.setRequestHeader(\"Authorization\", \"Bearer \");\n \n xhr.send(data);" + }, + { + "lang": "PHP", + "source": "setUrl('https://apis-sandbox.fedex.com/globaltrade/v1/regulatorycompliance/lookup');\n$request->setMethod(HTTP_METH_POST);\n\n$request->setHeaders(array(\n 'Authorization' => 'Bearer ',\n 'X-locale' => 'en_US',\n 'Content-Type' => 'application/json'\n));\n\n$request->setBody(input); // 'input' refers to JSON Payload\n\ntry {\n $response = $request->send();\n\n echo $response->getBody();\n} catch (HttpException $ex) {\n echo $ex;\n}" + }, + { + "lang": "PYTHON", + "source": "import requests\n\nurl = \"https://apis-sandbox.fedex.com/globaltrade/v1/regulatorycompliance/lookup\"\n\npayload = input # 'input' refers to JSON Payload\nheaders = {\n 'Content-Type': \"application/json\",\n 'X-locale': \"en_US\",\n 'Authorization': \"Bearer \"\n }\n\nresponse = requests.post(url, data=payload, headers=headers)\n\nprint(response.text)" + }, + { + "lang": "RUST", + "source": "extern crate reqwest;\n\nuse std::io::Read;\n\nfn construct_headers() -> HeaderMap {\n let mut headers = HeaderMap::new();\n headers.insert(\"Content-Type\", \"application/json\");\n headers.insert(\"X-locale\", \"en_US\");\n headers.insert(\"Authorization\", \"Bearer \");\n headers\n}\n\nfn run() -> Result<()> {\n let client = reqwest::Client::new();\n let mut res = client.post(\"https://apis-sandbox.fedex.com/globaltrade/v1/regulatorycompliance/lookup\")\n .body(input) // 'input' refers to JSON Payload\n .headers(construct_headers())\n .send()?;\n let mut body = String::new();\n res.read_to_string(&mut body)?;\n\n println!(\"Status: {}\", res.status());\n println!(\"Headers:\\n{:#?}\", res.headers());\n println!(\"Body:\\n{}\", body);\n\n Ok(())\n}" + }, + { + "lang": "SWIFT", + "source": "import Foundation\n\nlet headers = [\n \"Content-Type\": \"application/json\",\n \"X-locale\": \"en_US\",\n \"Authorization\": \"Bearer \"\n]\nlet parameters = [\n input // 'input' refers to JSON Payload\n] as [String : Any]\n\nlet postData = JSONSerialization.data(withJSONObject: parameters, options: [])\n\nlet request = NSMutableURLRequest(url: NSURL(string: \"https://apis-sandbox.fedex.com/globaltrade/v1/regulatorycompliance/lookup\")! as URL,\n cachePolicy: .useProtocolCachePolicy,\n timeoutInterval: 10.0)\nrequest.httpMethod = \"POST\"\nrequest.allHTTPHeaderFields = headers\nrequest.httpBody = postData as Data\n\nlet session = URLSession.shared\nlet dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in\n if (error != nil) {\n print(error)\n } else {\n let httpResponse = response as? HTTPURLResponse\n print(httpResponse)\n }\n})\n\ndataTask.resume()" + } + ] + } + } + }, + "components": { + "schemas": { + "GticResponseVO": { + "type": "object", + "properties": { + "transactionId": { + "type": "string", + "description": "The transaction ID is a special set of numbers that defines each transaction.
Example: 624deea6-b709-470c-8c39-4b5511281492", + "example": "624deea6-b709-470c-8c39-4b5511281492" + }, + "customerTransactionId": { + "type": "string", + "description": "This element allows you to assign a unique identifier to your transaction. This element is also returned in the reply and helps you match the request to the reply.
Example: AnyCo_order123456789", + "example": "AnyCo_order123456789" + }, + "output": { + "$ref": "#/components/schemas/BaseProcessOutputVO_1" + } + }, + "description": "This is a wrapper class for outputVO." + }, + "BaseProcessOutputVO_1": { + "required": [ + "countryDetails", + "userMessages" + ], + "type": "object", + "properties": { + "userMessages": { + "type": "array", + "description": "Represents User Message", + "items": { + "$ref": "#/components/schemas/RegulatoryMessage" + } + }, + "countryDetails": { + "description": "Represents Country Details", + "allOf": [ + { + "$ref": "#/components/schemas/RegulatoryCountryDetails" + } + ] + }, + "cxsalerts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CXSAlert_1" + } + } + }, + "description": "ShipmentRegulatoryDetailsOutputVO Model" + }, + "ErrorResponseVO": { + "type": "object", + "properties": { + "transactionId": { + "type": "string", + "description": "The transaction ID is a special set of numbers that defines each transaction.
Example: 624deea6-b709-470c-8c39-4b5511281492", + "example": "624deea6-b709-470c-8c39-4b5511281492" + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CXSError" + } + } + }, + "description": "This holds the error responses." + }, + "CXSError": { + "type": "object", + "properties": { + "code": { + "description": "Indicates the error code.
Example: ACCOUNT.NUMBER.INVALID,LOGIN.REAUTHENTICATE.ERROR,SHIPMENT.USER.UNAUTHORIZED,NOT.FOUND.ERROR,INTERNAL.SERVER.ERROR" + }, + "parameterList": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Parameter_2" + } + }, + "message": { + "type": "string", + "description": "Indicates the description of API error alert message.
Example: We are unable to process this request. Please try again later or contact FedEx Customer Service." + } + }, + "description": "Indicates error alert when suspicious files, potential exploits and viruses found while scanning files , directories and user accounts. This includes code, message and parameter" + }, + "Parameter_2": { + "type": "object", + "properties": { + "value": { + "type": "string", + "description": "Identifies the error option to be applied." + }, + "key": { + "type": "string", + "description": "Indicates the value associated with the key." + } + }, + "description": "List of parameters which indicates the properties of the alert message." + }, + "ErrorResponseVO401": { + "type": "object", + "properties": { + "transactionId": { + "type": "string", + "description": "The transaction ID is a special set of numbers that defines each transaction.
Example: 624deea6-b709-470c-8c39-4b5511281492", + "example": "624deea6-b709-470c-8c39-4b5511281492" + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CXSError401" + } + } + }, + "description": "This holds the error responses." + }, + "CXSError401": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Indicates the error code.
Example: NOT.AUTHORIZED.ERROR" + }, + "parameterList": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Parameter" + } + }, + "message": { + "description": "Indicates the description of API error alert message.
Example: Access token expired. Please modify your request and try again." + } + }, + "description": "Indicates error alert when suspicious files, potential exploits and viruses found while scanning files , directories and user accounts. This includes code, message and parameter" + }, + "Parameter": { + "type": "object", + "properties": { + "value": { + "type": "string", + "description": "Identifies the error option to be applied." + }, + "key": { + "type": "string", + "description": "Indicates the value associated with the key." + } + }, + "description": "List of parameters which indicates the properties of the alert message." + }, + "ErrorResponseVO404": { + "type": "object", + "properties": { + "transactionId": { + "type": "string", + "description": "The transaction ID is a special set of numbers that defines each transaction.
Example: 624deea6-b709-470c-8c39-4b5511281492", + "example": "624deea6-b709-470c-8c39-4b5511281492" + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CXSError404" + } + } + }, + "description": "This holds the error responses." + }, + "CXSError404": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Indicates the error code.
Example: NOT.FOUND.ERROR" + }, + "parameterList": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Parameter" + } + }, + "message": { + "description": "Indicates the description of API error alert message.
Example: The resource you requested is no longer available. Please modify your request and try again." + } + }, + "description": "Indicates error alert when suspicious files, potential exploits and viruses found while scanning files , directories and user accounts. This includes code, message and parameter" + }, + "ErrorResponseVO422": { + "type": "object", + "properties": { + "transactionId": { + "type": "string", + "description": "The transaction ID is a special set of numbers that defines each transaction.
Example: 624deea6-b709-470c-8c39-4b5511281492", + "example": "624deea6-b709-470c-8c39-4b5511281492" + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CXSError422" + } + } + }, + "description": "This holds the error responses." + }, + "CXSError422": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Indicates the error code.
Example: INVALID.INPUT.EXCEPTION" + }, + "parameterList": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Parameter" + } + }, + "message": { + "description": "Validation failed for the object='shipmentRegulatoryDetailsInputVO'.Error count:1" + } + }, + "description": "Indicates error when mandatory elements are not passed in the request." + }, + "ErrorResponseVO500": { + "type": "object", + "properties": { + "transactionId": { + "type": "string", + "description": "The transaction ID is a special set of numbers that defines each transaction.
Example: 624deea6-b709-470c-8c39-4b5511281492", + "example": "624deea6-b709-470c-8c39-4b5511281492" + }, + "customerTransactionId": { + "type": "string", + "description": "This element allows you to assign a unique identifier to your transaction. This element is also returned in the reply and helps you match the request to the reply.
Example: AnyCo_order123456789", + "format": "uuid" + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CXSError500" + } + } + }, + "description": "This holds the error responses." + }, + "CXSError500": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Indicates the error code.
Example: INTERNAL.SERVER.ERROR" + }, + "parameterList": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Parameter" + } + }, + "message": { + "description": "Indicates the description of API error alert message.
Example: We encountered an unexpected error and are working to resolve the issue. We apologize for any inconvenience. Please check back at a later time." + } + }, + "description": "Indicates error alert when suspicious files, potential exploits and viruses found while scanning files , directories and user accounts. This includes code, message and parameter" + }, + "FullSchema": { + "required": [ + "carrierCode", + "destinationAddress", + "originAddress" + ], + "type": "object", + "properties": { + "serviceType": { + "type": "string", + "description": "Specify the type of service that is used to ship the package.
click here to see Service Types", + "example": "FEDEX_FREIGHT_ECONOMY" + }, + "totalCommodityValue": { + "description": "Specify the total commodity value. Either customsClearenceDetail or totalCommodityValue is required.", + "allOf": [ + { + "$ref": "#/components/schemas/Money" + } + ] + }, + "originAddress": { + "description": "Provide the shipment origin address details.", + "allOf": [ + { + "$ref": "#/components/schemas/Address" + } + ] + }, + "destinationAddress": { + "description": "Provide the shipment destination address details.", + "allOf": [ + { + "$ref": "#/components/schemas/Address" + } + ] + }, + "serviceOptionType": { + "type": "array", + "description": "Specify attributes to filter location types. If more than one value is specified, only those locations that have all the specified attributes will be returned.", + "example": [ + "FEDEX_ONE_RATE", + "SATURDAY_DELIVERY" + ], + "items": { + "type": "string", + "description": "Specify attributes to filter location types. If more than one value is specified, only those locations that have all the specified attributes will be returned.
Example: [FEDEX_ONE_RATE, SATURDAY_DELIVERY]", + "enum": [ + "FEDEX_ONE_RATE", + "FREIGHT_GUARANTEE", + "SATURDAY_DELIVERY", + "SMART_POST_ALLOWED_INDICIA", + "SMART_POST_HUB_ID" + ] + } + }, + "customsClearanceDetail": { + "description": "Specify the Customs clearance details.Either customsClearenceDetail or totalCommodityValue is required.", + "allOf": [ + { + "$ref": "#/components/schemas/CustomsClearanceDetailVO" + } + ] + }, + "shipDate": { + "type": "string", + "description": "Specify shipment date.

Note : Default value is current date in case the date is not provided or a past date is provided.
Format [YYYY-MM-DD].
Example: 2021-08-05'", + "example": "2019-10-14" + }, + "carrierCode": { + "type": "string", + "description": "Specify the four letter code of a FedEx operating company that meets your requirements.

Valid values are:
  • FDXE - FedEx Express
  • FDXG - FedEx Ground

  • Example: FDXE", + "example": "FDXE" + }, + "totalWeight": { + "description": "Provide the total weight for the shipment.", + "allOf": [ + { + "$ref": "#/components/schemas/Weight" + } + ] + }, + "includeURLReferences": { + "type": "boolean", + "description": "Specify if the url references to be included in the output. These are regulatory reference data urls specific to document, agency.", + "example": true + }, + "consolidationType": { + "type": "string", + "description": "Specify the type of consolidation that contains this shipment.

    Valid values are:
    • INTERNATIONAL_DISTRIBUTION_FREIGHT
    • INTERNATIONAL_ECONOMY_DISTRIBUTION
    • INTERNATIONAL_GROUND_DISTRIBUTION
    • INTERNATIONAL_PRIORITY_DISTRIBUTION
    • TRANSBORDER_DISTRIBUTION
    ", + "example": "INTERNATIONAL_DISTRIBUTION_FREIGHT" + }, + "consolidationRole": { + "type": "string", + "description": "Specify the role this shipment plays within the consolidation.

    Valid values are:
    • CONSOLIDATION_DOCUMENTS_SHIPMENT – Shipment contains clearance documents for the corresponding consolidation.
    • CRN_SHIPMENT – Shipment is a Child Reference Number(individual shipment within consolidation).
    • MASTER_AIRWAYBILL_SHIPMENT – Shipment represents entire consolidation, moving as a unit.
    ", + "example": "CONSOLIDATION_DOCUMENTS_SHIPMENT" + } + }, + "description": "The request elements to retrieve Shipment Regulatory Details." + }, + "Money": { + "type": "object", + "properties": { + "amount": { + "type": "number", + "description": "This is the amount.
    Example: 12.45", + "format": "double", + "example": 12.45, + "xml": { + "name": "Amount" + } + }, + "currency": { + "type": "string", + "description": "This is the currency code for the amount.
    Example: USD
    click here to see Currency codes", + "example": "USD", + "xml": { + "name": "Currency" + } + } + }, + "description": "Customs value for this commodity." + }, + "Address": { + "required": [ + "countryCode" + ], + "type": "object", + "properties": { + "countryCode": { + "type": "string", + "description": "Indicate the 2-character ISO country code.
    Maximum length is 2.
    Example: US
    click here to see Country codes", + "example": "US" + }, + "postalCode": { + "type": "string", + "description": "This is the postal code.
    Note: This is Optional for non postal-aware countries. Maximum length is 10.
    Example: 65247
    click here to see Postal aware countries", + "example": "75063" + }, + "stateOrProvinceCode": { + "type": "string", + "description": "This is a placeholder for state or province code.
    Example: CA.
    click here to see State or Province Code", + "example": "TX" + } + }, + "description": "Address Model" + }, + "CustomsClearanceDetailVO": { + "required": [ + "commodities", + "customsValue" + ], + "type": "object", + "properties": { + "regulatoryControls": { + "type": "array", + "description": "These are the Regulatory Controls applicable to the shipment.", + "example": "NOT_IN_FREE_CIRCULATION", + "items": { + "type": "string", + "enum": [ + "FOOD_OR_PERISHABLE", + "USMCA", + "NOT_APPLICABLE_FOR_LOW_VALUE_CUSTOMS_EXCEPTIONS", + "NOT_IN_FREE_CIRCULATION" + ] + } + }, + "insuranceCharges": { + "$ref": "#/components/schemas/Money_1" + }, + "importerOfRecordAccountNumber": { + "description": "The descriptive data for the importer of Record for the shipment and account number information.", + "allOf": [ + { + "$ref": "#/components/schemas/Party" + } + ] + }, + "customsValue": { + "$ref": "#/components/schemas/Money" + }, + "commercialInvoice": { + "$ref": "#/components/schemas/CommercialInvoice" + }, + "commodities": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CommodityVO" + } + }, + "documentContent": { + "type": "string", + "description": "Defaults to COMMODITY. Only used for int'l Express requests to indicate if just documents are being shipped or not.", + "example": "DOCUMENT", + "enum": [ + "DOCUMENT", + "COMMODITY" + ] + } + }, + "description": "These are customs clearance details.
    Required for International and intra-country Shipments." + }, + "Money_1": { + "type": "object", + "properties": { + "amount": { + "type": "number", + "description": "This is the amount.
    Example: 12.45", + "format": "double", + "example": 12.45, + "xml": { + "name": "Amount" + } + }, + "currency": { + "type": "string", + "description": "This is the currency code for the amount.
    Example: USD
    click here to see Currency codes", + "example": "USD", + "xml": { + "name": "Currency" + } + } + }, + "description": "Specify Insurance charges if applicable.
    Note: FedEx does not provide insurance of any kind." + }, + "Party": { + "type": "object", + "properties": { + "accountNumber": { + "type": "string", + "description": "This is FedEx Account number details. Example: 123456789" + } + }, + "description": "Attributes for a Party to a transaction including the physical address, contact information and account number information.", + "example": "897654564" + }, + "CommercialInvoice": { + "type": "object", + "properties": { + "freightCharge": { + "description": "Indicate the freight charge.", + "allOf": [ + { + "$ref": "#/components/schemas/Money" + } + ] + }, + "purpose": { + "type": "string", + "description": "It describes the purpose.", + "example": "SOLD" + } + }, + "description": "Use this object to provide Commercial Invoice details. This element is required for electronic upload of CI data. It will serve to create/transmit an electronic Commercial Invoice through the FedEx system.
    Customers are responsible for printing their own Commercial Invoice.
    If you would like FedEx to generate a Commercial Invoice and transmit it to Customs for clearance purposes, you need to specify that in the ETDDetail/RequestedDocumentCopies element.
    Supports maximum of 99 commodity line items." + }, + "CommodityVO": { + "required": [ + "harmonizedCode" + ], + "type": "object", + "properties": { + "quantity": { + "type": "string", + "description": "Total number of units (using quantityUnits as the unit of measure) of this commodity present in the shipment.
    Example: '1'" + }, + "quantityUOM": { + "type": "string", + "description": "This is the units quantity per commodity. This is used to estimate duties and taxes in GTC.
    Example: 125" + }, + "customsValue": { + "description": "Required
    Customs value for this commodity", + "allOf": [ + { + "$ref": "#/components/schemas/Money" + } + ] + }, + "countryOfManufacture": { + "type": "string", + "description": "Required
    Max Length is 4
    Example: IN", + "example": "US" + }, + "name": { + "type": "string", + "description": "This represents the name of commodity." + }, + "harmonizedCode": { + "type": "string", + "description": "This is to specify the Harmonized Tariff System (HTS) code to meet U.S. and foreign governments' customs requirements. These are mainly used to estimate the duties and taxes.
    Example: 0613
    To research the classification for your commodity, use the FedEx Global Trade Manager online at fedex.com/gtm. You will find country-specific information to determine whether your commodity is considered to be a document or non-document for your destination.", + "example": "0613" + }, + "description": { + "type": "string", + "description": "This represents commodity description" + }, + "weight": { + "description": "Represents Weight of the packages or shipment.", + "allOf": [ + { + "$ref": "#/components/schemas/Weight" + } + ] + }, + "commodityId": { + "type": "integer", + "description": "This represents the commodity id", + "format": "int32" + }, + "additionalMeasures": { + "$ref": "#/components/schemas/Measure" + } + } + }, + "Weight": { + "required": [ + "units", + "value" + ], + "type": "object", + "properties": { + "units": { + "type": "string", + "description": "Indicate the weight unit type. The package and commodity weight unit should be the same else the request will result in an error.", + "example": "KG", + "enum": [ + "KG", + "LB" + ] + }, + "value": { + "type": "number", + "description": "This is the weight. Max. Length is 99999.
    Example: 68.25", + "format": "double", + "example": 68.25 + } + }, + "description": "Indicates the weight details of the commodity.", + "example": { + "units": "KG", + "value": 68 + } + }, + "Measure": { + "required": [ + "quantity", + "uom" + ], + "type": "object", + "properties": { + "uom": { + "type": "string", + "description": "Unit of measure used to express the quantity of this commodity line item.", + "xml": { + "name": "Uom" + } + }, + "quantity": { + "type": "number", + "description": "Specify commodity quantity.", + "format": "double", + "xml": { + "name": "Quantity" + } + } + }, + "description": "This object contains additional quantitative information other than weight and quantity to calculate duties and taxes." + }, + "MinimumSamplePayload": { + "example": { + "originAddress": { + "countryCode": "IN" + }, + "destinationAddress": { + "countryCode": "CA" + }, + "carrierCode": "FDXE", + "customsClearanceDetail": { + "customsValue": { + "amount": "", + "currency": "" + }, + "commodities": [ + { + "harmonizedCode": "580122" + } + ] + } + } + }, + "GticResponseVO_1": { + "type": "object", + "properties": { + "transactionId": { + "type": "string", + "description": "It is the unique identifier for the transaction.", + "format": "uuid", + "example": "0e671149-016f-1000-941f-ef4dbabadd2e" + }, + "customerTransactionId": { + "type": "string", + "description": "This element allows you to assign a unique identifier to your transaction. This element is also returned in the reply and helps you match the request to the reply.", + "example": "0e671149-016f-1000-941f-ef4dbabadd2e" + }, + "output": { + "$ref": "#/components/schemas/BaseProcessOutputVO_2" + } + } + }, + "BaseProcessOutputVO_2": { + "type": "object", + "properties": { + "internalTrackingNumber": { + "type": "string", + "description": "This is the ITN number from US Customs.", + "example": "X20241011791496" + }, + "status": { + "type": "string", + "description": "This is EEI’s status code for the shipment reference number.", + "example": "A1" + }, + "statusDescription": { + "type": "string", + "description": "This is the status description.", + "example": "EEI Approved" + }, + "highestSeverity": { + "type": "string", + "description": "Specifies the type of severity of the notifications", + "example": "SUCCESS", + "enum": [ + "ERROR", + "FAILURE", + "NOTE", + "SUCCESS", + "WARNING" + ] + }, + "notification": { + "allOf": [ + { + "$ref": "#/components/schemas/Notification_Detail" + } + ] + } + } + }, + "CXSError400": { + "type": "object", + "properties": { + "transactionId": { + "type": "string", + "description": "It is the unique identifier for the transaction.", + "format": "uuid", + "example": "0e671149-016f-1000-941f-ef4dbabadd2e" + }, + "customerTransactionId": { + "type": "string", + "description": "It is the same customerTransactionId sent as part of the request's header,by the clients calling this endpoint.", + "format": "uuid", + "example": "0e671149-016f-1000-941f-ef4dbabadd2e" + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CXSError400_error" + } + } + }, + "description": "Indicates error alert when suspicious files, potential exploits and viruses found while scanning files , directories and user accounts. This includes code, message and parameter" + }, + "CXSError401_1": { + "type": "object", + "properties": { + "transactionId": { + "type": "string", + "description": "It is the unique identifier for the transaction.", + "format": "uuid", + "example": "0e671149-016f-1000-941f-ef4dbabadd2e" + }, + "customerTransactionId": { + "type": "string", + "description": "It is the same customerTransactionId sent as part of the request's header,by the clients calling this endpoint.", + "format": "uuid", + "example": "0e671149-016f-1000-941f-ef4dbabadd2e" + }, + "error": { + "$ref": "#/components/schemas/CXSError401_1_error" + } + }, + "description": "Indicates error alert when suspicious files, potential exploits and viruses found while scanning files , directories and user accounts. This includes code, message and parameter" + }, + "CXSError403": { + "type": "object", + "properties": { + "transactionId": { + "type": "string", + "description": "It is the unique identifier for the transaction.", + "format": "uuid", + "example": "0e671149-016f-1000-941f-ef4dbabadd2e" + }, + "customerTransactionId": { + "type": "string", + "description": "It is the same customerTransactionId sent as part of the request's header,by the clients calling this endpoint.", + "format": "uuid", + "example": "0e671149-016f-1000-941f-ef4dbabadd2e" + }, + "error": { + "$ref": "#/components/schemas/CXSError403_error" + } + }, + "description": "Indicates error alert when suspicious files, potential exploits and viruses found while scanning files , directories and user accounts. This includes code, message and parameter" + }, + "CXSError404_1": { + "type": "object", + "properties": { + "transactionId": { + "type": "string", + "description": "It is the unique identifier for the transaction.", + "format": "uuid", + "example": "0e671149-016f-1000-941f-ef4dbabadd2e" + }, + "customerTransactionId": { + "type": "string", + "description": "It is the same customerTransactionId sent as part of the request's header,by the clients calling this endpoint.", + "format": "uuid", + "example": "0e671149-016f-1000-941f-ef4dbabadd2e" + }, + "error": { + "$ref": "#/components/schemas/CXSError404_1_error" + } + }, + "description": "Indicates error alert when suspicious files, potential exploits and viruses found while scanning files , directories and user accounts. This includes code, message and parameter" + }, + "CXSError500_1": { + "type": "object", + "properties": { + "transactionId": { + "type": "string", + "description": "It is the unique identifier for the transaction.", + "format": "uuid", + "example": "0e671149-016f-1000-941f-ef4dbabadd2e" + }, + "customerTransactionId": { + "type": "string", + "description": "It is the same customerTransactionId sent as part of the request's header,by the clients calling this endpoint.", + "format": "uuid", + "example": "0e671149-016f-1000-941f-ef4dbabadd2e" + }, + "error": { + "$ref": "#/components/schemas/CXSError500_1_error" + } + }, + "description": "Indicates error alert when suspicious files, potential exploits and viruses found while scanning files , directories and user accounts. This includes code, message and parameter" + }, + "CXSError503": { + "type": "object", + "properties": { + "transactionId": { + "type": "string", + "description": "The transaction ID is a special set of numbers that defines each transaction.
    Example: 624deea6-b709-470c-8c39-4b5511281492", + "example": "624deea6-b709-470c-8c39-4b5511281492" + }, + "customerTransactionId": { + "type": "string", + "description": "This element allows you to assign a unique identifier to your transaction. This element is also returned in the reply and helps you match the request to the reply.
    Example: AnyCo_order123456789", + "example": "AnyCo_order123456789" + }, + "error": { + "$ref": "#/components/schemas/CXSError503_error" + } + } + }, + "RetrieveITNInputVO": { + "required": [ + "shipmentReferenceNumber" + ], + "type": "object", + "properties": { + "version": { + "$ref": "#/components/schemas/Version" + }, + "shipmentReferenceNumber": { + "type": "string", + "description": "This is the shipment reference number which is needed in order to retrieve the ITN (Internal Tracking Number).", + "example": "24091060018" + } + } + }, + "Version": { + "required": [ + "major", + "minor" + ], + "type": "object", + "properties": { + "major": { + "type": "integer", + "description": "This version is incremented when significant changes are made to the API functionality. These could be breaking changes and might require code-adjustments from clients. Accepts only numbers", + "example": 1 + }, + "minor": { + "type": "integer", + "description": "This represents a backward-compatible bug fix or minor adjustment to an existing API functionality. This is the second number in API versioning scheme. Accepts only numbers", + "example": 1 + }, + "patch": { + "type": "integer", + "description": "This represents a backward-compatible bug fix or minor adjustment to an existing API functionality. This is the third number in API versioning scheme. Accepts only numbers", + "example": 1 + } + } + }, + "GticResponseVO_2": { + "type": "object", + "properties": { + "transactionId": { + "type": "string", + "description": "It is the unique identifier for the transaction.", + "format": "uuid", + "example": "0e671149-016f-1000-941f-ef4dbabadd2e" + }, + "customerTransactionId": { + "type": "string", + "description": "It is the same customerTransactionId sent as part of the request's header,by the clients calling this endpoint.", + "format": "uuid", + "example": "0e671149-016f-1000-941f-ef4dbabadd2e" + }, + "output": { + "$ref": "#/components/schemas/FileEEIOutputVO" + } + } + }, + "FileEEIOutputVO": { + "type": "object", + "properties": { + "shipmentReferenceNumber": { + "type": "string", + "description": "Describes the reference number for the shipment.", + "example": "24102960001" + }, + "highestSeverity": { + "type": "string", + "description": "Specifies the type of severity of the notifications", + "example": "SUCCESS", + "enum": [ + "ERROR", + "FAILURE", + "NOTE", + "SUCCESS", + "WARNING" + ] + }, + "notification": { + "allOf": [ + { + "$ref": "#/components/schemas/Notification_Detail" + } + ] + } + } + }, + "Notification_Detail": { + "type": "object", + "properties": { + "severity": { + "type": "array", + "description": "Specifies the type of severity of the notifications", + "example": "SUCCESS", + "items": { + "type": "string", + "enum": [ + "ERROR", + "FAILURE", + "NOTE", + "SUCCESS", + "WARNING" + ] + } + }, + "source": { + "type": "string", + "description": "specifies the source of the notifications", + "example": "FEDEX" + }, + "code": { + "type": "string", + "description": "specifies the code related to the notifications", + "example": "0" + }, + "message": { + "type": "string", + "description": "Specifies the message related to the notifications", + "example": "Request was successfully processed." + } + } + }, + "CXSError400_1": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MessageParameters_1" + } + }, + "CXSError400_2": { + "type": "object", + "properties": { + "transactionId": { + "type": "string", + "description": "It is the unique identifier for the transaction.", + "example": "0e671149-016f-1000-941f-ef4dbabadd2e" + }, + "code": { + "type": "string", + "description": "Indicates the error code.", + "example": "COUNTRY.CODE.INVALID,PRICING.OPTION.INVALID,PAYMENTTYPEVALUE.INVALID,COUNTRY.SOURCETYPE.INVALID,COUNTRY.TYPE.ID.INVALID" + }, + "message": { + "type": "string", + "description": "Indicates the description of API error alert message.", + "example": "Longitude and Latitude are required." + } + }, + "description": "Indicates error alert when suspicious files, potential exploits and viruses found while scanning files , directories and user accounts. This includes code, message and parameter" + }, + "CXSError401_2": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CXSError401_3" + } + }, + "CXSError401_3": { + "type": "object", + "properties": { + "transactionId": { + "type": "string", + "description": "It is the unique identifier for the transaction.", + "example": "0e671149-016f-1000-941f-ef4dbabadd2e" + }, + "code": { + "type": "string", + "description": "Indicates the error code.", + "example": "LOGIN.REAUTHENTICATE.ERROR" + }, + "message": { + "type": "string", + "description": "Indicates the description of API error alert message.", + "example": "Your session is expired. Please enter your user ID and password to log in again." + } + }, + "description": "Indicates error alert when suspicious files, potential exploits and viruses found while scanning files , directories and user accounts. This includes code, message and parameter" + }, + "CXSError403_1": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CXSError403_2" + } + }, + "CXSError403_2": { + "type": "object", + "properties": { + "transactionId": { + "type": "string", + "description": "It is the unique identifier for the transaction.", + "example": "0e671149-016f-1000-941f-ef4dbabadd2e" + }, + "code": { + "type": "string", + "description": "Indicates the error code.", + "example": "FORBIDDEN.ERROR" + }, + "message": { + "type": "string", + "description": "Indicates the description of API error alert message.", + "example": "We could not authorize your credentials. Please check your permissions and try again" + } + }, + "description": "Indicates error alert when suspicious files, potential exploits and viruses found while scanning files , directories and user accounts. This includes code, message and parameter" + }, + "CXSError404_2": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CXSError404_3" + } + }, + "CXSError404_3": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Indicates the error code.", + "example": "NOT.FOUND.ERROR" + }, + "message": { + "type": "string", + "description": "Indicates the description of API error alert message.", + "example": "The resource you requested is no longer available. Please modify your request and try again." + } + }, + "description": "Indicates error alert when suspicious files, potential exploits and viruses found while scanning files , directories and user accounts. This includes code, message and parameter" + }, + "CXSError500_2": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CXSError500_3" + } + }, + "CXSError500_3": { + "type": "object", + "properties": { + "transactionId": { + "type": "string", + "description": "It is the unique identifier for the transaction.", + "example": "0e671149-016f-1000-941f-ef4dbabadd2e" + }, + "code": { + "type": "string", + "description": "Indicates the error code.", + "example": "INTERNAL.SERVER.ERROR" + }, + "message": { + "type": "string", + "description": "Indicates the description of API error alert message.", + "example": "We encountered an unexpected error and are working to resolve the issue. We apologize for any inconvenience. Please check back at a later time." + } + }, + "description": "Indicates error alert when suspicious files, potential exploits and viruses found while scanning files , directories and user accounts. This includes code, message and parameter" + }, + "FullSchema_FileEEIInputVO": { + "required": [ + "eeiPartyDetails", + "processingOption" + ], + "type": "object", + "properties": { + "version": { + "$ref": "#/components/schemas/Version" + }, + "processingOption": { + "type": "array", + "description": "processingOption for ADD Cancel Update", + "example": "ADD", + "items": { + "type": "string", + "enum": [ + "ADD", + "CANCEL", + "UPDATE" + ] + } + }, + "eeiControlDetail": { + "$ref": "#/components/schemas/FullSchema_FileEEIInputVO_eeiControlDetail" + }, + "eeiPartyDetails": { + "type": "array", + "description": "Both USPPI and ULTIMATE_CONSIGNEE are mandatory.", + "items": { + "$ref": "#/components/schemas/FullSchema_FileEEIInputVO_eeiPartyDetails" + } + }, + "eeiCommodities": { + "type": "array", + "description": "Contains details for each exported item, including description, tariff code, origin, weight and other information.", + "items": { + "$ref": "#/components/schemas/FullSchema_FileEEIInputVO_eeiCommodities" + } + } + } + }, + "SamplePayload_AddFiling": { + "example": { + "version": { + "minor": 1, + "major": 1, + "patch": 1 + }, + "processingOption": "ADD", + "eeiControlDetail": { + "shipDate": "2025-02-03", + "accountNumber": "130043016", + "customerReferenceNumber": "1234", + "hazardousMaterial": false, + "partiesToTransactionAreRelated": false + }, + "eeiPartyDetails": [ + { + "eeiShipmentPartyType": "ULTIMATE_CONSIGNEE", + "eeiContactAndAddress": { + "contact": { + "personName": { + "firstName": "", + "lastName": "" + }, + "title": "", + "companyName": "MARK PVT LIMITED", + "phoneNumberCountryCode": "", + "phoneNumberAreaCode": "", + "phoneNumber": "", + "phoneExtension": "", + "pagerNumber": "", + "faxNumber": "", + "eMailAddress": "" + }, + "address": { + "streetLines": [ + "BUILD NO 1" + ], + "city": "PARIS", + "stateOrProvinceCode": "", + "postalCode": "", + "urbanizationCode": "", + "countryCode": "FR", + "countryName": "", + "residential": false, + "geographicCoordinates": "" + } + }, + "einTaxId": "" + }, + { + "eeiShipmentPartyType": "USPPI", + "eeiContactAndAddress": { + "contact": { + "personName": { + "firstName": "RASI", + "lastName": "SAI" + }, + "title": "", + "companyName": "TEST LIMITED", + "phoneNumberCountryCode": "", + "phoneNumberAreaCode": "", + "phoneNumber": "8025192678", + "phoneExtension": "", + "pagerNumber": "", + "faxNumber": "", + "eMailAddress": "sait.osv@fedex.com" + }, + "address": { + "streetLines": [ + "BUILDING" + ], + "city": "AUSTIN", + "stateOrProvinceCode": "TX", + "postalCode": "73301", + "urbanizationCode": "", + "countryCode": "US", + "countryName": "", + "residential": false, + "geographicCoordinates": "" + } + }, + "einTaxId": "456736452" + } + ], + "eeiCommodities": [ + { + "commodity": { + "commodityId": "", + "numberOfPieces": 1, + "description": "REGISTERS, ACCOUNT BOOKS, NOTEBOOKS, ORDER BOOKS, RECEIPT BOOKS, LETTER PADS, MEMORANDUM PADS, DIARIES AND SIMILAR ARTICLES [REGISTERS, ACCOUNT BOOKS, NOTE BOOKS, ORDER BOOKS, RECEIPT BOOKS, LETTER PADS, MEMORANDUM PAD S, DIARIES AND SIMILAR ARTICLES, EXERCISE BOOKS, BLOTTING-PADS, BINDERS (LOOSELEAF OR OTHER)]", + "countryOfManufacture": "", + "harmonizedCode": "4820100000", + "weight": { + "units": "KG", + "value": 2 + }, + "quantity": 1, + "quantityUnits": "NO", + "unitPrice": { + "currency": "", + "amount": 0 + }, + "customsValue": { + "currency": "USD", + "amount": 2700 + }, + "exportLicenseNumber": "NLR", + "exportLicenseExpirationDate": "", + "cIMarksAndNumbers": "", + "partNumber": "" + }, + "scheduleBCode": "4820100000", + "exportInformationCode": "OS", + "eeiCommodityLicenseDetail": { + "licenseCode": "C33", + "licenseValue": { + "currency": "USD", + "amount": 0 + } + }, + "inbondCode": "", + "usDomestic": false, + "ddtcDetail": { + "ddtcITARExemptionNumber": "", + "ddtcRegistrationNumber": "", + "ddtcSignificantMilitarySMEIndicator": false, + "ddtcEligibleParty": false, + "usmlCategoryCode": "", + "ddtcXXIDeterminationNumber": "", + "ddtcUnitOfMeasure": { + "quantity": 0, + "units": "" + } + }, + "vehicleDetail": { + "vinNumber": "", + "titleNumber": "", + "titleState": "" + } + } + ] + } + }, + "SamplePayload_CancelFiling": { + "example": { + "processingOption": "CANCEL", + "eeiControlDetail": { + "shipmentReferenceNumber": "24092660018" + } + } + }, + "SamplePayload_UpdateFiling": { + "example": { + "processingOption": "UPDATE", + "eeiControlDetail": { + "shipDate": "2024-09-23", + "accountNumber": "130043016", + "shipmentReferenceNumber": "24093060018", + "hazardousMaterial": false, + "partiesToTransactionAreRelated": false + }, + "eeiPartyDetails": { + "eeiShipmentPartyType": "ULTIMATE_CONSIGNEE", + "eeiContactAndAddress": { + "contact": { + "personName": { + "firstName": "Surya", + "lastName": "Reddy" + }, + "title": "Mr", + "companyName": "HUAWEI", + "phoneNumberCountryCode": "1011", + "phoneNumberAreaCode": "1012", + "phoneNumber": "8907757679", + "phoneExtension": "1", + "pagerNumber": "1", + "faxNumber": "14560171", + "eMailAddress": "maneesh.nv@fedex.com" + }, + "address": { + "streetLines": [ + "10 FedEx Parkway" + ], + "city": "PARIS", + "stateOrProvinceCode": "TX", + "postalCode": "26150", + "urbanizationCode": "URB FAIR OAKS", + "countryCode": "US", + "countryName": "UNITED STATES", + "residential": false, + "geographicCoordinates": null + } + }, + "einTaxId": "456736452" + }, + "eeiCommodities": { + "commodity": { + "commodityId": "12", + "numberOfPieces": "1", + "description": "REGISTERS, ACCOUNT BOOKS, NOTEBOOKS, ORDER BOOKS, RECEIPT BOOKS, LETTER PADS, MEMORANDUM PADS, DIARIES AND SIMILAR ARTICLES [REGISTERS, ACCOUNT BOOKS, NOTE BOOKS, ORDER BOOKS, RECEIPT BOOKS, LETTER PADS, MEMORANDUM PAD S, DIARIES AND SIMILAR ARTICLES, EXERCISE BOOKS, BLOTTING-PADS, BINDERS (LOOSELEAF OR OTHER)]", + "countryOfManufacture": "US", + "harmonizedCode": "4820100000", + "weight": { + "units": "K", + "value": 2 + }, + "quantity": "1", + "quantityUnits": "NO", + "additionalMeasures": [ + null + ], + "unitPrice": { + "currency": "USD", + "amount": "12" + }, + "customsValue": { + "currency": "USD", + "amount": "2600" + }, + "exportLicenseNumber": "26456", + "exportLicenseExpirationDate": "2009-04-12", + "cIMarksAndNumbers": "87123", + "partNumber": "167" + }, + "scheduleBCode": "4820100000", + "exportInformationCode": "OS", + "eeiCommodityLicenseDetail": { + "licenseCode": "C33", + "licenseValue": { + "currency": "USD", + "amount": "0" + } + }, + "inbondCode": "36", + "usDomestic": "false", + "ddtcDetail": { + "ddtcITARExemptionNumber": "123.11B", + "ddtcRegistrationNumber": "C6754", + "ddtcSignificantMilitarySMEIndicator": false, + "ddtcEligibleParty": false, + "usmlCategoryCode": "17", + "ddtcUnitOfMeasure": { + "quantity": "0", + "units": "USD" + } + } + } + } + }, + "Minimum_Payload": { + "example": { + "processingOption": "ADD", + "eeiControlDetail": { + "shipDate": "2024-09-23", + "accountNumber": "130043016" + }, + "eeiPartyDetails": [ + { + "eeiShipmentPartyType": "USPPI", + "eeiContactAndAddress": { + "contact": { + "companyName": "HUAWEI", + "personName": { + "firstName": "Surya", + "lastName": "Kumar" + } + }, + "address": { + "streetLines": [ + "BUILDING" + ], + "city": "PARIS", + "countryCode": "US" + } + }, + "einTaxId": "456736452" + }, + { + "eeiShipmentPartyType": "ULTIMATE_CONSIGNEE", + "eeiContactAndAddress": { + "contact": { + "companyName": "HUAWEI" + }, + "address": { + "streetLines": [ + "BUILDING" + ], + "city": "PARIS", + "countryCode": "US" + } + } + } + ], + "eeiCommodities": { + "commodity": { + "description": "REGISTERS, ACCOUNT BOOKS, NOTEBOOKS, ORDER BOOKS, RECEIPT BOOKS, LETTER PADS, MEMORANDUM PADS, DIARIES AND SIMILAR ARTICLES [REGISTERS, ACCOUNT BOOKS, NOTE BOOKS, ORDER BOOKS, RECEIPT BOOKS, LETTER PADS, MEMORANDUM PAD S, DIARIES AND SIMILAR ARTICLES, EXERCISE BOOKS, BLOTTING-PADS, BINDERS (LOOSELEAF OR OTHER)]", + "harmonizedCode": "4820100000", + "quantityUnits": "NO", + "weight": { + "units": "KG" + } + }, + "exportInformationCode": "GP", + "eeiCommodityLicenseDetail": { + "licenseCode": "C33" + } + } + } + }, + "GticResponseVO_3": { + "type": "object", + "properties": { + "transactionId": { + "type": "string", + "description": "It is the unique identifier for the transaction.", + "format": "uuid", + "example": "0e671149-016f-1000-941f-ef4dbabadd2e" + }, + "customerTransactionId": { + "type": "string", + "description": "This element allows you to assign a unique identifier to your transaction. This element is also returned in the reply and helps you match the request to the reply.
    Example: AnyCo_order123456789", + "example": "AnyCo_order123456789" + }, + "output": { + "allOf": [ + { + "$ref": "#/components/schemas/BaseProcessOutputVO" + } + ] + } + } + }, + "BaseProcessOutputVO": { + "type": "object", + "properties": { + "regulatoryComplianceCountryDetails": { + "type": "array", + "description": "This is an array of nonnegative-Integer identifying the associated commodities.", + "items": { + "$ref": "#/components/schemas/RegulatoryComplianceCountryDetail" + } + }, + "shipmentRegulatoryComplianceDetails": { + "type": "array", + "description": "This is an array of nonnegative-Integer identifying the associated commodities.", + "items": { + "$ref": "#/components/schemas/RegulatoryComplianceTypeDetail" + } + } + } + }, + "CXSAlert": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Specifies the API alert code.", + "example": "INVALID.INPUT.EXCEPTION" + }, + "alertType": { + "type": "string", + "description": "Specifies the API alert Type.", + "example": "WARNING", + "enum": [ + "NOTE", + "WARNING" + ] + }, + "parameterList": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Parameter_1" + } + }, + "message": { + "type": "string", + "description": "Specifies the API alert message.", + "example": "Validation failed for object. Error count: 1" + } + } + }, + "Parameter_1": { + "type": "object", + "properties": { + "value": { + "type": "string", + "description": "Identifies the error option to be applied.", + "example": "packagingType can not be null" + }, + "key": { + "type": "string", + "description": "Indicates the value associated with the key.", + "example": "NotNull.specialServicesOptionsInputVO.requestedShipment.packagingType" + } + }, + "description": "List of parameters which indicates the properties of the alert message." + }, + "ErrorResponseVO_1": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ErrorResponseVO_2" + } + }, + "ErrorResponseVO_2": { + "type": "object", + "properties": { + "transactionId": { + "type": "string", + "description": "Unique identifier used to match requests to their respective responses.
    Example: XXX_ORDERXXXX789.", + "example": "XXX_ORDERXXXX789" + }, + "errors": { + "type": "array", + "description": "Indicates error alert when suspicious files, potential exploits and viruses found while scanning files , directories and user accounts.
    This includes code, message and parameter.", + "items": { + "$ref": "#/components/schemas/CXSError_1" + } + } + }, + "description": "Indicates error alert when suspicious files, potential exploits and viruses found while scanning files , directories and user accounts. This includes code, message and parameter." + }, + "CXSError_1": { + "type": "object", + "properties": { + "code": { + "description": "Indicates the error code.
    Example: ACCOUNT.NUMBER.INVALID,LOGIN.REAUTHENTICATE.ERROR,SHIPMENT.USER.UNAUTHORIZED,NOT.FOUND.ERROR,INTERNAL.SERVER.ERROR" + }, + "message": { + "type": "string", + "description": "Indicates the description of API error alert message.
    Example: We are unable to process this request. Please try again later or contact FedEx Customer Service." + } + }, + "description": "Indicates error alert when suspicious files, potential exploits and viruses found while scanning files , directories and user accounts. This includes code, message and parameter" + }, + "RequestVO": { + "required": [ + "carrierCode", + "consolidationRole", + "consolidationType", + "destinationAddress", + "originAddress", + "regulatoryCustomsClearanceDetail", + "serviceOptionTypes", + "serviceType", + "shipDate", + "totalCommodityValue", + "totalWeight" + ], + "type": "object", + "properties": { + "version": { + "$ref": "#/components/schemas/Version_optional" + }, + "shipDate": { + "type": "string", + "description": "String date format to indicate the date to be used for importing. Default to next day if not present in the request. This date can’t be greater than 120 days this includes weekends. The date format should be ISO8601Date, YYYY-MM-DD.", + "format": "YYYY-MM-DD", + "example": "2022-10-05" + }, + "carrierCode": { + "type": "string", + "description": "The shipment type abbreviation for a FedEx operating company. EX: FXE for FedEx Express.\r\nSupported Values: FXE, FXG, FXF or any value supported in the DOM element CarrierCodeType.", + "example": "FXE" + }, + "originAddress": { + "description": "Represents the origin address details required for regulatory compliance", + "allOf": [ + { + "$ref": "#/components/schemas/RegulatoryAddressVO" + } + ] + }, + "destinationAddress": { + "description": "Represents the destination address details required for regulatory compliance", + "allOf": [ + { + "$ref": "#/components/schemas/RegulatoryAddressVO" + } + ] + }, + "serviceType": { + "type": "string", + "description": "String value to indicate a FedEx operating company’s type of service. Valid values from the authoritative data source (ADS) are listed in the example. Default value is “IP” if not present in the request. Valid values are also DOM ServiceType values.", + "example": "[\"IP\",\"SG\",\"PO\",\"XS\",\"FR\",\"FL\"]" + }, + "serviceOptionTypes": { + "type": "array", + "description": "A list to indicate possible shipment features, some of which are listed below. (String[]) Values come from PLEFS (ADS) and DOM. Some possible valid values “FICE”, “ITAR”.", + "example": [ + "FICE" + ], + "items": { + "type": "string", + "enum": [ + "FICE", + "ITAR" + ] + } + }, + "totalWeight": { + "$ref": "#/components/schemas/Weight" + }, + "consolidationType": { + "type": "string", + "description": "String value to identify the type of consolidation containing this shipment.
    Example: INTERNATIONAL_PRIORITY_DISTRIBUTION", + "example": "INTERNATIONAL_PRIORITY_DISTRIBUTION" + }, + "consolidationRole": { + "type": "string", + "description": "A String value to identify the role of this shipment within the consolidation.
    Example: CRN_SHIPMENT", + "example": "CRN_SHIPMENT" + }, + "totalCommodityValue": { + "$ref": "#/components/schemas/Money_2" + }, + "regulatoryCustomsClearanceDetail": { + "$ref": "#/components/schemas/RegulatoryCustomsClearanceDetail" + } + }, + "additionalProperties": false + }, + "Version_optional": { + "type": "object", + "properties": { + "major": { + "type": "integer", + "description": "This version is incremented when significant changes are made to the API functionality. These could be breaking changes and might require code-adjustments from clients. Accepts only numbers", + "example": 1 + }, + "minor": { + "type": "integer", + "description": "This represents a backward-compatible bug fix or minor adjustment to an existing API functionality. This is the second number in API versioning scheme. Accepts only numbers", + "example": 1 + }, + "patch": { + "type": "integer", + "description": "This represents a backward-compatible bug fix or minor adjustment to an existing API functionality. This is the third number in API versioning scheme. Accepts only numbers", + "example": 1 + } + } + }, + "RegulatoryAddressVO": { + "required": [ + "countryCode" + ], + "type": "object", + "properties": { + "countryCode": { + "type": "string", + "description": "String value to indicate the 2-character ISO country code", + "example": "US" + }, + "stateOrProvinceCode": { + "type": "string", + "description": "String value to identify the abbreviation for US state, Canada province etc. The valid values for stateOrProvinceCode are AS, GU, MP, PR, VI, VA", + "example": "TX" + }, + "postalCode": { + "type": "string", + "description": "String value to indicate the zip code", + "example": "75024" + } + } + }, + "Money_2": { + "type": "object", + "properties": { + "amount": { + "type": "number", + "description": "This is the amount.
    Example: 12.45", + "format": "double", + "example": 12.45, + "xml": { + "name": "Amount" + } + }, + "currency": { + "type": "string", + "description": "This is the currency code for the amount.", + "example": "USD", + "xml": { + "name": "Currency" + } + } + } + }, + "RegulatoryCustomsClearanceDetail": { + "type": "object", + "properties": { + "regulatoryControls": { + "type": "array", + "example": "NOT_IN_FREE_CIRCULATION", + "items": { + "type": "string", + "enum": [ + "FOOD_OR_PERISHABLE", + "USMCA", + "NOT_APPLICABLE_FOR_LOW_VALUE_CUSTOMS_EXCEPTIONS", + "NOT_IN_FREE_CIRCULATION" + ] + } + }, + "documentContent": { + "type": "string", + "description": "It is the documentContent.", + "example": "NON_DOCUMENTS" + }, + "customsValue": { + "$ref": "#/components/schemas/Money_2" + }, + "commercialInvoice": { + "$ref": "#/components/schemas/CommercialInvoice" + }, + "commodities": { + "minItems": 1, + "description": "Indicates the details of commodities", + "type": "array", + "items": { + "$ref": "#/components/schemas/CommodityLookup" + } + } + } + }, + "CommodityLookup": { + "type": "object", + "properties": { + "commodityID": { + "type": "string", + "description": "Unique id with the commodity in the containing shipment.", + "example": "12" + }, + "scheduleBCode": { + "type": "string", + "description": "Is a 6 digit US customs code sent in request.", + "example": "500000" + }, + "harmonizedCode": { + "type": "string", + "description": "Is a 6 digit HS code sent in request.", + "example": "611692" + }, + "name": { + "type": "string", + "description": "String value to indicate the commodity name", + "example": "Papers" + }, + "description": { + "type": "string", + "description": "It describes the commodity", + "example": "Theragem Power Supply Unit" + }, + "exportControlClassificationNumber": { + "type": "string", + "description": "It describes the export Control Classification Number", + "example": "10" + }, + "commodityLicenseOrPermit": { + "type": "string", + "description": "It describes the Commodity License or Prmit", + "example": "10" + }, + "countryOfManufacture": { + "type": "string", + "description": "2-character ISO country code", + "example": "GB" + }, + "weight": { + "$ref": "#/components/schemas/Weight" + }, + "quantity": { + "type": "number", + "description": "Specifies the commodity quantity", + "example": 15 + }, + "quantityUnits": { + "type": "string", + "description": "This the unit of measure for the units quantity. This is used to estimate duties and taxes.
    Example: EA", + "example": "Ea" + }, + "customsValue": { + "$ref": "#/components/schemas/Money_2" + } + } + }, + "ShipmentRegulatoryDetailsOutputVO": { + "required": [ + "countryDetails", + "userMessages" + ], + "type": "object", + "properties": { + "userMessages": { + "type": "array", + "description": "Represents User Message", + "items": { + "$ref": "#/components/schemas/RegulatoryMessage" + } + }, + "countryDetails": { + "description": "Represents Country Details", + "allOf": [ + { + "$ref": "#/components/schemas/RegulatoryCountryDetails" + } + ] + }, + "cxsalerts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CXSAlert_1" + } + } + }, + "description": "ShipmentRegulatoryDetailsOutputVO Model" + }, + "RegulatoryMessage": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Indicates the message code.", + "example": "1028" + }, + "messageParameters": { + "type": "array", + "description": "Value indicating the translated text.", + "items": { + "$ref": "#/components/schemas/MessageParameters" + } + }, + "index": { + "type": "integer", + "description": "Non negative integer value indicating the index of the commodity description.", + "format": "int32", + "example": 1 + }, + "text": { + "type": "string", + "description": "Indicates the content of the user-instructional message in English.", + "example": "Based on shipment information provided, only non-document/commodity type is permitted for this shipment" + }, + "localizedText": { + "type": "string", + "description": "This is the return message from the service provider in local language.", + "example": "Selon les informations fournies sur l envoi, seul le type de produit / document est autorisé pour cet envo" + } + }, + "description": "Object representing the information needed during the interaction with clients" + }, + "MessageParameters": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Indicates the message identifier.", + "example": "1" + }, + "value": { + "type": "string", + "description": "Indicates the message.", + "example": "Based on shipment information provided, only non-document/commodity type is permitted for this shipment" + } + }, + "description": "Object containing the parameters for a Message object" + }, + "MessageParameters_1": { + "description": "Object containing the parameters for a Message object", + "type": "object", + "properties": { + "id": { + "description": "String value indicating the identifier of the message.", + "type": "string", + "example": "FIELD_NAME" + }, + "value": { + "description": "String value to indicate value of the message.", + "type": "string", + "example": "accountNumber" + } + } + }, + "RegulatoryCountryDetails": { + "required": [ + "category", + "countryCode", + "shipmentDetails" + ], + "type": "object", + "properties": { + "shipmentDetails": { + "description": "These are Shipment Details.", + "allOf": [ + { + "$ref": "#/components/schemas/RegulatoryShipmentDetail" + } + ] + }, + "countryCode": { + "type": "string", + "description": "Indicates Country Code." + }, + "category": { + "type": "string", + "description": "Indicates the Regulatory details category." + } + } + }, + "RegulatoryShipmentDetail": { + "type": "object", + "properties": { + "regulatoryStatements": { + "$ref": "#/components/schemas/RegulatoryStatement" + }, + "requiredCommodityUnitsOfMeasure": { + "type": "array", + "description": "This is the statistical unit of measure required by the government.", + "items": { + "type": "string", + "description": "Describes the regulatory data elements required to move the package." + } + }, + "level": { + "type": "string", + "description": "This a Delay Level Type. The attribute of the shipment that caused delay." + }, + "commodityIndex": { + "type": "integer", + "description": "This is a non negative integer. This is a 1-based index identifying the comodity in the request that resulted in this Commodity or Document type prohibition.", + "format": "int32" + }, + "regulatoryDocuments": { + "$ref": "#/components/schemas/RegulatoryDocument" + }, + "regulatoryCountryAdvisories": { + "$ref": "#/components/schemas/RegulatoryCountryAdvisory" + } + } + }, + "RegulatoryStatement": { + "type": "object", + "properties": { + "userMessage": { + "$ref": "#/components/schemas/RegulatoryMessage" + }, + "supportType": { + "type": "string", + "description": "This represents document support type.", + "enum": [ + "FEDEX_GENERATED", + "FILLABLE", + "PRINT_ONLY", + "SAMPLE" + ] + }, + "allowability": { + "type": "string", + "description": "Specifies a requirement type." + }, + "fileName": { + "type": "string", + "description": "This represents file name." + }, + "agencyUrl": { + "type": "string", + "description": "Represents agency url." + }, + "documentUrl": { + "type": "string", + "description": "Represents document url." + }, + "id": { + "type": "string", + "description": "This specifies Regualatory document id." + }, + "completionType": { + "type": "string", + "description": "This specifies completion type.", + "enum": [ + "COMPLETE", + "REQUIRES_COMPLETION" + ] + }, + "agencyName": { + "type": "string", + "description": "It Specifies agency name." + }, + "localizedAttributes": { + "$ref": "#/components/schemas/LocalizedAttributeDetail" + }, + "documentIds": { + "type": "array", + "description": "Specifies the document identifier.", + "items": { + "type": "string" + } + }, + "statementUrl": { + "type": "string", + "description": "This represents statement url." + } + }, + "description": "Specifies the list of regulatory statements." + }, + "LocalizedAttributeDetail": { + "type": "object", + "properties": { + "localization": { + "$ref": "#/components/schemas/Localization" + }, + "name": { + "type": "string", + "description": "Specifies the name of the product being shipped." + }, + "description": { + "type": "string", + "description": "Specifies elabaorate material description and other technical details of the product beingshipped." + } + }, + "description": "Specifies the localized attribute details." + }, + "Localization": { + "type": "object", + "properties": { + "localization": { + "type": "string", + "description": "Two letter language code.
    Example: EN
    click here to see Locales", + "example": "EN" + }, + "localeCode": { + "type": "string", + "description": "Two letter region code.
    Example: us
    click here to see Locales", + "example": "us" + } + }, + "description": "Specify locale details for composing email with the document." + }, + "RegulatoryDocument": { + "type": "object", + "properties": { + "userMessage": { + "$ref": "#/components/schemas/RegulatoryMessage" + }, + "supportType": { + "type": "string", + "description": "This represents document support type.", + "enum": [ + "FEDEX_GENERATED", + "FILLABLE", + "PRINT_ONLY", + "SAMPLE" + ] + }, + "allowability": { + "type": "string", + "description": "This is a Requirement type." + }, + "fileName": { + "type": "string", + "description": "This represents file name." + }, + "documentType": { + "type": "string", + "description": "Specifies the document type." + }, + "agencyUrl": { + "type": "string", + "description": "Represents the agency url." + }, + "documentUrl": { + "type": "string", + "description": "Represents document url." + }, + "id": { + "type": "string", + "description": "This specifies Regualatory document id." + }, + "agencyName": { + "type": "string", + "description": "Specifies the agency name." + }, + "localizedAttributes": { + "$ref": "#/components/schemas/LocalizedAttributeDetail" + } + }, + "description": "Specifies the Regulatory Documents." + }, + "RegulatoryCountryAdvisory": { + "type": "object", + "properties": { + "types": { + "type": "string", + "description": "Specifies the advisory type." + }, + "messages": { + "type": "array", + "description": "Specifies code and other parameters.", + "items": { + "$ref": "#/components/schemas/Message" + } + } + }, + "description": "Specifies the types and parameters of Country's advisory regulations." + }, + "Message": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Specifies the advisory document related code." + }, + "text": { + "type": "string", + "description": "Specifies names of the regulatory advisories." + }, + "parameters": { + "type": "array", + "description": "Specifies information related to the advisories and their relevant parameters.", + "items": { + "$ref": "#/components/schemas/MessageParameter" + } + }, + "localizedText": { + "type": "string", + "description": "This provides the specifics of the regulations." + } + } + }, + "MessageParameter": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Specifies the advisory ids." + }, + "value": { + "type": "string", + "description": "Specifies the advisory regulation." + } + } + }, + "CXSAlert_1": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Specifies the API alert code." + }, + "alertType": { + "type": "string", + "description": "Specifies the API alert type.", + "enum": [ + "NOTE", + "WARNING" + ] + }, + "parameterList": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Parameter" + } + }, + "message": { + "type": "string", + "description": "Specifies the API alert message." + } + } + }, + "RetrieveITNOutputVO": { + "type": "object", + "properties": { + "internalTrackingNumber": { + "type": "string", + "description": "This is the ITN number from US Customs.", + "example": "X20241011791496" + }, + "status": { + "type": "string", + "description": "This is EEI’s status code for the shipment reference number.", + "example": "A1" + }, + "statusDescription": { + "type": "string", + "description": "This is the status description.", + "example": "EEI Approved" + }, + "highestSeverity": { + "type": "string", + "description": "Specifies the type of severity of the notifications", + "enum": [ + "ERROR", + "FAILURE", + "NOTE", + "SUCCESS", + "WARNING" + ] + }, + "notification": { + "allOf": [ + { + "$ref": "#/components/schemas/Notification_Detail" + } + ] + } + } + }, + "AccountNumber": { + "type": "string", + "description": "The account number value.
    Max Length is 9.
    Example: 123456789", + "example": "602345XXX" + }, + "Measure1": { + "type": "object", + "properties": { + "units": { + "type": "string", + "description": "Barrels/Drums", + "example": "BBL" + }, + "quantity": { + "type": "number", + "description": "Specifies the number of quantity", + "format": "double", + "example": 0 + } + } + }, + "RegulatoryComplianceOutputVO": { + "type": "object", + "properties": { + "regulatoryComplianceCountryDetails": { + "type": "array", + "description": "This is an array of nonnegative-Integer identifying the associated commodities.", + "items": { + "$ref": "#/components/schemas/RegulatoryComplianceCountryDetail" + } + }, + "shipmentRegulatoryComplianceDetails": { + "type": "array", + "description": "This is an array of nonnegative-Integer identifying the associated commodities.", + "items": { + "$ref": "#/components/schemas/RegulatoryComplianceTypeDetail" + } + } + } + }, + "RegulatoryComplianceCountryDetail": { + "type": "object", + "properties": { + "countryCode": { + "type": "string", + "description": "The ISO country code for the country.", + "example": "US" + }, + "category": { + "type": "string", + "description": "Describes the type of category", + "example": "ProductType" + }, + "regulatoryComplianceCommodityDetails": { + "type": "array", + "description": "This is an array of nonnegative-Integer identifying the associated commodities.", + "items": { + "$ref": "#/components/schemas/RegulatoryComplianceCommodityDetail" + } + } + } + }, + "RegulatoryComplianceCommodityDetail": { + "type": "object", + "properties": { + "commodityComplianceTypeDetail": { + "$ref": "#/components/schemas/CommodityComplianceTypeDetail" + } + } + }, + "CommodityComplianceTypeDetail": { + "type": "object", + "properties": { + "commodityIndexes": { + "type": "array", + "description": "This is an array of nonnegative-Integer identifying the associated commodities.", + "example": 1, + "items": { + "minimum": 0, + "type": "number" + } + }, + "regulatoryComplianceTypeDetail": { + "$ref": "#/components/schemas/RegulatoryComplianceTypeDetail" + } + } + }, + "RegulatoryComplianceTypeDetail": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "compliance type.", + "example": "EEI" + }, + "description": { + "type": "string", + "description": "compliance description.", + "example": "Shipments to your selected country require an EEI filing" + } + } + }, + "regulatorydetails_retrieve_body": { + "oneOf": [ + { + "$ref": "#/components/schemas/FullSchema" + }, + { + "$ref": "#/components/schemas/MinimumSamplePayload" + } + ] + }, + "eei_file_body": { + "oneOf": [ + { + "$ref": "#/components/schemas/FullSchema_FileEEIInputVO" + }, + { + "$ref": "#/components/schemas/SamplePayload_AddFiling" + }, + { + "$ref": "#/components/schemas/SamplePayload_CancelFiling" + }, + { + "$ref": "#/components/schemas/SamplePayload_UpdateFiling" + }, + { + "$ref": "#/components/schemas/Minimum_Payload" + } + ] + }, + "BaseProcessOutputVO_2_alert": { + "type": "object", + "properties": { + "alertType": { + "type": "string", + "description": "Specifies the api alert type.", + "example": "NOTE", + "enum": [ + "NOTE", + "WARNING" + ] + }, + "message": { + "type": "string", + "description": "Specifies the api alert message.", + "example": "VALUE/QUANTITY 1 OUT OF RANGE - LOW" + } + } + }, + "CXSError400_error": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Indicates the error code.
    Example:CURRENCIESCONVERSION.FROMCURRENCYCODE.REQUIRED, CURRENCIESCONVERSION.TOCURRENCYCODE.REQUIRED", + "example": "CURRENCIESCONVERSION.FROMCURRENCYCODE.REQUIRED" + }, + "message": { + "type": "string", + "description": "Indicates the description of API error alert message.
    Example: Please provide a valid {{FROM}} currency code.", + "example": "Please provide a valid {{FROM}} currency code." + }, + "parameterList": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Parameter" + } + } + } + }, + "CXSError401_1_error": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Indicates the error code.
    Example: NOT.AUTHORIZED.ERROR, LOGIN.REAUTHENTICATE.ERROR", + "example": "LOGIN.REAUTHENTICATE.ERROR" + }, + "message": { + "type": "string", + "description": "Indicates the description of API error alert message.
    Example: Access token expired. Please modify your request and try again.", + "example": "Re-Login authentication error" + }, + "parameterList": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Parameter" + } + } + } + }, + "CXSError403_error": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Indicates the error code.
    Example: FORBIDDEN.ERROR" + }, + "parameterList": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Parameter" + } + }, + "message": { + "description": "Indicates the description of API error alert message.
    Example: We could not authorize your credentials. Please check your permissions and try again" + } + } + }, + "CXSError404_1_error": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Indicates the error code.
    Example: NOT.FOUND.ERROR" + }, + "parameterList": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Parameter" + } + }, + "message": { + "description": "Indicates the description of API error alert message.
    Example: The resource you requested is no longer available. Please modify your request and try again." + } + } + }, + "CXSError500_1_error": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Indicates the error code.
    Example: INTERNAL.SERVER.ERROR" + }, + "parameterList": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Parameter" + } + }, + "message": { + "description": "Indicates the description of API error alert message.
    Example: We encountered an unexpected error and are working to resolve the issue. We apologize for any inconvenience. Please check back at a later time." + } + } + }, + "CXSError503_error": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Indicates the error code.
    Example: INTERNAL.SERVER.ERROR" + }, + "parameterList": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Parameter" + } + }, + "message": { + "description": "Indicates the description of API error alert message.
    Example: We are unable to process this request. Please try again later or contact FedEx Customer Service." + } + } + }, + "FullSchema_FileEEIInputVO_eeiControlDetail_internationalControlledExportDetail": { + "type": "object", + "properties": { + "foreignTradeZoneCode": { + "type": "string", + "description": "Identity of the Foreign Trade Zone from which the merchandise was withdrawn." + }, + "entryNumber": { + "type": "string", + "description": "The import entry number for a shipment \"transported under bond\", or the import entry number when a FTZ NAFTA Deferred Duty claim is made." + } + } + }, + "FullSchema_FileEEIInputVO_eeiControlDetail": { + "required": [ + "accountNumber", + "shipDate", + "customerReferenceNumber" + ], + "type": "object", + "properties": { + "shipDate": { + "type": "string", + "description": "This is the shipment date
    Format [YYYY-MM-DD].", + "example": "2024-09-04" + }, + "accountNumber": { + "$ref": "#/components/schemas/AccountNumber" + }, + "portOfExportCode": { + "type": "string", + "description": "The code for the port of export for the export-import combination", + "example": "2095" + }, + "shipmentReferenceNumber": { + "type": "string", + "description": "This is the shipment reference number which will be returned in the response, this field is mandatory when doing an update or cancellation of an EEI filing.", + "example": "24102960001" + }, + "hazardousMaterial": { + "type": "boolean", + "description": "This indicates if this shipment contains hazardous materials", + "example": false + }, + "mode": { + "type": "string", + "description": "Object of ModeOfTransportationType", + "example": "AIR", + "enum": [ + "AIR", + "GROUND", + "RAIL", + "SEA" + ] + }, + "customerReferenceNumber": { + "type": "string", + "description": "Customer reference number, this is supplied by the customer", + "example": "410" + }, + "trackingNumber": { + "type": "string", + "description": "This is the AWB if it is available by the customer.", + "example": "1372" + }, + "partiesToTransactionAreRelated": { + "type": "boolean", + "description": "This indicates if the companies are related like a parent company", + "example": false + }, + "internationalControlledExportDetail": { + "$ref": "#/components/schemas/FullSchema_FileEEIInputVO_eeiControlDetail_internationalControlledExportDetail" + } + }, + "description": "Object of EEIControlDetail" + }, + "FullSchema_FileEEIInputVO_eeiContactAndAddress_contact_personName": { + "type": "object", + "properties": { + "firstName": { + "type": "string", + "description": "Identifies the contact person's name suffix.", + "example": "Surya" + }, + "lastName": { + "type": "string", + "description": "Identifies the contact person's name suffix.", + "example": "Kumar" + } + }, + "description": "String value to indicate the name of the person. personName and companyName cannot be null or empty string at the same time." + }, + "FullSchema_FileEEIInputVO_eeiContactAndAddress_contact": { + "required": [ + "companyName", + "personName" + ], + "type": "object", + "properties": { + "personName": { + "$ref": "#/components/schemas/FullSchema_FileEEIInputVO_eeiContactAndAddress_contact_personName" + }, + "title": { + "type": "string", + "description": "Identifies the contact person's title.", + "example": "Mr" + }, + "companyName": { + "type": "string", + "description": "Identifies the company this contact is associated with.", + "example": "MARK PVT LIMITED" + }, + "phoneNumber": { + "type": "string", + "description": "String value to indicate the phone number. Minimum length is 10 and supports maximum of 15 for certain countries using longer phone numbers.", + "example": "6127812999" + }, + "eMailAddress": { + "type": "string", + "description": "String value to indicate the email address. Maximum length is 80.", + "example": "maneesh.nv@fedex.com" + } + }, + "description": "Contact Object" + }, + "FullSchema_FileEEIInputVO_eeiContactAndAddress_address": { + "required": [ + "city", + "countryCode", + "streetLines" + ], + "type": "object", + "properties": { + "streetLines": { + "type": "array", + "description": "Array of string values to indicate the address lines, including combination of number, street name etc", + "example": [ + "10 FedEx Parkway", + "Suite 302" + ], + "items": { + "type": "string" + } + }, + "city": { + "type": "string", + "description": "The name of city.", + "example": "Beverly Hills" + }, + "stateOrProvinceCode": { + "type": "string", + "description": "String value to identify the abbreviation for US state, Canada province etc. The valid values for stateOrProvinceCode are AS, GU,MP, PR, VI, VA
    click here to see State or Province Code", + "example": "TX" + }, + "postalCode": { + "type": "string", + "description": "The postal zip code for the destination", + "example": "26150" + }, + "countryCode": { + "type": "string", + "description": "Specifies the country code.
    click here to see Country codes", + "example": "US" + } + }, + "description": "Address Object" + }, + "FullSchema_FileEEIInputVO_eeiContactAndAddress": { + "type": "object", + "properties": { + "contact": { + "$ref": "#/components/schemas/FullSchema_FileEEIInputVO_eeiContactAndAddress_contact" + }, + "address": { + "$ref": "#/components/schemas/FullSchema_FileEEIInputVO_eeiContactAndAddress_address" + } + }, + "description": "" + }, + "FullSchema_FileEEIInputVO_eeiPartyDetails": { + "required": [ + "einTaxId" + ], + "type": "object", + "properties": { + "eeiShipmentPartyType": { + "type": "string", + "description": "it is a eeishipmentpartytype", + "example": "USPPI,ULTIMATE_CONSIGNEE", + "enum": [ + "USPPI", + "ULTIMATE_CONSIGNEE", + "FORWARDER_CONSIGNEE", + "INTERMEDIATE_CONSIGNEE" + ] + }, + "ultimateConsigneeType": { + "type": "string", + "description": "Indicates the type of ultimate consignee receiving the goods.", + "example": "DIRECT_CONSUMER", + "enum": [ + "DIRECT_CONSUMER", + "GOVERNMENT_ENTITY", + "OTHER", + "RESELLER" + ] + }, + "eeiContactAndAddress": { + "$ref": "#/components/schemas/FullSchema_FileEEIInputVO_eeiContactAndAddress" + }, + "einTaxId": { + "type": "string", + "description": "This is the tax EIN number code for the USPPI.", + "example": "456736452" + } + } + }, + "FullSchema_FileEEIInputVO_commodity_customsValue": { + "type": "object", + "properties": { + "currency": { + "type": "string", + "description": "This is the currency code for the amount.", + "example": "USD" + }, + "amount": { + "type": "number", + "description": "This is the amount.", + "format": "double", + "example": 2700 + } + } + }, + "FullSchema_FileEEIInputVO_commodity": { + "required": [ + "description", + "harmonizedCode", + "quantityUnits" + ], + "type": "object", + "properties": { + "commodityId": { + "type": "string", + "description": "A number that identifies the specific commodity line item within a shipment.", + "example": "12" + }, + "description": { + "type": "string", + "description": "A commercial description of the commodity reported for the line item.", + "example": "REGISTERS, ACCOUNT BOOKS, NOTEBOOKS, ORDER BOOKS, RECEIPT BOOKS, LETTER PADS, MEMORANDUM PADS, DIARIES AND SIMILAR ARTICLES [REGISTERS, ACCOUNT BOOKS, NOTE BOOKS, ORDER BOOKS, RECEIPT BOOKS, LETTER PADS, MEMORANDUM PAD S, DIARIES AND SIMILAR ARTICLES, EXERCISE BOOKS, BLOTTING-PADS, BINDERS (LOOSELEAF OR OTHER)]" + }, + "countryOfManufacture": { + "type": "string", + "description": "Commodity country of manufacture.", + "example": "US" + }, + "harmonizedCode": { + "type": "string", + "description": "String that indicates the harmonizedCode", + "example": "4820100000" + }, + "weight": { + "$ref": "#/components/schemas/Weight" + }, + "quantity": { + "type": "number", + "description": "Total number of units that correspond to the unit", + "format": "double", + "example": 1 + }, + "quantityUnits": { + "type": "string", + "description": "A unit of measure code that corresponds to the quantity as prescribed by the Schedule B/HTS number reported.", + "example": "NO" + }, + "customsValue": { + "$ref": "#/components/schemas/FullSchema_FileEEIInputVO_commodity_customsValue" + }, + "exportLicenseNumber": { + "type": "string", + "description": "This is the export license number for the shipment.", + "example": "26456" + } + } + }, + "FullSchema_FileEEIInputVO_eeiCommodityLicenseDetail_licenseValue": { + "type": "object", + "properties": { + "currency": { + "type": "string", + "description": "This is the currency code for the amount.", + "example": "USD" + }, + "amount": { + "type": "number", + "description": "This is the amount.", + "format": "double", + "example": 0 + } + } + }, + "FullSchema_FileEEIInputVO_eeiCommodityLicenseDetail": { + "required": [ + "licenseCode" + ], + "type": "object", + "properties": { + "exportControlClassificationNumber": { + "type": "string", + "description": "It describes the export Control Classification Number", + "example": "0A018" + }, + "licenseCode": { + "type": "string", + "description": "Code defining whether the shipment completes the terms of the license, or the shipment is only a partial delivery relative to the license terms.", + "example": "C33" + }, + "licenseValue": { + "$ref": "#/components/schemas/FullSchema_FileEEIInputVO_eeiCommodityLicenseDetail_licenseValue" + } + } + }, + "FullSchema_FileEEIInputVO_ddtcDetail": { + "type": "object", + "properties": { + "ddtcITARExemptionNumber": { + "type": "string", + "description": "The specific citation (exemption number) under the International Traffic in Arms Regulations (ITAR) from the Code of Federal register (see 22 CFR 120-130) that exempts the shipment from the requirements for a license or other written authorization from DDTC.", + "example": "123.11B" + }, + "ddtcRegistrationNumber": { + "type": "string", + "description": "The registration identifier assigned by the DDTC to the registered manufacturer or exporter that has authorization from the DDTC (through a license or exemption) to export the article.", + "example": "C6754" + }, + "ddtcSignificantMilitarySMEIndicator": { + "type": "boolean", + "description": "An indication that the articles reported warrant special export controls because of their capacity for substantial military utility of capability ", + "example": false + }, + "ddtcEligibleParty": { + "type": "boolean", + "description": "A self-certification by the exporter for the exemption, and a self-certification by the exporter that they are an eligible party", + "example": false + }, + "usmlCategoryCode": { + "type": "string", + "description": "Classified Articles, Technical Data and Defense Service Not Otherwise Listed", + "example": "17" + }, + "ddtcXXIDeterminationNumber": { + "type": "string" + }, + "ddtcUnitOfMeasure": { + "$ref": "#/components/schemas/Measure1" + } + }, + "description": "If you choose licenseCode of S00, SCA, SGB or SAU you need to supply DDTC information." + }, + "FullSchema_FileEEIInputVO_vehicleDetail": { + "type": "object", + "properties": { + "vinNumber": { + "type": "string" + }, + "titleNumber": { + "type": "string" + }, + "titleState": { + "type": "string" + } + } + }, + "FullSchema_FileEEIInputVO_eeiCommodities": { + "required": [ + "exportInformationCode" + ], + "type": "object", + "properties": { + "commodity": { + "$ref": "#/components/schemas/FullSchema_FileEEIInputVO_commodity" + }, + "scheduleBCode": { + "type": "string", + "description": "Is a 6 digit US customs code sent in request.", + "example": "482010" + }, + "exportInformationCode": { + "type": "string", + "description": "US govt contract for overseas construction", + "example": "GP" + }, + "eeiCommodityLicenseDetail": { + "$ref": "#/components/schemas/FullSchema_FileEEIInputVO_eeiCommodityLicenseDetail" + }, + "inbondCode": { + "type": "string", + "description": "Warehouse withdrawal for IE", + "example": "36" + }, + "usDomestic": { + "type": "boolean", + "description": "An indication if the manufacture origin of the commodity is US Domestic or not.", + "example": false + }, + "ddtcDetail": { + "$ref": "#/components/schemas/FullSchema_FileEEIInputVO_ddtcDetail" + }, + "vehicleDetail": { + "$ref": "#/components/schemas/FullSchema_FileEEIInputVO_vehicleDetail" + } + } + } + }, + "parameters": { + "locale": { + "name": "X-locale", + "in": "header", + "description": "ISO locale ", + "schema": { + "type": "string" + }, + "example": "en_US" + }, + "content-type": { + "name": "content-type", + "in": "header", + "description": "This is used to indicate the media type of the resource. The media type is a string sent along with the file indicating format of the file.", + "required": true, + "schema": { + "type": "string" + }, + "example": "application/json" + }, + "Authorization": { + "name": "Authorization", + "in": "header", + "description": "Specifies the authorization token.", + "required": true, + "schema": { + "type": "string" + }, + "example": "Bearer XXX" + } + } + } +} \ No newline at end of file diff --git a/openapi/src/test/resources/fedex-ship-api.json b/openapi/src/test/resources/fedex-ship-api.json new file mode 100644 index 000000000..6ff55f967 --- /dev/null +++ b/openapi/src/test/resources/fedex-ship-api.json @@ -0,0 +1,9823 @@ +{ + "openapi": "3.0.0", + "servers": [ + { + "url": "https://apis-sandbox.fedex.com", + "description": "Sandbox Server" + }, + { + "url": "https://apis.fedex.com", + "description": "Production Server" + } + ], + "schemes": [ + "https" + ], + "info": { + "version": "1.0.0", + "title": "Ship API" + }, + "paths": { + "/ship/v1/shipments": { + "post": { + "summary": "Create Shipment", + "description": "This endpoint helps you to create shipment requests thereby validating all the shipping input information and either generates the labels (if the responses is synchronous) or a job ID if transaction is processed using asynchronous method.
    Note: FedEx APIs do not support Cross-Origin Resource Sharing (CORS) mechanism.", + "operationId": "Create Shipment", + "requestBody": { + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Full_Schema_Ship" + } + ] + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SHPCResponseVO_ShipShipment" + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseVO" + }, + "example": { + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "customerTransactionId": "AnyCo_order123456789", + "errors": [ + { + "code": "ACCOUNTNUMBER.REGISTRATION.REQUIRED", + "message": "Please enter a valid 9-digit FedEx account number or register for a new FedEx account number." + } + ] + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseVO401" + }, + "example": { + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "errors": [ + { + "code": "NOT.AUTHORIZED.ERROR", + "message": "Access token expired. Please modify your request and try again." + } + ] + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseVO403" + }, + "example": { + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "errors": [ + { + "code": "FORBIDDEN.ERROR", + "message": "We could not authorize your credentials. Please check your permissions and try again." + } + ] + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseVO404" + }, + "example": { + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "errors": [ + { + "code": "NOT.FOUND.ERROR", + "message": "The resource you requested is no longer available. Please modify your request and try again." + } + ] + } + } + } + }, + "500": { + "description": "Failure", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseVO500" + }, + "example": { + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "customerTransactionId": "AnyCo_order123456789", + "errors": [ + { + "code": "INTERNAL.SERVER.ERROR", + "message": "We encountered an unexpected error and are working to resolve the issue. We apologize for any inconvenience. Please check back at a later time." + } + ] + } + } + } + }, + "503": { + "description": "Service Unavailable", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseVO503" + }, + "example": { + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "customerTransactionId": "AnyCo_order123456789", + "errors": [ + { + "code": "SERVICE.UNAVAILABLE.ERROR", + "message": "The service is currently unavailable and we are working to resolve the issue. We apologize for any inconvenience. Please check back at a later time." + } + ] + } + } + } + } + }, + "parameters": [ + { + "in": "header", + "name": "x-customer-transaction-id", + "description": "This element allows you to assign a unique identifier to your transaction. This element is also returned in the reply and helps you match the request to the reply.", + "required": false, + "schema": { + "type": "string", + "example": "624deea6-b709-470c-8c39-4b5511281492" + } + }, + { + "in": "header", + "name": "content-type", + "description": "This is used to indicate the media type of the resource. The media type is a string sent along with the file indicating format of the file.", + "required": true, + "schema": { + "type": "string", + "example": "application/json" + } + }, + { + "in": "header", + "name": "x-locale", + "description": "This indicates the combination of language code and country code. Click here to see Locales", + "required": false, + "schema": { + "type": "string", + "example": "en_US" + } + }, + { + "in": "header", + "name": "authorization", + "description": "This indicates the authorization token for the input request.", + "required": true, + "schema": { + "type": "string", + "example": "Bearer XXX" + } + } + ], + "x-code-samples": [ + { + "lang": "C#", + "source": "var client = new RestClient(\"https://apis-sandbox.fedex.com/ship/v1/shipments\");\nvar request = new RestRequest(Method.POST);\nrequest.AddHeader(\"Authorization\", \"Bearer \");\nrequest.AddHeader(\"X-locale\", \"en_US\");\nrequest.AddHeader(\"Content-Type\", \"application/json\");\n// 'input' refers to JSON Payload\nrequest.AddParameter(\"application/x-www-form-urlencoded\", input, ParameterType.RequestBody);\nIRestResponse response = client.Execute(request);\n\n\n\n\n" + }, + { + "lang": "JAVA", + "source": "OkHttpClient client = new OkHttpClient();\n\nMediaType mediaType = MediaType.parse(\"application/json\");\n// 'input' refers to JSON Payload\nRequestBody body = RequestBody.create(mediaType, input);\nRequest request = new Request.Builder()\n .url(\"https://apis-sandbox.fedex.com/ship/v1/shipments\")\n .post(body)\n .addHeader(\"Content-Type\", \"application/json\")\n .addHeader(\"X-locale\", \"en_US\")\n .addHeader(\"Authorization\", \"Bearer \")\n .build();\n \nResponse response = client.newCall(request).execute();" + }, + { + "lang": "JAVASCRIPT", + "source": "// 'input' refers to JSON Payload\nvar data = JSON.stringify(input);\n \n var xhr = new XMLHttpRequest();\n xhr.withCredentials = true;\n \n xhr.addEventListener(\"readystatechange\", function () {\n if (this.readyState === 4) {\n console.log(this.responseText);\n }\n });\n \n xhr.open(\"POST\", \"https://apis-sandbox.fedex.com/ship/v1/shipments\");\n xhr.setRequestHeader(\"Content-Type\", \"application/json\");\n xhr.setRequestHeader(\"X-locale\", \"en_US\");\n xhr.setRequestHeader(\"Authorization\", \"Bearer \");\n \n xhr.send(data);" + }, + { + "lang": "PHP", + "source": "setUrl('https://apis-sandbox.fedex.com/ship/v1/shipments');\n$request->setMethod(HTTP_METH_POST);\n\n$request->setHeaders(array(\n 'Authorization' => 'Bearer ',\n 'X-locale' => 'en_US',\n 'Content-Type' => 'application/json'\n));\n\n$request->setBody(input); // 'input' refers to JSON Payload\n\ntry {\n $response = $request->send();\n\n echo $response->getBody();\n} catch (HttpException $ex) {\n echo $ex;\n}" + }, + { + "lang": "PYTHON", + "source": "import requests\n\nurl = \"https://apis-sandbox.fedex.com/ship/v1/shipments\"\n\npayload = input # 'input' refers to JSON Payload\nheaders = {\n 'Content-Type': \"application/json\",\n 'X-locale': \"en_US\",\n 'Authorization': \"Bearer \"\n }\n\nresponse = requests.post(url, data=payload, headers=headers)\n\nprint(response.text)" + }, + { + "lang": "RUST", + "source": "extern crate reqwest;\n\nuse std::io::Read;\n\nfn construct_headers() -> HeaderMap {\n let mut headers = HeaderMap::new();\n headers.insert(\"Content-Type\", \"application/json\");\n headers.insert(\"X-locale\", \"en_US\");\n headers.insert(\"Authorization\", \"Bearer \");\n headers\n}\n\nfn run() -> Result<()> {\n let client = reqwest::Client::new();\n let mut res = client.post(\"https://apis-sandbox.fedex.com/ship/v1/shipments\")\n .body(input) // 'input' refers to JSON Payload\n .headers(construct_headers())\n .send()?;\n let mut body = String::new();\n res.read_to_string(&mut body)?;\n\n println!(\"Status: {}\", res.status());\n println!(\"Headers:\\n{:#?}\", res.headers());\n println!(\"Body:\\n{}\", body);\n\n Ok(())\n}" + }, + { + "lang": "SWIFT", + "source": "import Foundation\n\nlet headers = [\n \"Content-Type\": \"application/json\",\n \"X-locale\": \"en_US\",\n \"Authorization\": \"Bearer \"\n]\nlet parameters = [\n input // 'input' refers to JSON Payload\n] as [String : Any]\n\nlet postData = JSONSerialization.data(withJSONObject: parameters, options: [])\n\nlet request = NSMutableURLRequest(url: NSURL(string: \"https://apis-sandbox.fedex.com/ship/v1/shipments\")! as URL,\n cachePolicy: .useProtocolCachePolicy,\n timeoutInterval: 10.0)\nrequest.httpMethod = \"POST\"\nrequest.allHTTPHeaderFields = headers\nrequest.httpBody = postData as Data\n\nlet session = URLSession.shared\nlet dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in\n if (error != nil) {\n print(error)\n } else {\n let httpResponse = response as? HTTPURLResponse\n print(httpResponse)\n }\n})\n\ndataTask.resume()" + } + ] + } + }, + "/ship/v1/shipments/cancel": { + "put": { + "summary": "Cancel Shipment", + "description": "Use this endpoint to cancel FedEx Express and Ground shipments that have not already been tendered to FedEx. This request will cancel all packages within the shipment.
    Note: FedEx APIs do not support Cross-Origin Resource Sharing (CORS) mechanism.", + "operationId": "Cancel Shipment", + "requestBody": { + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Full_Schema_Cancel_Shipment" + } + ] + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SHPCResponseVO_CancelShipment" + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseVO_2" + }, + "example": { + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "customerTransactionId": "AnyCo_order123456789", + "errors": [ + { + "code": "SHIPMENT.USER.UNAUTHORIZED", + "message": "Requested user is not authorized to perform the operation." + } + ] + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseVO401_2" + }, + "example": { + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "errors": [ + { + "code": "NOT.AUTHORIZED.ERROR", + "message": "Access token expired. Please modify your request and try again." + } + ] + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseVO403_2" + }, + "example": { + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "errors": [ + { + "code": "FORBIDDEN.ERROR", + "message": "We could not authorize your credentials. Please check your permissions and try again." + } + ] + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseVO404_2" + }, + "example": { + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "errors": [ + { + "code": "NOT.FOUND.ERROR", + "message": "The resource you requested is no longer available. Please modify your request and try again." + } + ] + } + } + } + }, + "500": { + "description": "Failure", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseVO500_2" + }, + "example": { + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "customerTransactionId": "AnyCo_order123456789", + "errors": [ + { + "code": "INTERNAL.SERVER.ERROR", + "message": "We encountered an unexpected error and are working to resolve the issue. We apologize for any inconvenience. Please check back at a later time." + } + ] + } + } + } + }, + "503": { + "description": "Service Unavailable", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseVO503_2" + }, + "example": { + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "customerTransactionId": "AnyCo_order123456789", + "errors": [ + { + "code": "SERVICE.UNAVAILABLE.ERROR", + "message": "The service is currently unavailable and we are working to resolve the issue. We apologize for any inconvenience. Please check back at a later time." + } + ] + } + } + } + } + }, + "parameters": [ + { + "in": "header", + "name": "x-customer-transaction-id", + "description": "This element allows you to assign a unique identifier to your transaction. This element is also returned in the reply and helps you match the request to the reply.", + "required": false, + "schema": { + "type": "string", + "example": "624deea6-b709-470c-8c39-4b5511281492" + } + }, + { + "in": "header", + "name": "content-type", + "description": "This is used to indicate the media type of the resource. The media type is a string sent along with the file indicating format of the file.", + "required": true, + "schema": { + "type": "string", + "example": "application/json" + } + }, + { + "in": "header", + "name": "x-locale", + "description": "This indicates the combination of language code and country code. Click here to see Locales", + "required": false, + "schema": { + "type": "string", + "example": "en_US" + } + }, + { + "in": "header", + "name": "authorization", + "description": "This indicates the authorization token for the input request.", + "required": true, + "schema": { + "type": "string", + "example": "Bearer XXX" + } + } + ], + "x-code-samples": [ + { + "lang": "C#", + "source": "var client = new RestClient(\"https://apis-sandbox.fedex.com/ship/v1/shipments/cancel\");\nvar request = new RestRequest(Method.PUT);\nrequest.AddHeader(\"Authorization\", \"Bearer \");\nrequest.AddHeader(\"X-locale\", \"en_US\");\nrequest.AddHeader(\"Content-Type\", \"application/json\");\n// 'input' refers to JSON Payload\nrequest.AddParameter(\"application/x-www-form-urlencoded\", input, ParameterType.RequestBody);\nIRestResponse response = client.Execute(request);" + }, + { + "lang": "JAVA", + "source": "OkHttpClient client = new OkHttpClient();\n\nMediaType mediaType = MediaType.parse(\"application/json\");\n// 'input' refers to JSON Payload\nRequestBody body = RequestBody.create(mediaType, input);\nRequest request = new Request.Builder()\n .url(\"https://apis-sandbox.fedex.com/ship/v1/shipments/cancel\")\n .put(body)\n .addHeader(\"Content-Type\", \"application/json\")\n .addHeader(\"X-locale\", \"en_US\")\n .addHeader(\"Authorization\", \"Bearer \")\n .build();\n\nResponse response = client.newCall(request).execute();" + }, + { + "lang": "JAVASCRIPT", + "source": "// 'input' refers to JSON Payload\nvar data = JSON.stringify(input);\n \n var xhr = new XMLHttpRequest();\n xhr.withCredentials = true;\n \n xhr.addEventListener(\"readystatechange\", function () {\n if (this.readyState === 4) {\n console.log(this.responseText);\n }\n });\n \n xhr.open(\"PUT\", \"https://apis-sandbox.fedex.com/ship/v1/shipments/cancel\");\n xhr.setRequestHeader(\"Content-Type\", \"application/json\");\n xhr.setRequestHeader(\"X-locale\", \"en_US\");\n xhr.setRequestHeader(\"Authorization\", \"Bearer \");\n \n xhr.send(data);" + }, + { + "lang": "PHP", + "source": "setUrl('https://apis-sandbox.fedex.com/ship/v1/shipments/cancel');\n$request->setMethod(HTTP_METH_PUT);\n\n$request->setHeaders(array(\n 'Authorization' => 'Bearer ',\n 'X-locale' => 'en_US',\n 'Content-Type' => 'application/json'\n));\n\n$request->setBody(input); // 'input' refers to JSON Payload\n\ntry {\n $response = $request->send();\n\n echo $response->getBody();\n} catch (HttpException $ex) {\n echo $ex;\n}" + }, + { + "lang": "PYTHON", + "source": "import requests\n\nurl = \"https://apis-sandbox.fedex.com/ship/v1/shipments/cancel\"\n\npayload = input # 'input' refers to JSON Payload\nheaders = {\n 'Content-Type': \"application/json\",\n 'X-locale': \"en_US\",\n 'Authorization': \"Bearer \"\n }\n\nresponse = requests.put(url, data=payload, headers=headers)\n\nprint(response.text)" + }, + { + "lang": "RUST", + "source": "extern crate reqwest;\n\nuse std::io::Read;\n\nfn construct_headers() -> HeaderMap {\n let mut headers = HeaderMap::new();\n headers.insert(\"Content-Type\", \"application/json\");\n headers.insert(\"X-locale\", \"en_US\");\n headers.insert(\"Authorization\", \"Bearer \");\n headers\n}\n\nfn run() -> Result<()> {\n let client = reqwest::Client::new();\n let mut res = client.put(\"https://apis-sandbox.fedex.com/ship/v1/shipments/cancel\")\n .body(input) // 'input' refers to JSON Payload\n .headers(construct_headers())\n .send()?;\n let mut body = String::new();\n res.read_to_string(&mut body)?;\n\n println!(\"Status: {}\", res.status());\n println!(\"Headers:\\n{:#?}\", res.headers());\n println!(\"Body:\\n{}\", body);\n\n Ok(())\n}" + }, + { + "lang": "SWIFT", + "source": "import Foundation\n\nlet headers = [\n \"Content-Type\": \"application/json\",\n \"X-locale\": \"en_US\",\n \"Authorization\": \"Bearer \"\n]\nlet parameters = [\n input // 'input' refers to JSON Payload\n] as [String : Any]\n\nlet postData = JSONSerialization.data(withJSONObject: parameters, options: [])\n\nlet request = NSMutableURLRequest(url: NSURL(string: \"https://apis-sandbox.fedex.com/ship/v1/shipments/cancel\")! as URL,\n cachePolicy: .useProtocolCachePolicy,\n timeoutInterval: 10.0)\nrequest.httpMethod = \"PUT\"\nrequest.allHTTPHeaderFields = headers\nrequest.httpBody = postData as Data\n\nlet session = URLSession.shared\nlet dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in\n if (error != nil) {\n print(error)\n } else {\n let httpResponse = response as? HTTPURLResponse\n print(httpResponse)\n }\n})\n\ndataTask.resume()" + } + ] + } + }, + "/ship/v1/shipments/results": { + "post": { + "summary": "Retrieve Async Ship", + "description": "This endpoint helps you to process confirmed shipments asynchronously (above 40 packages) and produce results based on job id.
    Note: FedEx APIs do not support Cross-Origin Resource Sharing (CORS) mechanism.", + "operationId": "Get Confirmed Shipment Async Results", + "parameters": [ + { + "name": "x-customer-transaction-id", + "in": "header", + "description": "This transaction Id helps the customers to track the transaction with APIF.", + "required": false, + "style": "simple", + "explode": false, + "schema": { + "type": "string" + }, + "example": "0e671149-016f-1000-941f-ef4dbabadd2e" + }, + { + "in": "header", + "name": "content-type", + "description": "This is used to indicate the media type of the resource. The media type is a string sent along with the file indicating format of the file.", + "required": true, + "schema": { + "type": "string", + "example": "application/json" + } + }, + { + "in": "header", + "name": "x-locale", + "description": "This indicates the combination of language code and country code. Click here to see Locales", + "required": false, + "schema": { + "type": "string", + "example": "en_US" + } + }, + { + "in": "header", + "name": "authorization", + "description": "This indicates the authorization token for the input request.", + "required": true, + "schema": { + "type": "string", + "example": "Bearer XXX" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/FullSchema-getConfirmedShipmentAsyncResults" + } + ] + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SHPCResponseVO_GetOpenShipmentResults" + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseVO_2" + }, + "example": { + "transactionId": "624xxxxx-b709-470c-8c39-4b55112xxxxx", + "customerTransactionId": "AnyCo_order123456789", + "errors": [ + { + "code": "TRACKINGNUMBER.ENTERED.INVALID", + "message": "Error with entered Tracking Number. Please verify the entered Tracking Number." + } + ] + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseVO401_2" + }, + "example": { + "transactionId": "624xxxxx-b709-470c-8c39-4b55112xxxxx", + "errors": [ + { + "code": "NOT.AUTHORIZED.ERROR", + "message": "Access token expired. Please modify your request and try again." + } + ] + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseVO403_2" + }, + "example": { + "transactionId": "624xxxxx-b709-470c-8c39-4b55112xxxxx", + "errors": [ + { + "code": "FORBIDDEN.ERROR", + "message": "We could not authorize your credentials. Please check your permissions and try again." + } + ] + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseVO404_2" + }, + "example": { + "transactionId": "624xxxxx-b709-470c-8c39-4b55112xxxxx", + "errors": [ + { + "code": "NOT.FOUND.ERROR", + "message": "The resource you requested is no longer available. Please modify your request and try again." + } + ] + } + } + } + }, + "500": { + "description": "Failure", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseVO500_2" + }, + "example": { + "transactionId": "624xxxxx-b709-470c-8c39-4b55112xxxxx", + "customerTransactionId": "AnyCo_order123456789", + "errors": [ + { + "code": "INTERNAL.SERVER.ERROR", + "message": "We encountered an unexpected error and are working to resolve the issue. We apologize for any inconvenience. Please check back at a later time." + } + ] + } + } + } + }, + "503": { + "description": "Service Unavailable", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseVO503_2" + }, + "example": { + "transactionId": "624xxxxx-b709-470c-8c39-4b55112xxxxx", + "customerTransactionId": "AnyCo_order123456789", + "errors": [ + { + "code": "SERVICE.UNAVAILABLE.ERROR", + "message": "The service is currently unavailable and we are working to resolve the issue. We apologize for any inconvenience. Please check back at a later time." + } + ] + } + } + } + } + }, + "x-code-samples": [ + { + "lang": "C#", + "source": "var client = new RestClient(\"https://apis-sandbox.fedex.com/ship/v1/shipments/results\");\nvar request = new RestRequest(Method.POST);\nrequest.AddHeader(\"Authorization\", \"Bearer \");\nrequest.AddHeader(\"X-locale\", \"en_US\");\nrequest.AddHeader(\"Content-Type\", \"application/json\");\n// 'input' refers to JSON Payload\nrequest.AddParameter(\"application/x-www-form-urlencoded\", input, ParameterType.RequestBody);\nIRestResponse response = client.Execute(request);\n\n\n\n\n" + }, + { + "lang": "JAVA", + "source": "OkHttpClient client = new OkHttpClient();\n\nMediaType mediaType = MediaType.parse(\"application/json\");\n// 'input' refers to JSON Payload\nRequestBody body = RequestBody.create(mediaType, input);\nRequest request = new Request.Builder()\n .url(\"https://apis-sandbox.fedex.com/ship/v1/shipments/results\")\n .post(body)\n .addHeader(\"Content-Type\", \"application/json\")\n .addHeader(\"X-locale\", \"en_US\")\n .addHeader(\"Authorization\", \"Bearer \")\n .build();\n \nResponse response = client.newCall(request).execute();" + }, + { + "lang": "JAVASCRIPT", + "source": "// 'input' refers to JSON Payload\nvar data = JSON.stringify(input);\n \n var xhr = new XMLHttpRequest();\n xhr.withCredentials = true;\n \n xhr.addEventListener(\"readystatechange\", function () {\n if (this.readyState === 4) {\n console.log(this.responseText);\n }\n });\n \n xhr.open(\"POST\", \"https://apis-sandbox.fedex.com/ship/v1/shipments/results\");\n xhr.setRequestHeader(\"Content-Type\", \"application/json\");\n xhr.setRequestHeader(\"X-locale\", \"en_US\");\n xhr.setRequestHeader(\"Authorization\", \"Bearer \");\n \n xhr.send(data);" + }, + { + "lang": "PHP", + "source": "setUrl('https://apis-sandbox.fedex.com/ship/v1/shipments/results');\n$request->setMethod(HTTP_METH_POST);\n\n$request->setHeaders(array(\n 'Authorization' => 'Bearer ',\n 'X-locale' => 'en_US',\n 'Content-Type' => 'application/json'\n));\n\n$request->setBody(input); // 'input' refers to JSON Payload\n\ntry {\n $response = $request->send();\n\n echo $response->getBody();\n} catch (HttpException $ex) {\n echo $ex;\n}" + }, + { + "lang": "PYTHON", + "source": "import requests\n\nurl = \"https://apis-sandbox.fedex.com/ship/v1/shipments/results\"\n\npayload = input # 'input' refers to JSON Payload\nheaders = {\n 'Content-Type': \"application/json\",\n 'X-locale': \"en_US\",\n 'Authorization': \"Bearer \"\n }\n\nresponse = requests.post(url, data=payload, headers=headers)\n\nprint(response.text)" + }, + { + "lang": "RUST", + "source": "extern crate reqwest;\n\nuse std::io::Read;\n\nfn construct_headers() -> HeaderMap {\n let mut headers = HeaderMap::new();\n headers.insert(\"Content-Type\", \"application/json\");\n headers.insert(\"X-locale\", \"en_US\");\n headers.insert(\"Authorization\", \"Bearer \");\n headers\n}\n\nfn run() -> Result<()> {\n let client = reqwest::Client::new();\n let mut res = client.post(\"https://apis-sandbox.fedex.com/ship/v1/shipments/results\")\n .body(input) // 'input' refers to JSON Payload\n .headers(construct_headers())\n .send()?;\n let mut body = String::new();\n res.read_to_string(&mut body)?;\n\n println!(\"Status: {}\", res.status());\n println!(\"Headers:\\n{:#?}\", res.headers());\n println!(\"Body:\\n{}\", body);\n\n Ok(())\n}" + }, + { + "lang": "SWIFT", + "source": "import Foundation\n\nlet headers = [\n \"Content-Type\": \"application/json\",\n \"X-locale\": \"en_US\",\n \"Authorization\": \"Bearer \"\n]\nlet parameters = [\n input // 'input' refers to JSON Payload\n] as [String : Any]\n\nlet postData = JSONSerialization.data(withJSONObject: parameters, options: [])\n\nlet request = NSMutableURLRequest(url: NSURL(string: \"https://apis-sandbox.fedex.com/ship/v1/shipments/results\")! as URL,\n cachePolicy: .useProtocolCachePolicy,\n timeoutInterval: 10.0)\nrequest.httpMethod = \"POST\"\nrequest.allHTTPHeaderFields = headers\nrequest.httpBody = postData as Data\n\nlet session = URLSession.shared\nlet dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in\n if (error != nil) {\n print(error)\n } else {\n let httpResponse = response as? HTTPURLResponse\n print(httpResponse)\n }\n})\n\ndataTask.resume()" + } + ] + } + }, + "/ship/v1/shipments/packages/validate": { + "post": { + "summary": "Validate Shipment", + "description": "Use this endpoint to verify the accuracy of a shipment request prior to actually submitting shipment request. This allow businesses that receive shipping orders from end-user/customers to verify the shipment information prior to submitting a create shipment request to FedEx and printing a label. If for any reason the information needs to be edited or changed, it can be done while the end-user is still available to confirm the changes.

    Note:
    • This is shipment level validation hence supports validation for single piece shipment only.
    • Shipment validation is supported for all Express and Ground - Domestic as well as international shipments with all applicable special services.
    • Shipment validation is supported for SmartPost and not for Freight LTL shipments.


    Note: FedEx APIs do not support Cross-Origin Resource Sharing (CORS) mechanism.", + "operationId": "ShipmentPackageValidate", + "requestBody": { + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/FullSchema-VerifyShipment" + } + ] + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SHPCResponseVO_Validate" + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseVO_2" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseVO_2" + }, + "example": { + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "errors": [ + { + "code": "LOGIN.REAUTHENTICATE.ERROR", + "message": "Re-Login authentication error" + } + ] + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseVO_2" + }, + "example": { + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "errors": [ + { + "code": "UNAUTHORIZED.USAGE", + "message": "UNAUTHORIZED.USAGE" + } + ] + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "example": { + "error": "NOT.FOUND.ERROR", + "error_detail": "The resource you requested is no longer available. Please modify your request and try again." + } + } + } + }, + "500": { + "description": "Failure", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseVO_2" + }, + "example": { + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "errors": [ + { + "code": "INTERNAL.SERVER.ERROR", + "message": "We encountered an unexpected error and are working to resolve the issue. We apologize for any inconvenience. Please check back at a later time." + } + ] + } + } + } + } + }, + "parameters": [ + { + "in": "header", + "name": "x-customer-transaction-id", + "description": "This element allows you to assign a unique identifier to your transaction. This element is also returned in the reply and helps you match the request to the reply.", + "required": false, + "schema": { + "type": "string", + "example": "624deea6-b709-470c-8c39-4b5511281492" + } + }, + { + "in": "header", + "name": "content-type", + "description": "This is used to indicate the media type of the resource. The media type is a string sent along with the file indicating format of the file.", + "required": true, + "schema": { + "type": "string", + "example": "application/json" + } + }, + { + "in": "header", + "name": "x-locale", + "description": "This indicates the combination of language code and country code. Click here to see Locales", + "required": false, + "schema": { + "type": "string", + "example": "en_US" + } + }, + { + "in": "header", + "name": "authorization", + "description": "This indicates the authorization token for the input request.", + "required": true, + "schema": { + "type": "string", + "example": "Bearer XXX" + } + } + ], + "x-code-samples": [ + { + "lang": "C#", + "source": "var client = new RestClient(\"https://apis-sandbox.fedex.com/ship/v1/shipments/packages/validate\");\nvar request = new RestRequest(Method.POST);\nrequest.AddHeader(\"Authorization\", \"Bearer \");\nrequest.AddHeader(\"X-locale\", \"en_US\");\nrequest.AddHeader(\"Content-Type\", \"application/json\");\n// 'input' refers to JSON Payload\nrequest.AddParameter(\"application/x-www-form-urlencoded\", input, ParameterType.RequestBody);\nIRestResponse response = client.Execute(request);\n\n\n\n\n" + }, + { + "lang": "JAVA", + "source": "OkHttpClient client = new OkHttpClient();\n\nMediaType mediaType = MediaType.parse(\"application/json\");\n// 'input' refers to JSON Payload\nRequestBody body = RequestBody.create(mediaType, input);\nRequest request = new Request.Builder()\n .url(\"https://apis-sandbox.fedex.com/ship/v1/shipments/packages/validate\")\n .post(body)\n .addHeader(\"Content-Type\", \"application/json\")\n .addHeader(\"X-locale\", \"en_US\")\n .addHeader(\"Authorization\", \"Bearer \")\n .build();\n \nResponse response = client.newCall(request).execute();" + }, + { + "lang": "JAVASCRIPT", + "source": "// 'input' refers to JSON Payload\nvar data = JSON.stringify(input);\n \n var xhr = new XMLHttpRequest();\n xhr.withCredentials = true;\n \n xhr.addEventListener(\"readystatechange\", function () {\n if (this.readyState === 4) {\n console.log(this.responseText);\n }\n });\n \n xhr.open(\"POST\", \"https://apis-sandbox.fedex.com/ship/v1/shipments/packages/validate\");\n xhr.setRequestHeader(\"Content-Type\", \"application/json\");\n xhr.setRequestHeader(\"X-locale\", \"en_US\");\n xhr.setRequestHeader(\"Authorization\", \"Bearer \");\n \n xhr.send(data);" + }, + { + "lang": "PHP", + "source": "setUrl('https://apis-sandbox.fedex.com/ship/v1/shipments/packages/validate');\n$request->setMethod(HTTP_METH_POST);\n\n$request->setHeaders(array(\n 'Authorization' => 'Bearer ',\n 'X-locale' => 'en_US',\n 'Content-Type' => 'application/json'\n));\n\n$request->setBody(input); // 'input' refers to JSON Payload\n\ntry {\n $response = $request->send();\n\n echo $response->getBody();\n} catch (HttpException $ex) {\n echo $ex;\n}" + }, + { + "lang": "PYTHON", + "source": "import requests\n\nurl = \"https://apis-sandbox.fedex.com/ship/v1/shipments/packages/validate\"\n\npayload = input # 'input' refers to JSON Payload\nheaders = {\n 'Content-Type': \"application/json\",\n 'X-locale': \"en_US\",\n 'Authorization': \"Bearer \"\n }\n\nresponse = requests.post(url, data=payload, headers=headers)\n\nprint(response.text)" + }, + { + "lang": "RUST", + "source": "extern crate reqwest;\n\nuse std::io::Read;\n\nfn construct_headers() -> HeaderMap {\n let mut headers = HeaderMap::new();\n headers.insert(\"Content-Type\", \"application/json\");\n headers.insert(\"X-locale\", \"en_US\");\n headers.insert(\"Authorization\", \"Bearer \");\n headers\n}\n\nfn run() -> Result<()> {\n let client = reqwest::Client::new();\n let mut res = client.post(\"https://apis-sandbox.fedex.com/ship/v1/shipments/packages/validate\")\n .body(input) // 'input' refers to JSON Payload\n .headers(construct_headers())\n .send()?;\n let mut body = String::new();\n res.read_to_string(&mut body)?;\n\n println!(\"Status: {}\", res.status());\n println!(\"Headers:\\n{:#?}\", res.headers());\n println!(\"Body:\\n{}\", body);\n\n Ok(())\n}" + }, + { + "lang": "SWIFT", + "source": "import Foundation\n\nlet headers = [\n \"Content-Type\": \"application/json\",\n \"X-locale\": \"en_US\",\n \"Authorization\": \"Bearer \"\n]\nlet parameters = [\n input // 'input' refers to JSON Payload\n] as [String : Any]\n\nlet postData = JSONSerialization.data(withJSONObject: parameters, options: [])\n\nlet request = NSMutableURLRequest(url: NSURL(string: \"https://apis-sandbox.fedex.com/ship/v1/shipments/packages/validate\")! as URL,\n cachePolicy: .useProtocolCachePolicy,\n timeoutInterval: 10.0)\nrequest.httpMethod = \"POST\"\nrequest.allHTTPHeaderFields = headers\nrequest.httpBody = postData as Data\n\nlet session = URLSession.shared\nlet dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in\n if (error != nil) {\n print(error)\n } else {\n let httpResponse = response as? HTTPURLResponse\n print(httpResponse)\n }\n})\n\ndataTask.resume()" + } + ] + } + }, + "/ship/v1/shipments/tag": { + "post": { + "summary": "Create Tag", + "description": "FedEx creates and delivers a returnnn shipping label to your customer and collects the item for return. Your customer needs to have the package ready for pickup when the FedEx driver arrives. Use this endpoint to create tag requests for FedEx Express and FedEx Ground shipments.
    Note: FedEx APIs do not support Cross-Origin Resource Sharing (CORS) mechanism.", + "operationId": "Create Tag", + "requestBody": { + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Full_Schema_Create_Tag" + } + ] + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SHPCResponseVO_CreateTag" + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseVO" + }, + "example": { + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "customerTransactionId": "AnyCo_order123456789", + "errors": [ + { + "code": "SHIPMENT.USER.UNAUTHORIZED", + "message": "Requested user is not authorized to perform the operation." + } + ] + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseVO401" + }, + "example": { + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "errors": [ + { + "code": "NOT.AUTHORIZED.ERROR", + "message": "Access token expired. Please modify your request and try again." + } + ] + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseVO403" + }, + "example": { + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "errors": [ + { + "code": "FORBIDDEN.ERROR", + "message": "We could not authorize your credentials. Please check your permissions and try again." + } + ] + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseVO404" + }, + "example": { + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "errors": [ + { + "code": "NOT.FOUND.ERROR", + "message": "The resource you requested is no longer available. Please modify your request and try again." + } + ] + } + } + } + }, + "500": { + "description": "Failure", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseVO500" + }, + "example": { + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "customerTransactionId": "AnyCo_order123456789", + "errors": [ + { + "code": "INTERNAL.SERVER.ERROR", + "message": "We encountered an unexpected error and are working to resolve the issue. We apologize for any inconvenience. Please check back at a later time." + } + ] + } + } + } + }, + "503": { + "description": "Service Unavailable", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseVO503" + }, + "example": { + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "customerTransactionId": "AnyCo_order123456789", + "errors": [ + { + "code": "SERVICE.UNAVAILABLE.ERROR", + "message": "The service is currently unavailable and we are working to resolve the issue. We apologize for any inconvenience. Please check back at a later time." + } + ] + } + } + } + } + }, + "parameters": [ + { + "in": "header", + "name": "x-customer-transaction-id", + "description": "This element allows you to assign a unique identifier to your transaction. This element is also returned in the reply and helps you match the request to the reply.", + "required": false, + "schema": { + "type": "string", + "example": "624deea6-b709-470c-8c39-4b5511281492" + } + }, + { + "in": "header", + "name": "content-type", + "description": "This is used to indicate the media type of the resource. The media type is a string sent along with the file indicating format of the file.", + "required": true, + "schema": { + "type": "string", + "example": "application/json" + } + }, + { + "in": "header", + "name": "x-locale", + "description": "This indicates the combination of language code and country code. Click here to see Locales", + "required": false, + "schema": { + "type": "string", + "example": "en_US" + } + }, + { + "in": "header", + "name": "authorization", + "description": "This indicates the authorization token for the input request.", + "required": true, + "schema": { + "type": "string", + "example": "Bearer XXX" + } + } + ], + "x-code-samples": [ + { + "lang": "C#", + "source": "var client = new RestClient(\"https://apis-sandbox.fedex.com/ship/v1/shipments/tag\");\nvar request = new RestRequest(Method.POST);\nrequest.AddHeader(\"Authorization\", \"Bearer \");\nrequest.AddHeader(\"X-locale\", \"en_US\");\nrequest.AddHeader(\"Content-Type\", \"application/json\");\n// 'input' refers to JSON Payload\nrequest.AddParameter(\"application/x-www-form-urlencoded\", input, ParameterType.RequestBody);\nIRestResponse response = client.Execute(request);\n\n\n\n\n" + }, + { + "lang": "JAVA", + "source": "OkHttpClient client = new OkHttpClient();\n\nMediaType mediaType = MediaType.parse(\"application/json\");\n// 'input' refers to JSON Payload\nRequestBody body = RequestBody.create(mediaType, input);\nRequest request = new Request.Builder()\n .url(\"https://apis-sandbox.fedex.com/ship/v1/shipments/tag\")\n .post(body)\n .addHeader(\"Content-Type\", \"application/json\")\n .addHeader(\"X-locale\", \"en_US\")\n .addHeader(\"Authorization\", \"Bearer \")\n .build();\n \nResponse response = client.newCall(request).execute();" + }, + { + "lang": "JAVASCRIPT", + "source": "// 'input' refers to JSON Payload\nvar data = JSON.stringify(input);\n \n var xhr = new XMLHttpRequest();\n xhr.withCredentials = true;\n \n xhr.addEventListener(\"readystatechange\", function () {\n if (this.readyState === 4) {\n console.log(this.responseText);\n }\n });\n \n xhr.open(\"POST\", \"https://apis-sandbox.fedex.com/ship/v1/shipments/tag\");\n xhr.setRequestHeader(\"Content-Type\", \"application/json\");\n xhr.setRequestHeader(\"X-locale\", \"en_US\");\n xhr.setRequestHeader(\"Authorization\", \"Bearer \");\n \n xhr.send(data);" + }, + { + "lang": "PHP", + "source": "setUrl('https://apis-sandbox.fedex.com/ship/v1/shipments/tag');\n$request->setMethod(HTTP_METH_POST);\n\n$request->setHeaders(array(\n 'Authorization' => 'Bearer ',\n 'X-locale' => 'en_US',\n 'Content-Type' => 'application/json'\n));\n\n$request->setBody(input); // 'input' refers to JSON Payload\n\ntry {\n $response = $request->send();\n\n echo $response->getBody();\n} catch (HttpException $ex) {\n echo $ex;\n}" + }, + { + "lang": "PYTHON", + "source": "import requests\n\nurl = \"https://apis-sandbox.fedex.com/ship/v1/shipments/tag\"\n\npayload = input # 'input' refers to JSON Payload\nheaders = {\n 'Content-Type': \"application/json\",\n 'X-locale': \"en_US\",\n 'Authorization': \"Bearer \"\n }\n\nresponse = requests.post(url, data=payload, headers=headers)\n\nprint(response.text)" + }, + { + "lang": "RUST", + "source": "extern crate reqwest;\n\nuse std::io::Read;\n\nfn construct_headers() -> HeaderMap {\n let mut headers = HeaderMap::new();\n headers.insert(\"Content-Type\", \"application/json\");\n headers.insert(\"X-locale\", \"en_US\");\n headers.insert(\"Authorization\", \"Bearer \");\n headers\n}\n\nfn run() -> Result<()> {\n let client = reqwest::Client::new();\n let mut res = client.post(\"https://apis-sandbox.fedex.com/ship/v1/shipments/tag\")\n .body(input) // 'input' refers to JSON Payload\n .headers(construct_headers())\n .send()?;\n let mut body = String::new();\n res.read_to_string(&mut body)?;\n\n println!(\"Status: {}\", res.status());\n println!(\"Headers:\\n{:#?}\", res.headers());\n println!(\"Body:\\n{}\", body);\n\n Ok(())\n}" + }, + { + "lang": "SWIFT", + "source": "import Foundation\n\nlet headers = [\n \"Content-Type\": \"application/json\",\n \"X-locale\": \"en_US\",\n \"Authorization\": \"Bearer \"\n]\nlet parameters = [\n input // 'input' refers to JSON Payload\n] as [String : Any]\n\nlet postData = JSONSerialization.data(withJSONObject: parameters, options: [])\n\nlet request = NSMutableURLRequest(url: NSURL(string: \"https://apis-sandbox.fedex.com/ship/v1/shipments/tag\")! as URL,\n cachePolicy: .useProtocolCachePolicy,\n timeoutInterval: 10.0)\nrequest.httpMethod = \"POST\"\nrequest.allHTTPHeaderFields = headers\nrequest.httpBody = postData as Data\n\nlet session = URLSession.shared\nlet dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in\n if (error != nil) {\n print(error)\n } else {\n let httpResponse = response as? HTTPURLResponse\n print(httpResponse)\n }\n})\n\ndataTask.resume()" + } + ] + } + }, + "/ship/v1/shipments/tag/cancel/{shipmentid}": { + "put": { + "summary": "Cancel Tag", + "description": "This endpoint cancels a FedEx Return Tag and the associated pickup for FedEx Express and FedEx Ground shipments if the shipment has not yet been picked up by the courier.
    Note: FedEx APIs do not support Cross-Origin Resource Sharing (CORS) mechanism.", + "operationId": "CancelTag", + "parameters": [ + { + "name": "shipmentid", + "in": "path", + "required": true, + "style": "simple", + "explode": false, + "schema": { + "type": "string" + } + }, + { + "in": "header", + "name": "x-customer-transaction-id", + "description": "This element allows you to assign a unique identifier to your transaction. This element is also returned in the reply and helps you match the request to the reply.", + "required": false, + "schema": { + "type": "string", + "example": "624deea6-b709-470c-8c39-4b5511281492" + } + }, + { + "in": "header", + "name": "content-type", + "description": "This is used to indicate the media type of the resource. The media type is a string sent along with the file indicating format of the file.", + "required": true, + "schema": { + "type": "string", + "example": "application/json" + } + }, + { + "in": "header", + "name": "x-locale", + "description": "This indicates the combination of language code and country code. Click here to see Locales", + "required": false, + "schema": { + "type": "string", + "example": "en_US" + } + }, + { + "in": "header", + "name": "authorization", + "description": "This indicates the authorization token for the input request.", + "required": true, + "schema": { + "type": "string", + "example": "Bearer XXX" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/FullSchema-CancelTag" + } + ] + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SHPCResponseVO" + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseVO_2" + }, + "example": { + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "customerTransactionId": "AnyCo_order123456789", + "errors": [ + { + "code": "SHIPMENT.USER.UNAUTHORIZED", + "message": "Requested user is not authorized to perform the operation." + } + ] + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseVO401_2" + }, + "example": { + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "errors": [ + { + "code": "NOT.AUTHORIZED.ERROR", + "message": "Access token expired. Please modify your request and try again." + } + ] + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseVO403_2" + }, + "example": { + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "errors": [ + { + "code": "FORBIDDEN.ERROR", + "message": "We could not authorize your credentials. Please check your permissions and try again." + } + ] + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseVO404_2" + }, + "example": { + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "errors": [ + { + "code": "NOT.FOUND.ERROR", + "message": "The resource you requested is no longer available. Please modify your request and try again." + } + ] + } + } + } + }, + "500": { + "description": "Failure", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseVO500_2" + }, + "example": { + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "customerTransactionId": "AnyCo_order123456789", + "errors": [ + { + "code": "INTERNAL.SERVER.ERROR", + "message": "We encountered an unexpected error and are working to resolve the issue. We apologize for any inconvenience. Please check back at a later time." + } + ] + } + } + } + }, + "503": { + "description": "Service Unavailable", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseVO503_2" + }, + "example": { + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "errors": [ + { + "code": "SERVICE.UNAVAILABLE.ERROR", + "message": "The service is currently unavailable and we are working to resolve the issue. We apologize for any inconvenience. Please check back at a later time." + } + ] + } + } + } + } + }, + "x-code-samples": [ + { + "lang": "C#", + "source": "var client = new RestClient(\"https://apis-sandbox.fedex.com/ship/v1/shipments/tag/cancel/{shipmentid}\");\nvar request = new RestRequest(Method.PUT);\nrequest.AddHeader(\"Authorization\", \"Bearer \");\nrequest.AddHeader(\"X-locale\", \"en_US\");\nrequest.AddHeader(\"Content-Type\", \"application/json\");\n// 'input' refers to JSON Payload\nrequest.AddParameter(\"application/x-www-form-urlencoded\", input, ParameterType.RequestBody);\nIRestResponse response = client.Execute(request);" + }, + { + "lang": "JAVA", + "source": "OkHttpClient client = new OkHttpClient();\n\nMediaType mediaType = MediaType.parse(\"application/json\");\n// 'input' refers to JSON Payload\nRequestBody body = RequestBody.create(mediaType, input);\nRequest request = new Request.Builder()\n .url(\"https://apis-sandbox.fedex.com/ship/v1/shipments/tag/cancel/{shipmentid}\")\n .put(body)\n .addHeader(\"Content-Type\", \"application/json\")\n .addHeader(\"X-locale\", \"en_US\")\n .addHeader(\"Authorization\", \"Bearer \")\n .build();\n\nResponse response = client.newCall(request).execute();" + }, + { + "lang": "JAVASCRIPT", + "source": "// 'input' refers to JSON Payload\nvar data = JSON.stringify(input);\n \n var xhr = new XMLHttpRequest();\n xhr.withCredentials = true;\n \n xhr.addEventListener(\"readystatechange\", function () {\n if (this.readyState === 4) {\n console.log(this.responseText);\n }\n });\n \n xhr.open(\"PUT\", \"https://apis-sandbox.fedex.com/ship/v1/shipments/tag/cancel/{shipmentid}\");\n xhr.setRequestHeader(\"Content-Type\", \"application/json\");\n xhr.setRequestHeader(\"X-locale\", \"en_US\");\n xhr.setRequestHeader(\"Authorization\", \"Bearer \");\n \n xhr.send(data);" + }, + { + "lang": "PHP", + "source": "setUrl('https://apis-sandbox.fedex.com/ship/v1/shipments/tag/cancel/{shipmentid}');\n$request->setMethod(HTTP_METH_PUT);\n\n$request->setHeaders(array(\n 'Authorization' => 'Bearer ',\n 'X-locale' => 'en_US',\n 'Content-Type' => 'application/json'\n));\n\n$request->setBody(input); // 'input' refers to JSON Payload\n\ntry {\n $response = $request->send();\n\n echo $response->getBody();\n} catch (HttpException $ex) {\n echo $ex;\n}" + }, + { + "lang": "PYTHON", + "source": "import requests\n\nurl = \"https://apis-sandbox.fedex.com/ship/v1/shipments/tag/cancel/{shipmentid}\"\n\npayload = input # 'input' refers to JSON Payload\nheaders = {\n 'Content-Type': \"application/json\",\n 'X-locale': \"en_US\",\n 'Authorization': \"Bearer \"\n }\n\nresponse = requests.put(url, data=payload, headers=headers)\n\nprint(response.text)" + }, + { + "lang": "RUST", + "source": "extern crate reqwest;\n\nuse std::io::Read;\n\nfn construct_headers() -> HeaderMap {\n let mut headers = HeaderMap::new();\n headers.insert(\"Content-Type\", \"application/json\");\n headers.insert(\"X-locale\", \"en_US\");\n headers.insert(\"Authorization\", \"Bearer \");\n headers\n}\n\nfn run() -> Result<()> {\n let client = reqwest::Client::new();\n let mut res = client.put(\"https://apis-sandbox.fedex.com/ship/v1/shipments/tag/cancel/{shipmentid}\")\n .body(input) // 'input' refers to JSON Payload\n .headers(construct_headers())\n .send()?;\n let mut body = String::new();\n res.read_to_string(&mut body)?;\n\n println!(\"Status: {}\", res.status());\n println!(\"Headers:\\n{:#?}\", res.headers());\n println!(\"Body:\\n{}\", body);\n\n Ok(())\n}" + }, + { + "lang": "SWIFT", + "source": "import Foundation\n\nlet headers = [\n \"Content-Type\": \"application/json\",\n \"X-locale\": \"en_US\",\n \"Authorization\": \"Bearer \"\n]\nlet parameters = [\n input // 'input' refers to JSON Payload\n] as [String : Any]\n\nlet postData = JSONSerialization.data(withJSONObject: parameters, options: [])\n\nlet request = NSMutableURLRequest(url: NSURL(string: \"https://apis-sandbox.fedex.com/ship/v1/shipments/tag/cancel/{shipmentid}\")! as URL,\n cachePolicy: .useProtocolCachePolicy,\n timeoutInterval: 10.0)\nrequest.httpMethod = \"PUT\"\nrequest.allHTTPHeaderFields = headers\nrequest.httpBody = postData as Data\n\nlet session = URLSession.shared\nlet dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in\n if (error != nil) {\n print(error)\n } else {\n let httpResponse = response as? HTTPURLResponse\n print(httpResponse)\n }\n})\n\ndataTask.resume()" + } + ] + } + } + }, + "components": { + "schemas": { + "Full_Schema_Ship": { + "required": [ + "accountNumber", + "labelResponseOptions", + "requestedShipment" + ], + "type": "object", + "properties": { + "mergeLabelDocOption": { + "type": "string", + "description": "It specifies the content of the merged pdf URL in the response. The merged pdf URL is generated only if the labelResponseOption is indicated as URL_ONLY.
    • If the value is 'LABELS_AND_DOCS', then merged (all shipping labels and shipping documents) pdf URL will be returned.
    • If the value is 'LABELS_ONLY', merged (all shipping labels only) pdf URL will be returned.
    • If the value is 'NONE', then no merged pdf URL will be returned.

    This is optional field and will default to LABELS_AND_DOCS.
    Note: If the value is 'LABELS_ONLY', then the returned merged pdf label will not be in the Base64 encoded format.", + "example": "LABELS_AND_DOCS", + "enum": [ + "NONE", + "LABELS_AND_DOCS", + "LABELS_ONLY" + ] + }, + "requestedShipment": { + "$ref": "#/components/schemas/RequestedShipment_1" + }, + "labelResponseOptions": { + "$ref": "#/components/schemas/LABELRESPONSEOPTIONS" + }, + "accountNumber": { + "$ref": "#/components/schemas/ShipperAccountNumber" + }, + "shipAction": { + "$ref": "#/components/schemas/OpenShipmentAction" + }, + "processingOptionType": { + "$ref": "#/components/schemas/AsynchronousProcessingOptionType_1" + }, + "oneLabelAtATime": { + "type": "boolean", + "description": "This flag is used to specify if the shipment is singleshot mps or one Label at a time, piece by piece shipment. Default is false. If true, one label at a time is processed.", + "example": true + } + }, + "description": "The request elements required to create a shipment." + }, + "RequestedShipment_1": { + "required": [ + "labelSpecification", + "packagingType", + "pickupType", + "recipients", + "requestedPackageLineItems", + "serviceType", + "shipper", + "shippingChargesPayment", + "totalWeight" + ], + "type": "object", + "properties": { + "shipDatestamp": { + "type": "string", + "description": "This is the shipment date. Default value is current date in case the date is not provided or a past date is provided.
    Format [YYYY-MM-DD].
    Example: 2019-10-14", + "example": "2019-10-14" + }, + "totalDeclaredValue": { + "description": "It is the sum of all declared values of all packages in a shipment. The amount of totalDeclaredValue must be equal to the sum of all the individual declaredValues in the shipment. The declaredValue and totalDeclaredValue must match in all currencies in one shipment. This value represents FedEx maximum liability associated with a shipment. This is including, but not limited to any loss, damage, delay, misdelivery, any failure to provide information, or misdelivery of information related to the Shipment.
    Note: The totalDeclaredValue should not exceed customsValue.", + "allOf": [ + { + "$ref": "#/components/schemas/Money" + } + ] + }, + "shipper": { + "description": "Indicate the Shipper contact details for this shipment.", + "example": { + "address": { + "streetLines": [ + "10 FedEx Parkway", + "Suite 302" + ], + "city": "Beverly Hills", + "stateOrProvinceCode": "CA", + "postalCode": "90210", + "countryCode": "US", + "residential": false + }, + "contact": { + "personName": "John Taylor", + "emailAddress": "sample@company.com", + "phoneExtension": "91", + "phoneNumber": "XXXX567890", + "companyName": "Fedex" + }, + "tins": [ + { + "number": "XXX567", + "tinType": "FEDERAL", + "usage": "usage", + "effectiveDate": "2024-06-13", + "expirationDate": "2024-06-13" + } + ] + }, + "allOf": [ + { + "$ref": "#/components/schemas/ShipperParty" + } + ] + }, + "recipients": { + "type": "array", + "description": "Indicate the descriptive data for the recipient location to which the shipment is to be received.", + "items": { + "$ref": "#/components/schemas/RecipientsParty" + } + }, + "soldTo": { + "description": "Will indicate the party responsible for purchasing the goods shipped from the shipper to the recipient. The sold to party is not necessarily the recipient or the importer of record. The sold to party is relevant when the purchaser, rather than the recipient determines when certain customs regulations apply.", + "allOf": [ + { + "$ref": "#/components/schemas/SoldToParty" + } + ] + }, + "recipientLocationNumber": { + "type": "string", + "description": "A unique identifier for a recipient location.
    Example:1234567", + "example": "1234567" + }, + "pickupType": { + "type": "string", + "description": "Indicates if shipment is being dropped off at a FedEx location or being picked up by FedEx or if it's a regularly scheduled pickup for this shipment. Required for FedEx Express and Ground Shipment.
    Example: USE_SCHEDULED_PICKUP", + "example": "USE_SCHEDULED_PICKUP", + "enum": [ + "CONTACT_FEDEX_TO_SCHEDULE", + "DROPOFF_AT_FEDEX_LOCATION", + "USE_SCHEDULED_PICKUP" + ] + }, + "serviceType": { + "type": "string", + "description": "Indicate the FedEx service type used for this shipment.
    Example: STANDARD_OVERNIGHT
    click here to see Service Types", + "example": "PRIORITY_OVERNIGHT" + }, + "packagingType": { + "type": "string", + "description": "Specify the packaging used.
    Note: For Express Freight shipments, the packaging will default to YOUR_PACKAGING irrespective of the user provided package type in the request.
    Example: FEDEX_PAK
    click here to see Package Types", + "example": "YOUR_PACKAGING" + }, + "totalWeight": { + "type": "number", + "description": "Indicate the shipment total weight in pounds.
    Example: 10.6
    Note:
    • This only applies to International shipments and should be used on the first package of a multiple piece shipment.
    • This value contains 1 explicit decimal position.
    • For one Label at a time shipments, the unit of totalWeight is considered same as the unit of weight provided in requestedPackageLineItem field.
    ", + "format": "double", + "example": 20.6 + }, + "origin": { + "description": "Indicate shipment origin address information, if it is different from the shipper address.", + "allOf": [ + { + "$ref": "#/components/schemas/ContactAndAddress_1" + } + ] + }, + "shippingChargesPayment": { + "$ref": "#/components/schemas/Payment" + }, + "shipmentSpecialServices": { + "$ref": "#/components/schemas/ShipmentSpecialServicesRequested" + }, + "emailNotificationDetail": { + "$ref": "#/components/schemas/ShipShipmentEMailNotificationDetail" + }, + "expressFreightDetail": { + "$ref": "#/components/schemas/ExpressFreightDetail" + }, + "variableHandlingChargeDetail": { + "$ref": "#/components/schemas/VariableHandlingChargeDetail" + }, + "customsClearanceDetail": { + "$ref": "#/components/schemas/CustomsClearanceDetail" + }, + "smartPostInfoDetail": { + "$ref": "#/components/schemas/SmartPostInfoDetail" + }, + "blockInsightVisibility": { + "type": "boolean", + "description": "If true, only the shipper/payer will have visibility of this shipment.
    Valid Value : true, false.
    Default:false
    Example: true", + "example": true + }, + "labelSpecification": { + "$ref": "#/components/schemas/LabelSpecification" + }, + "shippingDocumentSpecification": { + "$ref": "#/components/schemas/ShippingDocumentSpecification" + }, + "rateRequestType": { + "type": "array", + "description": "Indicate the type of rates to be returned. The account specific rates are returned by default if the account number is specified in the request.
    Following are values:
    • LIST - Returns FedEx published list rates in addition to account-specific rates (if applicable).
    • INCENTIVE - This is one-time discount for incentivising the customer. For more information, contact your FedEx representative.
    • ACCOUNT - Returns account specific rates (Default).
    • PREFERRED - Returns rates in the preferred currency specified in the element preferredCurrency.
    • RETAIL - Returns customer rate from one of retail FedEx service centers.
    Examples: [\"ACCOUNT\", \"PREFERRED\"]", + "example": [ + "LIST", + "PREFERRED" + ], + "items": { + "type": "string", + "enum": [ + "LIST", + "NONE", + "PREFERRED", + "ACCOUNT", + "INCENTIVE", + "RETAIL" + ] + } + }, + "preferredCurrency": { + "type": "string", + "description": "Indicate the currency the caller requests to have used in all returned monetary values. Should be Used in conjunction with the element RateRequestType.
    Example: USD
    click here to see available Currency codes
    Note: Incorrect currency codes should not be supplied. The system ignores the incorrect currency code.", + "example": "USD" + }, + "totalPackageCount": { + "type": "integer", + "description": "For an MPS, this is the total number of packages in the shipment.Applicable for parent shipment for one label at a time shipments.
    Example: 25", + "format": "int32", + "example": 25 + }, + "masterTrackingId": { + "$ref": "#/components/schemas/MasterTrackingId" + }, + "requestedPackageLineItems": { + "type": "array", + "description": "These are one or more package-attribute descriptions, each of which describes an individual package, a group of identical packages, or (for the total-piece-total-weight case) common characteristics of all packages in the shipment.
    • At least one instance containing the weight for at least one package is required for EXPRESS and GROUND shipments.
    • Single piece requests will have one RequestedPackageLineItem.
    • Multiple piece requests will have multiple RequestedPackageLineItems.
    • Maximum occurrences is 30.
    ", + "items": { + "$ref": "#/components/schemas/RequestedPackageLineItem" + } + } + }, + "description": "The descriptive data of the requested shipment." + }, + "Money": { + "type": "object", + "properties": { + "amount": { + "type": "number", + "description": "This is the amount. Maximum limit is 5 digits before decimal.
    Example: 12.45", + "format": "double", + "example": 12.45 + }, + "currency": { + "type": "string", + "description": "This is the currency code for the amount.
    Example: USD
    Click here to see Currency codes", + "example": "USD" + } + }, + "description": "This customs value is applicable for all items(or units) under the specified commodity" + }, + "Customs_Money": { + "type": "object", + "properties": { + "amount": { + "type": "number", + "description": "This is commodity value in amount used for Customs declaration.
    Max limit: 11 digits before decimal.
    Example: 1,55,6457.25", + "format": "double", + "example": "1556.25" + }, + "currency": { + "type": "string", + "description": "This is the currency code for the amount.
    Example: USD
    Click here to see Currency codes", + "example": "USD" + } + }, + "description": "This customs value is applicable for all items(or units) under the specified commodity." + }, + "ShipperParty": { + "required": [ + "address", + "contact" + ], + "type": "object", + "properties": { + "address": { + "$ref": "#/components/schemas/PartyAddress_2" + }, + "contact": { + "$ref": "#/components/schemas/PartyContact" + }, + "tins": { + "type": "array", + "description": "This is the tax identification number details.", + "items": { + "$ref": "#/components/schemas/TaxpayerIdentification" + } + } + }, + "description": "Indicate the Shipper contact details for this shipment.", + "example": { + "address": { + "streetLines": [ + "10 FedEx Parkway", + "Suite 302" + ], + "city": "Beverly Hills", + "stateOrProvinceCode": "CA", + "postalCode": "90210", + "countryCode": "US", + "residential": false + }, + "contact": { + "personName": "John Taylor", + "emailAddress": "sample@company.com", + "phoneExtension": "000", + "phoneNumber": "XXXX345671", + "companyName": "Fedex" + }, + "tins": [ + { + "number": "123567", + "tinType": "FEDERAL", + "usage": "usage", + "effectiveDate": "2000-01-23T04:56:07.000+00:00", + "expirationDate": "2000-01-23T04:56:07.000+00:00" + } + ] + } + }, + "SoldToParty": { + "description": "Will indicate the party responsible for purchasing the goods shipped from the shipper to the recipient. The sold to party is not necessarily the recipient or the importer of record. The sold to party is relevant when the purchaser, rather than the recipient determines when certain customs regulations apply.", + "type": "object", + "properties": { + "address": { + "$ref": "#/components/schemas/PartyAddress" + }, + "contact": { + "$ref": "#/components/schemas/PartyContact" + }, + "tins": { + "description": "Used for adding the tax id", + "type": "array", + "items": { + "$ref": "#/components/schemas/TaxpayerIdentification" + } + }, + "accountNumber": { + "description": "Identification of a specific FedEx customer account.", + "$ref": "#/components/schemas/AccountNumber" + } + } + }, + "PartyAddress": { + "required": [ + "city", + "countryCode", + "streetLines" + ], + "type": "object", + "properties": { + "streetLines": { + "type": "array", + "description": "Combination of number, street name, etc. At least one line is required for a valid physical address. Empty lines should not be included. Max Length is 35.
    Example: [1550 Union Blvd,Suite 302]", + "example": "1550 Union Blvd, Suite 302", + "items": { + "type": "string" + } + }, + "city": { + "type": "string", + "maxLength": 35, + "description": "The name of city, town of the recipient.Max length is 35.
    Example: Beverly Hills", + "example": "Beverly Hills" + }, + "stateOrProvinceCode": { + "type": "string", + "description": "The US States,Canada and Puerto Rico Province codes of the recipient. The Format and presence of this field may vary depending on the country.State code is required for US, CA, PR and not required for other countries. Conditional.
    Example: CA", + "example": "CA" + }, + "postalCode": { + "type": "string", + "description": "This is the postal code.
    Note: This is Optional for non postal-aware countries. Maximum length is 10.
    Example: 65247
    click here to see Postal aware countries", + "example": "90210" + }, + "countryCode": { + "type": "string", + "description": "This is the two-letter country code.
    Maximum length is 2.
    Example: US
    click here to see Country codes", + "example": "US" + }, + "residential": { + "type": "boolean", + "description": "Indicates whether this address is residential (as opposed to commercial).
    Example: false", + "example": false + } + }, + "description": "This is detailed information on physical location. May be used as an actual physical address (place to which one could go), or as a container of address parts which should be handled as a unit (such as a city-state-ZIP combination within the US).", + "example": { + "streetLines": [ + "10 FedEx Parkway", + "Suite 302" + ], + "city": "Beverly Hills", + "stateOrProvinceCode": "CA", + "postalCode": "90210", + "countryCode": "US", + "residential": false + } + }, + "PartyAddress_2": { + "required": [ + "city", + "countryCode", + "streetLines" + ], + "type": "object", + "properties": { + "streetLines": { + "type": "array", + "description": "Combination of number, street name, etc. At least one line is required for a valid physical address. Empty lines should not be included. Max Length is 35.
    Example: [1550 Union Blvd,Suite 302]", + "example": "1550 Union Blvd, Suite 302", + "items": { + "type": "string" + } + }, + "city": { + "type": "string", + "maxLength": 35, + "description": "The name of city, town of the recipient.Max length is 35.
    Example: Beverly Hills", + "example": "Beverly Hills" + }, + "stateOrProvinceCode": { + "type": "string", + "description": "It is used to identify the principal subdivisions (e.g., provinces or states) of countries. The Format and presence of this field may vary depending on the country. Note: For specific countries, such as the United States and Canada, and Puerto Rico, there is a two-character state, province, codes limit . Example: TX", + "example": "CA" + }, + "postalCode": { + "type": "string", + "description": "This is the postal code.
    Note: This is Optional for non postal-aware countries. Maximum length is 10.
    Example: 65247
    click here to see Postal aware countries", + "example": "90210" + }, + "countryCode": { + "type": "string", + "description": "This is the two-letter country code.
    Maximum length is 2.
    Example: US
    click here to see Country codes", + "example": "US" + }, + "residential": { + "type": "boolean", + "description": "Indicates whether this address is residential (as opposed to commercial).
    Example: false", + "example": false + } + }, + "description": "This is detailed information on physical location. May be used as an actual physical address (place to which one could go), or as a container of address parts which should be handled as a unit (such as a city-state-ZIP combination within the US).", + "example": { + "streetLines": [ + "10 FedEx Parkway", + "Suite 302" + ], + "city": "Beverly Hills", + "stateOrProvinceCode": "CA", + "postalCode": "90210", + "countryCode": "US", + "residential": false + } + }, + "PartyContact": { + "required": [ + "phoneNumber" + ], + "type": "object", + "properties": { + "personName": { + "type": "string", + "description": "Specify contact name. Maximum length is 70.
    Note: Either the companyName or personName is mandatory.
    Example: John Taylor", + "example": "John Taylor" + }, + "emailAddress": { + "type": "string", + "description": "Specify contact email address. Maximum length is 80.
    Example: sample@company.com", + "example": "sample@company.com" + }, + "phoneExtension": { + "type": "string", + "description": "Specify contact phone extension. Maximum length is 6.
    Example: 1234", + "example": "91" + }, + "phoneNumber": { + "type": "string", + "description": "The shipper's phone number.
    Minimum length is 10 and supports maximum of 15 for certain countries using longer phone numbers.
    Note: For US and CA, a phone number must have exactly 10 digits, plus an optional leading country code of '1' or '+1'.
    Example: 918xxxxx890", + "example": "918xxxxx890" + }, + "companyName": { + "type": "string", + "description": "The shipper's company name. Max length is 35.
    Example: FedEx", + "example": "Fedex" + } + }, + "description": "Indicate the contact details for this shipment.", + "example": { + "personName": "John Taylor", + "emailAddress": "sample@company.com", + "phoneExtension": "91", + "phoneNumber": "1234567890", + "companyName": "Fedex" + } + }, + "TaxpayerIdentification": { + "type": "object", + "required": [ + "number", + "tinType" + ], + "properties": { + "number": { + "type": "string", + "description": "Specify tax ID number. Maximum length is 18.
    Example: 123567", + "example": "123567" + }, + "tinType": { + "type": "string", + "description": "Identifies the type of Tax Identification Number in Shipment processing.
    Example: FEDERAL", + "example": "FEDERAL", + "enum": [ + "PERSONAL_NATIONAL", + "PERSONAL_STATE", + "FEDERAL", + "BUSINESS_NATIONAL", + "BUSINESS_STATE", + "BUSINESS_UNION" + ] + }, + "usage": { + "type": "string", + "description": "Identifies the usage of Tax Identification Number in Shipment processing.
    Example: usage", + "example": "usage" + }, + "effectiveDate": { + "type": "string", + "description": "Effective Date. FORMAT[YYYY-MM-DD]
    Example: 2024-06-13", + "format": "Date", + "example": "2024-06-13" + }, + "expirationDate": { + "type": "string", + "description": "Expiration Date. FORMAT[YYYY-MM-DD]
    Example: 2024-06-13", + "format": "Date", + "example": "2024-06-13" + } + }, + "example": { + "number": "123567", + "tinType": "FEDERAL", + "usage": "usage", + "effectiveDate": "2000-01-23T04:56:07.000+00:00", + "expirationDate": "2000-01-23T04:56:07.000+00:00" + } + }, + "RecipientsParty": { + "required": [ + "address", + "contact" + ], + "type": "object", + "properties": { + "address": { + "$ref": "#/components/schemas/PartyAddress_2" + }, + "contact": { + "$ref": "#/components/schemas/PartyContact" + }, + "tins": { + "type": "array", + "description": "This is the tax identification number details.", + "items": { + "$ref": "#/components/schemas/TaxpayerIdentification" + } + }, + "deliveryInstructions": { + "type": "string", + "description": "Specify the delivery instructions to be added with the shipment. Use with Ground Home Delivery.
    Example: Delivery Instructions", + "example": "Instruction 1" + } + }, + "description": "The descriptive information of the recipient for the shipment and the physical location for the package destination.", + "example": { + "address": { + "streetLines": [ + "10 FedEx Parkway", + "Suite 302" + ], + "city": "Beverly Hills", + "stateOrProvinceCode": "CA", + "postalCode": "90210", + "countryCode": "US", + "residential": false + }, + "contact": { + "personName": "John Taylor", + "emailAddress": "sample@company.com", + "phoneExtension": "000", + "phoneNumber": "XXXX345671", + "companyName": "FedEx" + }, + "tins": [ + { + "number": "123567", + "tinType": "FEDERAL", + "usage": "usage", + "effectiveDate": "2000-01-23T04:56:07.000+00:00", + "expirationDate": "2000-01-23T04:56:07.000+00:00" + } + ], + "deliveryInstructions": "Delivery Instructions" + } + }, + "ContactAndAddress_1": { + "type": "object", + "properties": { + "contact": { + "$ref": "#/components/schemas/Contact_2" + }, + "address": { + "$ref": "#/components/schemas/Address_1" + } + }, + "description": "Specifies the contact and address details of a location.", + "example": { + "address": { + "streetLines": [ + "10 FedEx Parkway", + "Suite 302" + ], + "city": "Beverly Hills", + "stateOrProvinceCode": "CA", + "postalCode": "38127", + "countryCode": "US", + "residential": false + }, + "contact": { + "personName": "person name", + "emailAddress": "email address", + "phoneNumber": "phone number", + "phoneExtension": "phone extension", + "companyName": "company name", + "faxNumber": "fax number" + } + } + }, + "Contact_2": { + "type": "object", + "properties": { + "personName": { + "type": "string", + "description": "Specify contact person name.
    Recommended length is 70.
    Note: There's no specific validation for the person name.
    Example: John Taylor", + "example": "John Taylor" + }, + "emailAddress": { + "type": "string", + "description": "Specify contact email address. Maximum length is 80.
    Example: sample@company.com", + "example": "sample@company.com" + }, + "phoneNumber": { + "type": "string", + "description": "Specify contact phone number.
    Minimum length is 10 and supports maximum of 15 for certain countries using longer phone numbers.
    Note: Recommended Maximum length is 15 and there's no specific validation will be done for the phone number.
    Example: 918xxxxx890", + "example": "1234567890" + }, + "phoneExtension": { + "type": "string", + "description": "Specify contact phone extension.
    Note: Recommended length is 6. There's no specific validation for the phone extension.
    Example: 1234", + "example": "91" + }, + "faxNumber": { + "type": "string", + "description": "Specify contact fax number.
    Note: Recommended length is 15. There's no specific validation for the fax number.
    Example: 1234567890", + "example": "956123" + }, + "companyName": { + "type": "string", + "description": "Specify contact company name.
    Recommended length is 35.
    Note: There's no specific validation for the company name.
    Example: FedEx", + "example": "Fedex" + } + }, + "description": "Indicate the contact details of the shipper.", + "example": { + "personName": "John Taylor", + "emailAddress": "sample@company.com", + "phoneNumber": "1234567890", + "phoneExtension": 1234, + "faxNumber": "1234567890", + "companyName": "Fedex" + } + }, + "Address_1": { + "type": "object", + "properties": { + "streetLines": { + "type": "array", + "description": "This is the combination of number, street name, etc.
    Note: At least one line is required and streetlines more than 3 will be ignored. Empty lines should not be included. Maximum length per line is 35.
    Example: [10 FedEx Parkway, Suite 302, .etc.]", + "example": [ + "Bldg. 10", + "10 FedEx Parkway" + ], + "items": { + "type": "string" + } + }, + "city": { + "type": "string", + "description": "This is a placeholder for City Name.
    Note: This is conditional and not required in all the requests.
    Note: It is recommended for Express shipments for the most accurate ODA and OPA surcharges.
    Example: Beverly Hills", + "example": "Beverly Hills" + }, + "stateOrProvinceCode": { + "type": "string", + "description": "This is a placeholder for State or Province code.State code is required for US, CA, PR and not required for other countries. Conditional. Max length is 2.
    Example: CA
    click here to see State or Province Code", + "example": "CA" + }, + "postalCode": { + "type": "string", + "description": "Indicate the Postal code. This is Optional for non postal-aware countries. Maximum length is 10.
    Example: 65247
    click here to see Postal aware countries", + "example": "38127" + }, + "countryCode": { + "type": "string", + "description": "This is the two-letter country code.
    Maximum length is 2.
    Example: US
    click here to see Country codes", + "example": "US" + }, + "residential": { + "type": "boolean", + "description": "Indicates whether this address is residential (as opposed to commercial).
    Example: false", + "example": false + } + }, + "description": "This is detailed information on physical location. May be used as an actual physical address (place to which one could go), or as a container of address parts which should be handled as a unit (such as a city-state-ZIP combination within the U.S.)." + }, + "Payment": { + "required": [ + "paymentType" + ], + "type": "object", + "properties": { + "paymentType": { + "type": "string", + "description": "Indicates who and how the shipment will be paid for.Required for Express and Ground.
    Example: SENDER", + "enum": [ + "SENDER", + "RECIPIENT", + "THIRD_PARTY", + "COLLECT" + ], + "example": "SENDER" + }, + "payor": { + "$ref": "#/components/schemas/Payor" + } + }, + "description": "Specifies the payment details specifying the method and means of payment to FedEx for providing shipping services.", + "example": { + "paymentType": "SENDER", + "payor": { + "responsibleParty": { + "address": { + "streetLines": [ + "10 FedEx Parkway", + "Suite 302" + ], + "city": "Beverly Hills", + "stateOrProvinceCode": "CA", + "postalCode": "90210", + "countryCode": "US", + "residential": false + }, + "contact": { + "personName": "John Taylor", + "emailAddress": "sample@company.com", + "phoneNumber": "XXXX567890", + "phoneExtension": "phone extension", + "companyName": "Fedex", + "faxNumber": "fax number" + }, + "accountNumber": { + "value": "Your account number" + } + } + } + } + }, + "Payor": { + "required": [ + "responsibleParty" + ], + "type": "object", + "properties": { + "responsibleParty": { + "$ref": "#/components/schemas/ResponsiblePartyParty" + } + }, + "description": "Payor is mandatory when the paymentType is RECIPIENT, THIRD_PARTY or COLLECT.", + "example": { + "responsibleParty": { + "address": { + "streetLines": [ + "10 FedEx Parkway", + "Suite 302" + ], + "city": "Beverly Hills", + "stateOrProvinceCode": "CA", + "postalCode": "90210", + "countryCode": "US", + "residential": false + }, + "contact": { + "personName": "John Taylor", + "emailAddress": "sample@company.com", + "phoneNumber": "XXXX567890", + "phoneExtension": "phone extension", + "companyName": "Fedex", + "faxNumber": "fax number" + }, + "accountNumber": { + "value": "Your account number" + } + } + } + }, + "ResponsiblePartyParty": { + "required": [ + "accountNumber" + ], + "type": "object", + "properties": { + "address": { + "$ref": "#/components/schemas/PartyAddress" + }, + "contact": { + "$ref": "#/components/schemas/PartyContact" + }, + "accountNumber": { + "$ref": "#/components/schemas/PartyAccountNumber" + } + }, + "description": "Indicate the payer Information responsible for paying for the shipment.
    Note: ResponsibleParty accountNumber is required for ACCOUNT based services.", + "example": { + "address": { + "streetLines": [ + "10 FedEx Parkway", + "Suite 302" + ], + "city": "Beverly Hills", + "stateOrProvinceCode": "CA", + "postalCode": "90210", + "countryCode": "US", + "residential": false + }, + "contact": { + "personName": "John Taylor", + "emailAddress": "sample@company.com", + "phoneExtension": "000", + "phoneNumber": "XXXX345671", + "companyName": "FedEx" + }, + "accountNumber": { + "value": "Your account number" + } + } + }, + "PartyAccountNumber": { + "type": "object", + "properties": { + "value": { + "type": "string", + "description": "Conditional.
    The account number value.
    Max Length is 9.
    Example: 12XXXXX89", + "example": "12XXXXX89" + } + }, + "description": "This is FedEx Account number details.", + "example": { + "value": "Your account number" + } + }, + "PartyAccountNumber_1": { + "type": "object", + "properties": { + "value": { + "type": "string", + "description": "Conditional.
    The account number value.
    Max Length is 9.
    Example: 12XXXXX89
    NOTE-FedEx Account Number is required for FedEx International Connect Plus (FICP) service shipments from APAC to US or PR with duty & tax Bill-to recipient:
    1. If any of the shipment Commodities' Country of Manufacture is CN/HK", + "example": "12XXXXX89" + } + }, + "description": "This is FedEx Account number details.", + "example": { + "value": "Your account number" + } + }, + "ShipmentSpecialServicesRequested": { + "type": "object", + "properties": { + "specialServiceTypes": { + "type": "array", + "description": "Special services requested for the shipment.
    Example:
    • HOLD_AT_LOCATION
    • RETURN_SHIPMENT
    • BROKER_SELECT_OPTION
    • CALL_BEFORE_DELIVERY
    • COD
    • CUSTOM_DELIVERY_WINDOW

    click here to see Shipment Special Service Types", + "example": [ + "THIRD_PARTY_CONSIGNEE", + "PROTECTION_FROM_FREEZING" + ], + "items": { + "type": "string" + } + }, + "etdDetail": { + "$ref": "#/components/schemas/ETDDetail" + }, + "returnShipmentDetail": { + "$ref": "#/components/schemas/ReturnShipmentDetail" + }, + "deliveryOnInvoiceAcceptanceDetail": { + "$ref": "#/components/schemas/DeliveryOnInvoiceAcceptanceDetail" + }, + "internationalTrafficInArmsRegulationsDetail": { + "$ref": "#/components/schemas/InternationalTrafficInArmsRegulationsDetail" + }, + "pendingShipmentDetail": { + "$ref": "#/components/schemas/PendingShipmentDetail" + }, + "holdAtLocationDetail": { + "$ref": "#/components/schemas/HoldAtLocationDetail" + }, + "shipmentCODDetail": { + "$ref": "#/components/schemas/ShipmentCODDetail" + }, + "shipmentDryIceDetail": { + "$ref": "#/components/schemas/ShipmentDryIceDetail_1" + }, + "internationalControlledExportDetail": { + "$ref": "#/components/schemas/InternationalControlledExportDetail" + }, + "homeDeliveryPremiumDetail": { + "$ref": "#/components/schemas/HomeDeliveryPremiumDetail" + } + }, + "description": "Specify the special services requested at the shipment level.
    If the shipper is requesting a special service which requires additional data (such as the COD amount), the shipment special service type must be present in the specialServiceTypes collection, and the supporting detail must be provided in the appropriate sub-object below.
    RETURN_SHIPMENT is required for creating return shipments." + }, + "ETDDetail": { + "type": "object", + "properties": { + "attributes": { + "type": "array", + "description": "Specifies the Post Document Upload
    Example: POST_SHIPMENT_UPLOAD_REQUESTED", + "items": { + "type": "string", + "enum": [ + "POST_SHIPMENT_UPLOAD_REQUESTED" + ], + "example": "POST_SHIPMENT_UPLOAD_REQUESTED" + } + }, + "attachedDocuments": { + "type": "array", + "description": "Use this object to specify the details regarding already uploded document(s). This object is required if the documents are uploaded Pre-Shipment uploaded documents. It is recommended to provide values for all elements under this object.", + "items": { + "$ref": "#/components/schemas/UploadDocumentReferenceDetail" + } + }, + "requestedDocumentTypes": { + "type": "array", + "description": "Indicates the types of shipping documents requested by the shipper.
    Example: CERTIFICATE_OF_ORIGIN, COMMERCIAL_INVOICE etc.", + "example": [ + "VICS_BILL_OF_LADING", + "GENERAL_AGENCY_AGREEMENT" + ], + "items": { + "type": "string", + "enum": [ + "CERTIFICATE_OF_ORIGIN", + "COMMERCIAL_INVOICE", + "CUSTOM_PACKAGE_DOCUMENT", + "CUSTOM_SHIPMENT_DOCUMENT", + "CUSTOMER_SPECIFIED_LABELS", + "EXPORT_DECLARATION", + "GENERAL_AGENCY_AGREEMENT", + "LABEL", + "USMCA_CERTIFICATION_OF_ORIGIN", + "OP_900", + "PENDING_SHIPMENT_EMAIL_NOTIFICATION", + "PRO_FORMA_INVOICE", + "RETURN_INSTRUCTIONS", + "USMCA_COMMERCIAL_INVOICE_CERTIFICATION_OF_ORIGIN" + ] + } + } + }, + "description": "Use this object to specify all information on how the electronic Trade document references used with the shipment." + }, + "UploadDocumentReferenceDetail": { + "type": "object", + "properties": { + "documentType": { + "type": "string", + "description": "Returns the type of document (if any) specified in the ship shipment request.
    Example: PRO_FORMA_INVOICE", + "example": "PRO_FORMA_INVOICE", + "enum": [ + "CERTIFICATE_OF_ORIGIN", + "NET_RATE_SHEET", + "COMMERCIAL_INVOICE", + "ETD_LABEL", + "USMCA_CERTIFICATION_OF_ORIGIN", + "OTHER", + "PRO_FORMA_INVOICE", + "USMCA_COMMERCIAL_INVOICE_CERTIFICATION_OF_ORIGIN" + ] + }, + "documentReference": { + "type": "string", + "description": "Specify the reference for the uploaded document.This is for the customer to reference their uploaded docs when they retrieve them. Could be anything, order number, po number, whatever the customer used to tie the document to something they would use.
    Note: Ensure to supply document references in case of Pre-Shipment document upload.

    Example: Reference", + "example": "DocumentReference" + }, + "description": { + "type": "string", + "description": "Specify additional information about the uploaded document for better understanding.
    Example: Certificate of Origin is uploaded for country of manufacturing verification.", + "example": "PRO FORMA INVOICE" + }, + "documentId": { + "type": "string", + "description": "This is the uploaded document ID value.
    Example: 090927d680038c61", + "example": "090927d680038c61" + } + }, + "description": "Specify the document upload reference details." + }, + "ReturnShipmentDetail": { + "required": [ + "returnType" + ], + "type": "object", + "properties": { + "returnEmailDetail": { + "$ref": "#/components/schemas/ReturnEmailDetail" + }, + "rma": { + "$ref": "#/components/schemas/ReturnMerchandiseAuthorization" + }, + "returnAssociationDetail": { + "$ref": "#/components/schemas/ReturnAssociationDetail" + }, + "returnType": { + "type": "string", + "description": "This specifies the return Type. Required to be set to PRINT_RETURN_LABEL for printed return label shipments.For email return label shipments returnType must be set to PENDING and pendingShipmentDetail must be set to EMAIL.
    Valid Values : PENDING, PRINT_RETURN_LABEL
    Example: PRINT_RETURN_LABEL", + "example": "PRINT_RETURN_LABEL", + "enum": [ + "PENDING", + "PRINT_RETURN_LABEL" + ] + } + }, + "description": "Use this object for specifying return shipment details." + }, + "ReturnEmailDetail": { + "required": [ + "merchantPhoneNumber", + "allowedSpecialService" + ], + "type": "object", + "properties": { + "merchantPhoneNumber": { + "type": "string", + "description": "This is the merchant phone number and required for Email Return Labels.
    Example: 19012635656", + "example": "19012635656" + }, + "allowedSpecialService": { + "type": "array", + "description": "Indicate the allowed (merchant-authorized) special services which may be selected when the subsequent shipment is created.
    Only services represented in EmailLabelAllowedSpecialServiceType will be controlled by this list.", + "items": { + "type": "string", + "example": "SATURDAY_DELIVERY", + "enum": [ + "SATURDAY_DELIVERY", + "SATURDAY_PICKUP" + ] + } + } + }, + "description": "These are email details for the return shipment." + }, + "ReturnMerchandiseAuthorization": { + "type": "object", + "properties": { + "reason": { + "type": "string", + "description": "Specify the reason for the return.
    Note: There is no validation for reason. Recommended length is 60 alpha-numeric characters
    Example: Wrong color or size.", + "example": "Wrong Size or Color" + } + }, + "description": "This is a Return Merchant Authorization (RMA) for the return shipment.
    Reason for the requirement is mandatory." + }, + "ReturnAssociationDetail": { + "type": "object", + "required": [ + "trackingNumber" + ], + "properties": { + "shipDatestamp": { + "type": "string", + "description": "This is the ship date for the outbound shipment associated with a return shipment. The format is YYYY-MM-DD.
    Example: 2019-10-01", + "example": "2019-10-01" + }, + "trackingNumber": { + "type": "string", + "description": "This is the tracking number associated with this package.
    Example: 49XXX0000XXX20032835", + "example": "123456789" + } + }, + "description": "Specifies the details of an outbound shipment in order to associate the return shipment to it." + }, + "DeliveryOnInvoiceAcceptanceDetail": { + "type": "object", + "properties": { + "recipient": { + "description": "The descriptive data for the recipient of the shipment and the physical location for the shipment destination.", + "allOf": [ + { + "$ref": "#/components/schemas/RecipientsParty" + }, + { + "required": [ + "address", + "contact" + ], + "properties": { + "address": { + "required": [ + "countryCode", + "streetLines" + ], + "properties": { + "streetLines": { + "type": "array", + "description": "This is the combination of number, street name, etc.
    Note: At least one line is required and streetlines more than 3 will be ignored. Empty lines should not be included. Maximum length per line is 35.
    Example: [10 FedEx Parkway, Suite 302, .etc.]", + "example": [ + "23, RUE JOSEPH-DE MA" + ], + "items": { + "type": "string" + } + }, + "countryCode": { + "type": "string", + "description": "The two-letter code used to identify a country. Maximum length is 2.
    Example: US
    click here to see Country codes", + "example": "US" + } + } + }, + "contact": { + "required": [ + "companyName", + "personName", + "phoneNumber" + ], + "properties": { + "companyName": { + "type": "string", + "description": "Identifies the company this contact is associated with. Maximum length is 35.", + "example": "Fedex" + }, + "personName": { + "type": "string", + "description": "Specify Person Name.
    Example: John Taylor", + "example": "John Taylor" + }, + "phoneNumber": { + "type": "string", + "description": "Identifies the phone number associated with this contact. Maximum length is 10.", + "example": "1234567890" + } + } + } + } + } + ] + } + }, + "description": "Indicate the Delivery On Invoice Acceptance detail. Recipient is required for Delivery On Invoice Special service." + }, + "InternationalTrafficInArmsRegulationsDetail": { + "required": [ + "licenseOrExemptionNumber" + ], + "type": "object", + "properties": { + "licenseOrExemptionNumber": { + "type": "string", + "description": "The export or license number for the ITAR shipment.
    Minimum length is 5 characters.
    Maximum length is 21 characters.
    Example: 9871234", + "example": "9871234" + } + }, + "description": "These are International Traffic In Arms Regulations shipment service details." + }, + "PendingShipmentDetail": { + "required": [ + "emailLabelDetail", + "pendingShipmentType" + ], + "type": "object", + "properties": { + "pendingShipmentType": { + "type": "string", + "description": "Specifies the pending shipment type. Must include the value: EMAIL for email return shipments.
    Not applicable for other types of shipments
    Example: EMAIL", + "example": "EMAIL", + "enum": [ + "EMAIL" + ] + }, + "processingOptions": { + "$ref": "#/components/schemas/PendingShipmentProcessingOptionsRequested" + }, + "recommendedDocumentSpecification": { + "$ref": "#/components/schemas/RecommendedDocumentSpecification" + }, + "emailLabelDetail": { + "$ref": "#/components/schemas/EmailLabelDetail" + }, + "attachedDocuments": { + "type": "array", + "description": "These are the reference document details with the shipment.", + "items": { + "$ref": "#/components/schemas/UploadDocumentReferenceDetail_1" + } + }, + "expirationTimeStamp": { + "type": "string", + "description": "Specifies the Email Label expiration date. The maximum expiration date for an Email Return Label must be greater of equal to the day of the label request and not greater than 2 years in the future. Format[YYYY-MM-DD]
    Example: 2020-01-01", + "example": "2020-01-01" + } + }, + "description": "This object is used to specify the Pending Shipment Type for Email label." + }, + "PendingShipmentProcessingOptionsRequested": { + "type": "object", + "properties": { + "options": { + "type": "array", + "description": "Pending Shipment Processing Option Type
    Example: ALLOW_MODIFICATIONS", + "example": [ + "ALLOW_MODIFICATIONS" + ], + "items": { + "type": "string", + "enum": [ + "ALLOW_MODIFICATIONS" + ] + } + } + }, + "description": "Use this object to allow the Email Label shipment originator, specify if the Email label shipment completer can make modifications to editable shipment data." + }, + "RecommendedDocumentSpecification": { + "required": [ + "types" + ], + "type": "object", + "properties": { + "types": { + "type": "array", + "description": "This is the recommended document Type.
    click here to see shipment document type", + "example": [ + "ANTIQUE_STATEMENT_EUROPEAN_UNION", + "ANTIQUE_STATEMENT_UNITED_STATES" + ], + "items": { + "type": "string", + "enum": [ + "ANTIQUE_STATEMENT_EUROPEAN_UNION", + "ANTIQUE_STATEMENT_UNITED_STATES", + "ASSEMBLER_DECLARATION", + "BEARING_WORKSHEET", + "CERTIFICATE_OF_SHIPMENTS_TO_SYRIA", + "COMMERCIAL_INVOICE_FOR_THE_CARIBBEAN_COMMON_MARKET", + "CONIFEROUS_SOLID_WOOD_PACKAGING_MATERIAL_TO_THE_PEOPLES_REPUBLIC_OF_CHINA", + "DECLARATION_FOR_FREE_ENTRY_OF_RETURNED_AMERICAN_PRODUCTS", + "DECLARATION_OF_BIOLOGICAL_STANDARDS", + "DECLARATION_OF_IMPORTED_ELECTRONIC_PRODUCTS_SUBJECT_TO_RADIATION_CONTROL_STANDARD", + "ELECTRONIC_INTEGRATED_CIRCUIT_WORKSHEET", + "FILM_AND_VIDEO_CERTIFICATE", + "INTERIM_FOOTWEAR_INVOICE", + "USMCA_CERTIFICATION_OF_ORIGIN_CANADA_ENGLISH", + "USMCA_CERTIFICATION_OF_ORIGIN_CANADA_FRENCH", + "USMCA_CERTIFICATION_OF_ORIGIN_SPANISH", + "USMCA_CERTIFICATION_OF_ORIGIN_UNITED_STATES", + "PACKING_LIST", + "PRINTED_CIRCUIT_BOARD_WORKSHEET", + "REPAIRED_WATCH_BREAKOUT_WORKSHEET", + "STATEMENT_REGARDING_THE_IMPORT_OF_RADIO_FREQUENCY_DEVICES", + "TOXIC_SUBSTANCES_CONTROL_ACT", + "UNITED_STATES_CARIBBEAN_BASIN_TRADE_PARTNERSHIP_ACT_CERTIFICATE_OF_ORIGIN_TEXTILES", + "UNITED_STATES_CARIBBEAN_BASIN_TRADE_PARTNERSHIP_ACT_CERTIFICATE_OF_ORIGIN_NON_TEXTILES", + "UNITED_STATES_NEW_WATCH_WORKSHEET", + "UNITED_STATES_WATCH_REPAIR_DECLARATION" + ] + } + } + }, + "description": "These are documents that are recommended to be included with the shipment.
    Example:ANTIQUE_STATEMENT_EUROPEAN_UNION" + }, + "EmailLabelDetail": { + "type": "object", + "properties": { + "recipients": { + "type": "array", + "description": "This is Email label recipient email address, shipment role, & language locale details. Atleast one entry must be specified.", + "items": { + "$ref": "#/components/schemas/EmailRecipient" + } + }, + "message": { + "type": "string", + "description": "Specifies an optional personalized message to be included in the email to the email label recipient.
    Example: YOUR OPTIONAL MESSAGE", + "example": "your optional message" + } + }, + "description": "These are specific information about the pending email label.
    Required when PendingShipmentType is EMAIL.
    Not applicable for CreateTag." + }, + "EmailRecipient": { + "required": [ + "emailAddress", + "role" + ], + "type": "object", + "properties": { + "emailAddress": { + "type": "string", + "description": "This is recipient email address for notifying the return label. Maximum length 200 characters.
    Example: neenaaaaa@abc.com", + "example": "nnnnneena@fedex.com" + }, + "optionsRequested": { + "$ref": "#/components/schemas/EmailOptionsRequested" + }, + "role": { + "type": "string", + "description": "Relationship that the emailRecipient has to the pending email return label shipments.
    Valid Values: SHIPMENT_COMPLETOR,SHIPMENT_INITIATOR
    Example: SHIPMENT_COMPLETOR", + "enum": [ + "SHIPMENT_COMPLETOR", + "SHIPMENT_INITIATOR" + ], + "example": "SHIPMENT_COMPLETOR" + }, + "locale": { + "type": "string", + "description": "These are locale details.
    Example: 'en_US'
    click here to see locales
    Note: If the locale is left blank or an invalid locale is entered, an error message is returned in response.", + "example": "en_US" + } + }, + "description": "These are the recipient details for the online email return label." + }, + "EmailOptionsRequested": { + "type": "object", + "properties": { + "options": { + "type": "array", + "description": "These are the processing options.", + "example": [ + "PRODUCE_PAPERLESS_SHIPPING_FORMAT", + "SUPPRESS_ACCESS_EMAILS" + ], + "items": { + "type": "string", + "enum": [ + "PRODUCE_PAPERLESS_SHIPPING_FORMAT", + "SUPPRESS_ADDITIONAL_LANGUAGES", + "SUPPRESS_ACCESS_EMAILS" + ] + } + } + }, + "description": "These are to indicate how the email notifications for the pending shipment to be processed." + }, + "UploadDocumentReferenceDetail_1": { + "type": "object", + "properties": { + "documentType": { + "type": "string", + "description": "This is the uploaded document type.", + "example": "PRO_FORMA_INVOICE", + "enum": [ + "CERTIFICATE_OF_ORIGIN", + "COMMERCIAL_INVOICE", + "ETD_LABEL", + "USMCA_CERTIFICATION_OF_ORIGIN", + "NET_RATE_SHEET", + "OTHER", + "PRO_FORMA_INVOICE", + "USMCA_COMMERCIAL_INVOICE_CERTIFICATION_OF_ORIGIN" + ] + }, + "documentReference": { + "type": "string", + "description": "Specify the reference for the uploaded document.
    Example: Reference", + "example": "DocumentReference" + }, + "description": { + "type": "string", + "description": "This is the document description of the attached document.
    Example: PRO FORMA INVOICE", + "example": "PRO FORMA INVOICE" + }, + "documentId": { + "type": "string", + "description": "This is the uploaded document ID value.
    Example: 090927d680038c61", + "example": "090927d680038c61" + } + }, + "description": "Specify the document upload reference details." + }, + "HoldAtLocationDetail": { + "required": [ + "locationId" + ], + "type": "object", + "properties": { + "locationId": { + "type": "string", + "description": "This is an alphanumeric identifier used for Location/Facility Identification.
    Example: YBZA
    Note:
    • For HAL Shipment, Location ID is REQUIRED to ensure packages are delivered to the right location.
    • Use endpoint [Find Location] in [Location Search API], to find the correct location ID for your shipment.
    ", + "example": "YBZA" + }, + "locationContactAndAddress": { + "$ref": "#/components/schemas/ContactAndAddress" + }, + "locationType": { + "type": "string", + "description": "Type of facility at which package/shipment is to be held.
    Example: FEDEX_ONSITE", + "example": "FEDEX_ONSITE", + "enum": [ + "FEDEX_AUTHORIZED_SHIP_CENTER", + "FEDEX_OFFICE", + "FEDEX_SELF_SERVICE_LOCATION", + "FEDEX_STAFFED", + "RETAIL_ALLICANCE_LOCATION", + "FEDEX_GROUND_TERMINAL", + "FEDEX_ONSITE" + ] + } + }, + "description": "Use this object to specify required information for a shipment to be held at destination FedEx location.
    Note: This object HoldAtLocationDetail is Required, when HOLD_AT_LOCATION is chosen in the specialServiceTypes." + }, + "ContactAndAddress": { + "type": "object", + "properties": { + "contact": { + "$ref": "#/components/schemas/Contact_1" + }, + "address": { + "$ref": "#/components/schemas/Address_1" + } + }, + "description": "Specifies the contact and address details of a location.", + "example": { + "address": { + "streetLines": [ + "10 FedEx Parkway", + "Suite 302" + ], + "city": "Beverly Hills", + "stateOrProvinceCode": "CA", + "postalCode": "38127", + "countryCode": "US", + "residential": false + }, + "contact": { + "personName": "person name", + "emailAddress": "email address", + "phoneNumber": "phone number", + "phoneExtension": "phone extension", + "companyName": "company name", + "faxNumber": "fax number" + } + } + }, + "Contact_1": { + "type": "object", + "properties": { + "personName": { + "type": "string", + "description": "Specify contact person name.
    Recommended length is 70.
    Note: There's no specific validation for the person name.
    Example: John Taylor", + "example": "John Taylor" + }, + "emailAddress": { + "type": "string", + "description": "Specify contact email address. Maximum length is 80.
    Example: sample@company.com", + "example": "sample@company.com" + }, + "phoneNumber": { + "type": "string", + "description": "Contact person's phone number.
    Minimum length is 10 and supports maximum of 15 for certain countries using longer phone numbers.
    Note: For US and CA, a phone number must have exactly 10 digits, plus an optional leading country code of '1' or '+1'.
    Example: 918xxxxx890", + "example": "918xxxxx890" + }, + "phoneExtension": { + "type": "string", + "description": "Specify contact phone extension.
    Note: Recommended length is 6. There's no specific validation for the phone extension.
    Example: 1234", + "example": "91" + }, + "faxNumber": { + "type": "string", + "description": "Specify contact fax number.
    Note: Recommended length is 15. There's no specific validation for the fax number.
    Example: 1234567890", + "example": "956123" + }, + "companyName": { + "type": "string", + "description": "Contact person's company name.
    Note: Recommended Length is 35. There's no specific validation for the company name.
    Example: FedEx", + "example": "Fedex" + } + }, + "description": "Indicate the contact details of the shipper.", + "example": { + "personName": "John Taylor", + "emailAddress": "sample@company.com", + "phoneNumber": "1234567890", + "phoneExtension": 1234, + "faxNumber": "1234567890", + "companyName": "Fedex" + } + }, + "ShipmentCODDetail": { + "required": [ + "codCollectionType" + ], + "type": "object", + "properties": { + "addTransportationChargesDetail": { + "$ref": "#/components/schemas/CODTransportationChargesDetail" + }, + "codRecipient": { + "description": "Descriptive data of the Cash On Delivery along with their details of the physical location.", + "allOf": [ + { + "$ref": "#/components/schemas/Party_1" + } + ] + }, + "remitToName": { + "type": "string", + "description": "Specify the name of the person or company receiving the secured/unsecured funds payment
    Example: remitToName", + "example": "remitToName" + }, + "codCollectionType": { + "type": "string", + "description": "Identifies the type of funds FedEx should collect upon shipment delivery
    Example: CASH", + "enum": [ + "ANY", + "CASH", + "GUARANTEED_FUNDS", + "COMPANY_CHECK", + "PERSONAL_CHECK" + ], + "example": "CASH" + }, + "financialInstitutionContactAndAddress": { + "$ref": "#/components/schemas/ContactAndAddress" + }, + "codCollectionAmount": { + "description": "Indicate the COD collection amount.", + "allOf": [ + { + "$ref": "#/components/schemas/Money" + } + ] + }, + "returnReferenceIndicatorType": { + "type": "string", + "description": "Indicates which type of reference information to include on the COD return shipping label.
    Example: INVOICE", + "enum": [ + "INVOICE", + "PO", + "REFERENCE", + "TRACKING" + ], + "example": "INVOICE" + }, + "shipmentCodAmount": { + "description": "Indicate the COD amount for this shipment.", + "allOf": [ + { + "$ref": "#/components/schemas/Money" + } + ] + } + }, + "description": "This is the shipment level COD detail." + }, + "CODTransportationChargesDetail": { + "type": "object", + "properties": { + "rateType": { + "type": "string", + "description": "Specify the Rate Type used.", + "enum": [ + "ACCOUNT", + "LIST", + "ACTUAL", + "CURRENT", + "CUSTOM" + ], + "example": "ACCOUNT" + }, + "rateLevelType": { + "type": "string", + "description": "Specify which level the rate to be applied.", + "enum": [ + "BUNDLED_RATE", + "INDIVIDUAL_PACKAGE_RATE" + ] + }, + "chargeLevelType": { + "type": "string", + "description": "Specify which level the charges to be applied.", + "enum": [ + "CURRENT_PACKAGE", + "SUM_OF_PACKAGES" + ] + }, + "chargeType": { + "type": "string", + "description": "Specify Charge type.", + "enum": [ + "COD_SURCHARGE", + "NET_CHARGE", + "NET_FREIGHT", + "TOTAL_CUSTOMER_CHARGE" + ] + } + }, + "description": "Use this object to specify C.O.D. transportation charges." + }, + "Party_1": { + "type": "object", + "required": [ + "contact" + ], + "properties": { + "address": { + "$ref": "#/components/schemas/PartyAddress" + }, + "contact": { + "$ref": "#/components/schemas/PartyContact" + }, + "accountNumber": { + "$ref": "#/components/schemas/PartyAccountNumber" + }, + "tins": { + "type": "array", + "description": "This is the tax identification number details.", + "items": { + "$ref": "#/components/schemas/TaxpayerIdentification" + } + } + }, + "example": { + "address": { + "streetLines": [ + "10 FedEx Parkway", + "Suite 302" + ], + "city": "Beverly Hills", + "stateOrProvinceCode": "CA", + "postalCode": "90210", + "countryCode": "US", + "residential": false + }, + "contact": { + "personName": "John Taylor", + "emailAddress": "sample@company.com", + "phoneExtension": "000", + "phoneNumber": "XXXX345671", + "companyName": "Fedex" + }, + "accountNumber": { + "value": "Your account number" + }, + "tins": [ + { + "number": "123567", + "tinType": "FEDERAL", + "usage": "usage", + "effectiveDate": "2000-01-23T04:56:07.000+00:00", + "expirationDate": "2000-01-23T04:56:07.000+00:00" + } + ] + } + }, + "ShipmentDryIceDetail_1": { + "type": "object", + "properties": { + "totalWeight": { + "$ref": "#/components/schemas/Weight_1" + }, + "packageCount": { + "type": "integer", + "description": "Indicates the total number of packages in the shipment that contain dry ice.
    Example: 12", + "format": "int32", + "example": 12 + } + }, + "description": "This is the descriptive data required for a FedEx shipment containing dangerous materials. This element is required when SpecialServiceType DRY_ICE is selected.

    Note:

    • Dry Ice is a Package level Special Service for Domestic and International shipments.
    • Dry Ice must be declared at both Shipment and Package level for International MPS shipments to print the compliance statement on Airway Bill labels.

    " + }, + "Weight_1": { + "type": "object", + "properties": { + "units": { + "type": "string", + "description": "For the Dry Ice weight in the shipment the unit of measure must be KG.", + "example": "LB", + "enum": [ + "KG", + "LB" + ] + }, + "value": { + "type": "number", + "description": "Weight Value.
    Example: 68.25
    Click here to see Weight Values.", + "format": "double", + "example": 68.25 + } + }, + "description": "This is the total dry ice weight in all the packages of the shipment.", + "example": { + "units": "LB", + "value": 10 + } + }, + "InternationalControlledExportDetail": { + "required": [ + "type" + ], + "type": "object", + "properties": { + "licenseOrPermitExpirationDate": { + "type": "string", + "description": "Indicate the expiration date for the license or permit. The format is YYYY-MM-DD.
    Example: \"2019-12-03\"", + "example": "2019-12-03" + }, + "licenseOrPermitNumber": { + "type": "string", + "description": "Indicate License Or Permit Number for the commodity being exported.
    Example: 11", + "example": "11" + }, + "entryNumber": { + "type": "string", + "description": "Indicate Entry Number for the export.
    Example: 125", + "example": "125" + }, + "foreignTradeZoneCode": { + "type": "string", + "description": "Indicate the Foreign Trade Zone Code.
    Example: US", + "example": "US" + }, + "type": { + "type": "string", + "description": "International Controlled Export Type
    Example: WAREHOUSE_WITHDRAWAL", + "example": "WAREHOUSE_WITHDRAWAL", + "enum": [ + "DEA_036", + "DEA_236", + "DSP_05", + "DSP_61", + "DSP_73", + "DSP_85", + "DSP_LICENSE_AGREEMENT", + "WAREHOUSE_WITHDRAWAL", + "FROM_FOREIGN_TRADE_ZONE", + "DEA_486", + "DSP_94" + ] + } + }, + "description": "Use this object to specify International Controlled Export shipment Details.
    Note: licenseOrPermitExpirationDate and licenseOrPermitNumber are not required when type is WAREHOUSE_WITHDRAWAL." + }, + "HomeDeliveryPremiumDetail": { + "type": "object", + "properties": { + "phoneNumber": { + "$ref": "#/components/schemas/PhoneNumber1" + }, + "deliveryDate": { + "type": "string", + "description": "This is delivery date. Required for FedEx Date Certain Home Delivery. Valid dates are Monday to Sunday.
    There may be a delay in delivery on Sundays to locations that are geographically difficult to access.
    Example: 2019-06-26", + "example": "2019-06-26" + }, + "homedeliveryPremiumType": { + "type": "string", + "description": "Home Delivery Premium Type. Allows the user to specify additional premimum service options for their home delivery shipment. Customer can specify Evening delivery or a Date certain, or can specify they would like to make an appointment for the delivery.
    Example: APPOINTMENT", + "example": "APPOINTMENT", + "enum": [ + "APPOINTMENT", + "DATE_CERTAIN", + "EVENING" + ] + } + }, + "description": "These are Special service elements for FedEx Ground Home Delivery shipments. If selected, element homedeliveryPremiumType is mandatory. " + }, + "PhoneNumber1": { + "type": "object", + "properties": { + "areaCode": { + "type": "string", + "description": "Area-Code
    Example: 901", + "example": "901" + }, + "localNumber": { + "type": "string", + "description": "Local Number
    Example: 3575012", + "example": "3575012" + }, + "extension": { + "type": "string", + "description": "Extension
    Example: 200", + "example": "200" + }, + "personalIdentificationNumber": { + "type": "string", + "description": "Personal Identification Number
    Example: 98712345", + "example": "98712345" + } + }, + "description": "Indicate the phone number. Only numeric values allowed.
    Note that phoneNumber is mandatory when homedeliveryPremiumType is DATE_CERTAIN or EVENING.", + "example": { + "areaCode": "901", + "localNumber": "3575012", + "extension": "200", + "personalIdentificationNumber": "98712345" + } + }, + "ShipShipmentEMailNotificationDetail": { + "type": "object", + "properties": { + "aggregationType": { + "type": "string", + "description": "Shipment Notification Aggregation Type.
    Example:PER_PACKAGE", + "example": "PER_PACKAGE", + "enum": [ + "PER_PACKAGE", + "PER_SHIPMENT" + ] + }, + "emailNotificationRecipients": { + "type": "array", + "description": "These are email notification recipient details.", + "items": { + "$ref": "#/components/schemas/ShipShipmentEmailNotificationRecipient" + } + }, + "personalMessage": { + "type": "string", + "description": "This is your personal message for the email.
    Note: The maximum personal message character limit depends on the element notificationFormatType values:
    • If notificationFormatType is TEXT, then only 120 characters printed on the email
    • If notificationFormatType is HTML, then 500 characters printed on the email

    Example: This is concerning the order 123456 of 26 July 2021 - art no 34324-23 Teddy Bear, brown", + "example": "your personal message here" + } + }, + "description": "This is used to provide eMail notification information.." + }, + "ShipShipmentEmailNotificationRecipient": { + "required": [ + "emailAddress", + "emailNotificationRecipientType" + ], + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Specify the recipient name.
    Example: Joe Smith", + "example": "Joe Smith" + }, + "emailNotificationRecipientType": { + "type": "string", + "description": "This is the email notification recipient type.
    Example: SHIPPER", + "example": "SHIPPER", + "enum": [ + "BROKER", + "OTHER", + "RECIPIENT", + "SHIPPER", + "THIRD_PARTY" + ] + }, + "emailAddress": { + "type": "string", + "description": "Specify the recipient email address.
    Example: xyz@aol.com", + "example": "jsmith3@aol.com" + }, + "notificationFormatType": { + "type": "string", + "description": "This is the format for the email notification. Either HTML or plain text can be provided.
    Example: TEXT", + "example": "TEXT", + "enum": [ + "HTML", + "TEXT" + ] + }, + "notificationType": { + "type": "string", + "description": "Indicate the type of notification that will be sent as an email
    Example: EMAIL", + "example": "EMAIL", + "enum": [ + "EMAIL" + ] + }, + "locale": { + "type": "string", + "description": "These are the locale details for email.
    Example: en_US, fr_CA, es_MX,.etc.
    click here to see Locales
    Note: If the locale is left blank or an invalid locale is entered, an error message is returned in response.", + "example": "en_US" + }, + "notificationEventType": { + "type": "array", + "description": "These are to specify the notification event types.
    Example: [ON_PICKUP_DRIVER_ARRIVED, ON_SHIPMENT]
    Click here for more information on Notification Event Types.", + "example": [ + "ON_PICKUP_DRIVER_ARRIVED", + "ON_SHIPMENT" + ], + "items": { + "type": "string", + "enum": [ + "ON_DELIVERY", + "ON_EXCEPTION", + "ON_SHIPMENT", + "ON_TENDER", + "ON_ESTIMATED_DELIVERY", + "ON_PICKUP_DRIVER_ARRIVED", + "ON_PICKUP_DRIVER_ASSIGNED", + "ON_PICKUP_DRIVER_DEPARTED", + "ON_PICKUP_DRIVER_EN_ROUTE" + ] + } + } + }, + "description": "These are recipient details for receiving email notification." + }, + "ExpressFreightDetail": { + "type": "object", + "properties": { + "bookingConfirmationNumber": { + "type": "string", + "description": "This is an advanced booking number that must be acquired through the appropriate channel in the shipment origin country. Without the booking number pickup and space allocation for the Express Freight shipment are not guaranteed.
    Minimum length: 5 digits
    Maximum length: 12 digits
    Example: XXXX56789812", + "example": "123456789812" + }, + "shippersLoadAndCount": { + "type": "integer", + "description": "Indicates the content of a container were loaded and counted by the shipper.
    Minimum length: 1 digits
    Maximum length: 5 digits
    Example: If a skid has 32 small boxes on it that are shrinkwrapped, the shippersLoadAndCount should be “32”", + "format": "int32", + "example": 123 + }, + "packingListEnclosed": { + "type": "boolean", + "description": "This indicates whether or not the Packing List is enclosed with the shipment. A packing list is a document that includes details about the contents of a package.
    Example: true", + "example": true + } + }, + "description": "Indicates the advance booking number, shipper load /count and packing list details. This details must be provided by the user during freight shipment." + }, + "VariableHandlingChargeDetail": { + "type": "object", + "properties": { + "rateType": { + "type": "string", + "description": "The rate type indicates what type of rate request is being returned; account, preferred, incentive, etc
    Example: PREFERRED_CURRENCY", + "example": "PREFERRED_CURRENCY", + "enum": [ + "ACCOUNT", + "ACTUAL", + "CURRENT", + "CUSTOM", + "LIST", + "INCENTIVE", + "PREFERRED", + "PREFERRED_INCENTIVE", + "PREFERRED_CURRENCY" + ] + }, + "percentValue": { + "type": "number", + "description": "This is the variable handling percentage. If the percent value is mentioned as 10, it means 10%(multiplier of 0.1).
    Example: 12.45", + "format": "double", + "example": 12.45 + }, + "rateLevelType": { + "type": "string", + "description": "indicates whether or not the rating is being done at the package level, or if the packages are bundled together. At the package level, charges are applied based on the details of each individual package. If they are bundled, one package is chosen as the parent and charges are applied based on that one package.
    Example: INDIVIDUAL_PACKAGE_RATE", + "example": "INDIVIDUAL_PACKAGE_RATE", + "enum": [ + "BUNDLED_RATE", + "INDIVIDUAL_PACKAGE_RATE" + ] + }, + "fixedValue": { + "description": "This is to specify a fixed handling charge on the shipment. The element allows entry of 7 characters before the decimal and 2 characters following the decimal.
    Example: 5.00.", + "allOf": [ + { + "$ref": "#/components/schemas/Money" + }, + { + "required": [ + "amount", + "currency" + ], + "properties": { + "amount": { + "type": "number", + "description": "fixed variable handling charge amount" + }, + "currency": { + "type": "string", + "description": "fixed variable handling charge currency type
    click here to see Currency codes" + } + }, + "example": { + "amount": 24.45, + "currency": "USD" + } + } + ] + }, + "rateElementBasis": { + "type": "string", + "description": "Specify the charge type upon which the variable handling percentage amount is calculated.", + "example": "NET_CHARGE_EXCLUDING_TAXES", + "enum": [ + "NET_CHARGE", + "NET_FREIGHT", + "BASE_CHARGE", + "NET_CHARGE_EXCLUDING_TAXES" + ] + } + }, + "description": "Indicate the details about how to calculate variable handling charges at the shipment level. They can be based on a percentage of the shipping charges or a fixed amount. If indicated, element rateLevelType is required." + }, + "CustomsClearanceDetail": { + "required": [ + "commercialInvoice", + "commodities" + ], + "type": "object", + "properties": { + "regulatoryControls": { + "type": "array", + "description": "These are the regulatory controls applicable to the shipment.
    Example:[USMCA,FOOD_OR_PERISHABLE]", + "example": [ + "NOT_IN_FREE_CIRCULATION", + "USMCA" + ], + "items": { + "type": "string", + "enum": [ + "FOOD_OR_PERISHABLE", + "USMCA", + "NOT_APPLICABLE_FOR_LOW_VALUE_CUSTOMS_EXCEPTIONS", + "NOT_IN_FREE_CIRCULATION" + ] + } + }, + "brokers": { + "type": "array", + "description": "Specify broker information. Use this option only if you are using Broker Select Option for your shipment. A country code must be specified in addition to one of the following address items: postal code, city, or location id.", + "items": { + "$ref": "#/components/schemas/BrokerDetail" + } + }, + "commercialInvoice": { + "$ref": "#/components/schemas/CommercialInvoice" + }, + "freightOnValue": { + "type": "string", + "description": "Specify the risk owner for the Freight shipment.This element is only mandatory or valid for Intra India shipments.
    Example: OWN_RISK", + "example": "OWN_RISK", + "enum": [ + "CARRIER_RISK", + "OWN_RISK" + ] + }, + "dutiesPayment": { + "$ref": "#/components/schemas/Payment_1" + }, + "commodities": { + "type": "array", + "description": "Indicates the details about the dutiable packages. Maximum upto 999 commodities per shipment.", + "items": { + "$ref": "#/components/schemas/Commodity" + } + }, + "isDocumentOnly": { + "type": "boolean", + "description": "Defaults to false. Only used for international Express requests to indicate if just documents are being shipped or not. A valude of DERIVED will cause the value to be determined by PMIS based on the specified commodities information
    Example: false", + "example": true + }, + "recipientCustomsId": { + "$ref": "#/components/schemas/RecipientCustomsId" + }, + "customsOption": { + "$ref": "#/components/schemas/CustomsOptionDetail" + }, + "importerOfRecord": { + "description": "The descriptive data for the importer of Record for the shipment and their physical address, contact and account number information.", + "allOf": [ + { + "$ref": "#/components/schemas/Party_1" + } + ] + }, + "generatedDocumentLocale": { + "type": "string", + "description": "This is the locale for generated document.
    Example: en_US
    click here to see Locales
    Note: If the locale is left blank or an invalid locale is entered, an error message is returned in response.", + "example": "en_US" + }, + "exportDetail": { + "$ref": "#/components/schemas/ExportDetail" + }, + "totalCustomsValue": { + "description": "This is the total customs value.", + "allOf": [ + { + "$ref": "#/components/schemas/Money" + } + ] + }, + "partiesToTransactionAreRelated": { + "type": "boolean", + "description": "Specify if the transacting parties are related." + }, + "declarationStatementDetail": { + "$ref": "#/components/schemas/CustomsDeclarationStatementDetail" + }, + "insuranceCharge": { + "description": "Specify insurance charges if applicable.
    Note: FedEx does not provide insurance of any kind.", + "allOf": [ + { + "$ref": "#/components/schemas/Money" + } + ] + } + }, + "description": "These are customs clearance details. Required for International and intra-country Shipments." + }, + "BrokerDetail": { + "type": "object", + "properties": { + "broker": { + "description": "These are broker details for the shipment with physical address, contact and account number information.", + "allOf": [ + { + "$ref": "#/components/schemas/Party_1" + }, + { + "required": [ + "address", + "contact" + ], + "properties": { + "address": { + "description": "Specifies broker address details." + }, + "contact": { + "description": "Specifies broker contact details." + } + } + } + ] + }, + "type": { + "type": "string", + "description": "Identifies the type of Broker.
    Example: IMPORT", + "example": "IMPORT", + "enum": [ + "IMPORT" + ] + } + }, + "description": "These are broker details for the shipment.", + "example": { + "broker": { + "address": { + "streetLines": [ + "10 FedEx Parkway", + "Suite 302" + ], + "city": "Beverly Hills", + "stateOrProvinceCode": "CA", + "postalCode": "90210", + "countryCode": "US", + "residential": false + }, + "contact": { + "personName": "John Taylor", + "emailAddress": "sample@company.com", + "phoneNumber": "1234567890", + "phoneExtension": 91, + "companyName": "Fedex", + "faxNumber": 1234567 + }, + "accountNumber": { + "value": "Your account number" + }, + "tins": [ + { + "number": "number", + "tinType": "FEDERAL", + "usage": "usage", + "effectiveDate": "2000-01-23T04:56:07.000+00:00", + "expirationDate": "2000-01-23T04:56:07.000+00:00" + } + ], + "deliveryInstructions": "deliveryInstructions" + }, + "type": "IMPORT" + } + }, + "CommercialInvoice": { + "type": "object", + "properties": { + "originatorName": { + "type": "string", + "description": "The originatorName that will populate the Commercial Invoice (or Pro Forma).
    Example: originator name", + "example": "originator Name" + }, + "paymentTerms": { + "description": "The payment terms that will populate the Commercial Invoice (or Pro Forma). This field is being supported for completeness only.
    Example: payment terms", + "type": "string", + "example": "payment terms" + }, + "comments": { + "type": "array", + "description": "The comments that will populate the Commercial Invoice (or Pro Forma). Only the comments specified in the first two indexes of the array will be printed on the invoice and other comments would be ignored as the limitation is set for only two indexes. It considers the comment which is in the first index as a Special Instructions, Hence the comment at first index will be printed under special instructions and the other will be printed at comments section in the Commercial Invoice Document.
    Example: comments", + "example": [ + "optional comments for the commercial invoice" + ], + "items": { + "type": "string" + } + }, + "customerReferences": { + "type": "array", + "description": "These are additional customer reference data for commercial invoice.", + "items": { + "$ref": "#/components/schemas/CustomerReference" + } + }, + "taxesOrMiscellaneousCharge": { + "description": "Indicate the taxes or miscellaneous charges(other than freight charges or insurance charges) that are associated with the shipment.", + "allOf": [ + { + "$ref": "#/components/schemas/Money" + } + ] + }, + "taxesOrMiscellaneousChargeType": { + "type": "string", + "description": "Specifies the Taxes Or Miscellaneous Charge Type
    Example: COMMISSIONS", + "example": "COMMISSIONS", + "enum": [ + "COMMISSIONS", + "DISCOUNTS", + "HANDLING_FEES", + "OTHER", + "ROYALTIES_AND_LICENSE_FEES", + "TAXES" + ] + }, + "freightCharge": { + "description": "Indicates the freight charge added by the shipper/customer for shipping the package. Optional to the customer.", + "allOf": [ + { + "$ref": "#/components/schemas/Money" + } + ] + }, + "packingCosts": { + "description": "Indicates the packing cost added by the shipper/customer for shipping the package. Optional to the customer.", + "allOf": [ + { + "$ref": "#/components/schemas/Money" + } + ] + }, + "handlingCosts": { + "description": "Indicates the packing cost added by the shipper/customer for shipping the package. Optional to the customer.", + "allOf": [ + { + "$ref": "#/components/schemas/Money" + } + ] + }, + "declarationStatement": { + "type": "string", + "description": "This is the declaration statement which will populate the Commercial Invoice (or Pro Forma).
    Maximum length is 554.
    Example: declarationStatement", + "example": "declarationStatement" + }, + "termsOfSale": { + "type": "string", + "description": "The termsOfSale that will populate the Commercial Invoice (or Pro Forma). Max length is 3
    Example: FCA", + "example": "FCA" + }, + "specialInstructions": { + "type": "string", + "description": "These are special instructions that will be populated on the Commercial Invoice (or Pro Forma).
    Example: specialInstructions", + "example": "specialInstructions\"" + }, + "shipmentPurpose": { + "type": "string", + "description": "The reason for the shipment. Note: SOLD is not a valid purpose for a Proforma Invoice.
    Example: REPAIR_AND_RETURN", + "example": "REPAIR_AND_RETURN", + "enum": [ + "GIFT", + "NOT_SOLD", + "PERSONAL_EFFECTS", + "REPAIR_AND_RETURN", + "SAMPLE", + "SOLD" + ] + }, + "emailNotificationDetail": { + "$ref": "#/components/schemas/ShipEmailDispositionDetail" + } + }, + "description": "Use this object to provide Commercial Invoice details. This element is required for electronic upload of CI data. It will serve to create/transmit an electronic Commercial Invoice through the FedEx system.
    Customers are responsible for printing their own Commercial Invoice.
    If you would like FedEx to generate a Commercial Invoice and transmit it to Customs for clearance purposes, you need to specify that in the ETDDetail/RequestedDocumentCopies element.
    Supports maximum of 99 commodity line items." + }, + "CustomerReference": { + "type": "object", + "properties": { + "customerReferenceType": { + "type": "string", + "description": "This is a customer reference type. Note: Use type Type, RMA_ASSOCIATION and value as the RMA Number to associate Ground Call Tag shipments to the outbound shipment.
    Example: DEPARTMENT_NUMBER", + "example": "DEPARTMENT_NUMBER", + "enum": [ + "CUSTOMER_REFERENCE", + "DEPARTMENT_NUMBER", + "INVOICE_NUMBER", + "P_O_NUMBER", + "INTRACOUNTRY_REGULATORY_REFERENCE", + "RMA_ASSOCIATION" + ] + }, + "value": { + "type": "string", + "description": "This is a customer reference type value.
    Example: 3686
    • The P_O_NUMBER value must be specified in customerReferences under requestedPackageLineItems
    • The INVOICE_NUMBER value that is printed on the FedEx-supplied invoice must be specified in customerReferences under commercialInvoice. Value defined in this section will print on the label that is attached to the package
    • The RMA value sent by the customer is returned on the label in human readable form but also as a barcode. RMA_ASSOCIATION only prints on the label as a barcode for a Return shipment.
    NOTE:
    • INTRACOUNTRY_REGULATORY_REFERENCE is applicable only in Intra-Brazil.
    • Maximum length varies for value field depending on customerReferenceType.
    Maximum length for value is as follows:
    • CUSTOMER_REFERENCE - 40(Express), 30(Ground)
    • DEPARTMENT_NUMBER - 30
    • INVOICE_NUMBER - 30
    • P_O_NUMBER - 30
    • INTRACOUNTRY_REGULATORY_REFERENCE - 30
    • RMA_ASSOCIATION - 20
    • ", + "example": "3686" + } + } + }, + "ShipEmailDispositionDetail": { + "type": "object", + "properties": { + "emailAddress": { + "type": "string", + "description": "This is email Address.
      Example: xxxx@xxx.com", + "example": "neena@fedex.com" + }, + "type": { + "type": "string", + "description": "Specify the email status.
      Example: EMAILED", + "example": "EMAILED" + }, + "recipientType": { + "type": "string", + "description": "Specify the recipient Type.
      Example: SHIPPER/BROKER", + "example": "SHIPPER" + } + }, + "description": "These are email disposition details. Provides the type and email addresses of e-mail recipients. If returnedDispositionDetail in labelSpecification is set as true then email will be send with label and documents copy." + }, + "Payment_1": { + "type": "object", + "properties": { + "payor": { + "$ref": "#/components/schemas/Payor_1" + }, + "billingDetails": { + "$ref": "#/components/schemas/BillingDetails" + }, + "paymentType": { + "type": "string", + "description": "Indicates who and how the shipment will be paid for.Required for Express and Ground.
      Example: SENDER", + "enum": [ + "SENDER", + "RECIPIENT", + "THIRD_PARTY", + "COLLECT" + ], + "example": "SENDER" + } + }, + "description": "This is a payment type, basically indicates who is the payor for the shipment.Conditional required for International Shipments", + "example": { + "payor": { + "responsibleParty": { + "address": { + "streetLines": [ + "10 FedEx Parkway", + "Suite 302" + ], + "city": "Beverly Hills", + "stateOrProvinceCode": "CA", + "postalCode": "38127", + "countryCode": "US", + "residential": false + }, + "contact": { + "personName": "John Taylor", + "emailAddress": "sample@company.com", + "phoneNumber": "1234567890", + "phoneExtension": "phone extension", + "companyName": "Fedex", + "faxNumber": "fax number" + }, + "accountNumber": { + "value": "Your account number" + }, + "tins": [ + { + "number": "number", + "tinType": "FEDERAL", + "usage": "usage", + "effectiveDate": "2024-06-13", + "expirationDate": "2024-06-13" + }, + { + "number": "number", + "tinType": "FEDERAL", + "usage": "usage", + "effectiveDate": "2024-06-13", + "expirationDate": "2024-06-13" + } + ] + } + }, + "billingDetails": { + "billingCode": "billingCode", + "billingType": "billingType", + "aliasId": "aliasId", + "accountNickname": "accountNickname", + "accountNumber": "Your account number", + "accountNumberCountryCode": "US" + }, + "paymentType": "SENDER" + } + }, + "Payor_1": { + "type": "object", + "properties": { + "responsibleParty": { + "$ref": "#/components/schemas/Party_2" + } + }, + "description": "Information about the person who is paying for the shipment. Not applicable for credit card payment. ", + "example": { + "responsibleParty": { + "address": { + "streetLines": [ + "10 FedEx Parkway", + "Suite 302" + ], + "city": "Beverly Hills", + "stateOrProvinceCode": "CA", + "postalCode": "38127", + "countryCode": "US", + "residential": false + }, + "contact": { + "personName": "John Taylor", + "emailAddress": "sample@company.com", + "phoneNumber": "1234567890", + "phoneExtension": "phone extension", + "companyName": "Fedex", + "faxNumber": "fax number" + }, + "accountNumber": { + "value": "Your account number" + }, + "tins": [ + { + "number": "number", + "tinType": "FEDERAL", + "usage": "usage", + "effectiveDate": "2000-01-23T04:56:07.000+00:00", + "expirationDate": "2000-01-23T04:56:07.000+00:00" + }, + { + "number": "number", + "tinType": "FEDERAL", + "usage": "usage", + "effectiveDate": "2000-01-23T04:56:07.000+00:00", + "expirationDate": "2000-01-23T04:56:07.000+00:00" + } + ] + } + } + }, + "Party_2": { + "type": "object", + "properties": { + "address": { + "$ref": "#/components/schemas/Address_1" + }, + "contact": { + "$ref": "#/components/schemas/Contact_1" + }, + "accountNumber": { + "$ref": "#/components/schemas/PartyAccountNumber_1" + }, + "tins": { + "type": "array", + "description": "This is the tax identification number details.", + "items": { + "$ref": "#/components/schemas/TaxpayerIdentification" + } + } + }, + "description": "Use this object to provide the attributes such as physical address, contact information and account number information.", + "example": { + "address": { + "streetLines": [ + "10 FedEx Parkway", + "Suite 302" + ], + "city": "Beverly Hills", + "stateOrProvinceCode": "CA", + "postalCode": "38127", + "countryCode": "US", + "residential": false + }, + "contact": { + "personName": "John Taylor", + "emailAddress": "sample@company.com", + "phoneNumber": "1234567890", + "phoneExtension": "phone extension", + "companyName": "Fedex", + "faxNumber": "fax number" + }, + "accountNumber": { + "value": "Your account number" + }, + "tins": [ + { + "number": "number", + "tinType": "FEDERAL", + "usage": "usage", + "effectiveDate": "2000-01-23T04:56:07.000+00:00", + "expirationDate": "2000-01-23T04:56:07.000+00:00" + }, + { + "number": "number", + "tinType": "FEDERAL", + "usage": "usage", + "effectiveDate": "2000-01-23T04:56:07.000+00:00", + "expirationDate": "2000-01-23T04:56:07.000+00:00" + } + ] + } + }, + "BillingDetails": { + "type": "object", + "properties": { + "billingCode": { + "type": "string", + "description": "Indicates a billing code." + }, + "billingType": { + "type": "string", + "description": "These are duties and taxes billing type." + }, + "aliasId": { + "type": "string", + "description": "This is bill to alias identifier." + }, + "accountNickname": { + "type": "string", + "description": "This is account nick name." + }, + "accountNumber": { + "type": "string", + "description": "This is bill to account number." + }, + "accountNumberCountryCode": { + "type": "string", + "description": "This is the country code of the account number.
      Example: CA" + } + }, + "description": "These are billing details.", + "example": { + "billingCode": "128345", + "billingType": "billingType", + "aliasId": "alias identifier", + "accountNickname": "accountNickname", + "accountNumber": "Your account number", + "accountNumberCountryCode": "CA" + } + }, + "Commodity": { + "required": [ + "description" + ], + "type": "object", + "properties": { + "unitPrice": { + "description": "This is the unit price.", + "allOf": [ + { + "$ref": "#/components/schemas/Money" + } + ] + }, + "additionalMeasures": { + "type": "array", + "description": "This object contains additional quantitative information other than weight and quantity to calculate duties and taxes.", + "items": { + "$ref": "#/components/schemas/AdditionalMeasures" + } + }, + "numberOfPieces": { + "type": "integer", + "description": "Indicate the number of pieces associated with the commodity. The value can neither be negative nor exceed 9,999.
      Example: 12", + "format": "int32", + "example": 12 + }, + "quantity": { + "type": "integer", + "description": "This is the units quantity (using quantityUnits as the unit of measure) per commodity. This is used to estimate duties and taxes.
      Example: 125", + "format": "int32", + "example": 125 + }, + "quantityUnits": { + "type": "string", + "description": "This is the unit of measure for the units quantity. This is used to estimate duties and taxes.
      Example: EA
      click here to see Commodity Unit Measures", + "example": "Ea" + }, + "customsValue": { + "description": "This customs value is applicable for all items(or units) under the specified commodity.", + "allOf": [ + { + "$ref": "#/components/schemas/Customs_Money" + } + ] + }, + "countryOfManufacture": { + "type": "string", + "description": "This is commodity country of manufacture. This is required for International shipments. Maximum allowed length is 4.
      Example: US
      click here to see Country codes", + "example": "US" + }, + "cIMarksAndNumbers": { + "type": "string", + "description": "This is an identifying mark or number used on the packaging of a shipment to help customers identify a particular shipment
      Example: 87123", + "example": "87123" + }, + "harmonizedCode": { + "type": "string", + "description": "This is to specify the Harmonized Tariff System (HTS) code to meet U.S. and foreign governments' customs requirements. These are mainly used to estimate the duties and taxes.
      Example: 0613
      To research the classification for your commodity, use the FedEx Global Trade Manager online at fedex.com/gtm. You will find country-specific information to determine whether your commodity is considered to be a document or non-document for your destination.", + "example": "0613" + }, + "description": { + "type": "string", + "description": "Required
      ScrewsMaximum allowed 450 characters.
      Example: description", + "example": "description" + }, + "name": { + "type": "string", + "description": "This is Commodity name.
      Example: Non-Threaded Rivets", + "example": "non-threaded rivets" + }, + "weight": { + "$ref": "#/components/schemas/Weight_4" + }, + "exportLicenseNumber": { + "type": "string", + "description": "This is the export license number for the shipment.
      Example: 26456", + "example": "26456" + }, + "exportLicenseExpirationDate": { + "type": "string", + "description": "Specify the export license expiration date for the shipment.
      Format YYYY-MM-DD
      Example : 2009-04-12", + "format": "date-time" + }, + "partNumber": { + "type": "string", + "description": "This is a part number.
      Example: 167", + "example": "167" + }, + "purpose": { + "type": "string", + "description": "This field is used for calculation of duties and taxes.

      Valid values are : BUSINESS and CONSUMER.
      Example:BUSINESS", + "example": "BUSINESS", + "enum": [ + "BUSINESS", + "CONSUMER" + ] + }, + "usmcaDetail": { + "$ref": "#/components/schemas/UsmcaDetail" + } + } + }, + "AdditionalMeasures": { + "type": "object", + "properties": { + "quantity": { + "type": "number", + "description": "Specify commodity quantity.", + "format": "double", + "example": 12.45 + }, + "units": { + "type": "string", + "description": "Unit of measure used to express the quantity of this commodity line item.", + "example": "KG" + } + } + }, + "Weight": { + "required": [ + "units", + "value" + ], + "type": "object", + "properties": { + "units": { + "type": "string", + "description": "Specifies the package weight unit type.
      Example:KG", + "example": "KG", + "enum": [ + "KG", + "LB" + ] + }, + "value": { + "type": "number", + "description": "Weight Value.
      Example: 68.25
      Click here to see Weight Values.", + "format": "double", + "example": 68.25 + } + }, + "description": "These are the package weight details.
      Note: Weight is not required for One rate shipments", + "example": { + "units": "KG", + "value": 68 + } + }, + "Weight_4": { + "required": [ + "units", + "value" + ], + "type": "object", + "properties": { + "units": { + "type": "string", + "description": "Indicate the weight unit type. The package and commodity weight unit should be the same else the request will result in an error.", + "example": "KG", + "enum": [ + "KG", + "LB" + ] + }, + "value": { + "type": "number", + "description": "Weight Value.
      Example: 68.25", + "format": "double", + "example": 68.25 + } + }, + "description": "It is the total weight of the commodity.
      Note: Weight is not required for One rate shipments", + "example": { + "units": "KG", + "value": 68 + } + }, + "Weight_3": { + "required": [ + "units", + "value" + ], + "type": "object", + "properties": { + "units": { + "type": "string", + "description": "Indicate the weight unit type. The package and commodity weight unit should be the same else the request will result in an error.
      Example:KG", + "example": "KG", + "enum": [ + "KG", + "LB" + ] + }, + "value": { + "type": "number", + "description": "Weight Value.
      Example: 68.25
      ", + "format": "double", + "example": 68.25 + } + }, + "description": "These are the package weight details.
      Note: Weight is not required for One rate shipments", + "example": { + "units": "KG", + "value": 68 + } + }, + "UsmcaDetail": { + "type": "object", + "properties": { + "originCriterion": { + "type": "string", + "description": "Specify the origin criterion.", + "enum": [ + "A", + "B", + "C", + "D", + "E" + ] + } + }, + "description": "Indicates the USMCA detail" + }, + "RecipientCustomsId": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "This is ID Type.", + "example": "PASSPORT", + "enum": [ + "COMPANY", + "INDIVIDUAL", + "PASSPORT" + ] + }, + "value": { + "type": "string", + "description": "This is the ID number.", + "example": "123" + } + }, + "description": "Use this element to provide valid identification details. Used for populating brazil tax id." + }, + "CustomsOptionDetail": { + "type": "object", + "properties": { + "description": { + "type": "string", + "description": "Specify additional description about customs options. This is a required field when the Type is OTHER.", + "example": "Description" + }, + "type": { + "type": "string", + "description": "Specify the reason for a global return, as recognized by Customs. Valid values:
      • COURTESY_RETURN_LABEL: Applicable for Outbound shipments.
      • EXHIBITION_TRADE_SHOW: For exhibition or trade-show, outbound and inbound.
      • FAULTY_ITEM: For faulty item being returned, inbound only.
      • FOLLOWING_REPAIR: For repaired or processed item being sent, outbound only.
      • FOR_REPAIR: For repair or processing, outbound and inbound.
      • ITEM_FOR_LOAN: For loan item, outbound and inbound.
      • OTHER: Other reason, outbound and inbound. This type requires a description.
      • REJECTED: For rejected merchandise being returned, inbound.
      • REPLACEMENT: For replacement being sent, outbound only.
      • TRIAL: For use in a trial, outbound and inbound.
      ", + "example": "COURTESY_RETURN_LABEL", + "enum": [ + "COURTESY_RETURN_LABEL", + "EXHIBITION_TRADE_SHOW", + "FAULTY_ITEM", + "FOLLOWING_REPAIR", + "FOR_REPAIR", + "ITEM_FOR_LOAN", + "OTHER", + "REJECTED", + "REPLACEMENT", + "TRIAL" + ] + } + }, + "description": "These are customs Option Detail, type must be indicated for each occurrence.", + "example": { + "description": "Description", + "type": "COURTESY_RETURN_LABEL" + } + }, + "ExportDetail": { + "type": "object", + "properties": { + "destinationControlDetail": { + "$ref": "#/components/schemas/DestinationControlDetail" + }, + "b13AFilingOption": { + "type": "string", + "description": "Specify the filing option being exercised. Required for non-document shipments originating in Canada destinated for any country other than Canada, the United States, Puerto Rico, or the U.S. Virgin Islands.", + "example": "NOT_REQUIRED", + "enum": [ + "NOT_REQUIRED", + "MANUALLY_ATTACHED", + "FILED_ELECTRONICALLY", + "SUMMARY_REPORTING", + "FEDEX_TO_STAMP" + ] + }, + "exportComplianceStatement": { + "type": "string", + "description": "For US export shipments requiring an EEI, enter the ITN number received from AES when you filed your shipment or the FTR (Foreign Trade Regulations) exemption number.The proper format for an ITN number is AES XYYYYMMDDNNNNNN where YYYYMMDD is date and NNNNNN are numbers generated by the AES.
      Example: AESX20220714987654
      Note: The ITN or FTR exemption number you submit in the ship request prints on the international shipping label.

      For CA export shipments,it can be Proof of report number(15-32 alphanumeric) , Summary proof of report number(7-32 alphanumeric) or Exemption number(2 digit) based on the selected b13AFilingOption.
      Example: 98765432107654321(POR number), 7654321(Summary POR number) and 02(Exemption number).
      For FTR exemption number you need provide a predefined value as NO_EEI_30_37_A.", + "example": "12345678901234567" + }, + "permitNumber": { + "type": "string", + "description": "This is a Permit Number. This field is applicable only to Canada export non-document shipments of any value to any destination. No special characters are allowed.
      Example: 12345", + "example": "12345" + } + }, + "description": "These are export Detail used for US or CA exports." + }, + "DestinationControlDetail": { + "required": [ + "statementTypes" + ], + "type": "object", + "properties": { + "endUser": { + "type": "string", + "description": "Specify End User name. Its is required if StatementTypes is entered as DEPARTMENT_OF_STATE.
      Example: John Wick", + "example": "dest country user" + }, + "statementTypes": { + "type": "string", + "description": "Specify appropriate destination control statement type(s), Also make sure to specify destination country and end user.", + "example": "DEPARTMENT_OF_COMMERCE", + "enum": [ + "DEPARTMENT_OF_COMMERCE", + "DEPARTMENT_OF_STATE" + ] + }, + "destinationCountries": { + "type": "array", + "description": "Specify DCS shipment destination country. You may enter up to four country codes in this element. Up to 11 alphanumeric characters are allowed.
      Example: US
      click here to see Country codes", + "example": [ + "USA", + "India" + ], + "items": { + "type": "string" + } + } + }, + "description": "Use this object to specify the appropriate destination control statement type(s). Also make sure to specify destination country and end user." + }, + "CustomsDeclarationStatementDetail": { + "required": [ + "usmcaLowValueStatementDetail" + ], + "type": "object", + "properties": { + "usmcaLowValueStatementDetail": { + "$ref": "#/components/schemas/UsmcaLowValueStatementDetail" + } + }, + "description": "Specifies about the statements to be declared for Customs. " + }, + "UsmcaLowValueStatementDetail": { + "required": [ + "customsRole" + ], + "type": "object", + "properties": { + "countryOfOriginLowValueDocumentRequested": { + "type": "boolean", + "description": "Specify the country Of Origin of Low Value Document for Customs declaration.
      Example:true", + "example": true + }, + "customsRole": { + "type": "string", + "description": "Customs Role Type.
      Example: EXPORTER", + "example": "EXPORTER", + "enum": [ + "EXPORTER", + "IMPORTER" + ] + } + }, + "description": "Specify the low Value statement necessary for printing the USMCA for Customs documentation." + }, + "SmartPostInfoDetail": { + "required": [ + "hubId", + "indicia" + ], + "type": "object", + "properties": { + "ancillaryEndorsement": { + "type": "string", + "description": "Required for Presorted Standard but not for returns or parcel select. They are not all usable for all ancillary endorsements.
      Example: RETURN_SERVICE", + "example": "RETURN_SERVICE", + "enum": [ + "ADDRESS_CORRECTION", + "CARRIER_LEAVE_IF_NO_RESPONSE", + "CHANGE_SERVICE", + "FORWARDING_SERVICE", + "RETURN_SERVICE" + ] + }, + "hubId": { + "type": "string", + "description": "Required
      Specify the HubID using the four-digit numeric value.
      Example: 5015", + "example": "5015" + }, + "indicia": { + "type": "string", + "description": "Specify the indicia type.
      Available options include:
      • MEDIA_MAIL
      • PARCEL_SELECT (1 LB through 70 LB)
      • PRESORTED_BOUND_PRINTED_MATTER
      • PRESORTED_STANDARD (less than 1 LB)
      • PARCEL_RETURN
      Example:PRESORTED_STANDARD", + "example": "PRESORTED_STANDARD", + "enum": [ + "MEDIA_MAIL", + "PARCEL_RETURN", + "PARCEL_SELECT", + "PRESORTED_BOUND_PRINTED_MATTER", + "PRESORTED_STANDARD" + ] + }, + "specialServices": { + "type": "string", + "description": "SmartPost Shipment Special Service Type
      Example: USPS_DELIVERY_CONFIRMATION", + "example": "USPS_DELIVERY_CONFIRMATION", + "enum": [ + "USPS_DELIVERY_CONFIRMATION" + ] + } + }, + "description": "Use this object to specify the smartpost shipment details.
      Required for SMARTPOST service. If SmartPostInfoDetail is indicated, the elements below it are also required." + }, + "LabelSpecification": { + "required": [ + "imageType", + "labelStockType" + ], + "type": "object", + "properties": { + "labelFormatType": { + "type": "string", + "description": "Specifies the label Format Type
      Example: COMMON2D", + "example": "COMMON2D", + "enum": [ + "COMMON2D", + "LABEL_DATA_ONLY" + ] + }, + "labelOrder": { + "type": "string", + "description": "This is the order of the Shipping label/documents to be generated.", + "example": "SHIPPING_LABEL_FIRST", + "enum": [ + "SHIPPING_LABEL_FIRST", + "SHIPPING_LABEL_LAST" + ] + }, + "customerSpecifiedDetail": { + "$ref": "#/components/schemas/CustomerSpecifiedLabelDetail" + }, + "printedLabelOrigin": { + "$ref": "#/components/schemas/ContactAndAddress" + }, + "labelStockType": { + "type": "string", + "description": "Label Stock Type.
      Example: PAPER_7X475", + "example": "PAPER_7X475", + "enum": [ + "PAPER_4X6", + "STOCK_4X675", + "PAPER_4X675", + "PAPER_4X8", + "PAPER_4X9", + "PAPER_7X475", + "PAPER_85X11_BOTTOM_HALF_LABEL", + "PAPER_85X11_TOP_HALF_LABEL", + "PAPER_LETTER", + "STOCK_4X675_LEADING_DOC_TAB", + "STOCK_4X8", + "STOCK_4X9_LEADING_DOC_TAB", + "STOCK_4X6", + "STOCK_4X675_TRAILING_DOC_TAB", + "STOCK_4X9_TRAILING_DOC_TAB", + "STOCK_4X9", + "STOCK_4X85_TRAILING_DOC_TAB", + "STOCK_4X105_TRAILING_DOC_TAB" + ] + }, + "labelRotation": { + "type": "string", + "description": "This is applicable only to documents produced on thermal printers with roll stock.", + "example": "UPSIDE_DOWN", + "enum": [ + "LEFT", + "RIGHT", + "UPSIDE_DOWN", + "NONE" + ] + }, + "imageType": { + "type": "string", + "description": "Specifies the image type of this shipping document.
      Example:PDF", + "example": "PDF", + "enum": [ + "ZPLII", + "EPL2", + "PDF", + "PNG" + ] + }, + "labelPrintingOrientation": { + "type": "string", + "description": "This is applicable only to documents produced on thermal printers with roll stock.", + "example": "TOP_EDGE_OF_TEXT_FIRST", + "enum": [ + "BOTTOM_EDGE_OF_TEXT_FIRST", + "TOP_EDGE_OF_TEXT_FIRST" + ] + }, + "returnedDispositionDetail": { + "type": "string", + "description": "Specifies a particular way in which a kind of shipping document is to be produced and provided
      Example:RETURNED", + "example": "RETURNED" + }, + "resolution": { + "type": "integer", + "description": "Specifies the image resolution in DPI (Dots Per Inch). Valid values are 203 & 300. If not provided or for any other value, system will default it to 203.Note: 300 DPI resolution is only allowed for ZPLII image type.", + "example": 300 + } + }, + "description": "These are label specification details includes the image type, printer format, and label stock for label. Can also specify specific details such as doc-tab content, regulatory labels, and masking data on the label." + }, + "CustomerSpecifiedLabelDetail": { + "type": "object", + "properties": { + "maskedData": { + "type": "array", + "description": "Controls which data/sections will be suppressed.
      Example: TOTAL_WEIGHT", + "example": [ + "PACKAGE_SEQUENCE_AND_COUNT", + "TOTAL_WEIGHT" + ], + "items": { + "type": "string", + "default": "SHIPPER_INFORMATION", + "enum": [ + "CUSTOMS_VALUE", + "SHIPPER_ACCOUNT_NUMBER", + "DIMENSIONS", + "DUTIES_AND_TAXES_PAYOR_ACCOUNT_NUMBER", + "INSURED_VALUE", + "SECONDARY_BARCODE", + "SHIPPER_INFORMATION", + "TERMS_AND_CONDITIONS", + "TOTAL_WEIGHT", + "TRANSPORTATION_CHARGES_PAYOR_ACCOUNT_NUMBER" + ] + } + }, + "regulatoryLabels": { + "type": "array", + "description": "Specify how the regulatory details to be provided on the labels.", + "items": { + "$ref": "#/components/schemas/RegulatoryLabelContentDetail" + } + }, + "additionalLabels": { + "type": "array", + "description": "Specify how the additional details to be provided on the labels.", + "items": { + "$ref": "#/components/schemas/AdditionalLabelsDetail" + } + }, + "docTabContent": { + "$ref": "#/components/schemas/DocTabContent" + } + }, + "description": "This object allows the control of label content for customization." + }, + "RegulatoryLabelContentDetail": { + "type": "object", + "properties": { + "generationOptions": { + "type": "string", + "description": "Specify the regulatory content preference to be displayed on the label.", + "example": "CONTENT_ON_SHIPPING_LABEL_ONLY", + "enum": [ + "CONTENT_ON_SHIPPING_LABEL_PREFERRED", + "CONTENT_ON_SUPPLEMENTAL_LABEL_ONLY", + "CONTENT_ON_SHIPPING_LABEL_ONLY" + ] + }, + "type": { + "type": "string", + "description": "Specify the type of regulatory content to be added on the label.", + "example": "ALCOHOL_SHIPMENT_LABEL", + "enum": [ + "ALCOHOL_SHIPMENT_LABEL" + ] + } + } + }, + "AdditionalLabelsDetail": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Specify the type of additional details to be added on the label.
      Example:MANIFEST", + "example": "MANIFEST", + "enum": [ + "BROKER", + "CONSIGNEE", + "CUSTOMS", + "DESTINATION", + "DESTINATION_CONTROL_STATEMENT", + "FREIGHT_REFERENCE", + "MANIFEST", + "ORIGIN", + "RECIPIENT", + "SECOND_ADDRESS", + "SHIPPER" + ] + }, + "count": { + "type": "integer", + "description": "Specifies the count of label to return.
      Example:1", + "example": 1 + } + } + }, + "DocTabContent": { + "type": "object", + "properties": { + "docTabContentType": { + "type": "string", + "description": "Indicates the content type of the doc tab.", + "example": "BARCODED", + "enum": [ + "BARCODED", + "CUSTOM", + "MINIMUM", + "STANDARD", + "ZONE001" + ] + }, + "zone001": { + "$ref": "#/components/schemas/DocTabContentZone001" + }, + "barcoded": { + "$ref": "#/components/schemas/DocTabContentBarcoded" + } + }, + "description": "Specifies details of doc tab content.It is only applicable only with imageType as ZPLII." + }, + "DocTabContentZone001": { + "type": "object", + "properties": { + "docTabZoneSpecifications": { + "type": "array", + "description": "Indicate the doc tab specifications for the individual doc tab zone on the label.", + "items": { + "$ref": "#/components/schemas/DocTabZoneSpecification" + } + } + }, + "description": "Indicate the doc tab specification for different zones on the label. The specification includes zone number, header and data field to be displayed on the label." + }, + "DocTabZoneSpecification": { + "type": "object", + "properties": { + "zoneNumber": { + "type": "integer", + "description": "It is a non-negative integer that represents the portion of doc-tab in a label.
      Example: 1", + "format": "int32" + }, + "header": { + "type": "string", + "description": "Indicates the parameter name in the header for the doc tab zone. The maximum charater limit is 7.
      Example: WHT" + }, + "dataField": { + "type": "string", + "description": "Indicate the path request/reply element to be printed on doc tab.
      Example:
      • REQUEST/PACKAGE/weight/Value
      • REQUEST/PACKAGE/weight/Value
      • REQUEST/PACKAGE/InsuredValue/Amount
      • REQUEST/SHIPMENT/SpecialServicesRequested/CodDetail/CodCollectionAmount/Amount
      • REQUEST/SHIPMENT/Shipper/Address/StreetLines[1]CLIENT/MeterNumber
      • TRANSACTION/CustomerTransactionId
      • REQUEST/SHIPMENT/TotalWeight/Value
      • REQUEST/SHIPMENT/ShipTimestamp
      • REQUEST/SHIPMENT/Recipient/Contact/PersonName
      • REPLY/SHIPMENT/OperationalDetail/DeliveryDate
      • REPLY/SHIPMENT/RATES/ACTUAL/totalBaseCharge/Amount
      • REPLY/SHIPMENT/RATES/ACTUAL/totalFreightDiscounts/Amount
      • REPLY/SHIPMENT/RATES/ACTUAL/totalSurcharges/Amount
      • REPLY/SHIPMENT/RATES/ACTUAL/totalNetCharge/Amount
      • REPLY/SHIPMENT/RATES/PAYOR_ACCOUNT_PACKAGE/totalSurcharges/Amount
      " + }, + "literalValue": { + "type": "string", + "description": "Indicates the actual data to be printed in the label
      " + }, + "justification": { + "type": "string", + "description": "Indicates the justification format for the string.", + "example": "RIGHT", + "enum": [ + "LEFT", + "RIGHT" + ] + } + }, + "description": "Indicates the doc tab zone specification." + }, + "DocTabContentBarcoded": { + "type": "object", + "properties": { + "symbology": { + "type": "string", + "description": "Indicates the type of barcode symbology used on FedEx documents and labels.", + "example": "UCC128", + "enum": [ + "CODABAR", + "CODE128", + "CODE128_WIDEBAR", + "CODE128B", + "CODE128C", + "CODE39", + "CODE93", + "I2OF5", + "MANUAL", + "PDF417", + "POSTNET", + "QR_CODE", + "UCC128" + ] + }, + "specification": { + "$ref": "#/components/schemas/DocTabZoneSpecification" + } + }, + "description": "It is a doc tab content type which is in barcoded format." + }, + "ShippingDocumentSpecification": { + "type": "object", + "properties": { + "generalAgencyAgreementDetail": { + "$ref": "#/components/schemas/GeneralAgencyAgreementDetail" + }, + "returnInstructionsDetail": { + "$ref": "#/components/schemas/ReturnInstructionsDetail" + }, + "op900Detail": { + "$ref": "#/components/schemas/Op900Detail" + }, + "usmcaCertificationOfOriginDetail": { + "$ref": "#/components/schemas/UsmcaCertificationOfOriginDetail" + }, + "usmcaCommercialInvoiceCertificationOfOriginDetail": { + "$ref": "#/components/schemas/UsmcaCommercialInvoiceCertificationOfOriginDetail" + }, + "shippingDocumentTypes": { + "type": "array", + "description": "Conditionally required in order to obtain shipping documents.Indicates the types of shipping documents requested by the shipper
      Example:RETURN_INSTRUCTIONS", + "example": [ + "RETURN_INSTRUCTIONS" + ], + "items": { + "type": "string", + "enum": [ + "CERTIFICATE_OF_ORIGIN", + "COMMERCIAL_INVOICE", + "CUSTOM_PACKAGE_DOCUMENT", + "CUSTOM_SHIPMENT_DOCUMENT", + "CUSTOMER_SPECIFIED_LABELS", + "EXPORT_DECLARATION", + "GENERAL_AGENCY_AGREEMENT", + "LABEL", + "USMCA_CERTIFICATION_OF_ORIGIN", + "OP_900", + "PENDING_SHIPMENT_EMAIL_NOTIFICATION", + "PRO_FORMA_INVOICE", + "RETURN_INSTRUCTIONS", + "USMCA_COMMERCIAL_INVOICE_CERTIFICATION_OF_ORIGIN" + ] + } + }, + "certificateOfOrigin": { + "$ref": "#/components/schemas/CertificateOfOriginDetail" + }, + "commercialInvoiceDetail": { + "$ref": "#/components/schemas/CommercialInvoiceDetail" + } + }, + "description": "Use this object to provide all data required for additional (non-label) shipping documents to be produced." + }, + "GeneralAgencyAgreementDetail": { + "type": "object", + "properties": { + "documentFormat": { + "$ref": "#/components/schemas/ShippingDocumentFormat" + } + }, + "description": "Use this object to specify details to generate general agency agreement detail." + }, + "ShippingDocumentFormat": { + "type": "object", + "properties": { + "provideInstructions": { + "type": "boolean", + "description": "For those shipping document types which have both a \"form\" and \"instructions\" component (e.g General Agency Agreement), this field indicates whether to provide the instructions.
      Example: true", + "example": true + }, + "optionsRequested": { + "$ref": "#/components/schemas/DocumentFormatOptionsRequested" + }, + "stockType": { + "type": "string", + "description": "Specifies the label stock type. Lists the correct type of paper for the Freight address label option.Specify valid value PAPER_4_PER_PAGE_PORTRAIT.
      Example:PAPER_TYPE", + "example": "PAPER_LETTER", + "enum": [ + "PAPER_LETTER" + ] + }, + "dispositions": { + "type": "array", + "description": "Specifies how to create, organize, and return the document\n\n", + "items": { + "$ref": "#/components/schemas/ShippingDocumentDispositionDetail" + } + }, + "locale": { + "type": "string", + "description": "These are locale details.
      example: 'en_US'
      click here to see Locales
      Note: If the locale is left blank or an invalid locale is entered, an error message is returned in response.", + "example": "en_US" + }, + "docType": { + "type": "string", + "description": "Specify the image format used for a shipping document.
      Example:PDF", + "example": "PDF", + "enum": [ + "PDF" + ] + } + }, + "description": "Specify the shipping document format." + }, + "DocumentFormatOptionsRequested": { + "type": "object", + "properties": { + "options": { + "type": "array", + "description": "Indicates the format options. SUPPRESS_ADDITIONAL_LANGUAGES value will suppress English language if another language is specified in the language code field.", + "example": [ + "SUPPRESS_ADDITIONAL_LANGUAGES", + "SHIPPING_LABEL_LAST" + ], + "items": { + "type": "string", + "enum": [ + "SHIPPING_LABEL_FIRST", + "SHIPPING_LABEL_LAST", + "SUPPRESS_ADDITIONAL_LANGUAGES" + ] + } + } + }, + "description": "Indicate the requested options for document format." + }, + "ShippingDocumentDispositionDetail": { + "type": "object", + "properties": { + "eMailDetail": { + "$ref": "#/components/schemas/ShippingDocumentEmailDetail" + }, + "dispositionType": { + "type": "string", + "description": "Values in this field specify how to create and return the document.
      Example:CONFIRMED", + "example": "CONFIRMED", + "enum": [ + "CONFIRMED", + "DEFERRED_QUEUED", + "DEFERRED_RETURNED", + "DEFERRED_STORED", + "EMAILED", + "QUEUED", + "RETURNED", + "STORED" + ] + } + }, + "description": "These are document diposition details. Each occurrence of this class specifies a particular way in which a kind of shipping document is to be produced and provided." + }, + "ShippingDocumentEmailDetail": { + "required": [ + "eMailRecipients" + ], + "type": "object", + "properties": { + "eMailRecipients": { + "type": "array", + "description": "Indicates the shipping document email recipients.", + "items": { + "$ref": "#/components/schemas/ShippingDocumentEmailRecipient" + } + }, + "locale": { + "type": "string", + "description": "These are locale details.
      Example: 'en_US'
      click here to see locales
      Note: If the locale is left blank or an invalid locale is entered, an error message is returned in response.", + "example": "en_US" + }, + "grouping": { + "type": "string", + "description": "Identifies the convention by which documents are to be grouped as email attachment.", + "example": "NONE", + "enum": [ + "BY_RECIPIENT", + "NONE" + ] + } + }, + "description": "Specifies how to e-mail shipping documents." + }, + "ShippingDocumentEmailRecipient": { + "required": [ + "recipientType" + ], + "type": "object", + "properties": { + "emailAddress": { + "type": "string", + "description": "Specifies the email address.
      Example: email@fedex.com", + "example": "email@fedex.com" + }, + "recipientType": { + "type": "string", + "description": "Specify the email notification recipient type.", + "example": "THIRD_PARTY", + "enum": [ + "BROKER", + "OTHER", + "RECIPIENT", + "SHIPPER", + "THIRD_PARTY", + "OTHER1", + "OTHER2" + ] + } + } + }, + "ReturnInstructionsDetail": { + "type": "object", + "properties": { + "customText": { + "type": "string", + "description": "Specify additional information (text) to be inserted into the return document.
      Example: This is additional text printed on Return Label", + "example": "This is additional text printed on Return instr" + }, + "documentFormat": { + "$ref": "#/components/schemas/ReturnShippingDocumentFormat" + } + }, + "description": "These are return instruction details which will be returned in the transaction to be printed on Return Label." + }, + "ReturnShippingDocumentFormat": { + "type": "object", + "properties": { + "provideInstructions": { + "type": "boolean", + "description": "For those shipping document types which have both a \"form\" and \"instructions\" component (e.g General Agency Agreement), this field indicates whether to provide the instructions.
      Example: true", + "example": true + }, + "optionsRequested": { + "$ref": "#/components/schemas/DocumentFormatOptionsRequested" + }, + "stockType": { + "type": "string", + "description": "Specifies the label stock type. Lists the correct type of paper for the Freight address label option.Specify valid value PAPER_4_PER_PAGE_PORTRAIT
      Example:PAPER_LETTER", + "example": "PAPER_LETTER", + "enum": [ + "PAPER_LETTER" + ] + }, + "dispositions": { + "type": "array", + "description": "Details on creating, organizing, and returning the document.\n\n", + "items": { + "$ref": "#/components/schemas/ShippingDocumentDispositionDetail" + } + }, + "locale": { + "type": "string", + "description": "These are locale details.
      example: 'en_US'
      click here to see Locales
      Note: If the locale is left blank or an invalid locale is entered, an error message is returned in response.", + "example": "en_US\"" + }, + "docType": { + "type": "string", + "description": "Specify the image format used for a shipping document.
      Example:PNG", + "example": "PNG", + "enum": [ + "PNG", + "PDF" + ] + } + }, + "description": "These are characteristics of a shipping document to be produced." + }, + "Op900Detail": { + "type": "object", + "properties": { + "customerImageUsages": { + "type": "array", + "description": "Specify the use and identification of supplied images to be used on document.", + "items": { + "$ref": "#/components/schemas/CustomerImageUsage" + } + }, + "signatureName": { + "type": "string", + "description": "Indicates the name to be printed as signature on the document instead of (or in addition to) a signature image.
      Example: John Hill", + "example": "Signature Name" + }, + "documentFormat": { + "$ref": "#/components/schemas/ShippingDocumentFormat" + } + }, + "description": "Use this object to specify details to generate the OP-900 document for hazardous material packages." + }, + "CustomerImageUsage": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Specify the Image ID.
      Example:IMAGE_5", + "example": "IMAGE_5", + "enum": [ + "IMAGE_1", + "IMAGE_2", + "IMAGE_3", + "IMAGE_4", + "IMAGE_5" + ] + }, + "type": { + "type": "string", + "description": "Specify Customer Image Type.
      Example:SIGNATURE", + "example": "SIGNATURE", + "enum": [ + "SIGNATURE", + "LETTER_HEAD" + ] + }, + "providedImageType": { + "type": "string", + "description": "Provided Image Type
      Example: SIGNATURE", + "example": "SIGNATURE", + "enum": [ + "LETTER_HEAD", + "SIGNATURE" + ] + } + }, + "description": "Specify the usse and identification of supplied images to be used on this document." + }, + "UsmcaCertificationOfOriginDetail": { + "type": "object", + "properties": { + "customerImageUsages": { + "type": "array", + "description": "Specifies the usage and identification of customer supplied images to be used on this document.", + "items": { + "$ref": "#/components/schemas/CustomerImageUsage" + } + }, + "documentFormat": { + "$ref": "#/components/schemas/ShippingDocumentFormat" + }, + "certifierSpecification": { + "type": "string", + "description": "This is certifier specification.", + "example": "EXPORTER", + "enum": [ + "EXPORTER", + "IMPORTER", + "PRODUCER" + ] + }, + "importerSpecification": { + "type": "string", + "description": "This is importer specification.", + "example": "UNKNOWN", + "enum": [ + "UNKNOWN", + "VARIOUS" + ] + }, + "producerSpecification": { + "type": "string", + "description": "This is producer specification.", + "example": "SAME_AS_EXPORTER", + "enum": [ + "AVAILABLE_UPON_REQUEST", + "VARIOUS", + "SAME_AS_EXPORTER" + ] + }, + "producer": { + "$ref": "#/components/schemas/Party_3" + }, + "blanketPeriod": { + "$ref": "#/components/schemas/RetrieveDateRange" + }, + "certifierJobTitle": { + "type": "string", + "description": "Specify the job title of the certifier", + "example": "Manager" + } + }, + "description": "The instructions indicating how to print the USMCA Certificate of Origin (e.g. whether or not to include the instructions, image type, etc ...)." + }, + "Party_3": { + "type": "object", + "properties": { + "address": { + "$ref": "#/components/schemas/PartyAddress_1" + }, + "contact": { + "$ref": "#/components/schemas/PartyContact_1" + }, + "tins": { + "type": "array", + "description": "This is the tax identification number details.", + "items": { + "$ref": "#/components/schemas/TaxpayerIdentification" + } + } + }, + "example": { + "address": { + "streetLines": [ + "10 FedEx Parkway", + "Suite 302" + ], + "city": "Beverly Hills", + "stateOrProvinceCode": "CA", + "postalCode": "90210", + "countryCode": "US", + "residential": false + }, + "contact": { + "personName": "John Taylor", + "emailAddress": "sample@company.com", + "phoneExtension": "000", + "phoneNumber": "XXXX345671", + "companyName": "Fedex" + }, + "accountNumber": { + "value": "Your account number" + }, + "tins": [ + { + "number": "123567", + "tinType": "FEDERAL", + "usage": "usage", + "effectiveDate": "2000-01-23T04:56:07.000+00:00", + "expirationDate": "2000-01-23T04:56:07.000+00:00" + } + ] + } + }, + "PartyAddress_1": { + "type": "object", + "properties": { + "streetLines": { + "type": "array", + "description": "This is the combination of number, street name, etc. Maximum length per line is 35.
      Example: 10 FedEx Parkway, Suite 302.

      Note:

      • At least one line is required.
      • Streetlines more than 3 will be ignored.
      • Empty lines should not be included
      • For SmartPost Shipments, only 30 characters from the individual street lines will be printed on the labels.

      ", + "example": [ + "1550 Union Blvd", + "Suite 302" + ], + "items": { + "type": "string" + } + }, + "city": { + "type": "string", + "description": "This is a placeholder for City Name.
      Example: Beverly Hills", + "example": "Beverly Hills" + }, + "stateOrProvinceCode": { + "type": "string", + "description": "This is a placeholder for State or Province code.State code is required for US, CA, PR and not required for other countries. Conditional. Max length is 2.
      Example: CA.
      click here to see State or Province Code", + "example": "CA" + }, + "postalCode": { + "type": "string", + "description": "This is the Postal code.
      This is Optional for non postal-aware countries.
      Maximum length is 10.
      Example: 65247
      click here to see Postal aware countries", + "example": "90210" + }, + "countryCode": { + "type": "string", + "description": "This is the two-letter country code.
      Maximum length is 2.
      Example: US
      click here to see Country codes", + "example": "US" + }, + "residential": { + "type": "boolean", + "description": "Indicate whether this address is residential (as opposed to commercial).", + "example": false + }, + "geographicCoordinates": { + "type": "string", + "description": "Indicates the geographic coordinates.
      example: geographicCoordinates", + "example": "geographicCoordinates" + } + }, + "description": "This is detailed information on physical location. May be used as an actual physical address (place to which one could go), or as a container of address parts which should be handled as a unit (such as a city-state-ZIP combination within the US).", + "example": { + "streetLines": [ + "10 FedEx Parkway", + "Suite 302" + ], + "city": "Beverly Hills", + "stateOrProvinceCode": "CA", + "postalCode": "90210", + "countryCode": "US", + "residential": false + } + }, + "PartyContact_1": { + "type": "object", + "properties": { + "personName": { + "type": "string", + "description": "Specify contact name. Maximum length is 70.
      Example: John Taylor", + "example": "John Taylor" + }, + "emailAddress": { + "type": "string", + "description": "Specify contact email address. Maximum length is 80.
      Example: sample@company.com", + "example": "sample@company.com" + }, + "phoneExtension": { + "type": "string", + "description": "Specify contact phone extension. Maximum length is 6.
      Example: 1234", + "example": "91" + }, + "phoneNumber": { + "type": "string", + "description": "Specify contact phone number.
      Minimum length is 10 and supports Maximum as 15 for certain countries using longer phone numbers.
      Note: Recommended Maximum length is 15 and there's no specific validation will be done for the phone number.
      Example: 918xxxxx890", + "example": "1234567890" + }, + "companyName": { + "type": "string", + "description": "Specify contact company name.
      Recommended length is 35.
      Note: There's no specific validation of the company name.", + "example": "Fedex" + }, + "faxNumber": { + "type": "string", + "description": "Specify contact person's fax number. Maximum length is 15." + } + }, + "description": "Indicate the contact details for this shipment.", + "example": { + "personName": "John Taylor", + "emailAddress": "sample@company.com", + "phoneExtension": "91", + "phoneNumber": "1234567890", + "companyName": "Fedex" + } + }, + "RetrieveDateRange": { + "type": "object", + "properties": { + "begins": { + "type": "string", + "description": "Indicates the start date.", + "example": "22-01-2020" + }, + "ends": { + "type": "string", + "description": "Indicates the end date.", + "example": "2-01-2020" + } + }, + "description": "Date Range for custom delivery request; only used if type is BETWEEN." + }, + "UsmcaCommercialInvoiceCertificationOfOriginDetail": { + "type": "object", + "properties": { + "customerImageUsages": { + "type": "array", + "description": "Specifies the usage and identification of customer supplied images to be used on this document.", + "items": { + "$ref": "#/components/schemas/CustomerImageUsage" + } + }, + "documentFormat": { + "$ref": "#/components/schemas/ShippingDocumentFormat" + }, + "certifierSpecification": { + "type": "string", + "description": "This is certifier specification.", + "example": "EXPORTER", + "enum": [ + "EXPORTER", + "IMPORTER", + "PRODUCER" + ] + }, + "importerSpecification": { + "type": "string", + "description": "This is importer specification.", + "example": "UNKNOWN", + "enum": [ + "UNKNOWN", + "VARIOUS" + ] + }, + "producerSpecification": { + "type": "string", + "description": "This is producer specification.", + "example": "SAME_AS_EXPORTER", + "enum": [ + "AVAILABLE_UPON_REQUEST", + "VARIOUS", + "SAME_AS_EXPORTER" + ] + }, + "producer": { + "$ref": "#/components/schemas/Party_3" + }, + "certifierJobTitle": { + "type": "string", + "description": "Specify the job title of the certifier", + "example": "Manager" + } + }, + "description": "The instructions indicating commercial invoice certification of origin." + }, + "CertificateOfOriginDetail": { + "type": "object", + "properties": { + "customerImageUsages": { + "type": "array", + "description": "Specifies the usage and identification of customer supplied images to be used on this document.", + "items": { + "$ref": "#/components/schemas/CustomerImageUsage" + } + }, + "documentFormat": { + "$ref": "#/components/schemas/ShippingDocumentFormat" + } + }, + "description": "The instructions indicating how to print the Certificate of Origin ( e.g. whether or not to include the instructions, image type, etc ...)" + }, + "CommercialInvoiceDetail": { + "type": "object", + "properties": { + "customerImageUsages": { + "type": "array", + "description": "Specifies the usage and identification of customer supplied images to be used on this document.", + "items": { + "$ref": "#/components/schemas/CustomerImageUsage" + } + }, + "documentFormat": { + "$ref": "#/components/schemas/ShippingDocumentFormat" + } + }, + "description": "The instructions indicating how to print the Commercial Invoice( e.g. image type) Specifies characteristics of a shipping document to be produced." + }, + "MasterTrackingId": { + "type": "object", + "properties": { + "formId": { + "type": "string", + "description": "This is FedEx tracking Identifier associated with the package.
      Example: 8600", + "example": "0201" + }, + "trackingIdType": { + "type": "string", + "description": "Specify the FedEx transportation type.
      Example: EXPRESS", + "example": "EXPRESS" + }, + "uspsApplicationId": { + "type": "string", + "description": "Specify the USPS tracking Identifier associated with FedEx SmartPost shipment.
      Example: 92", + "example": "92" + }, + "trackingNumber": { + "type": "string", + "description": "This is the number associated with the package that is used to track it.For child shipment of an oneLabelAtATime shipments,this should be same as the masterTrackingNumber of the parent shipment.
      Example: 49XXX0000XXX20032835", + "example": "49092000070120032835" + } + }, + "description": "Indicates the tracking details of the package.Required for child shipments of an oneLabelAtATime shipments" + }, + "RequestedPackageLineItem": { + "required": [ + "weight" + ], + "type": "object", + "properties": { + "sequenceNumber": { + "type": "integer", + "description": "Optional. Used only with individual packages as a unique identifier of each requested package. Will be adjusted at the shipment level as pieces are added.
      Example: 1", + "example": "1" + }, + "subPackagingType": { + "type": "string", + "description": "Indicate the subPackagingType, if you are using your own packaging for the shipment. Use it for all shipments inbound to Canada (CA) and inbound shipments to the U.S. and Puerto Rico (PR) from Canada and Mexico (MX).subPackagingType is mandatory for shipments to Canada.
      Example: TUBE, CARTON, CONTAINER. etc.
      Note: If the value is TUBE, a non-machinable surcharge will be applicable for SmartPost shipments.
      click here to see Sub-Packaging Types
      For more information on physical packaging or packaging regulatory requirements, contact your FedEx representative.", + "example": "BUCKET" + }, + "customerReferences": { + "type": "array", + "description": "This object lists the customer references provided with the package.", + "items": { + "$ref": "#/components/schemas/CustomerReference_1" + } + }, + "declaredValue": { + "description": "This is the Declared Value of any shipment which represents FedEx maximum liability associated with a shipment. This is including, but not limited to any loss, damage, delay, misdelivery, any failure to provide information, or misdelivery of information related to the Shipment.", + "allOf": [ + { + "$ref": "#/components/schemas/Money" + } + ] + }, + "weight": { + "$ref": "#/components/schemas/Weight" + }, + "dimensions": { + "description": "Indicate the dimensions of the package.
      Following conditions will apply:
      • Dimensions are optional but when added, then all three dimensions must be indicated.
      • Dimensions are required when using a Express freight service.
      Note: The maximum/minimum dimension values varies based on the services and the packaging types. Refer FedEx Service Guide for service details related to DIM Weighting for FedEx Express and oversize conditions for FedEx Express and FedEx Ground.", + "allOf": [ + { + "$ref": "#/components/schemas/Dimensions" + } + ] + }, + "groupPackageCount": { + "type": "integer", + "description": "Indicate the grouped package count. These are number of identical package(s) each with one or more commodities.
      Example: 2", + "format": "int32", + "example": 2 + }, + "itemDescriptionForClearance": { + "type": "string", + "description": "Package description used for clearance. The value is required for intra-UAE. and is optional for intra-EU.
      Example:description", + "example": "description" + }, + "contentRecord": { + "type": "array", + "description": "Use this object to specify package content details.", + "items": { + "$ref": "#/components/schemas/ContentRecord" + } + }, + "itemDescription": { + "type": "string", + "description": "This the item description for the package.
      Note: Item description is required for Email Label return shipments and ground Create tag.
      Example: Item description
      Maximum limit is 50 characters", + "example": "item description for the package" + }, + "variableHandlingChargeDetail": { + "$ref": "#/components/schemas/VariableHandlingChargeDetail" + }, + "packageSpecialServices": { + "$ref": "#/components/schemas/PackageSpecialServicesRequested" + } + }, + "description": "These are one or more package-attribute descriptions, each of which describes an individual package, a group of identical packages, or (for the total-piece-total-weight case) common characteristics of all packages in the shipment.
      • At least one instance containing the weight for at least one package is required for EXPRESS and GROUND shipments.
      • Single piece requests will have one RequestedPackageLineItem.
      • Multiple piece requests will have multiple RequestedPackageLineItems.
      • Maximum occurrences is 30.
      " + }, + "CustomerReference_1": { + "type": "object", + "properties": { + "customerReferenceType": { + "type": "string", + "description": "This is a customer reference type. The value specified here for the element is printed on the Commercial Invoice only for tracking and label information.

      Note:

      • The P_O_NUMBER value must be specified in customerReferences under requestedPackageLineItems
      • The INVOICE_NUMBER value that is printed on the FedEx-supplied invoice must be specified in customerReferences under commercialInvoice. Value defined in this section will print on the label that is attached to the package
      • The RMA_ASSOCIATION value sent by the customer is returned on the label in human readable form but also as a barcode.
      Note: INTRACOUNTRY_REGULATORY_REFERENCE is applicable only in Intra-Brazil.
      For more information, click here for Customer References.
      Example: DEPARTMENT_NUMBER", + "example": "INVOICE_NUMBER", + "enum": [ + "CUSTOMER_REFERENCE", + "DEPARTMENT_NUMBER", + "INVOICE_NUMBER", + "P_O_NUMBER", + "INTRACOUNTRY_REGULATORY_REFERENCE", + "RMA_ASSOCIATION" + ] + }, + "value": { + "type": "string", + "description": "This is a customer reference type value.
      Example: 3686
      • The P_O_NUMBER value must be specified in customerReferences under requestedPackageLineItems
      • The INVOICE_NUMBER value that is printed on the FedEx-supplied invoice must be specified in customerReferences under commercialInvoice. Value defined in this section will print on the label that is attached to the package
      • The RMA value sent by the customer is returned on the label in human readable form but also as a barcode. RMA_ASSOCIATION only prints on the label as a barcode for a Return shipment.
      NOTE:
      • INTRACOUNTRY_REGULATORY_REFERENCE is applicable only in Intra-Brazil.
      • Maximum length varies for value field depending on customerReferenceType.
      Maximum length for value is as follows:
      • CUSTOMER_REFERENCE - 40(Express), 30(Ground)
      • DEPARTMENT_NUMBER - 30
      • INVOICE_NUMBER - 30
      • P_O_NUMBER - 30
      • INTRACOUNTRY_REGULATORY_REFERENCE - 30
      • RMA_ASSOCIATION - 20
      • ", + "example": "3686" + } + } + }, + "Dimensions": { + "type": "object", + "properties": { + "length": { + "type": "integer", + "description": "Indicate the length of the package. No implied decimal places. Maximum value: 999
        Example: 20", + "format": "int32", + "example": 3 + }, + "width": { + "type": "integer", + "description": "Indicate the width of the package. No implied decimal places. Maximum value: 999
        Example: 10", + "format": "int32", + "example": 2 + }, + "height": { + "type": "integer", + "description": "Indicate the height of the package. No implied decimal places. Maximum value: 999
        Example: 10", + "format": "int32", + "example": 1 + }, + "units": { + "type": "string", + "description": "Indicate the Unit of measure for the provided dimensions.
        Valid Values are:
      • IN - inches
      • CM - centimeters
      • Note: Any value other than CM including blank/null will default to IN.", + "example": "CM", + "enum": [ + "CM", + "IN" + ] + } + }, + "description": "Indicate the dimensions of the package.
        Following conditions will apply:
        • Dimensions are optional but when added, then all three dimensions must be indicated.
        • Dimensions are required with YOUR_PACKAGING package type.
        Note: The maximum/minimum dimension values varies based on the services and the packaging types. Refer FedEx Service Guide for service details related to DIM Weighting for FedEx Express and oversize conditions for FedEx Express and FedEx Ground.", + "example": { + "length": 100, + "width": 50, + "height": 30, + "units": "CM" + } + }, + "ContentRecord": { + "type": "object", + "properties": { + "itemNumber": { + "type": "string", + "description": "This is a package item number.", + "example": "2876" + }, + "receivedQuantity": { + "type": "integer", + "description": "This is the package item quantity.", + "format": "int32", + "example": 256 + }, + "description": { + "type": "string", + "description": "This is the description of the package item.", + "example": "Description" + }, + "partNumber": { + "type": "string", + "description": "This is the part number.", + "example": "456" + } + }, + "description": "Use this object to specify package content details." + }, + "PackageSpecialServicesRequested": { + "type": "object", + "properties": { + "specialServiceTypes": { + "type": "array", + "description": "The list of all special services requested for the package.
        Click here to see Package Special Service Types
        Example:ALCOHOL", + "example": [ + "ALCOHOL", + "NON_STANDARD_CONTAINER", + "DANGEROUS_GOODS", + "SIGNATURE_OPTION", + "PRIORITY_ALERT" + ], + "items": { + "type": "string" + } + }, + "signatureOptionType": { + "type": "string", + "description": "Signature Option Type
        ADULT - Adult signature required, at recipient''s address.
        DIRECT - Signature required, at recipient''s address.
        INDIRECT - Signature required, alternate address is accepted.
        NO_SIGNATURE_REQUIRED - Signature is not required.
        SERVICE_DEFAULT - Signature handled as per current Service Guide.
        Example:ADULT", + "example": "ADULT", + "enum": [ + "SERVICE_DEFAULT", + "NO_SIGNATURE_REQUIRED", + "INDIRECT", + "DIRECT", + "ADULT" + ] + }, + "priorityAlertDetail": { + "$ref": "#/components/schemas/PriorityAlertDetail" + }, + "signatureOptionDetail": { + "$ref": "#/components/schemas/SignatureOptionDetail" + }, + "alcoholDetail": { + "$ref": "#/components/schemas/AlcoholDetail" + }, + "dangerousGoodsDetail": { + "$ref": "#/components/schemas/DangerousGoodsDetail" + }, + "packageCODDetail": { + "$ref": "#/components/schemas/PackageCODDetail" + }, + "pieceCountVerificationBoxCount": { + "type": "integer", + "description": "Provide the pieceCount or VerificationBoxCount for batteries or cells that are contained within this specific package.
        Example:1", + "format": "int32" + }, + "batteryDetails": { + "type": "array", + "description": "Provide details about the batteries or cells that are contained within this specific package.", + "items": { + "$ref": "#/components/schemas/BatteryDetail" + } + }, + "dryIceWeight": { + "$ref": "#/components/schemas/Weight_3" + }, + "standaloneBatteryDetails": { + "type": "array", + "description": "Provide details about the batteries or cells that are contained within this specific package.", + "items": { + "$ref": "#/components/schemas/StandaloneBatteryDetails" + } + } + }, + "description": "These are special services that are available at the package level for some or all service types." + }, + "PriorityAlertDetail": { + "type": "object", + "properties": { + "enhancementTypes": { + "type": "array", + "description": "The types of all enhancement for the Priority Alert.
        Example: PRIORITY_ALERT_PLUS", + "example": [ + "PRIORITY_ALERT_PLUS" + ], + "items": { + "type": "string" + } + }, + "content": { + "type": "array", + "description": "Specifies Content for the Priority Alert Detail.
        Example:string", + "example": [ + "string" + ], + "items": { + "type": "string" + } + } + }, + "description": "Specifies the Priority Alert Detail." + }, + "SignatureOptionDetail": { + "type": "object", + "properties": { + "signatureReleaseNumber": { + "type": "string", + "description": "This is release number.
        Example: 23456", + "example": "23456" + } + }, + "description": "This element specifies Signature option details." + }, + "AlcoholDetail": { + "type": "object", + "properties": { + "alcoholRecipientType": { + "type": "string", + "description": "Specify the Alcohol Recipient Type of the shipment.
        Example: LICENSEE ", + "example": "LICENSEE", + "enum": [ + "LICENSEE", + "CONSUMER" + ] + }, + "shipperAgreementType": { + "type": "string", + "description": "Specify the type of entity, the shipper for alcohol shipment is registered such as fulfillment house, retailer or a winery.", + "example": "Retailer" + } + }, + "description": "These are detcontentails for the package containing alcohol. This is required for alcohol special service. The alcoholRecipientType is required." + }, + "DangerousGoodsDetail": { + "type": "object", + "properties": { + "cargoAircraftOnly": { + "description": "A Boolean value that, when True, specifies the mode of shipment transportation should be Cargo Aircraft for Dangerous Goods. Its default value is set as False.
        Note: An identifier DGD-CAO is added in AWB for cargo aircraft shipments.", + "type": "boolean", + "example": false + }, + "regulation": { + "type": "string", + "description": "It is a HazardousCommodityRegulationType(The regulation under which the DG data has been validated).", + "example": "ADR", + "enum": [ + "ADR", + "DOT", + "IATA", + "ORMD" + ] + }, + "accessibility": { + "type": "string", + "description": "Specify Dangerous Goods Accessibility Type.
        • Inaccessible – it does not have to be accessable on the aircraft.
        • Accessible – it must be fully accessible on the aircraft, and is more strictly controlled.
        Note: Accessibility is only required for IATA controlled DG shipments.", + "example": "INACCESSIBLE", + "enum": [ + "ACCESSIBLE", + "INACCESSIBLE" + ] + }, + "options": { + "type": "array", + "description": "Indicate type of DG being reported.
        - SMALL_QUANTITY_EXCEPTION : It is applicable for only One Piece shipment.", + "example": [ + "LIMITED_QUANTITIES_COMMODITIES", + "ORM_D" + ], + "items": { + "type": "string", + "xml": { + "name": "options" + }, + "enum": [ + "HAZARDOUS_MATERIALS", + "BATTERY", + "ORM_D", + "REPORTABLE_QUANTITIES", + "SMALL_QUANTITY_EXCEPTION", + "LIMITED_QUANTITIES_COMMODITIES" + ] + } + } + }, + "description": "Provide dangerous goods shipment details." + }, + "PackageCODDetail": { + "type": "object", + "properties": { + "codCollectionAmount": { + "description": "Indicate the COD collection amount.", + "allOf": [ + { + "$ref": "#/components/schemas/Money" + } + ] + } + }, + "description": "These are COD package details. For use with FedEx Ground services only; COD must be present in shipments special services." + }, + "BatteryDetail": { + "type": "object", + "properties": { + "batteryPackingType": { + "type": "string", + "description": "Describe the packing arrangement of the battery or cell with respect to other items within the same package.", + "enum": [ + "CONTAINED_IN_EQUIPMENT", + "PACKED_WITH_EQUIPMENT" + ] + }, + "batteryRegulatoryType": { + "type": "string", + "description": "This is a regulation specific classification for the battery or the cell.", + "enum": [ + "IATA_SECTION_II" + ] + }, + "batteryMaterialType": { + "type": "string", + "description": "Indicate the material composition of the battery or cell.", + "enum": [ + "LITHIUM_METAL", + "LITHIUM_ION" + ] + } + } + }, + "StandaloneBatteryDetails": { + "type": "object", + "properties": { + "batteryMaterialType": { + "type": "string", + "description": "Describes the material composition of the battery or cell.", + "example": "LITHIUM_METAL", + "enum": [ + "LITHIUM_METAL", + "LITHIUM_ION" + ] + } + } + }, + "LABELRESPONSEOPTIONS": { + "type": "string", + "description": "Note- Label will be returned as Base64 ONLY when openShipmentAction is PROVIDE_DOCUMENTS_INCREMENTALLY.
        LabelResponseOptions specifies the label generation format.
        Example:URL_ONLY", + "example": "URL_ONLY", + "enum": [ + "URL_ONLY", + "LABEL" + ] + }, + "ShipperAccountNumber": { + "required": [ + "value" + ], + "type": "object", + "properties": { + "value": { + "type": "string", + "description": "The account number value. Maximum length is 9 .
        Example: Your account number" + } + }, + "description": "The account number associated with the shipment.", + "example": { + "value": "Your account number" + } + }, + "OpenShipmentAction": { + "type": "string", + "description": "Indicate shipment action for the Shipment.
        • CONFIRM – used in case of shipment submission
        • TRANSFER – used in case of Email Label Shipment or Pending Shipment submission.", + "example": "CONFIRM", + "enum": [ + "CONFIRM", + "TRANSFER" + ] + }, + "AsynchronousProcessingOptionType_1": { + "type": "string", + "description": "Indicate the processing option for submitting a Single shot MPS shipment. The value indicates if the MPS to be processed synchronously or asynchronously.
          Note:
          • Default value is SYNCHRONOUS_ONLY.
          • Value or element is not needed when groupPackageCount is less than or equal to 40.
          • Must provide element with value ALLOW_ASYNCHRONOUS when groupPackageCount is greater than 40.

          Example:ALLOW_ASYNCHRONUS", + "example": "ALLOW_ASYNCHRONOUS", + "enum": [ + "SYNCHRONOUS_ONLY", + "ALLOW_ASYNCHRONOUS" + ] + }, + "SHPCResponseVO_ShipShipment": { + "type": "object", + "properties": { + "transactionId": { + "type": "string", + "description": "The transaction ID is a special set of numbers that defines each transaction.
          Example: 624deea6-b709-470c-8c39-4b5511281492", + "example": "624deea6-b709-470c-8c39-4b5511281492" + }, + "customerTransactionId": { + "type": "string", + "description": "This element has a unique identifier added in your request, helps you match the request to the reply.
          Example: XXXX_XXX123XXXXX", + "example": "AnyCo_order123456789" + }, + "output": { + "$ref": "#/components/schemas/BaseProcessOutputVO_ShipShipment" + } + }, + "description": "Wrapper class for ShipShipmentOutputVO. It holds transactionId and output." + }, + "BaseProcessOutputVO_ShipShipment": { + "$ref": "#/components/schemas/ShipShipmentOutputVO" + }, + "ShipShipmentOutputVO": { + "type": "object", + "properties": { + "transactionShipments": { + "type": "array", + "description": "These are shipping transaction details, such as master tracking number, service type, and ship date and time.", + "items": { + "$ref": "#/components/schemas/TransactionShipmentOutputVO" + } + }, + "alerts": { + "type": "array", + "description": "The alerts received when processing a shipment request.", + "items": { + "$ref": "#/components/schemas/Alert" + } + }, + "jobId": { + "type": "string", + "description": "Unique identifier for a Job. Example: abc123456", + "example": "abc123456" + } + }, + "description": "This is the response received when a shipment is requested." + }, + "TransactionShipmentOutputVO": { + "type": "object", + "properties": { + "serviceType": { + "type": "string", + "description": "Indicate the FedEx serviceType used for this shipment. The results will be filtered by the serviceType value indicated.
          Example: STANDARD_OVERNIGHT
          click here to see Service Types", + "example": "STANDARD_OVERNIGHT" + }, + "shipDatestamp": { + "type": "string", + "description": "This is the shipment date. Default value is current date in case the date is not provided or a past date is provided.
          Format [YYYY-MM-DD].
          Example: 2019-10-14", + "example": "2010-03-04" + }, + "serviceCategory": { + "type": "string", + "description": "Indicates the Service Category.
          Example: EXPRESS", + "example": "EXPRESS" + }, + "shipmentDocuments": { + "type": "array", + "description": "These are shipping document details.", + "items": { + "$ref": "#/components/schemas/LabelResponseVO" + } + }, + "pieceResponses": { + "type": "array", + "description": "Specifies the information about the pieces, received in the response.", + "items": { + "$ref": "#/components/schemas/PieceResponse" + } + }, + "serviceName": { + "type": "string", + "description": "This is the service name associated with the shipment.
          Example: FedEx Ground", + "example": "FedEx 2 Day Freight" + }, + "alerts": { + "type": "array", + "description": "These are alert details received in the response.", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/Alert_3P" + }, + { + "$ref": "#/components/schemas/Alert_3PP" + } + ] + } + }, + "completedShipmentDetail": { + "$ref": "#/components/schemas/CompletedShipmentDetail" + }, + "shipmentAdvisoryDetails": { + "$ref": "#/components/schemas/ShipmentAdvisoryDetails" + }, + "masterTrackingNumber": { + "type": "string", + "description": "This is a master tracking number for the shipment (must be unique for stand-alone open shipments, or unique within consolidation if consolidation key is provided).
          Example: 794953535000", + "example": "794953535000" + } + }, + "description": "Specifies shipping transaction output details" + }, + "LabelResponseVO": { + "type": "object", + "properties": { + "contentKey": { + "type": "string", + "description": "This is the content key of the document/label.
          Example: content key", + "example": "content key" + }, + "copiesToPrint": { + "type": "integer", + "description": "These are the number of copies to print for the specific document type.
          Example: 10", + "format": "int32", + "example": 10 + }, + "contentType": { + "type": "string", + "description": "Indicates the type of document/label.", + "example": "COMMERCIAL_INVOICE", + "enum": [ + "LABEL", + "BILL_OF_LADING", + "GAA_FORM", + "HAZMAT_LABEL", + "END_OF_DAY_HAZMAT_REPORT", + "MANIFEST_REPORT", + "MULTIWEIGHT_REPORT", + "MERGED_LABEL_DOCUMENTS", + "AUXILIARY", + "RETURN_INSTRUCTIONS", + "ACCEPTANCE_LABEL", + "COMMERCIAL_INVOICE", + "PROFORMA_INVOICE", + "USMCA_CERTIFICATION_OF_ORIGIN", + "CERTIFICATE_OF_ORIGIN", + "MERGED_LABELS_ONLY", + "USMCA_COMMERCIAL_INVOICE_CERTIFICATION_OF_ORIGIN" + ] + }, + "trackingNumber": { + "type": "string", + "description": "This is the tracking number of the package.
          Example: 49XXX0000XXX20032835
          ", + "example": "794953535000" + }, + "docType": { + "type": "string", + "description": "This is the document type.
          Example: PDF", + "example": "PDF" + }, + "alerts": { + "type": "array", + "description": "These are alerts received in the label response.", + "items": { + "$ref": "#/components/schemas/Alert" + } + }, + "encodedLabel": { + "type": "string", + "description": "Specifies if the document is encoded.
          Example: encoded label", + "example": "encoded label" + }, + "url": { + "type": "string", + "description": "The URL of the shipping document/label
          Example: https://.../document/v2/document/retrieve/SH,794816968200_Merge/isLabel=true&autoPrint=false
          Note: The URL once created will be active for 24 hours.", + "example": "https://wwwdev.idev.fedex.com/document/v2/document/retrieve/SH,794810209259_SHIPPING_P/isLabel=true&autoPrint=false" + } + }, + "description": "These are shipping document/label specific information." + }, + "Alert": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Specifies the api alert code.
          Example: SHIPMENT.VALIDATION.SUCCESS", + "example": "SHIPMENT.VALIDATION.SUCCESS" + }, + "alertType": { + "type": "string", + "description": "Specifies the api alert type.", + "example": "NOTE", + "enum": [ + "NOTE", + "WARNING" + ] + }, + "message": { + "type": "string", + "description": "Specifies the api alert message.
          Example: Shipment validated successfully. No errors found.", + "example": "Shipment validated successfully. No errors found." + } + }, + "description": "These are alert details received in the response." + }, + "Alert_3P": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Specifies the api alert code.
          Example: RECIPIENTCONTACT.PHONENUMBER.INVALID", + "example": "RECIPIENTCONTACT.PHONENUMBER.INVALID" + }, + "message": { + "type": "string", + "description": "Specifies the api alert message.
          Example: Recipient’s phone number format is not matching with recipient's country code; hence, recipient will not receive Convenient Delivery Options. Moving forward, please provide valid mobile phone number.", + "example": "Recipient’s phone number format is not matching with recipient's country code; hence, recipient will not receive Convenient Delivery Options. Moving forward, please provide valid mobile phone number." + } + }, + "description": "Specifies the api alerts." + }, + "Alert_3PP": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Specifies the api alert code.
          Example: RECIPIENTCONTACT.PHONENUMBER.NOTSUPPORTED", + "example": "RECIPIENTCONTACT.PHONENUMBER.NOTSUPPORTED" + }, + "message": { + "type": "string", + "description": "Convenient Delivery Options will not be provided with recipient’s landline number. Moving forward, please provide valid mobile phone number.", + "example": "Convenient Delivery Options will not be provided with recipient’s landline number. Moving forward, please provide valid mobile phone number." + } + }, + "description": "Specifies the api alerts." + }, + "PieceResponse": { + "type": "object", + "properties": { + "netChargeAmount": { + "type": "number", + "description": "Indicates the net charges amount.
          Example: 21.45", + "format": "double", + "example": 21.45 + }, + "packageDocuments": { + "type": "array", + "description": "These are package documents returned in the response.", + "items": { + "$ref": "#/components/schemas/LabelResponseVO" + } + }, + "acceptanceTrackingNumber": { + "type": "string", + "description": "Indicates the acceptance tracking number.
          Example: 7949XXXXX5000", + "example": "794953535000" + }, + "serviceCategory": { + "type": "string", + "description": "Indicates the service category.", + "example": "EXPRESS", + "enum": [ + "EXPRESS", + "GROUND", + "EXPRESS_FREIGHT", + "FREIGHT", + "SMARTPOST", + "EXPRESS_PARCEL", + "NULL" + ] + }, + "listCustomerTotalCharge": { + "type": "string", + "description": "Indicates total charges applicable to the customer.
          Example: listCustomerTotalCharge", + "example": "listCustomerTotalCharge" + }, + "deliveryTimestamp": { + "type": "string", + "description": "Indicates delivery date with timestamp.
          Example: 2012-09-23", + "example": "2012-09-23" + }, + "trackingIdType": { + "type": "string", + "description": "Indicates the type of the tracking identifier.", + "example": "FEDEX" + }, + "additionalChargesDiscount": { + "type": "number", + "description": "These are additional charges or discounts.
          Example: 621.45", + "format": "double", + "example": 621.45 + }, + "listRateAmount": { + "type": "number", + "description": "Indicates the net List rate amount.
          Example: 1.45", + "format": "double", + "example": 1.45 + }, + "baseRateAmount": { + "type": "number", + "description": "Specifies the base rate amount.
          Example: 321.45", + "format": "double", + "example": 321.45 + }, + "packageSequenceNumber": { + "type": "integer", + "description": "Indicates package sequence number.
          Example: 215", + "format": "int32", + "example": 215 + }, + "netDiscountAmount": { + "type": "number", + "description": "Specifies the net discount amount.
          Example: 121.45", + "format": "double", + "example": 121.45 + }, + "codCollectionAmount": { + "type": "number", + "description": "Specifies the Collect on Delivery collection amount.
          Example: 231.45", + "format": "double", + "example": 231.45 + }, + "masterTrackingNumber": { + "type": "string", + "description": "This is a master tracking number of the shipment (must be unique for stand-alone open shipments, or unique within consolidation if consolidation key is provided).
          Example: 794XXXXX5000", + "example": "794953535000" + }, + "acceptanceType": { + "type": "string", + "description": "Indicates acceptance type.
          Example: acceptanceType
          Example:acceptanceType", + "example": "acceptanceType" + }, + "trackingNumber": { + "type": "string", + "description": "This is the tracking number associated with this package.
          Example: 49XXX0000XXX20032835", + "example": "794953535000" + }, + "customerReferences": { + "type": "array", + "description": "These are additional customer reference data.
          Note: The groupPackageCount must be specified to retrieve customer references.", + "items": { + "$ref": "#/components/schemas/CustomerReference" + } + } + }, + "description": "Piece Response information." + }, + "TransactionDetailVO": { + "type": "object", + "properties": { + "transactionDetails": { + "type": "string", + "description": "Includes data returned which governs data payload language/translations. The TransactionDetail from the request is echoed back to the caller in the corresponding reply.
          Example: transactionDetails", + "example": "transactionDetails" + }, + "transactionId": { + "type": "string", + "description": "This element has a unique identifier added in your request, helps you match the request to the reply. Maximum of 40 characters allowed.
          Example: XXXX_XXX123XXXXX.", + "example": "12345" + } + } + }, + "CompletedShipmentDetail": { + "type": "object", + "properties": { + "completedPackageDetails": { + "type": "array", + "description": "Indicates the completed package details.", + "items": { + "$ref": "#/components/schemas/CompletedPackageDetail" + } + }, + "operationalDetail": { + "$ref": "#/components/schemas/ShipmentOperationalDetail" + }, + "carrierCode": { + "type": "string", + "description": "Specify the four letter code of a FedEx operating company that meets your requirements
          Examples of FedEx Operating Companies are:
          • FDXE - FedEx Express
          • FDXG - FedEx Ground
          • FXSP - FedEx SmartPost
          • FXCC - FedEx Custom Critical.
          ", + "example": "FDXE" + }, + "completedHoldAtLocationDetail": { + "$ref": "#/components/schemas/CompletedHoldAtLocationDetail" + }, + "completedEtdDetail": { + "$ref": "#/components/schemas/CompletedEtdDetail" + }, + "packagingDescription": { + "type": "string", + "description": "Specifies packaging description
          Example: Customer Packaging", + "example": "Customer Packaging" + }, + "masterTrackingId": { + "$ref": "#/components/schemas/TrackingId" + }, + "serviceDescription": { + "$ref": "#/components/schemas/ServiceDescription" + }, + "usDomestic": { + "type": "boolean", + "description": "Indicates whether or not this is an intra-U.S. shipment.", + "example": true + }, + "hazardousShipmentDetail": { + "$ref": "#/components/schemas/CompletedHazardousShipmentDetail" + }, + "shipmentRating": { + "$ref": "#/components/schemas/ShipmentRating" + }, + "documentRequirements": { + "$ref": "#/components/schemas/DocumentRequirementsDetail" + }, + "exportComplianceStatement": { + "type": "string", + "description": "For US export shipments requiring an EEI, enter the ITN number received from AES when you filed your shipment or the FTR (Foreign Trade Regulations) exemption number.The proper format for an ITN number is AES XYYYYMMDDNNNNNN where YYYYMMDD is date and NNNNNN are numbers generated by the AES.
          Example: AESX20220714987654
          Note: The ITN or FTR exemption number you submit in the ship request prints on the international shipping label.

          For CA export shipments,it can be Proof of report number(15-32 alphanumeric) , Summary proof of report number(7-32 alphanumeric) or Exemption number(2 digit) based on the selected b13AFilingOption.
          Example: 98765432107654321(POR number), 7654321(Summary POR number) and 02(Exemption number).
          For FTR exemption number you need provide a predefined value as NO_EEI_30_37_A.", + "example": "12345678901234567" + }, + "accessDetail": { + "$ref": "#/components/schemas/PendingShipmentAccessDetail" + } + }, + "description": "Returns the result of processing the desired package as a single-package shipment." + }, + "CompletedPackageDetail": { + "type": "object", + "properties": { + "sequenceNumber": { + "type": "integer", + "description": "This is package sequence number. No negative value or decimals are allowed.
          Example: 256", + "format": "int32", + "example": 256 + }, + "operationalDetail": { + "$ref": "#/components/schemas/PackageOperationalDetail" + }, + "signatureOption": { + "type": "string", + "description": "It specifies the signature option applied, to allow cases in which the value requested conflicted with other service features in the shipment.
          Example: DIRECT", + "example": "DIRECT" + }, + "trackingIds": { + "type": "array", + "description": "Tracking details of the package.", + "items": { + "$ref": "#/components/schemas/TrackingId" + } + }, + "groupNumber": { + "type": "integer", + "description": "This is group shipment number. Used with request containing PACKAGE_GROUPS, to identify which group of identical packages was used to produce a reply item.
          Example: 10", + "format": "int32", + "example": 567 + }, + "oversizeClass": { + "type": "string", + "description": "Indicates the oversize classification.
          Example: OVERSIZE_1", + "example": "OVERSIZE_1, OVERSIZE_2, OVERSIZE_3" + }, + "packageRating": { + "$ref": "#/components/schemas/PackageRating" + }, + "dryIceWeight": { + "description": "Descriptive data required for a FedEx shipment containing dry ice. Includes weight and units. This element is required when SpecialServiceType DRY_ICE is present in the SpecialServiceTypes collection at the package level.", + "allOf": [ + { + "$ref": "#/components/schemas/Weight" + } + ] + }, + "hazardousPackageDetail": { + "$ref": "#/components/schemas/CompletedHazardousPackageDetail" + } + } + }, + "PackageOperationalDetail": { + "type": "object", + "properties": { + "astraHandlingText": { + "type": "string", + "description": "Human-readable text for pre-January 2011 clients.
          Example: astraHandlingText", + "example": "astraHandlingText" + }, + "barcodes": { + "$ref": "#/components/schemas/PackageBarcodes" + }, + "operationalInstructions": { + "type": "array", + "description": "These are operational instruction such as Ground Information printed on a given area of the label, one-dimensional barcode with only x-axis that contains the details of the shipment in encrypted form, COD Return operational instructions data such as COD amount, SECURED or UNSECURED.", + "items": { + "$ref": "#/components/schemas/OperationalInstructions" + } + } + }, + "description": "Package-level data required for labeling and/or movement." + }, + "PackageBarcodes": { + "type": "object", + "properties": { + "binaryBarcodes": { + "type": "array", + "description": "This is binary-style barcodes used for the package identification.", + "items": { + "$ref": "#/components/schemas/BinaryBarcode" + } + }, + "stringBarcodes": { + "type": "array", + "description": "This is string-style barcodes used for package identification.", + "items": { + "$ref": "#/components/schemas/StringBarcode" + } + } + }, + "description": "These are package barcode details. Each instance of this data type represents the set of barcodes (of all types) which are associated with a specific package." + }, + "BinaryBarcode": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "The kind of barcode data in this instance.
          Example: COMMON-2D", + "example": "COMMON-2D" + }, + "value": { + "type": "string", + "description": "This is the value.", + "format": "byte" + } + }, + "description": "Each instance of this data type represents a barcode whose content must be represented as binary data (i.e. not ASCII text)." + }, + "StringBarcode": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "The kind of barcode data in this instance. example valid values are:
          ADDRESS - Represents the recipient address
          GROUND - FedEx Ground parcel barcode
          Example: ADDRESS", + "example": "ADDRESS" + }, + "value": { + "type": "string", + "description": "This is the value.
          Example: 1010062512241535917900794953544894", + "example": "1010062512241535917900794953544894" + } + }, + "description": "Each instance of this data type represents a barcode whose content must be represented as ASCII text (i.e. not binary data)." + }, + "OperationalInstructions": { + "type": "object", + "properties": { + "number": { + "type": "integer", + "description": "Specifies the number of operational instructions returned for this shipment.
          Example: 17", + "format": "int32", + "example": 17 + }, + "content": { + "type": "string", + "description": "This is an operational instruction printed or available on the shipping document.
          Example: SECURED", + "example": "content" + } + } + }, + "TrackingId": { + "type": "object", + "properties": { + "formId": { + "type": "string", + "description": "This is FedEx tracking Identifier associated with the package.
          Example: 8600", + "example": "0201" + }, + "trackingIdType": { + "type": "string", + "description": "Specify the FedEx transportation type.
          Example: EXPRESS", + "example": "EXPRESS" + }, + "uspsApplicationId": { + "type": "string", + "description": "Specify the USPS tracking Identifier associated with FedEx SmartPost shipment.
          Example: 92", + "example": "92" + }, + "trackingNumber": { + "type": "string", + "description": "This is the number associated with the package that is used to track it.
          Example: 49XXX0000XXX20032835", + "example": "49092000070120032835" + } + }, + "description": "Indicates the tracking details of the package." + }, + "PackageRating": { + "type": "object", + "properties": { + "effectiveNetDiscount": { + "type": "number", + "description": "This is the difference between the list and account net charge.
          Example: 0.0", + "format": "double", + "example": 0 + }, + "actualRateType": { + "type": "string", + "description": "This is the actual rate type. It identifies which entry in the following array is considered as presenting the actual rates for the package.
          Example: PAYOR_ACCOUNT_PACKAGE", + "example": "PAYOR_ACCOUNT_PACKAGE" + }, + "packageRateDetails": { + "type": "array", + "description": "Data for a package's rates, as calculated per a specific rate type.", + "items": { + "$ref": "#/components/schemas/PackageRateDetail" + } + } + }, + "description": "This class groups together all package-level rate data for a single package (across all rate types) as part of the response to a shipping request, which groups shipment-level data together and groups package-level data by package." + }, + "PackageRateDetail": { + "type": "object", + "properties": { + "ratedWeightMethod": { + "type": "string", + "description": "Indicates the weight types used in calculating this rate, such as actual weight or dimensional weight.
          Example: DIM", + "example": "DIM" + }, + "totalFreightDiscounts": { + "type": "number", + "description": "The sum of all freight discounts for this package.
          Example: 44.55", + "format": "double", + "example": 44.55 + }, + "totalTaxes": { + "type": "number", + "description": "The sum of all taxes on this package.
          Example: 3.45", + "format": "double", + "example": 3.45 + }, + "minimumChargeType": { + "type": "string", + "description": "Indicates the minumum charge type. INTERNAL FEDEX USE ONLY.Example: minimumChargeType", + "example": "CUSTOMER" + }, + "baseCharge": { + "type": "number", + "description": "The package transportation charge(prior to any discounts applied).
          Example: 45.67", + "format": "double", + "example": 45.67 + }, + "totalRebates": { + "type": "number", + "description": "Specifies total rebates on this package.
          Example: 4.56", + "format": "double", + "example": 4.56 + }, + "rateType": { + "type": "string", + "description": "This is the rate type used.
          Example: PAYOR_RETAIL_PACKAGE", + "example": "PAYOR_RETAIL_PACKAGE" + }, + "billingWeight": { + "$ref": "#/components/schemas/Weight" + }, + "netFreight": { + "type": "number", + "description": "This is the net freight charges. i.e. base charge minus total freight discounts for a package.
          Example: 4.89", + "format": "double", + "example": 4.89 + }, + "surcharges": { + "type": "array", + "description": "These are all surcharges on this package.
          click here to see Surcharges", + "items": { + "$ref": "#/components/schemas/Surcharge" + } + }, + "totalSurcharges": { + "type": "number", + "description": "The sum of all surcharges on this package.
          Example: 22.56", + "format": "double", + "example": 22.56 + }, + "netFedExCharge": { + "type": "number", + "description": "This is sum of net freight and total surcharges (not including totalTaxes) for this package.
          Example: 12.56", + "format": "double", + "example": 12.56 + }, + "netCharge": { + "type": "number", + "description": "This is the sum of net freight, total surcharges and total taxes for a package.
          Example: 121.56", + "format": "double", + "example": 121.56 + }, + "currency": { + "type": "string", + "description": "This is the currency code.
          Example: USD
          click here to see Currency codes", + "example": "USD" + } + }, + "description": "These are package rate details, as calculated per a specific rate type." + }, + "Surcharge": { + "type": "object", + "properties": { + "amount": { + "type": "number", + "format": "double", + "example": "56.22", + "description": "This is the surcharge amount.
          Example: 15.35" + }, + "surchargeType": { + "type": "string", + "description": "This is the surcharge type.
          Example: APPOINTMENT_DELIVERY", + "example": "APPOINTMENT_DELIVERY" + }, + "level": { + "type": "string", + "description": "Specifies if the surcharge applies to the entire shipment, or to an individual package.
          Example: PACKAGE", + "example": "PACKAGE, or SHIPMENT" + }, + "description": { + "type": "string", + "description": "Specifies the description of the surcharge. Indicates delivery and returns information for FedEx Ground Economy services.
          Example: Fuel Surcharge", + "example": "description" + } + }, + "description": "These are surcharges details.
          click here to see Surcharges" + }, + "CompletedHazardousPackageDetail": { + "type": "object", + "properties": { + "regulation": { + "type": "string", + "description": "Specifies the hazardous package regulation type.
          Example: IATA", + "example": "IATA" + }, + "accessibility": { + "type": "string", + "description": "Specifies the hazardous package accessibility.
          Example: ACCESSIBLE", + "example": "ACCESSIBLE" + }, + "labelType": { + "type": "string", + "description": "Specifies the label type of hazardous package.
          Example: II_YELLOW", + "example": "II_YELLOW" + }, + "containers": { + "type": "array", + "description": "Indicates one or more approved containers used to pack dangerous goods commodities. This does not describe any individual inner receptacles that may be within this container.", + "items": { + "$ref": "#/components/schemas/ValidatedHazardousContainer" + } + }, + "cargoAircraftOnly": { + "type": "boolean", + "description": "When TRUE-indicates that the package can be transported only on a cargo aircraft.
          Example: true", + "example": true + }, + "referenceId": { + "type": "string", + "description": "A unique reference id that matches the package to a package configuration. This is populated if the client provided a package configuration for several packages that have the exact same dangerous goods content.
          Example: 123456", + "example": "123456" + }, + "radioactiveTransportIndex": { + "type": "number", + "description": "Specifies the maximum radiation level from the package (measured in microSieverts per hour at a distance of one meter from the external surface of the package, divided by 10).
          Example: 2.45", + "format": "double", + "example": 2.45 + } + }, + "description": "Complete package-level hazardous commodity information for a single package." + }, + "ValidatedHazardousContainer": { + "type": "object", + "properties": { + "QValue": { + "type": "number", + "description": "Indicates that the quantity of the dangerous goods packaged is permissible for shipping. This is used to ensure that the dangerous goods commodities do not exceed the net quantity per package restrictions.
          Example: 2.0", + "format": "double", + "example": 2 + }, + "hazardousCommodities": { + "type": "array", + "description": "Indicates the details of the hazardous commodities in the completed package.", + "items": { + "$ref": "#/components/schemas/ValidatedHazardousCommodityContent" + } + } + }, + "description": "Specifies the details of a container used to package dangerous goods commodities." + }, + "ValidatedHazardousCommodityContent": { + "type": "object", + "properties": { + "quantity": { + "description": "Indicates hazardous commodity quantity details.", + "allOf": [ + { + "$ref": "#/components/schemas/HazardousCommodityQuantityDetail" + } + ] + }, + "options": { + "$ref": "#/components/schemas/HazardousCommodityOptionDetail" + }, + "description": { + "$ref": "#/components/schemas/ValidatedHazardousCommodityDescription" + }, + "netExplosiveDetail": { + "$ref": "#/components/schemas/NetExplosiveDetail" + }, + "massPoints": { + "type": "number", + "description": "The mass points are a calculation used by ADR regulations for measuring the risk of a particular hazardous commodity.
          Example: 2.0", + "format": "double", + "example": 2 + } + }, + "description": "These the details on the kind and quantity of an individual hazardous commodity in a package." + }, + "HazardousCommodityQuantityDetail": { + "required": [ + "amount", + "quantityType" + ], + "type": "object", + "properties": { + "quantityType": { + "type": "string", + "description": "Specifies which measure of quantity is to be validated.
          Example:GROSS", + "example": "GROSS", + "enum": [ + "GROSS", + "NET" + ] + }, + "amount": { + "type": "number", + "description": "Indicate the amount of the commodity in alternate units.
          Example: 24.56", + "format": "double", + "example": 24.56 + }, + "units": { + "type": "string", + "description": "Indicate the unit of measure.
          Example: KG", + "example": "Kg" + } + }, + "description": "Specify the Hazardous commodity quantity details." + }, + "HazardousCommodityContent001": { + "type": "object", + "properties": { + "quantity": { + "$ref": "#/components/schemas/HazardousCommodityQuantityDetail" + }, + "innerReceptacles": { + "type": "array", + "description": "Specifies the inner receptacles within the container.", + "items": { + "$ref": "#/components/schemas/HazardousCommodityInnerReceptacleDetail01" + } + }, + "options": { + "$ref": "#/components/schemas/HazardousCommodityOptionDetail01" + }, + "description": { + "$ref": "#/components/schemas/HazardousCommodityDescription01" + } + }, + "description": "Customer-provided specifications for handling individual commodities." + }, + "HazardousCommodityInnerReceptacleDetail01": { + "type": "object", + "properties": { + "quantity": { + "$ref": "#/components/schemas/HazardousCommodityQuantityDetail002" + } + } + }, + "HazardousCommodityQuantityDetail002": { + "required": [ + "amount", + "quantityType" + ], + "type": "object", + "properties": { + "quantityType": { + "type": "string", + "description": "Specifies which measure of quantity is to be validated.", + "example": "NET", + "enum": [ + "GROSS", + "NET" + ] + }, + "amount": { + "type": "number", + "description": "Number of units of the type below.
          Example: 34.56", + "format": "double", + "example": 34.56 + }, + "units": { + "type": "string", + "description": "Specifies the units.
          Example: KG", + "example": "Kg" + } + }, + "description": "Indicates the Hazardous Commodity Quantity Detail." + }, + "HazardousCommodityOptionDetail01": { + "type": "object", + "properties": { + "labelTextOption": { + "type": "string", + "description": "Indicates the label text option.", + "enum": [ + "APPEND", + "OVERRIDE", + "STANDARD" + ] + }, + "customerSuppliedLabelText": { + "type": "string", + "description": "'DG Data Upload Mode:- Optional.,DG Full Validation Mode:- Optional,Text used in labeling the commodity under control of the LabelTextOption field
          Example:Customer Supplied Label Text' \n\n", + "example": "Customer Supplied Label Text." + } + }, + "description": "Indicates details of hazardous commodity option detail." + }, + "HazardousCommodityDescription01": { + "required": [ + "packingGroup", + "reportableQuantity" + ], + "type": "object", + "properties": { + "sequenceNumber": { + "type": "integer", + "description": "Required
          Specify the sequence number.
          Example: 9812", + "format": "int32", + "example": 9812 + }, + "processingOptions": { + "type": "array", + "description": "Indicates any special processing options to be applied to the description of the dangerous goods commodity
          Example: [\"INCLUDE_SPECIAL_PROVISIONS\"]", + "items": { + "type": "string", + "example": "INCLUDE_SPECIAL_PROVISIONS", + "enum": [ + "INCLUDE_SPECIAL_PROVISIONS" + ] + } + }, + "subsidiaryClasses": { + "type": "array", + "description": "Required\n\nIndicates list of subsidiary classes
          Example: [\"Subsidiary Classes\"]", + "example": [ + "Subsidiary Classes" + ], + "items": { + "type": "string" + } + }, + "labelText": { + "type": "string", + "description": "Specifies the text for the label.", + "example": "labelText" + }, + "technicalName": { + "type": "string", + "description": "Specifies the technical name for the hazardous material.", + "example": "technicalName" + }, + "packingDetails": { + "$ref": "#/components/schemas/HazardousCommodityPackingDetail01" + }, + "authorization": { + "type": "string", + "description": "Information related to quantity limitations and operator or state variations as may be applicable to the dangerous goods commodity.", + "example": "authorization" + }, + "reportableQuantity": { + "type": "boolean", + "description": "Reportable Quantity", + "example": true + }, + "percentage": { + "type": "number", + "description": "Percentage
          Example: 12.45", + "format": "double", + "example": 12.45 + }, + "id": { + "type": "string", + "description": "ID
          Example: 123", + "example": "123" + }, + "packingGroup": { + "type": "string", + "description": "Identifies DOT packing group for a hazardous commodity", + "example": "I", + "enum": [ + "DEFAULT", + "I", + "II", + "III" + ] + }, + "properShippingName": { + "type": "string", + "description": "The proper shipping name as defined by the regulation. The name can also include qualifying words
          Example: properShippingName", + "example": "properShippingName" + }, + "hazardClass": { + "type": "string", + "description": "Specifies the hazard class for the commodity
          Example: hazard Class\n", + "example": "hazard Class" + } + }, + "description": "Required
          Details of hazardous commodity description." + }, + "HazardousCommodityPackingDetail01": { + "required": [ + "cargoAircraftOnly" + ], + "type": "object", + "properties": { + "packingInstructions": { + "type": "string", + "description": "Coded specification for how commodity is to be packed.
          Example: packing Instructions", + "example": "packing Instructions" + }, + "cargoAircraftOnly": { + "type": "boolean", + "description": "A Boolean value that, when True, specifies the mode of shipment transportation should be Cargo Aircraft for Dangerous Goods.
          Note: An identifier DGD-CAO is added in AWB for cargo aircraft shipments.Example: true", + "example": true + } + }, + "description": "Specifies documentation and limits for validation of an individual packing group/category. DG Data Upload Mode: Required (IATA), Optional (Other), DG Full Validation Mode: Required (IATA), Optional (Other)," + }, + "ValidatedHazardousCommodityDescription": { + "type": "object", + "properties": { + "sequenceNumber": { + "type": "integer", + "description": "In conjunction with the regulatory identifier, this field uniquely identifies a specific hazardous materials commodity.
          Example: 876", + "format": "int32", + "example": 876 + }, + "packingInstructions": { + "type": "string", + "description": "Specifies Packing Instructions.
          Example: packingInstructions", + "example": "packingInstructions" + }, + "subsidiaryClasses": { + "type": "array", + "description": "Specifies subsidiary Classes.
          Example:[\"Subsidiary Classes\"]", + "example": [ + "Subsidiary Classes" + ], + "items": { + "type": "string" + } + }, + "labelText": { + "type": "string", + "description": "Specifies Hazard Label Text.
          Example: labelText", + "example": "labelText" + }, + "tunnelRestrictionCode": { + "type": "string", + "description": "There are five categories of tunnel categorization with A representing the least restrictive and E as the most restrictive. Category A, as the least restrictive, will not be sign-posted. Category E, the most restrictive, only allows the passage of UN2919, UN3291, UN3331, UN3359 and UN3373.
          Example: UN2919", + "example": "UN2919" + }, + "specialProvisions": { + "type": "string", + "description": "Specifies Special Provisions if any.
          Example: specialProvisions", + "example": "specialProvisions" + }, + "properShippingNameAndDescription": { + "type": "string", + "description": "Fully-expanded descriptive text for a hazardous commodity.
          Example: properShippingNameAndDescription", + "example": "properShippingNameAndDescription" + }, + "technicalName": { + "type": "string", + "description": "Specifies Technical Name.
          Example: technicalName", + "example": "technicalName" + }, + "symbols": { + "type": "string", + "description": "Specifies Symbols.
          Example: symbols", + "example": "symbols" + }, + "authorization": { + "type": "string", + "description": "Information related to quantity limitations and operator or state variations as may be applicable to the dangerous goods commodity.", + "example": "authorization" + }, + "attributes": { + "type": "array", + "description": "Specifies attributes.
          Example: [\"attributes\"]", + "example": [ + "attributes" + ], + "items": { + "type": "string" + } + }, + "id": { + "type": "string", + "description": "Specifies the Identification.
          Example: 1234", + "example": "1234" + }, + "packingGroup": { + "type": "string", + "description": "Specifies packing Group.
          Example: Packing Group", + "example": "packingGroup" + }, + "properShippingName": { + "type": "string", + "description": "Specifies Proper Shipping Name.
          Example: Proper Shipping Name", + "example": "properShippingName" + }, + "hazardClass": { + "type": "string", + "description": "Specifies hazard class.
          Example: Hazard Class", + "example": "hazardClass" + } + }, + "description": "Identifies and describes an individual hazardous commodity. For 201001 load, this is based on data from the FedEx Ground Hazardous Materials Shipping Guide." + }, + "NetExplosiveDetail": { + "type": "object", + "properties": { + "amount": { + "type": "number", + "description": "Specifies amount.
          Example: 10.0", + "format": "double", + "example": 10 + }, + "units": { + "type": "string", + "description": "Specifies net explosive units.
          Example: units", + "example": "units" + }, + "type": { + "type": "string", + "description": "Specifies net explosive classification type.
          Example: NET_EXPLOSIVE_WEIGHT", + "example": "NET_EXPLOSIVE_WEIGHT" + } + }, + "description": "Specifies the total mass of the contained explosive substances, without the mass of any casings, bullets, shells, etc." + }, + "ShipmentOperationalDetail": { + "type": "object", + "properties": { + "originServiceArea": { + "type": "string", + "description": "Indicates the origin service area.
          Example: A1", + "example": "A1" + }, + "serviceCode": { + "type": "string", + "description": "Indicates the service code.
          Example: 010", + "example": "010" + }, + "airportId": { + "type": "string", + "description": "Indicates the airport identifier.
          Example: DFW", + "example": "DFW" + }, + "postalCode": { + "type": "string", + "description": "Specifies the postal code.
          Example: 38010
          click here to see Postal aware countries", + "example": "38010" + }, + "scac": { + "type": "string", + "description": "Indicates standard carrier alpha code.", + "example": "scac" + }, + "deliveryDay": { + "type": "string", + "description": "Specifies expected/estimated day of week of the delivery.
          Example: TUE", + "example": "TUE" + }, + "originLocationId": { + "type": "string", + "description": "This is the origin Location identifier.
          Example: 678", + "example": "678" + }, + "countryCode": { + "type": "string", + "description": "Indicate the two-letter country code.
          Example: US
          click here to see Country codes", + "example": "US" + }, + "astraDescription": { + "type": "string", + "description": "Specifies astra description.
          Example: SMART POST", + "example": "SMART POST" + }, + "originLocationNumber": { + "type": "integer", + "description": "Specifies origin location number.
          Example: 243", + "format": "int32", + "example": 243 + }, + "deliveryDate": { + "type": "string", + "description": "Specifies delivery date for the shipment. The format is [YYYY-MM-DD]
          Example: 2001-04-05", + "example": "2001-04-05" + }, + "deliveryEligibilities": { + "type": "array", + "description": "FedEx Ground delivery features for which this shipment may be eligible.
          Example: [\"deliveryEligibilities\"]", + "example": [ + "deliveryEligibilities" + ], + "items": { + "type": "string" + } + }, + "ineligibleForMoneyBackGuarantee": { + "type": "boolean", + "description": "Indicates that this shipment is not eligible for money back guarantee.", + "example": true + }, + "maximumTransitTime": { + "type": "string", + "description": "Maximum expected transit time.
          Example: SEVEN_DAYS", + "example": "SEVEN_DAYS" + }, + "destinationLocationStateOrProvinceCode": { + "type": "string", + "description": "This is the state or province code of the shipment destination location, and is not necessarily the same as the postal state.
          Example: GA
          click here to see State or Province Code", + "example": "GA" + }, + "astraPlannedServiceLevel": { + "type": "string", + "description": "Text describing planned delivery.
          Example: TUE - 15 OCT 10:30A", + "example": "TUE - 15 OCT 10:30A" + }, + "destinationLocationId": { + "type": "string", + "description": "Specifies the FedEx Destination Location Identifier.
          Example: DALA", + "example": "DALA" + }, + "transitTime": { + "type": "string", + "description": "Standard transit time per origin, destination, and service.
          Example: TWO_DAYS", + "example": "TWO_DAYS" + }, + "stateOrProvinceCode": { + "type": "string", + "description": "This is a placeholder for State or Province code.State code is required for US, CA, PR and not required for other countries. Conditional. Max length is 2.
          Example: CA
          click here to see State or Province Code", + "example": "GA" + }, + "destinationLocationNumber": { + "type": "integer", + "description": "Indicates destination location number.
          Example: 876", + "format": "int32", + "example": 876 + }, + "packagingCode": { + "type": "string", + "description": "Indicates packaging code.
          Example: 03", + "example": "03" + }, + "commitDate": { + "type": "string", + "description": "This is committed date of delivery.
          Example: 2019-10-15", + "example": "2019-10-15" + }, + "publishedDeliveryTime": { + "type": "string", + "description": "This is delivery time, as published in Service Guide.
          Example: 10:30A", + "example": "10:30A" + }, + "ursaSuffixCode": { + "type": "string", + "description": "This is ursa suffix code.
          Example: Ga", + "example": "Ga" + }, + "ursaPrefixCode": { + "type": "string", + "description": "This is ursa prefix code.
          Example: XH", + "example": "XH" + }, + "destinationServiceArea": { + "type": "string", + "description": "Specifies destination service area.
          Example: A1", + "example": "A1" + }, + "commitDay": { + "type": "string", + "description": "Committed day of week of delivery.
          Example: TUE", + "example": "TUE" + }, + "customTransitTime": { + "type": "string", + "description": "Transit time based on customer eligibility.
          Example: ONE_DAY", + "example": "ONE_DAY" + } + }, + "description": "Indicates the shipment level operational information." + }, + "CompletedHoldAtLocationDetail": { + "type": "object", + "properties": { + "holdingLocationType": { + "type": "string", + "description": "Indicates the type of the FedEx holding location
          Example: FEDEX_STAFFED", + "example": "FEDEX_STAFFED" + }, + "holdingLocation": { + "description": "Indicate the physical address of the FedEx holding location.", + "allOf": [ + { + "$ref": "#/components/schemas/JustContactAndAddress" + } + ] + } + }, + "description": "This is default holding location information when HOLD_AT_LOCATION special service is requested and the client does not specify the hold location address." + }, + "JustContactAndAddress": { + "type": "object", + "properties": { + "address": { + "$ref": "#/components/schemas/Address" + }, + "contact": { + "$ref": "#/components/schemas/Contact" + } + } + }, + "Address": { + "type": "object", + "properties": { + "streetLines": { + "type": "array", + "description": "This is the combination of number, street name, etc.
          Note: At least one line is required and streetlines more than 3 will be ignored. Empty lines should not be included. Maximum length per line is 35.
          Example: [10 FedEx Parkway, Suite 302, .etc.]", + "items": { + "type": "string" + } + }, + "city": { + "type": "string", + "description": "This is a placeholder for City Name.
          Note: This is conditional and not required in all the requests.
          Note: It is recommended for Express shipments for the most accurate ODA and OPA surcharges.
          Example: Beverly Hills" + }, + "stateOrProvinceCode": { + "type": "string", + "description": "This is a placeholder for State or Province code.State code is required for US, CA, PR and not required for other countries. Conditional. Max length is 2.
          Example: CA
          click here to see State or Province Code" + }, + "postalCode": { + "type": "string", + "description": "Indicate the Postal code. This is Optional for non postal-aware countries. Maximum length is 10.
          Example: 65247
          click here to see Postal aware countries" + }, + "countryCode": { + "type": "string", + "description": "This is the two-letter country code.
          Maximum length is 2.
          Example: US
          click here to see Country codes" + }, + "residential": { + "type": "boolean", + "description": "Indicate whether this address is residential (as opposed to commercial)." + } + }, + "description": "Descriptive data for a physical location. May be used as an actual physical address (place to which one could go), or as a container of \"address parts\" which should be handled as a unit (such as a city-state-ZIP combination within the US).", + "example": { + "streetLines": [ + "10 FedEx Parkway", + "Suite 302" + ], + "city": "Beverly Hills", + "stateOrProvinceCode": "CA", + "postalCode": "38127", + "countryCode": "US", + "residential": false + } + }, + "Contact": { + "type": "object", + "properties": { + "personName": { + "type": "string", + "description": "Specify person name.
          Example: John Taylor", + "example": "John" + }, + "emailAddress": { + "type": "string", + "description": "Specify email address.
          Example: sample@company.com" + }, + "phoneNumber": { + "type": "string", + "description": "The shippers phone number.
          Minimum length is 10 and supports maximum of 15 for certain countries using longer phone numbers.
          Note: For US and CA, a phone number must have exactly 10 digits, plus an optional leading country code of 1 or +1.
          Example: 918xxxxx890" + }, + "phoneExtension": { + "type": "string", + "description": "The shipper's phone extension. Max length is 6.
          Example: 91" + }, + "companyName": { + "type": "string", + "description": "Specify company name." + } + }, + "description": "Specify the contact information." + }, + "CompletedEtdDetail": { + "type": "object", + "properties": { + "folderId": { + "type": "string", + "description": "Returns the folder id where the documents is uploaded
          Example: \"0b0493e580dc1a1b\"", + "example": "0b0493e580dc1a1b" + }, + "type": { + "type": "string", + "description": "Returns the type of the document that is being uploaded
          Example: \"COMMERCIAL_INVOICE\"", + "example": "COMMERCIAL_INVOICE" + }, + "uploadDocumentReferenceDetails": { + "type": "array", + "description": "Specify the document upload reference details.", + "items": { + "$ref": "#/components/schemas/UploadDocumentReferenceDetail" + } + } + }, + "description": "These are completed ETD details when ELECTRONIC_TRADE_DOCUMENTS Special service type is requested" + }, + "ServiceDescription": { + "type": "object", + "properties": { + "serviceType": { + "type": "string", + "description": "Indicate the FedEx serviceType used for this shipment. The results will be filtered by the serviceType value indicated.
          Example: STANDARD_OVERNIGHT
          click here to see Service Types", + "example": "FEDEX_1_DAY_FREIGHT" + }, + "code": { + "type": "string", + "description": "Specifies code of the Service.
          example: 80", + "example": "80" + }, + "names": { + "type": "array", + "description": "Branded, translated, and/or localized names for this service.", + "items": { + "$ref": "#/components/schemas/ProductName" + } + }, + "operatingOrgCodes": { + "type": "array", + "description": "FOR FEDEX INTERNAL USE ONLY. The operating org code in a service.
          Example: [\"FXE\", \"FXE\"]", + "example": [ + "FXE" + ], + "items": { + "type": "string" + } + }, + "astraDescription": { + "type": "string", + "description": "Specifies astra Description.
          Example: 2 DAY FRT", + "example": "2 DAY FRT" + }, + "description": { + "type": "string", + "description": "specifies the description.
          Example:description", + "example": "description" + }, + "serviceId": { + "type": "string", + "description": "FOR FEDEX INTERNAL USE ONLY, Designates the service ID.
          Example: EP1000000027", + "example": "EP1000000027" + }, + "serviceCategory": { + "type": "string", + "description": "FOR FEDEX INTERNAL USE ONLY. This is tied to the Product EFS interface definition which will currently contain the values of parcel.
          Example: EXPRESS_PARCEL", + "example": "freight" + } + }, + "description": "Descriptions for a service." + }, + "ProductName": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "The type of name (long, medium, short, etc.) to which this value refers.
          Example: long", + "example": "long" + }, + "encoding": { + "type": "string", + "description": "The character encoding used to represent this product name.
          Example: UTF-8", + "example": "UTF-8" + }, + "value": { + "type": "string", + "description": "Specifies the value of the Product.
          Example: F-2", + "example": "F-2" + } + }, + "description": "Product Name information." + }, + "CompletedHazardousShipmentDetail": { + "type": "object", + "properties": { + "hazardousSummaryDetail": { + "$ref": "#/components/schemas/CompletedHazardousSummaryDetail" + }, + "adrLicense": { + "$ref": "#/components/schemas/AdrLicenseDetail" + }, + "dryIceDetail": { + "$ref": "#/components/schemas/ShipmentDryIceDetail" + } + }, + "description": "Completed shipment level hazardous commodity information." + }, + "CompletedHazardousSummaryDetail": { + "type": "object", + "properties": { + "smallQuantityExceptionPackageCount": { + "type": "integer", + "description": "Specifies the total number of packages containing hazardous commodities in small exceptions.
          Example: 10", + "format": "int32", + "example": 10 + } + }, + "description": "Specifies Completed Hazardous Summary Detail." + }, + "AdrLicenseDetail": { + "type": "object", + "properties": { + "licenseOrPermitDetail": { + "$ref": "#/components/schemas/LicenseOrPermitDetail" + } + }, + "description": "Specifies the details around the ADR license required for shipping." + }, + "LicenseOrPermitDetail": { + "type": "object", + "properties": { + "number": { + "type": "string", + "description": "Specifies license or permit detail number.
          Example: 12345", + "example": "12345" + }, + "effectiveDate": { + "type": "string", + "description": "Specifies the effective date of the license.
          The format is [YYYY-MM-DD].
          Example: 2019-08-09", + "example": "2019-08-09" + }, + "expirationDate": { + "type": "string", + "description": "Specifies the expiration date of the license.
          The format is [YYYY-MM-DD].
          Example: 2019-04-09", + "example": "2019-04-09" + } + }, + "description": "This contains the ADR license information, which identifies the license number, the effective date and the expiration date under which the customer is allowed to ship." + }, + "ShipmentDryIceDetail": { + "required": [ + "packageCount" + ], + "type": "object", + "properties": { + "totalWeight": { + "description": "Specify total dry ice weight for the shipment.", + "allOf": [ + { + "$ref": "#/components/schemas/Weight" + } + ] + }, + "packageCount": { + "type": "integer", + "description": "Specifies the package Count for the shipment
          Example: 10", + "format": "int32", + "example": 10 + }, + "processingOptions": { + "$ref": "#/components/schemas/ShipmentDryIceProcessingOptionsRequested" + } + }, + "description": "Specifies the shipment level totals of dry ice data across all packages." + }, + "ShipmentDryIceProcessingOptionsRequested": { + "type": "object", + "properties": { + "options": { + "type": "array", + "description": "Specifies the options.
          Example: [\"options\"]", + "example": [ + "options" + ], + "items": { + "type": "string" + } + } + }, + "description": "Specify that dry ice information is only applicable at the shipment level. Package level dry ice information would not apply." + }, + "ShipmentRating": { + "type": "object", + "properties": { + "actualRateType": { + "type": "string", + "description": "This rate type identifies which entry in the following array is considered as presenting the \"actual\" rates for the shipment.
          Example: PAYOR_LIST_SHIPMENT", + "example": "PAYOR_LIST_SHIPMENT" + }, + "shipmentRateDetails": { + "type": "array", + "description": "Each element of this field provides shipment-level rate totals for a specific rate type.", + "items": { + "$ref": "#/components/schemas/ShipmentRateDetail" + } + } + }, + "description": "All shipment-level rating data for this shipment, which may include data for multiple rate types." + }, + "ShipmentRateDetail": { + "type": "object", + "properties": { + "rateZone": { + "type": "string", + "description": "Indicates the rate zone used (based on origin and destination).
          Example: US001O", + "example": "US001O" + }, + "ratedWeightMethod": { + "type": "string", + "description": "Indicates which weight was used.
          Example: ACTUAL", + "example": "ACTUAL" + }, + "totalDutiesTaxesAndFees": { + "type": "number", + "description": "The total of the total duties & taxes and the total ancillary fees & taxes.
          Example: 24.56", + "format": "double", + "example": 24.56 + }, + "pricingCode": { + "type": "string", + "description": "Specifies pricing Code.
          Example: PACKAGE", + "example": "LTL_FREIGHT" + }, + "totalFreightDiscounts": { + "type": "number", + "description": "The total discounts used in the rate calculation.
          Example: 1.56", + "format": "double", + "example": 1.56 + }, + "totalTaxes": { + "type": "number", + "description": "Total of the transportation-based taxes.
          Example: 3.45", + "format": "double", + "example": 3.45 + }, + "totalDutiesAndTaxes": { + "type": "number", + "description": "Total of all values under this shipment's duties and taxes; only provided if estimated duties and taxes were calculated for this shipment.
          Example: 6.78", + "format": "double", + "example": 6.78 + }, + "totalAncillaryFeesAndTaxes": { + "type": "number", + "description": "Identifies the total amount of the shipment-level fees and taxes that are not based on transportation charges or commodity-level estimated duties and taxes.
          Example: 5.67", + "format": "double", + "example": 5.67 + }, + "taxes": { + "type": "array", + "description": "All transportation-based taxes applicable to this shipment.", + "items": { + "allOf": [ + { + "$ref": "#/components/schemas/Tax" + } + ] + } + }, + "totalRebates": { + "type": "number", + "description": "The total sum of all rebates applied to this shipment.
          Example: 1.98", + "format": "double", + "example": 1.98 + }, + "fuelSurchargePercent": { + "type": "number", + "description": "Specifies a fuel surcharge percentage.
          Example: 4.56", + "format": "double", + "example": 4.56 + }, + "currencyExchangeRate": { + "$ref": "#/components/schemas/CurrencyExchangeRate" + }, + "totalNetFreight": { + "type": "number", + "description": "The freight charge minus discounts.
          Example: 9.56", + "format": "double", + "example": 9.56 + }, + "totalNetFedExCharge": { + "type": "number", + "description": "This is the sum of shipment's total net freight, total surchages (not including totalTaxes).
          Example: 88.56", + "format": "double", + "example": 88.56 + }, + "shipmentLegRateDetails": { + "type": "array", + "description": "This is data for a single leg of a shipment's total/summary rates, as calculated per a specific rate type.", + "items": { + "$ref": "#/components/schemas/ShipmentLegRateDetail" + } + }, + "dimDivisor": { + "type": "integer", + "description": "The value used to calculate the weight based on the dimensions.
          Example: 0", + "format": "int32", + "example": 0 + }, + "rateType": { + "type": "string", + "description": "The Type used for this specific set of rate data.
          Example: RATED_ACCOUNT_SHIPMENT", + "example": "RATED_ACCOUNT_SHIPMENT" + }, + "surcharges": { + "type": "array", + "description": "All surcharges that apply to this shipment.
          click here to see Surcharges", + "items": { + "$ref": "#/components/schemas/Surcharge" + } + }, + "totalSurcharges": { + "type": "number", + "description": "The total amount of all surcharges applied to this shipment.
          Example: 9.88", + "format": "double", + "example": 9.88 + }, + "totalBillingWeight": { + "description": "The weight used to calculate these rates.", + "allOf": [ + { + "$ref": "#/components/schemas/Weight" + } + ] + }, + "freightDiscounts": { + "type": "array", + "description": "Indicates the freight discounts.", + "items": { + "$ref": "#/components/schemas/RateDiscount" + } + }, + "rateScale": { + "type": "string", + "description": "Indicates the rate scale used.
          Example: 00000", + "example": "00000" + }, + "totalNetCharge": { + "type": "number", + "description": "The net charge after applying all discounts and surcharges.
          Example: 3.78", + "format": "double", + "example": 3.78 + }, + "totalBaseCharge": { + "type": "number", + "description": "The total Shipment charge that was calculated before surcharges, discounts and taxes.
          Example: 234.56", + "format": "double", + "example": 234.56 + }, + "totalNetChargeWithDutiesAndTaxes": { + "type": "number", + "description": "This is the sum of shipment's total net charges and total duties and taxes; only provided if estimated duties and taxes were calculated for this shipment AND duties, taxes and transportation charges are all paid by the same sender account.
          Example: 222.56", + "format": "double", + "example": 222.56 + }, + "currency": { + "type": "string", + "description": "Indicates the currency code.
          click here to see Currency Codes", + "example": "USD" + } + }, + "description": "This is a placeholder for shipment total/summary rates details, as calculated per a specific rate type. The totals may differ from the sum of corresponding package data for Multiweight or Express MPS." + }, + "Tax": { + "type": "object", + "properties": { + "amount": { + "type": "number", + "description": "Indicates the amount of tax.
          Example: 10.0", + "format": "double", + "example": 10 + }, + "level": { + "type": "string", + "description": "Indicates the Level of Tax.
          Example: level", + "example": "level" + }, + "description": { + "type": "string", + "description": "Placeholder for the tax description.
          Example: descrption", + "example": "description" + }, + "type": { + "type": "string", + "description": "Placeholder for the Type of the Tax.
          Example:type", + "example": "type" + } + }, + "description": "Specifies the tax for the shipment." + }, + "CurrencyExchangeRate": { + "type": "object", + "properties": { + "rate": { + "type": "number", + "description": "Multiplier used to convert from Currency units to into Currency units.
          Example: 25.6", + "format": "double", + "example": 25.6 + }, + "fromCurrency": { + "type": "string", + "description": "The currency code for the original (converted FROM) currency.
          Example: Rupee
          click here to see Currency codes", + "example": "Rupee" + }, + "intoCurrency": { + "type": "string", + "description": "The currency code for the final(converted INTO) currency.
          Example: USD
          click here to see currencycodes", + "example": "USD" + } + }, + "description": "Specifies the currency exchange performed on financial amounts on this rate." + }, + "ShipmentLegRateDetail": { + "type": "object", + "properties": { + "rateZone": { + "type": "string", + "description": "Indicates the rate zone used (based on origin and destination).
          Example: rateZone", + "example": "rateZone" + }, + "pricingCode": { + "type": "string", + "description": "Specifies the Pricing Code.
          Example: pricingCode", + "example": "pricingCode" + }, + "taxes": { + "type": "array", + "description": "Specifies the taxes.", + "items": { + "$ref": "#/components/schemas/Tax" + } + }, + "totalDimWeight": { + "description": "Sum of dimensional weights for all packages.", + "allOf": [ + { + "$ref": "#/components/schemas/Weight" + } + ] + }, + "totalRebates": { + "type": "number", + "description": "Specifies the total rebate.
          Example: 2.0", + "format": "double", + "example": 2 + }, + "fuelSurchargePercent": { + "type": "number", + "description": "Specifies a fuel surcharge percentage.
          Example: 6.0", + "format": "double", + "example": 6 + }, + "currencyExchangeRate": { + "description": "Specifies currency exchange rate.", + "allOf": [ + { + "$ref": "#/components/schemas/CurrencyExchangeRate" + } + ] + }, + "dimDivisor": { + "type": "integer", + "description": "The value used to calculate the weight based on the dimensions.
          Example: 6", + "format": "int32", + "example": 6 + }, + "rateType": { + "type": "string", + "description": "Type used for this specific set of rate data.
          Example: PAYOR_RETAIL_PACKAGE", + "example": "PAYOR_RETAIL_PACKAGE" + }, + "legDestinationLocationId": { + "type": "string", + "description": "Specifies the location id the destination of shipment leg.
          Example: HKAA", + "example": "legDestinationLocationId" + }, + "dimDivisorType": { + "type": "string", + "description": "Identifies the type of dim divisor that was applied.
          Example: dimDivisorType", + "example": "dimDivisorType" + }, + "totalBaseCharge": { + "type": "number", + "description": "The total freight charge that was calculated before surcharges, discounts and taxes.
          Example: 6.0", + "format": "double", + "example": 6 + }, + "ratedWeightMethod": { + "type": "string", + "description": "Indicates which weight was used.
          Example: ratedWeightMethod", + "example": "ratedWeightMethod" + }, + "totalFreightDiscounts": { + "type": "number", + "description": "The sum of all discounts.
          Example: 9.0", + "format": "double", + "example": 9 + }, + "totalTaxes": { + "type": "number", + "description": "Total of the transportation-based taxes.
          Example: 12.6", + "format": "double", + "example": 12.6 + }, + "minimumChargeType": { + "type": "string", + "description": "Specifies minimum charge type.Example: minimumChargeType", + "example": "minimumChargeType" + }, + "totalDutiesAndTaxes": { + "type": "number", + "description": "Total of shipments duties and taxes; only provided if estimated duties and taxes were calculated for this shipment.
          Example: 17.78", + "format": "double", + "example": 17.78 + }, + "totalNetFreight": { + "type": "number", + "description": "The freight charge minus discounts.
          Example: 6.0", + "format": "double", + "example": 6 + }, + "totalNetFedExCharge": { + "type": "number", + "description": "This is the sum of shipment's total surcharges (not including total taxes).
          Example: 3.2", + "format": "double", + "example": 3.2 + }, + "surcharges": { + "type": "array", + "description": "All surcharges that apply to this shipment.
          click here to see surcharges", + "items": { + "$ref": "#/components/schemas/Surcharge" + } + }, + "totalSurcharges": { + "type": "number", + "description": "The total of all surcharges.
          Example: 5.0", + "format": "double", + "example": 5 + }, + "totalBillingWeight": { + "description": "The weight used to calculate these rates.", + "allOf": [ + { + "$ref": "#/components/schemas/Weight" + } + ] + }, + "freightDiscounts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RateDiscount" + } + }, + "rateScale": { + "type": "string", + "description": "Indicates the rate scale used.
          Example: 6702", + "example": "6702" + }, + "totalNetCharge": { + "type": "number", + "description": "The net charge after applying all discounts and surcharges.
          Example: 253", + "format": "double", + "example": 253 + }, + "totalNetChargeWithDutiesAndTaxes": { + "type": "number", + "description": "Sum of total net charge, total duties and taxes; only provided if estimated duties and taxes were calculated for this shipment and duties, taxes and transportation charges are all paid by the same sender account.
          Example: 25.67", + "format": "double", + "example": 25.67 + }, + "currency": { + "type": "string", + "description": "This is the currency code for the amount.
          Example: USD
          click here to see Currency codes", + "example": "USD" + } + }, + "description": "This is a placeholder for single leg of a shipment rates details, as calculated per a specific rate type." + }, + "RateDiscount": { + "type": "object", + "properties": { + "amount": { + "type": "number", + "description": "Specifies the amount.
          Example: 8.9", + "format": "double", + "example": 8.9 + }, + "rateDiscountType": { + "type": "string", + "description": "The type of rate discount.
          Valid Values are BONUS, COUPON,EARNED,OTHER,VOLUME.
          Example: COUPON", + "example": "COUPON" + }, + "percent": { + "type": "number", + "description": "Specifies the percentage of Rate discount.
          Example: 28.9", + "format": "double", + "example": 28.9 + }, + "description": { + "type": "string", + "description": "Specifies the description of the discounted rate.
          Example: description", + "example": "description" + } + }, + "description": "Specifies discount Rate for Shipment." + }, + "DocumentRequirementsDetail": { + "type": "object", + "properties": { + "requiredDocuments": { + "type": "array", + "description": "Indicates the required documents information.
          Example: [\"COMMERCIAL_OR_PRO_FORMA_INVOICE\",\"AIR_WAYBILL\"]", + "example": [ + "COMMERCIAL_OR_PRO_FORMA_INVOICE", + "AIR_WAYBILL" + ], + "items": { + "type": "string" + } + }, + "prohibitedDocuments": { + "type": "array", + "description": "Indicates the prohibited Documents info.
          Example: [\"CERTIFICATE_OF_ORIGIN \"]", + "example": [ + "CERTIFICATE_OF_ORIGIN" + ], + "items": { + "type": "string" + } + }, + "generationDetails": { + "type": "array", + "description": "Specifies the generation details.", + "items": { + "$ref": "#/components/schemas/DocumentGenerationDetail" + } + } + }, + "description": "Indicates the document requirements detail." + }, + "DocumentGenerationDetail": { + "type": "object", + "properties": { + "letterhead": { + "type": "string", + "description": "Indicates the letterhead requirement type.
          Example: OPTIONAL" + }, + "electronicSignature": { + "type": "string", + "description": "Indicates electronic signature requirement type.
          Example: OPTIONAL" + }, + "minimumCopiesRequired": { + "type": "integer", + "description": "It is a non-Negative Integer.
          Example: 3", + "format": "int32" + }, + "type": { + "type": "string", + "description": "It is an Enterprise Document Type.
          Example: COMMERCIAL_INVOICE" + } + }, + "description": "Indicates the document generation detail information.", + "example": { + "type": "COMMERCIAL_INVOICE", + "minimumCopiesRequired": 3, + "letterhead": "OPTIONAL", + "electronicSignature": "OPTIONAL" + } + }, + "PendingShipmentAccessDetail": { + "type": "object", + "properties": { + "accessorDetails": { + "type": "array", + "description": "Indicates the details about the users who can access the shipment.", + "items": { + "$ref": "#/components/schemas/PendingShipmentAccessorDetail" + } + } + }, + "description": "This information describes how and when a online email return label shipment may be accessed for completion." + }, + "PendingShipmentAccessorDetail": { + "type": "object", + "properties": { + "password": { + "type": "string", + "description": "Specifies the accessor password.
          Example: password", + "example": "password" + }, + "role": { + "type": "string", + "description": "Specifies the accessor role.
          Example: role", + "example": "role" + }, + "emailLabelUrl": { + "type": "string", + "description": "Specifies the URL for the email label.
          Example: emailLabelUrl", + "example": "emailLabelUrl" + }, + "userId": { + "type": "string", + "description": "Specifies the accessor User ID.
          Example: userId", + "example": "userId" + } + }, + "description": "Specifies details for how to access the pending email return label." + }, + "ShipmentAdvisoryDetails": { + "type": "object", + "properties": { + "regulatoryAdvisory": { + "$ref": "#/components/schemas/RegulatoryAdvisoryDetail" + } + }, + "description": "These are shipment advisory details." + }, + "RegulatoryAdvisoryDetail": { + "type": "object", + "properties": { + "prohibitions": { + "type": "array", + "description": "It is a regulatory probitions.", + "items": { + "$ref": "#/components/schemas/RegulatoryProhibition" + } + } + }, + "description": "Indicates the regulatory advisory details." + }, + "SuggestedCommodityDetail": { + "type": "object", + "properties": { + "description": { + "type": "string", + "description": "This is a suggested commodity description.
          Example: Commodity", + "example": "description" + }, + "harmonizedCode": { + "type": "string", + "description": "Specify the harmonized code.
          Example: XXX12", + "example": "harmonized Code" + } + } + }, + "RegulatoryProhibition": { + "type": "object", + "properties": { + "derivedHarmonizedCode": { + "type": "string", + "description": "Indicates the derived harmonized code value
          Example: 01", + "example": "01" + }, + "advisory": { + "$ref": "#/components/schemas/Message" + }, + "commodityIndex": { + "type": "integer", + "description": "Indicates one based index identifying the associated commodity.
          Example: 12", + "format": "int32", + "example": 12 + }, + "source": { + "type": "string", + "description": "Indicates the prohibition source type.
          Example: source", + "example": "source" + }, + "categories": { + "type": "array", + "description": "Indicate the shipment rule type.
          Example: [\"categories\"]", + "example": [ + "categories" + ], + "items": { + "type": "string" + } + }, + "type": { + "type": "string", + "description": "Indicates the prohibition type.
          Example: type", + "example": "type" + }, + "waiver": { + "$ref": "#/components/schemas/RegulatoryWaiver" + }, + "status": { + "type": "string", + "description": "Indicates the prohibitory status.
          Example: status", + "example": "status" + } + } + }, + "Message": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Specifies the message code for the tag created.
          Example: code", + "example": "code" + }, + "text": { + "type": "string", + "description": "Specifies the text message for the tag created.
          Example: Text", + "example": "Text" + }, + "parameters": { + "type": "array", + "description": "Specifies the message parameters list.", + "items": { + "$ref": "#/components/schemas/MessageParameter" + } + }, + "localizedText": { + "type": "string", + "description": "Specifies the message ID and value.
          Example: localizedText", + "example": "localizedText" + } + }, + "description": "Specifies the advisory details." + }, + "MessageParameter": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Specifies the message parameter code.
          Example: message ID", + "example": "message ID" + }, + "value": { + "type": "string", + "description": "Specifies the message parameter value of the code.
          Example: value", + "example": "Message value" + } + } + }, + "RegulatoryWaiver": { + "type": "object", + "properties": { + "advisories": { + "type": "array", + "description": "Indicates the advisories list.", + "items": { + "$ref": "#/components/schemas/Message" + } + }, + "description": { + "type": "string", + "description": "Indicates the regulatory prohibitions description.
          Example: description", + "example": "description" + }, + "id": { + "type": "string", + "description": "Indicates the prohibitory ID.
          Example: id", + "example": "id" + } + }, + "description": "Indicates the regulatory waiver." + }, + "ErrorResponseVO": { + "type": "object", + "properties": { + "transactionId": { + "type": "string", + "description": "The transaction ID is a special set of numbers that defines each transaction.
          Example: 624deea6-b709-470c-8c39-4b5511281492", + "example": "624deea6-b709-470c-8c39-4b5511281492" + }, + "customerTransactionId": { + "type": "string", + "description": "This element allows you to assign a unique identifier to your transaction. This element is also returned in the reply and helps you match the request to the reply.
          Example: AnyCo_order123456789", + "example": "AnyCo_order123456789" + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CXSError" + } + } + } + }, + "CXSError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Indicates the error code.
          Example: SHIPMENT.USER.UNAUTHORIZED" + }, + "parameterList": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Parameter" + } + }, + "message": { + "type": "string", + "description": "Indicates the description of API error alert message.
          Example: Requested user is not authorized to perform the operation." + } + }, + "description": "Indicates error alert when suspicious files, potential exploits and viruses found while scanning files , directories and user accounts. This includes code, message and parameter" + }, + "Parameter": { + "type": "object", + "properties": { + "value": { + "type": "string", + "description": "Identifies the error option to be applied." + }, + "key": { + "type": "string", + "description": "Indicates the value associated with the key." + } + }, + "description": "List of parameters which indicates the properties of the alert message." + }, + "ErrorResponseVO401": { + "type": "object", + "properties": { + "transactionId": { + "type": "string", + "description": "The transaction ID is a special set of numbers that defines each transaction.
          Example: 624deea6-b709-470c-8c39-4b5511281492", + "example": "624deea6-b709-470c-8c39-4b5511281492" + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CXSError401" + } + } + } + }, + "CXSError401": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Indicates the error code.
          Example: NOT.AUTHORIZED.ERROR" + }, + "parameterList": { + "type": "array", + "description": "Specifies list of parameters.", + "items": { + "$ref": "#/components/schemas/Parameter" + } + }, + "message": { + "description": "Indicates the description of API error alert message.
          Example: Access token expired. Please modify your request and try again." + } + }, + "description": "Indicates error alert when suspicious files, potential exploits and viruses found while scanning files , directories and user accounts. This includes code, message and parameter" + }, + "ErrorResponseVO403": { + "type": "object", + "properties": { + "transactionId": { + "type": "string", + "description": "The transaction ID is a special set of numbers that defines each transaction.
          Example: 624deea6-b709-470c-8c39-4b5511281492", + "example": "624deea6-b709-470c-8c39-4b5511281492" + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CXSError403" + } + } + } + }, + "CXSError403": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Indicates the error code.
          Example: FORBIDDEN.ERROR" + }, + "parameterList": { + "type": "array", + "description": "Specifies list of parameters.", + "items": { + "$ref": "#/components/schemas/Parameter" + } + }, + "message": { + "description": "Indicates the description of API error alert message.
          Example: We could not authorize your credentials. Please check your permissions and try again" + } + }, + "description": "Indicates error alert when suspicious files, potential exploits and viruses found while scanning files , directories and user accounts. This includes code, message and parameter" + }, + "ErrorResponseVO404": { + "type": "object", + "properties": { + "transactionId": { + "type": "string", + "description": "The transaction ID is a special set of numbers that defines each transaction.
          Example: 624deea6-b709-470c-8c39-4b5511281492", + "example": "624deea6-b709-470c-8c39-4b5511281492" + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CXSError404" + } + } + } + }, + "CXSError404": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Indicates the error code.
          Example: NOT.FOUND.ERROR" + }, + "parameterList": { + "type": "array", + "description": "Specifies list of parameters.", + "items": { + "$ref": "#/components/schemas/Parameter" + } + }, + "message": { + "description": "Indicates the description of API error alert message.
          Example: The resource you requested is no longer available. Please modify your request and try again." + } + }, + "description": "Indicates error alert when suspicious files, potential exploits and viruses found while scanning files , directories and user accounts. This includes code, message and parameter" + }, + "ErrorResponseVO500": { + "type": "object", + "properties": { + "transactionId": { + "type": "string", + "description": "The transaction ID is a special set of numbers that defines each transaction.
          Example: 624deea6-b709-470c-8c39-4b5511281492", + "example": "624deea6-b709-470c-8c39-4b5511281492" + }, + "customerTransactionId": { + "type": "string", + "description": "This element allows you to assign a unique identifier to your transaction. This element is also returned in the reply and helps you match the request to the reply.
          Example: AnyCo_order123456789", + "example": "AnyCo_order123456789" + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CXSError500" + } + } + } + }, + "CXSError500": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Indicates the error code.
          Example: INTERNAL.SERVER.ERROR" + }, + "parameterList": { + "type": "array", + "description": "Specifies list of parameters.", + "items": { + "$ref": "#/components/schemas/Parameter" + } + }, + "message": { + "description": "Indicates the description of API error alert message.
          Example: We encountered an unexpected error and are working to resolve the issue. We apologize for any inconvenience. Please check back at a later time." + } + }, + "description": "Indicates error alert when suspicious files, potential exploits and viruses found while scanning files , directories and user accounts. This includes code, message and parameter" + }, + "ErrorResponseVO503": { + "type": "object", + "properties": { + "transactionId": { + "type": "string", + "description": "The transaction ID is a special set of numbers that defines each transaction.
          Example: 624deea6-b709-470c-8c39-4b5511281492", + "example": "624deea6-b709-470c-8c39-4b5511281492" + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CXSError503" + } + } + } + }, + "CXSError503": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Indicates the error code.
          Example: SERVICE.UNAVAILABLE.ERROR" + }, + "parameterList": { + "type": "array", + "description": "Specifies list of parameters.", + "items": { + "$ref": "#/components/schemas/Parameter" + } + }, + "message": { + "description": "Indicates the description of API error alert message.
          Example: The service is currently unavailable and we are working to resolve the issue. We apologize for any inconvenience. Please check back at a later time." + } + }, + "description": "Indicates error alert when suspicious files, potential exploits and viruses found while scanning files , directories and user accounts. This includes code, message and parameter" + }, + "Full_Schema_Cancel_Shipment": { + "required": [ + "accountNumber", + "trackingNumber" + ], + "type": "object", + "properties": { + "accountNumber": { + "description": "The account number (account value) associated with the shipment.", + "allOf": [ + { + "$ref": "#/components/schemas/ShipperAccountNumber" + } + ] + }, + "emailShipment": { + "description": "A boolean flag passed by Clients to indicate that whether a shipment is a EMAIL shipment(Pending Shipment) or not. Once a shipment is confirmed, it can no longer be cancelled by having this flag as True.", + "type": "boolean", + "example": "false" + }, + "senderCountryCode": { + "type": "string", + "description": "The two-letter sender Country code(Ex: US, CA, GB..etc).
          Example: US
          Click here to see Country Codes", + "example": "US" + }, + "deletionControl": { + "type": "string", + "description": "Specifies which packages in a shipment to be canceledDELETE_ALL_PACKAGES which will cancel all tracking numbers associated to the shipment.", + "example": "DELETE_ALL_PACKAGES", + "enum": [ + "DELETE_ALL_PACKAGES" + ] + }, + "trackingNumber": { + "type": "string", + "description": "This is an unique number assigned by FedEx to the packages for tracking.
          Example: \"794953555571\"", + "example": "794953555571" + } + }, + "description": "The request elements required to cancel a shipment. " + }, + "SHPCResponseVO_CancelShipment": { + "type": "object", + "properties": { + "transactionId": { + "type": "string", + "description": "The transaction ID is a special set of numbers that defines each transaction.
          Example: 624deea6-b709-470c-8c39-4b5511281492", + "example": "624deea6-b709-470c-8c39-4b5511281492" + }, + "customerTransactionId": { + "type": "string", + "description": "This element allows you to assign a unique identifier to your transaction. This element is also returned in the reply and helps you match the request to the reply.
          Example: AnyCo_order123456789", + "example": "AnyCo_order123456789" + }, + "output": { + "$ref": "#/components/schemas/BaseProcessOutputVO_CancelShipment" + } + }, + "description": "This is a wrapper class for outputVO" + }, + "BaseProcessOutputVO_CancelShipment": { + "$ref": "#/components/schemas/CancelShipmentOutputVO" + }, + "CancelShipmentOutputVO": { + "type": "object", + "properties": { + "cancelledShipment": { + "type": "boolean", + "description": "Indicates whether the shipment has been cancelled or not. If the value is True, then it indicates that the shipment has been cancelled.
          Example: true", + "example": true + }, + "cancelledHistory": { + "type": "boolean", + "description": "Indicates whether the shipment has been deleted from history or not. If the value is True, then it indicates that the shipment has been deleted.
          Example: true", + "example": true + }, + "message": { + "type": "string", + "description": "The success message generated during cancellation request for Shipment.
          Example:Shipment is successfully cancelled", + "example": "Shipment is successfully cancelled" + }, + "alerts": { + "type": "array", + "description": "This is a cancellation request alert. This alert includes information such as alert code, alert type, and alert message.", + "items": { + "$ref": "#/components/schemas/Alert" + } + } + }, + "description": "The response elements received when a shipment is cancelled." + }, + "ErrorResponseVO_2": { + "type": "object", + "properties": { + "transactionId": { + "type": "string", + "description": "The transaction ID is a special set of numbers that defines each transaction.
          Example: 624deea6-b709-470c-8c39-4b5511281492", + "example": "624deea6-b709-470c-8c39-4b5511281492" + }, + "customerTransactionId": { + "type": "string", + "description": "This element allows you to assign a unique identifier to your transaction. This element is also returned in the reply and helps you match the request to the reply.
          Example: AnyCo_order123456789", + "example": "AnyCo_order123456789" + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CXSError_2" + } + } + } + }, + "CXSError_2": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Indicates the error code.
          Example: SHIPMENT.USER.UNAUTHORIZED" + }, + "parameterList": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Parameter" + } + }, + "message": { + "type": "string", + "description": "Indicates the description of API error alert message.
          Example: Requested user is not authorized to perform the operation." + } + }, + "description": "Indicates error alert when suspicious files, potential exploits and viruses found while scanning files , directories and user accounts. This includes code, message and parameter" + }, + "ErrorResponseVO401_2": { + "type": "object", + "properties": { + "transactionId": { + "type": "string", + "description": "The transaction ID is a special set of numbers that defines each transaction.
          Example: 624deea6-b709-470c-8c39-4b5511281492", + "example": "624deea6-b709-470c-8c39-4b5511281492" + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CXSError401" + } + } + } + }, + "ErrorResponseVO403_2": { + "type": "object", + "properties": { + "transactionId": { + "type": "string", + "description": "The transaction ID is a special set of numbers that defines each transaction.
          Example: 624deea6-b709-470c-8c39-4b5511281492", + "example": "624deea6-b709-470c-8c39-4b5511281492" + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CXSError403" + } + } + } + }, + "ErrorResponseVO404_2": { + "type": "object", + "properties": { + "transactionId": { + "type": "string", + "description": "The transaction ID is a special set of numbers that defines each transaction.
          Example: 624deea6-b709-470c-8c39-4b5511281492", + "example": "624deea6-b709-470c-8c39-4b5511281492" + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CXSError404" + } + } + } + }, + "ErrorResponseVO500_2": { + "type": "object", + "properties": { + "transactionId": { + "type": "string", + "description": "The transaction ID is a special set of numbers that defines each transaction.
          Example: 624deea6-b709-470c-8c39-4b5511281492", + "example": "624deea6-b709-470c-8c39-4b5511281492" + }, + "customerTransactionId": { + "type": "string", + "description": "This element allows you to assign a unique identifier to your transaction. This element is also returned in the reply and helps you match the request to the reply.
          Example: AnyCo_order123456789", + "example": "AnyCo_order123456789" + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CXSError500" + } + } + } + }, + "ErrorResponseVO503_2": { + "type": "object", + "properties": { + "transactionId": { + "type": "string", + "description": "The transaction ID is a special set of numbers that defines each transaction.
          Example: 624deea6-b709-470c-8c39-4b5511281492", + "example": "624deea6-b709-470c-8c39-4b5511281492" + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CXSError503" + } + } + } + }, + "FullSchema-getConfirmedShipmentAsyncResults": { + "required": [ + "accountNumber", + "jobId" + ], + "type": "object", + "properties": { + "accountNumber": { + "$ref": "#/components/schemas/AccountNumber" + }, + "jobId": { + "type": "string", + "description": "Indicates the job under which the deferred shipment artifacts must be identified in the subsequent retrieval request.
          Example: 89sxxxxx233ae24ff31xxxxx", + "example": "89sxxxxx233ae24ff31xxxxx" + } + } + }, + "AccountNumber": { + "$ref": "#/components/schemas/PartyAccountNumber" + }, + "SHPCResponseVO_GetOpenShipmentResults": { + "type": "object", + "properties": { + "transactionId": { + "type": "string", + "description": "The transaction ID is a special set of numbers that defines each transaction.
          Example: 624xxxxx-b709-470c-8c39-4b55112xxxxx", + "example": "624xxxxx-b709-470c-8c39-4b55112xxxxx" + }, + "customerTransactionId": { + "type": "string", + "description": "This is a unique identifier to your transaction and helps you match the request to the reply.
          Example: AnyCo_order123456789", + "example": "AnyCo_order123456789" + }, + "output": { + "allOf": [ + { + "description": "This is the output response." + }, + { + "$ref": "#/components/schemas/BaseProcessOutputVO_GetOpenShipmentResults" + } + ] + } + }, + "description": "Wrapper class for GetOpenshipmentResultsOutputVo. It holds transactionId and output." + }, + "BaseProcessOutputVO_GetOpenShipmentResults": { + "$ref": "#/components/schemas/GetOpenShipmentResultsOutputVO" + }, + "GetOpenShipmentResultsOutputVO": { + "type": "object", + "properties": { + "transactionShipments": { + "type": "array", + "description": "These are shipping transaction details, such as master tracking number, service type, and ship date and time.", + "items": { + "$ref": "#/components/schemas/TransactionShipmentOutputVO" + } + }, + "alerts": { + "type": "array", + "description": "object indicate the alert details received in the output.", + "items": { + "$ref": "#/components/schemas/Alert" + } + } + } + }, + "FullSchema-VerifyShipment": { + "required": [ + "requestedShipment" + ], + "type": "object", + "properties": { + "requestedShipment": { + "$ref": "#/components/schemas/RequestedShipmentVerify" + }, + "accountNumber": { + "$ref": "#/components/schemas/ShipperAccountNumber" + } + }, + "description": "The request elements required to create a shipment." + }, + "RequestedShipmentVerify": { + "required": [ + "labelSpecification", + "packagingType", + "pickupType", + "recipients", + "requestedPackageLineItems", + "serviceType", + "shipper", + "shippingChargesPayment", + "totalWeight" + ], + "type": "object", + "properties": { + "shipDatestamp": { + "type": "string", + "description": "Indicate the shipment date.
          Format: YYYY-MM-DD
          Note: Default value is current date in case the date is not provided in the request.
          Example: 2021-04-06", + "example": "2019-10-14" + }, + "pickupType": { + "type": "string", + "description": "Select if the shipment is to be dropped off at Fedex location or to be picked up by FedEx or if it is a scheduled pickup for this shipment.
          Click here for more information on Pickup Types.", + "example": "USE_SCHEDULED_PICKUP", + "enum": [ + "CONTACT_FEDEX TO_SCHEDULE", + "DROPOFF_AT_FEDEX_LOCATION", + "USE_SCHEDULED_PICKUP" + ] + }, + "serviceType": { + "type": "string", + "description": "Indicate the FedEx service Type used for this shipment.
          Example: STANDARD_OVERNIGHT
          click here to see available FedEx Service Types", + "example": "PRIORITY_OVERNIGHT" + }, + "packagingType": { + "type": "string", + "description": "Indicate the type of packaging used for the package.
          Note: For Express Freight shipments, the packaging will default to value YOUR_PACKAGING irrespective type provided in the request.
          Example: FEDEX_ENVELOPE
          click here to see Package Types", + "example": "YOUR_PACKAGING" + }, + "totalWeight": { + "type": "integer", + "description": "shipment total weight should be in Kg or in Lbs", + "format": "int32", + "example": 20 + }, + "shipper": { + "description": "Indicate shippers details.
          Note: Shipper address and Origin address should be the same address.", + "example": { + "address": { + "streetLines": [ + "10 FedEx Parkway", + "Suite 302" + ], + "city": "Beverly Hills", + "stateOrProvinceCode": "CA", + "postalCode": "90210", + "countryCode": "US", + "residential": false + }, + "contact": { + "personName": "John Taylor", + "emailAddress": "sample@company.com", + "phoneExtension": "91", + "phoneNumber": "1234567890", + "companyName": "Fedex" + }, + "tins": [ + { + "number": "123567", + "tinType": "FEDERAL", + "usage": "usage", + "effectiveDate": "2000-01-23T04:56:07.000+00:00", + "expirationDate": "2000-01-23T04:56:07.000+00:00" + } + ] + }, + "allOf": [ + { + "$ref": "#/components/schemas/ShipperParty" + } + ] + }, + "recipients": { + "type": "array", + "description": "Indicate the shipment recipient details or the physical location details for the package destination.", + "items": { + "$ref": "#/components/schemas/RecipientsParty" + } + }, + "origin": { + "description": "Indicate the shipment origin address information, if it is different from the shippers address.", + "allOf": [ + { + "$ref": "#/components/schemas/ContactAndAddress_Verify" + } + ] + }, + "shippingChargesPayment": { + "$ref": "#/components/schemas/Payment" + }, + "shipmentSpecialServices": { + "$ref": "#/components/schemas/RequestedShipmentVerify_shipmentSpecialServices" + }, + "emailNotificationDetail": { + "$ref": "#/components/schemas/EMailNotificationDetail" + }, + "variableHandlingChargeDetail": { + "$ref": "#/components/schemas/VariableHandlingChargeDetail" + }, + "customsClearanceDetail": { + "$ref": "#/components/schemas/CustomsClearanceDetail" + }, + "smartPostInfoDetail": { + "$ref": "#/components/schemas/SmartPostInfoDetail" + }, + "blockInsightVisibility": { + "type": "boolean", + "description": "Indicate if the shipment be available to be visible/tracked using FedEx InSight® tool. If value indicated as true, only the shipper/payer will have visibility of this shipment in the said tool.", + "example": true + }, + "labelSpecification": { + "$ref": "#/components/schemas/LabelSpecification" + }, + "shippingDocumentSpecification": { + "$ref": "#/components/schemas/ShippingDocumentSpecification" + }, + "rateRequestType": { + "type": "array", + "description": "Indicate the type of rates to be returned.
          Following are values:
          • LIST - Returns published list rates will be returned in addition to account-specific rate (if applicable).
          • PREFERRED - It returns rates in currency as specified in the PreferredCurrency element.
          • ACCOUNT - Returns account specific rates. Note: The account specific rates are returned by default if the shipper account number is specified in the shipment.
          • INCENTIVE - This is one-time discount for incentivizing the customer.
          Examples: [\"ACCOUNT\", \"PREFERRED\"] ", + "example": [ + "LIST", + "PREFERRED" + ], + "items": { + "type": "string", + "enum": [ + "LIST", + "NONE", + "PREFERRED", + "ACCOUNT", + "INCENTIVE", + "RETAIL" + ] + } + }, + "preferredCurrency": { + "type": "string", + "description": "Indicate the currency the caller requests to have used in all returned monetary values. Should be Used in conjunction with the element RateRequestType.
          Example: USD
          click here to see available Currency codes
          Note: Incorrect currency codes should not be supplied. The system ignores the incorrect currency code.", + "example": "USD" + }, + "requestedPackageLineItems": { + "type": "array", + "description": "Use this object to provide the package details.
          Note:
          • At least one instance containing the weight is required for EXPRESS and GROUND package.
          • Only Single piece requests are supported henceonly one line item should be provided.
          • Multiple piece shipment validation is not supported.
          ", + "items": { + "$ref": "#/components/schemas/RequestedPackageLineItem" + } + } + }, + "description": "This is the detailed shipment request data to be validated before being submitted to FedEx." + }, + "ContactAndAddress_Verify": { + "type": "object", + "properties": { + "contact": { + "$ref": "#/components/schemas/Contact_verify" + }, + "address": { + "$ref": "#/components/schemas/Address_1" + } + }, + "description": "Specifies the contact and address details of a location.", + "example": { + "address": { + "streetLines": [ + "10 FedEx Parkway", + "Suite 302" + ], + "city": "Beverly Hills", + "stateOrProvinceCode": "CA", + "postalCode": "38127", + "countryCode": "US", + "residential": false + }, + "contact": { + "personName": "person name", + "emailAddress": "email address", + "phoneNumber": "phone number", + "phoneExtension": "phone extension", + "companyName": "company name", + "faxNumber": "fax number" + } + } + }, + "Contact_verify": { + "type": "object", + "properties": { + "personName": { + "type": "string", + "description": "Specify contact person name.
          Recommended length is 70.
          Note: There's no specific validation for the person name.
          Example: John Taylor", + "example": "John Taylor" + }, + "emailAddress": { + "type": "string", + "description": "Specify contact email address. Maximum length is 80.
          Example: sample@company.com", + "example": "sample@company.com" + }, + "phoneNumber": { + "type": "string", + "description": "Specify contact phone number.
          Minimum length is 10 and supports maximum of 15 for certain countries using longer phone numbers.
          Note: Recommended Maximum length is 15 and there's no specific validation will be done for the phone number.
          Example: 918xxxxx890", + "example": "1234567890" + }, + "phoneExtension": { + "type": "string", + "description": "Specify contact phone extension.
          Note: Recommended length is 6. There's no specific validation for the phone extension.
          Example: 1234", + "example": "91" + }, + "faxNumber": { + "type": "string", + "description": "Specify contact fax number.
          Note: Recommended length is 15. There's no specific validation for the fax number.
          Example: 1234567890", + "example": "956123" + }, + "companyName": { + "type": "string", + "description": "Specify contact company name.
          Recommended length is 35.
          Note: There's no specific validation for the company name.", + "example": "Fedex" + } + }, + "description": "Indicate the contact details of the shipper.", + "example": { + "personName": "John Taylor", + "emailAddress": "sample@company.com", + "phoneNumber": "1234567890", + "phoneExtension": 1234, + "faxNumber": "1234567890", + "companyName": "Fedex" + } + }, + "EMailNotificationDetail": { + "type": "object", + "properties": { + "aggregationType": { + "type": "string", + "description": "Shipment Notification Aggregation Type.
          Example:PER_PACKAGE", + "example": "PER_PACKAGE", + "enum": [ + "PER_PACKAGE", + "PER_SHIPMENT" + ] + }, + "emailNotificationRecipients": { + "type": "array", + "description": "These are email notification recipient details.", + "items": { + "$ref": "#/components/schemas/EmailNotificationRecipient" + } + }, + "personalMessage": { + "type": "string", + "description": "This is your personal message for the email.
          Note: The maximum personal message character limit depends on the element emailNotificationDetail\\emailNotificationRecipients\\notificationFormatType values:
          • If notificationFormatType is TEXT, then only 120 characters printed on the email
          • If notificationFormatType is HTML, then 500 characters printed on the email

          Example: This is concerning the order 123456 of 26 July 2021 - art no 34324-23 Teddy Bear, brown", + "example": "your personal message here" + } + }, + "description": "These are email disposition details. Provides the type and email addresses of e-mail recipients. If returnedDispositionDetail in labelSpecification is set as true then email will be send with label and documents copy." + }, + "EmailNotificationRecipient": { + "required": [ + "emailNotificationRecipientType" + ], + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Specify the recipient name.
          Example: Joe Smith", + "example": "Joe Smith" + }, + "emailNotificationRecipientType": { + "type": "string", + "description": "This is the email notification recipient type.
          Example: SHIPPER", + "example": "SHIPPER", + "enum": [ + "BROKER", + "OTHER", + "RECIPIENT", + "SHIPPER", + "THIRD_PARTY" + ] + }, + "emailAddress": { + "type": "string", + "description": "Specify the recipient email address.
          Example: xyz@aol.com", + "example": "jsmith3@aol.com" + }, + "notificationFormatType": { + "type": "string", + "description": "This is the format for the email notification. Either HTML or plain text can be provided.", + "example": "TEXT", + "enum": [ + "HTML", + "TEXT" + ] + }, + "notificationType": { + "type": "string", + "description": "Indicate the type of notification that will be sent as an email.", + "example": "EMAIL", + "enum": [ + "EMAIL" + ] + }, + "locale": { + "type": "string", + "description": "These are the locale details for email.
          click here to see Locales
          Note: If the locale is left blank or an invalid locale is entered, an error message is returned in response.", + "example": "en_US" + }, + "notificationEventType": { + "type": "array", + "description": "Specify notification event types.
          Click here for more information on Notification Event Types.", + "example": [ + "ON_PICKUP_DRIVER_ARRIVED", + "ON_SHIPMENT" + ], + "items": { + "type": "string", + "enum": [ + "ON_DELIVERY", + "ON_EXCEPTION", + "ON_SHIPMENT", + "ON_TENDER", + "ON_ESTIMATED_DELIVERY", + "ON_BILL_OF_LADING", + "ON_PICKUP_DRIVER_ARRIVED", + "ON_PICKUP_DRIVER_ASSIGNED", + "ON_PICKUP_DRIVER_DEPARTED", + "ON_PICKUP_DRIVER_EN_ROUTE" + ] + } + } + }, + "description": "These are recipient details for receiving email notification." + }, + "SHPCResponseVO_Validate": { + "type": "object", + "properties": { + "transactionId": { + "type": "string", + "description": "The transaction ID is a special set of numbers that defines each transaction.
          Example: 624deea6-b709-470c-8c39-4b5511281492", + "example": "624deea6-b709-470c-8c39-4b5511281492" + }, + "customerTransactionId": { + "type": "string", + "description": "This element allows you to assign a unique identifier to your transaction. This element is also returned in the reply and helps you match the request to the reply.
          Example: AnyCo_order123456789", + "example": "AnyCo_order123456789" + }, + "output": { + "$ref": "#/components/schemas/BaseProcessOutputVO_Validate" + } + }, + "description": "Wrapper class for VerifyShipmentOutputVO. It holds transactionId and output." + }, + "BaseProcessOutputVO_Validate": { + "$ref": "#/components/schemas/VerifyShipmentOutputVO" + }, + "VerifyShipmentOutputVO": { + "type": "object", + "properties": { + "alerts": { + "type": "array", + "description": "The alerts received when a Shipment Package Validate is processed. This includes the alert code, alert type, and alert message.", + "items": { + "$ref": "#/components/schemas/Alert" + } + } + }, + "description": "The response elements received when a shipment is created." + }, + "RequestedShipmentVerify_shipmentSpecialServices": { + "type": "object", + "properties": { + "specialServiceTypes": { + "type": "array", + "description": "Indicate the Special services requested for this shipment.
          Example:
          • HOLD_AT_LOCATION
          • RETURN_SHIPMENT
          • BROKER_SELECT_OPTION
          • CALL_BEFORE_DELIVERY
          • COD
          • CUSTOM_DELIVERY_WINDOW

          click here to see Shipment Special Service Types", + "example": [ + "THIRD_PARTY_CONSIGNEE" + ], + "items": { + "type": "string" + } + }, + "etdDetail": { + "$ref": "#/components/schemas/ETDDetail" + }, + "returnShipmentDetail": { + "$ref": "#/components/schemas/ReturnShipmentDetail" + }, + "deliveryOnInvoiceAcceptanceDetail": { + "$ref": "#/components/schemas/DeliveryOnInvoiceAcceptanceDetail" + }, + "internationalTrafficInArmsRegulationsDetail": { + "$ref": "#/components/schemas/InternationalTrafficInArmsRegulationsDetail" + }, + "pendingShipmentDetail": { + "$ref": "#/components/schemas/PendingShipmentDetail" + }, + "holdAtLocationDetail": { + "$ref": "#/components/schemas/HoldAtLocationDetail" + }, + "shipmentCODDetail": { + "$ref": "#/components/schemas/ShipmentCODDetail" + }, + "shipmentDryIceDetail": { + "$ref": "#/components/schemas/ShipmentDryIceDetail_1" + }, + "internationalControlledExportDetail": { + "$ref": "#/components/schemas/InternationalControlledExportDetail" + }, + "homeDeliveryPremiumDetail": { + "$ref": "#/components/schemas/HomeDeliveryPremiumDetail" + } + }, + "description": "Indicate the shipment special service or handling required for this shipment.
          Note:
          • If the shipper is requesting a special service, the special service type must be indicated in the object specialServiceTypes, and all supporting detail must be provided in the appropriate sub-object below.
          • For returns it is required to provide value RETURN_SHIPMENT in the specialServiceTypes.
          " + }, + "HazardousCommodityOptionDetail": { + "description": "Provides details of Hazardous Commodity Option Detail", + "type": "object", + "properties": { + "labelTextOption": { + "description": "Provides the label text option", + "type": "string", + "enum": [ + "APPEND", + "OVERRIDE", + "STANDARD" + ], + "example": "STANDARD" + }, + "customerSuppliedLabelText": { + "description": "DG Data Upload Mode:- Optional
          DG Full Validation Mode: Optional
          Text used in labeling the commodity under control of the LabelTextOption field", + "type": "string", + "example": "Customer Supplied Label Text" + } + } + }, + "Full_Schema_Create_Tag": { + "required": [ + "accountNumber", + "requestedShipment" + ], + "type": "object", + "properties": { + "requestedShipment": { + "description": "The shipment data describing the shipment being tendered to FedEx.", + "allOf": [ + { + "$ref": "#/components/schemas/CreateTagRequestedShipment" + } + ] + }, + "accountNumber": { + "description": "The specific FedEx customer account number (account value) associated with the shipment.", + "allOf": [ + { + "$ref": "#/components/schemas/AccountNumber" + } + ] + } + } + }, + "CreateTagRequestedShipment": { + "required": [ + "packagingType", + "pickupDetail", + "recipients", + "requestedPackageLineItems", + "serviceType", + "shipTimestamp", + "shipper", + "shippingChargesPayment", + "shippingLabelType", + "specialServicesRequested" + ], + "allOf": [ + { + "$ref": "#/components/schemas/RequestedShipment_tag" + }, + { + "properties": { + "pickupDetail": { + "required": [ + "latestPickupDateTime", + "readyPickupDateTime" + ], + "properties": { + "readyPickupDateTime": { + "type": "string", + "description": "Specify the time and date the package will be ready for pickup.", + "example": "2020-07-03T09:00:00Z" + }, + "latestPickupDateTime": { + "type": "string", + "description": "Specify the last possible pickup date and time.", + "example": "2020-07-03T09:00:00Z" + } + }, + "description": "Specifies the pickup details for the Tag shipment.
          ReadyDateTime and LatestPickupDateTime are required." + } + } + } + ] + }, + "RequestedShipment_tag": { + "required": [ + "labelSpecification", + "packagingType", + "pickupType", + "recipients", + "requestedPackageLineItems", + "serviceType", + "shipper", + "shippingChargesPayment", + "totalWeight" + ], + "type": "object", + "properties": { + "shipDatestamp": { + "type": "string", + "description": "This is the shipment date. Default value is current date in case the date is not provided or a past date is provided.
          Format [YYYY-MM-DD].
          Example: 2019-10-14", + "example": "2019-10-14" + }, + "totalDeclaredValue": { + "description": "It is the sum of all declared values of all packages in a shipment. The amount of totalDeclaredValue must be equal to the sum of all the individual declaredValues in the shipment. The declaredValue and totalDeclaredValue must match in all currencies in one shipment. This value represents FedEx maximum liability associated with a shipment. This is including, but not limited to any loss, damage, delay, misdelivery, any failure to provide information, or misdelivery of information related to the Shipment.
          Note: The totalDeclaredValue should not exceed customsValue.", + "allOf": [ + { + "$ref": "#/components/schemas/Money" + } + ] + }, + "shipper": { + "description": "Indicate the Shipper contact details for this shipment.", + "example": { + "address": { + "streetLines": [ + "10 FedEx Parkway", + "Suite 302" + ], + "city": "Beverly Hills", + "stateOrProvinceCode": "CA", + "postalCode": "90210", + "countryCode": "US", + "residential": false + }, + "contact": { + "personName": "John Taylor", + "emailAddress": "sample@company.com", + "phoneExtension": "91", + "phoneNumber": "XXXX567890", + "companyName": "Fedex" + }, + "tins": [ + { + "number": "XXX567", + "tinType": "FEDERAL", + "usage": "usage", + "effectiveDate": "2024-06-13", + "expirationDate": "2024-06-13" + } + ] + }, + "allOf": [ + { + "$ref": "#/components/schemas/ShipperParty" + } + ] + }, + "soldTo": { + "description": "Will indicate the party responsible for purchasing the goods shipped from the shipper to the recipient. The sold to party is not necessarily the recipient or the importer of record. The sold to party is relevant when the purchaser, rather than the recipient determines when certain customs regulations apply.", + "allOf": [ + { + "$ref": "#/components/schemas/SoldToParty" + } + ] + }, + "recipients": { + "type": "array", + "description": "Indicate the descriptive data for the recipient location to which the shipment is to be received.", + "items": { + "$ref": "#/components/schemas/RecipientsParty" + } + }, + "recipientLocationNumber": { + "type": "string", + "description": "A unique identifier for a recipient location.
          Example:1234567", + "example": "1234567" + }, + "pickupType": { + "type": "string", + "description": "Indicates if shipment is being dropped off at a FedEx location or being picked up by FedEx or if it's a regularly scheduled pickup for this shipment. Required for FedEx Express and Ground Shipment.
          Example: USE_SCHEDULED_PICKUP", + "example": "USE_SCHEDULED_PICKUP", + "enum": [ + "CONTACT_FEDEX_TO_SCHEDULE", + "DROPOFF_AT_FEDEX_LOCATION", + "USE_SCHEDULED_PICKUP" + ] + }, + "serviceType": { + "type": "string", + "description": "Indicate the FedEx service type used for this shipment.
          Example: STANDARD_OVERNIGHT
          click here to see Service Types", + "example": "PRIORITY_OVERNIGHT" + }, + "packagingType": { + "type": "string", + "description": "Specify the packaging used.
          Note: For Express Freight shipments, the packaging will default to YOUR_PACKAGING irrespective of the user provided package type in the request.
          Example: FEDEX_PAK
          click here to see Package Types", + "example": "YOUR_PACKAGING" + }, + "totalWeight": { + "type": "number", + "description": "Indicate the shipment total weight in pounds.
          Example: 10.6
          Note:
          • This only applies to International shipments and should be used on the first package of a multiple piece shipment.
          • This value contains 1 explicit decimal position.
          • For one Label at a time shipments, the unit of totalWeight is considered same as the unit of weight provided in requestedPackageLineItem field.
          ", + "format": "double", + "example": 20.6 + }, + "origin": { + "description": "Indicate shipment origin address information, if it is different from the shipper address.", + "allOf": [ + { + "$ref": "#/components/schemas/ContactAndAddress_1" + } + ] + }, + "shippingChargesPayment": { + "$ref": "#/components/schemas/Payment" + }, + "shipmentSpecialServices": { + "$ref": "#/components/schemas/ShipmentSpecialServicesRequested" + }, + "emailNotificationDetail": { + "$ref": "#/components/schemas/ShipShipmentEMailNotificationDetail" + }, + "expressFreightDetail": { + "$ref": "#/components/schemas/ExpressFreightDetail" + }, + "variableHandlingChargeDetail": { + "$ref": "#/components/schemas/VariableHandlingChargeDetail" + }, + "customsClearanceDetail": { + "$ref": "#/components/schemas/CustomsClearanceDetail_tag" + }, + "smartPostInfoDetail": { + "$ref": "#/components/schemas/SmartPostInfoDetail" + }, + "blockInsightVisibility": { + "type": "boolean", + "description": "If true, only the shipper/payer will have visibility of this shipment.
          Valid Value : true, false.
          Default:false
          Example: true", + "example": true + }, + "labelSpecification": { + "$ref": "#/components/schemas/LabelSpecification" + }, + "shippingDocumentSpecification": { + "$ref": "#/components/schemas/ShippingDocumentSpecification" + }, + "rateRequestType": { + "type": "array", + "description": "Indicate the type of rates to be returned. The account specific rates are returned by default if the account number is specified in the request.
          Following are values:
          • LIST - Returns FedEx published list rates in addition to account-specific rates (if applicable).
          • INCENTIVE - This is one-time discount for incentivising the customer. For more information, contact your FedEx representative.
          • ACCOUNT - Returns account specific rates (Default).
          • PREFERRED - Returns rates in the preferred currency specified in the element preferredCurrency.
          • RETAIL - Returns customer rate from one of retail FedEx service centers.
          Examples: [\"ACCOUNT\", \"PREFERRED\"]", + "example": [ + "LIST", + "PREFERRED" + ], + "items": { + "type": "string", + "enum": [ + "LIST", + "NONE", + "PREFERRED", + "ACCOUNT", + "INCENTIVE", + "RETAIL" + ] + } + }, + "preferredCurrency": { + "type": "string", + "description": "Indicate the currency the caller requests to have used in all returned monetary values. Should be Used in conjunction with the element RateRequestType.
          Example: USD
          click here to see available Currency codes
          Note: Incorrect currency codes should not be supplied. The system ignores the incorrect currency code.", + "example": "USD" + }, + "totalPackageCount": { + "type": "integer", + "description": "For an MPS, this is the total number of packages in the shipment.Applicable for parent shipment for one label at a time shipments.
          Example: 25", + "format": "int32", + "example": 25 + }, + "masterTrackingId": { + "$ref": "#/components/schemas/MasterTrackingId" + }, + "requestedPackageLineItems": { + "type": "array", + "description": "These are one or more package-attribute descriptions, each of which describes an individual package, a group of identical packages, or (for the total-piece-total-weight case) common characteristics of all packages in the shipment.
          • At least one instance containing the weight for at least one package is required for EXPRESS and GROUND shipments.
          • Single piece requests will have one RequestedPackageLineItem.
          • Multiple piece requests will have multiple RequestedPackageLineItems.
          • Maximum occurrences is 30.
          ", + "items": { + "$ref": "#/components/schemas/RequestedPackageLineItem" + } + } + }, + "description": "The descriptive data of the requested shipment." + }, + "PartyAccountNumber_tag": { + "type": "object", + "properties": { + "value": { + "type": "string", + "description": "Conditional.
          The account number value.
          Max Length is 9.
          Example: 12XXXXX89", + "example": "12XXXXX89" + } + }, + "description": "This is FedEx Account number details.", + "example": { + "value": "Your account number" + } + }, + "CustomsClearanceDetail_tag": { + "required": [ + "commercialInvoice", + "commodities" + ], + "type": "object", + "properties": { + "regulatoryControls": { + "type": "array", + "description": "These are the regulatory controls applicable to the shipment.
          Example:USMCA,FOOD_OR_PERISHABLE", + "example": [ + "NOT_IN_FREE_CIRCULATION", + "USMCA" + ], + "items": { + "type": "string", + "enum": [ + "FOOD_OR_PERISHABLE", + "USMCA", + "NOT_APPLICABLE_FOR_LOW_VALUE_CUSTOMS_EXCEPTIONS", + "NOT_IN_FREE_CIRCULATION" + ] + } + }, + "brokers": { + "type": "array", + "description": "Specify broker information. Use this option only if you are using Broker Select Option for your shipment. A country code must be specified in addition to one of the following address items: postal code, city, or location id.", + "items": { + "$ref": "#/components/schemas/BrokerDetail" + } + }, + "commercialInvoice": { + "$ref": "#/components/schemas/CommercialInvoice" + }, + "freightOnValue": { + "type": "string", + "description": "Specify the risk owner for the Freight shipment.This element is only mandatory or valid for Intra India shipments.
          Example: OWN_RISK", + "example": "OWN_RISK", + "enum": [ + "CARRIER_RISK", + "OWN_RISK" + ] + }, + "dutiesPayment": { + "$ref": "#/components/schemas/Payment_1_tag" + }, + "commodities": { + "type": "array", + "description": "Indicates the details about the dutiable packages. Maximum upto 999 commodities per shipment.", + "items": { + "$ref": "#/components/schemas/Commodity_1" + } + }, + "isDocumentOnly": { + "type": "boolean", + "description": "Defaults to false. Only used for international Express requests to indicate if just documents are being shipped or not. A valude of DERIVED will cause the value to be determined by PMIS based on the specified commodities information
          Example: false", + "example": false + }, + "recipientCustomsId": { + "$ref": "#/components/schemas/RecipientCustomsId" + }, + "customsOption": { + "$ref": "#/components/schemas/CustomsOptionDetail" + }, + "importerOfRecord": { + "description": "The descriptive data for the importer of Record for the shipment and their physical address, contact and account number information.", + "allOf": [ + { + "$ref": "#/components/schemas/Party_1" + } + ] + }, + "generatedDocumentLocale": { + "type": "string", + "description": "This is the locale for generated document.
          Example: en_US
          click here to see Locales
          Note: If the locale is left blank or an invalid locale is entered, an error message is returned in response.", + "example": "en_US" + }, + "exportDetail": { + "$ref": "#/components/schemas/ExportDetail" + }, + "totalCustomsValue": { + "description": "This is the total customs value.", + "allOf": [ + { + "$ref": "#/components/schemas/Money" + } + ] + }, + "partiesToTransactionAreRelated": { + "type": "boolean", + "description": "Specify if the transacting parties are related." + }, + "declarationStatementDetail": { + "$ref": "#/components/schemas/CustomsDeclarationStatementDetail" + }, + "insuranceCharge": { + "description": "Specify insurance charges if applicable.
          Note: FedEx does not provide insurance of any kind.", + "allOf": [ + { + "$ref": "#/components/schemas/Money" + } + ] + } + }, + "description": "These are customs clearance details. Required for International and intra-country Shipments." + }, + "Payment_1_tag": { + "type": "object", + "properties": { + "payor": { + "$ref": "#/components/schemas/Payor_1_tag" + }, + "billingDetails": { + "$ref": "#/components/schemas/BillingDetails" + }, + "paymentType": { + "type": "string", + "description": "Indicates who and how the shipment will be paid for.Required for Express and Ground.
          Example: SENDER", + "enum": [ + "SENDER", + "RECIPIENT", + "THIRD_PARTY", + "COLLECT" + ], + "example": "SENDER" + } + }, + "description": "This is a payment type, basically indicates who is the payor for the shipment.Conditional required for International Shipments", + "example": { + "payor": { + "responsibleParty": { + "address": { + "streetLines": [ + "10 FedEx Parkway", + "Suite 302" + ], + "city": "Beverly Hills", + "stateOrProvinceCode": "CA", + "postalCode": "38127", + "countryCode": "US", + "residential": false + }, + "contact": { + "personName": "John Taylor", + "emailAddress": "sample@company.com", + "phoneNumber": "1234567890", + "phoneExtension": "phone extension", + "companyName": "Fedex", + "faxNumber": "fax number" + }, + "accountNumber": { + "value": "Your account number" + }, + "tins": [ + { + "number": "number", + "tinType": "FEDERAL", + "usage": "usage", + "effectiveDate": "2024-06-13", + "expirationDate": "2024-06-13" + }, + { + "number": "number", + "tinType": "FEDERAL", + "usage": "usage", + "effectiveDate": "2024-06-13", + "expirationDate": "2024-06-13" + } + ] + } + }, + "billingDetails": { + "billingCode": "billingCode", + "billingType": "billingType", + "aliasId": "aliasId", + "accountNickname": "accountNickname", + "accountNumber": "Your account number", + "accountNumberCountryCode": "US" + }, + "paymentType": "SENDER" + } + }, + "Payor_1_tag": { + "type": "object", + "properties": { + "responsibleParty": { + "$ref": "#/components/schemas/Party_2_tag" + } + }, + "description": "Information about the person who is paying for the shipment. Not applicable for credit card payment. ", + "example": { + "responsibleParty": { + "address": { + "streetLines": [ + "10 FedEx Parkway", + "Suite 302" + ], + "city": "Beverly Hills", + "stateOrProvinceCode": "CA", + "postalCode": "38127", + "countryCode": "US", + "residential": false + }, + "contact": { + "personName": "John Taylor", + "emailAddress": "sample@company.com", + "phoneNumber": "1234567890", + "phoneExtension": "phone extension", + "companyName": "Fedex", + "faxNumber": "fax number" + }, + "accountNumber": { + "value": "Your account number" + }, + "tins": [ + { + "number": "number", + "tinType": "FEDERAL", + "usage": "usage", + "effectiveDate": "2000-01-23T04:56:07.000+00:00", + "expirationDate": "2000-01-23T04:56:07.000+00:00" + }, + { + "number": "number", + "tinType": "FEDERAL", + "usage": "usage", + "effectiveDate": "2000-01-23T04:56:07.000+00:00", + "expirationDate": "2000-01-23T04:56:07.000+00:00" + } + ] + } + } + }, + "Party_2_tag": { + "type": "object", + "properties": { + "address": { + "$ref": "#/components/schemas/Address_1" + }, + "contact": { + "$ref": "#/components/schemas/Contact_1" + }, + "accountNumber": { + "$ref": "#/components/schemas/PartyAccountNumber_tag" + }, + "tins": { + "type": "array", + "description": "This is the tax identification number details.", + "items": { + "$ref": "#/components/schemas/TaxpayerIdentification" + } + } + }, + "description": "Use this object to provide the attributes such as physical address, contact information and account number information.", + "example": { + "address": { + "streetLines": [ + "10 FedEx Parkway", + "Suite 302" + ], + "city": "Beverly Hills", + "stateOrProvinceCode": "CA", + "postalCode": "38127", + "countryCode": "US", + "residential": false + }, + "contact": { + "personName": "John Taylor", + "emailAddress": "sample@company.com", + "phoneNumber": "1234567890", + "phoneExtension": "phone extension", + "companyName": "Fedex", + "faxNumber": "fax number" + }, + "accountNumber": { + "value": "Your account number" + }, + "tins": [ + { + "number": "number", + "tinType": "FEDERAL", + "usage": "usage", + "effectiveDate": "2000-01-23T04:56:07.000+00:00", + "expirationDate": "2000-01-23T04:56:07.000+00:00" + }, + { + "number": "number", + "tinType": "FEDERAL", + "usage": "usage", + "effectiveDate": "2000-01-23T04:56:07.000+00:00", + "expirationDate": "2000-01-23T04:56:07.000+00:00" + } + ] + } + }, + "Commodity_1": { + "required": [ + "description" + ], + "type": "object", + "properties": { + "unitPrice": { + "description": "This is the unit price.", + "allOf": [ + { + "$ref": "#/components/schemas/Money" + } + ] + }, + "additionalMeasures": { + "type": "array", + "description": "This object contains additional quantitative information other than weight and quantity to calculate duties and taxes.", + "items": { + "$ref": "#/components/schemas/AdditionalMeasures" + } + }, + "numberOfPieces": { + "type": "integer", + "description": "Indicate the number of pieces associated with the commodity. The value can neither be negative nor exceed 9,999.
          Example: 12", + "format": "int32", + "example": 12 + }, + "quantity": { + "type": "integer", + "description": "This is the units quantity (using quantityUnits as the unit of measure) per commodity. This is used to estimate duties and taxes.
          Example: 125", + "format": "int32", + "example": 125 + }, + "quantityUnits": { + "type": "string", + "description": "This is the unit of measure for the units quantity. This is used to estimate duties and taxes.
          Example: EA
          click here to see Commodity Unit Measures", + "example": "Ea" + }, + "customsValue": { + "description": "This customs value is applicable for all items(or units) under the specified commodity.", + "allOf": [ + { + "$ref": "#/components/schemas/Customs_Money" + } + ] + }, + "countryOfManufacture": { + "type": "string", + "description": "This is commodity country of manufacture. This is required for International shipments. Maximum allowed length is 4.
          Example: US
          click here to see Country codes", + "example": "US" + }, + "cIMarksAndNumbers": { + "type": "string", + "description": "This is an identifying mark or number used on the packaging of a shipment to help customers identify a particular shipment
          Example: 87123", + "example": "87123" + }, + "harmonizedCode": { + "type": "string", + "description": "This is to specify the Harmonized Tariff System (HTS) code to meet U.S. and foreign governments' customs requirements. These are mainly used to estimate the duties and taxes.
          Example: 0613
          To research the classification for your commodity, use the FedEx Global Trade Manager online at fedex.com/gtm. You will find country-specific information to determine whether your commodity is considered to be a document or non-document for your destination.", + "example": "0613" + }, + "description": { + "type": "string", + "description": "Required
          ScrewsMaximum allowed 450 characters.
          Example: description", + "example": "description" + }, + "name": { + "type": "string", + "description": "This is Commodity name.
          Example: Non-Threaded Rivets", + "example": "non-threaded rivets" + }, + "weight": { + "$ref": "#/components/schemas/Weight_4" + }, + "exportLicenseNumber": { + "type": "string", + "description": "This is the export license number for the shipment.
          Example: 26456", + "example": "26456" + }, + "exportLicenseExpirationDate": { + "type": "string", + "description": "Specify the export license expiration date for the shipment.
          Format YYYY-MM-DD
          Example : 2009-04-12", + "format": "date-time" + }, + "partNumber": { + "type": "string", + "description": "This is a part number.
          Example: 167", + "example": "167" + }, + "purpose": { + "type": "string", + "description": "This field is used for calculation of duties and taxes.

          Valid values are : BUSINESS and CONSUMER.
          Example:BUSINESS", + "example": "BUSINESS", + "enum": [ + "BUSINESS", + "CONSUMER" + ] + }, + "usmcaDetail": { + "$ref": "#/components/schemas/UsmcaDetail" + } + } + }, + "SHPCResponseVO_CreateTag": { + "type": "object", + "properties": { + "transactionId": { + "type": "string", + "description": "The transaction ID is a special set of numbers that defines each transaction.
          Example: 624deea6-b709-470c-8c39-4b5511281492", + "example": "624deea6-b709-470c-8c39-4b5511281492" + }, + "customerTransactionId": { + "type": "string", + "description": "This element allows you to assign a unique identifier to your transaction. This element is also returned in the reply and helps you match the request to the reply.
          Example: AnyCo_order123456789", + "example": "AnyCo_order123456789" + }, + "output": { + "$ref": "#/components/schemas/BaseProcessOutputVO_CreateTag" + } + }, + "description": "Wrapper class for ShipShipmentOutputVO. It holds transactionId and output." + }, + "BaseProcessOutputVO_CreateTag": { + "$ref": "#/components/schemas/CreateTagOutputVO" + }, + "CreateTagOutputVO": { + "type": "object", + "properties": { + "masterTrackingNumber": { + "type": "string", + "description": "Specifies the Master Tracking Number for the requested shipment.
          Example: 997338100007320", + "example": "997338100007320" + }, + "serviceType": { + "type": "string", + "description": "Specifies the service type for this shipment.
          Example: GROUND_HOME_DELIVERY
          Click here to see Service Types", + "example": "GROUND_HOME_DELIVERY" + }, + "shipTimestamp": { + "type": "string", + "description": "Specifies the shipment date and time. The default timestamp is the current date-time. Format is MMM-dd-yyyy.
          Example: 2019-10-04", + "example": "2019-10-04" + }, + "completedTagDetail": { + "$ref": "#/components/schemas/CompletedTagDetail" + }, + "alerts": { + "type": "array", + "description": "Specifies the alerts received when a tag is created. This includes the alert code, alert type, and alert message.", + "items": { + "$ref": "#/components/schemas/Alert" + } + } + }, + "description": "Specifies the output details when a tag is created." + }, + "CompletedTagDetail": { + "description": "Specifies the pickup confirmation and location details for the return tag shipment.", + "allOf": [ + { + "$ref": "#/components/schemas/CompletedTagDetail_2" + } + ] + }, + "CompletedTagDetail_2": { + "required": [ + "confirmationNumber", + "dispatchDate", + "location" + ], + "type": "object", + "properties": { + "confirmationNumber": { + "type": "string", + "description": "Confirmation Number.
          Example: 275", + "example": "275" + }, + "location": { + "type": "string", + "description": "Applicable for FedEx Express services.
          Example: NQAA", + "example": "NQAA" + }, + "dispatchDate": { + "type": "string", + "description": "The dispatch date for the FedEx Tag to be cancelled.
          Example: 2019-08-03", + "example": "2019-08-03" + } + } + }, + "FullSchema-CancelTag": { + "required": [ + "accountNumber", + "completedTagDetail", + "serviceType" + ], + "type": "object", + "properties": { + "accountNumber": { + "description": "The specific FedEx customer account number (account value and account key) associated with the shipment.", + "allOf": [ + { + "$ref": "#/components/schemas/ShipmentAccountNumber" + } + ] + }, + "serviceType": { + "type": "string", + "description": "This is the FedEx service type associated with the shipment.
          Example: PRIORITY_OVERNIGHT
          Click here to see Service Types", + "example": "PRIORITY_OVERNIGHT" + }, + "trackingNumber": { + "type": "string", + "description": "The tracking number for the Express or Ground Tag to the cancelled.
          Example: 301025281523
          Click here to see mock tracking numbers for FedEx Express and FedEx Ground.", + "example": "301025281523" + }, + "completedTagDetail": { + "description": "The details of the package for which shipping has been completed. The details include dispatch confirmation number, dispatch date, location, and the cxs alerts associated with the process.", + "allOf": [ + { + "$ref": "#/components/schemas/CompletedTagDetail_2" + } + ] + } + }, + "description": "The input details required to cancel a tag." + }, + "ShipmentAccountNumber": { + "$ref": "#/components/schemas/PartyAccountNumber_2" + }, + "PartyAccountNumber_2": { + "type": "object", + "properties": { + "value": { + "type": "string", + "description": "Conditional.
          The account number value. Max Length is 9.
          Example: 123456789" + } + }, + "description": "The account number of the recipient.", + "example": { + "value": "123456789" + } + }, + "SHPCResponseVO": { + "type": "object", + "properties": { + "transactionId": { + "type": "string", + "description": "The transaction ID is a special set of numbers that defines each transaction.
          Example: 624deea6-b709-470c-8c39-4b5511281492", + "example": "624deea6-b709-470c-8c39-4b5511281492" + }, + "customerTransactionId": { + "type": "string", + "description": "This element allows you to assign a unique identifier to your transaction. This element is also returned in the reply and helps you match the request to the reply.
          Example: AnyCo_order123456789", + "example": "AnyCo_order123456789" + }, + "output": { + "$ref": "#/components/schemas/BaseProcessOutputVO" + } + }, + "description": "Wrapper class for CancelTagOuputVO. It holds transactionId and output." + }, + "BaseProcessOutputVO": { + "$ref": "#/components/schemas/CancelTagOuputVO" + }, + "CancelTagOuputVO": { + "type": "object", + "properties": { + "cancelledTag": { + "type": "boolean", + "description": "Indicates whether the tag has been cancelled or not. If true, then the tag has been successfully cancelled.
          Example: true", + "example": true + }, + "successMessage": { + "type": "string", + "description": "Message received when a tag is successfully cancelled.
          Example: success", + "example": "success" + } + }, + "description": "The output details when a tag is cancelled." + } + } + } +} \ No newline at end of file diff --git a/openapi/src/test/resources/fedex-track.json b/openapi/src/test/resources/fedex-track.json new file mode 100644 index 000000000..f8f27746c --- /dev/null +++ b/openapi/src/test/resources/fedex-track.json @@ -0,0 +1,4206 @@ +{ + "openapi": "3.0.0", + "servers": [ + { + "url": "https://apis-sandbox.fedex.com", + "description": "Sandbox Server" + }, + { + "url": "https://apis.fedex.com", + "description": "Production Server" + } + ], + "schemes": [ + "https" + ], + "info": { + "version": "1.0.0", + "title": "Basic Integrated Visibility " + }, + "paths": { + "/track/v1/associatedshipments": { + "post": { + "summary": "Track Multiple Piece Shipment", + "description": "This endpoint returns tracking information for multiplee piece shipments, Group MPS, or an outbounddd shipment which is linked to a return shipment.
          Note: FedEx APIs do not support Cross-Origin Resource Sharing (CORS) mechanism.", + "operationId": "Track Multiple Piece Shipment", + "requestBody": { + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Full_Schema_Multiple_Piece_Shipment" + } + ] + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TrkcResponseVO_Associated" + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseVO" + }, + "example": { + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "customerTransactionId": "AnyCo_order123456789", + "errors": [ + { + "code": "TRACKING.REFERENCETYPE.INVALID", + "message": "Please provide a valid reference/associated type" + } + ] + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseVO401" + }, + "example": { + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "errors": [ + { + "code": "NOT.AUTHORIZED.ERROR", + "message": "Access token expired. Please modify your request and try again." + } + ] + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseVO403" + }, + "example": { + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "errors": [ + { + "code": "FORBIDDEN.ERROR", + "message": "We could not authorize your credentials. Please check your permissions and try again." + } + ] + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseVO404" + }, + "example": { + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "errors": [ + { + "code": "NOT.FOUND.ERROR", + "message": "The resource you requested is no longer available. Please modify your request and try again." + } + ] + } + } + } + }, + "500": { + "description": "Failure", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseVO500" + }, + "example": { + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "customerTransactionId": "AnyCo_order123456789", + "errors": [ + { + "code": "INTERNAL.SERVER.ERROR", + "message": "We encountered an unexpected error and are working to resolve the issue. We apologize for any inconvenience. Please check back at a later time." + } + ] + } + } + } + }, + "503": { + "description": "Service Unavailable", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseVO503" + }, + "example": { + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "customerTransactionId": "AnyCo_order123456789", + "errors": [ + { + "code": "SERVICE.UNAVAILABLE.ERROR", + "message": "The service is currently unavailable and we are working to resolve the issue. We apologize for any inconvenience. Please check back at a later time." + } + ] + } + } + } + } + }, + "parameters": [ + { + "in": "header", + "name": "x-customer-transaction-id", + "description": "This element allows you to assign a unique identifier to your transaction. This element is also returned in the reply and helps you match the request to the reply.", + "required": false, + "schema": { + "type": "string", + "example": "624deea6-b709-470c-8c39-4b5511281492" + } + }, + { + "in": "header", + "name": "content-type", + "description": "This is used to indicate the media type of the resource. The media type is a string sent along with the file indicating format of the file.", + "required": true, + "schema": { + "type": "string", + "example": "application/json" + } + }, + { + "in": "header", + "name": "x-locale", + "description": "This indicates the combination of language code and country code. Click here to see Locales", + "required": false, + "schema": { + "type": "string", + "example": "en_US" + } + }, + { + "in": "header", + "name": "authorization", + "description": "This indicates the authorization token for the input request.", + "required": true, + "schema": { + "type": "string", + "example": "Bearer XXX" + } + } + ], + "x-code-samples": [ + { + "lang": "C#", + "source": "var client = new RestClient(\"https://apis-sandbox.fedex.com/track/v1/associatedshipments\");\nvar request = new RestRequest(Method.POST);\nrequest.AddHeader(\"Authorization\", \"Bearer \");\nrequest.AddHeader(\"X-locale\", \"en_US\");\nrequest.AddHeader(\"Content-Type\", \"application/json\");\n// 'input' refers to JSON Payload\nrequest.AddParameter(\"application/x-www-form-urlencoded\", input, ParameterType.RequestBody);\nIRestResponse response = client.Execute(request);\n\n\n\n\n" + }, + { + "lang": "JAVA", + "source": "OkHttpClient client = new OkHttpClient();\n\nMediaType mediaType = MediaType.parse(\"application/json\");\n// 'input' refers to JSON Payload\nRequestBody body = RequestBody.create(mediaType, input);\nRequest request = new Request.Builder()\n .url(\"https://apis-sandbox.fedex.com/track/v1/associatedshipments\")\n .post(body)\n .addHeader(\"Content-Type\", \"application/json\")\n .addHeader(\"X-locale\", \"en_US\")\n .addHeader(\"Authorization\", \"Bearer \")\n .build();\n \nResponse response = client.newCall(request).execute();" + }, + { + "lang": "JAVASCRIPT", + "source": "// 'input' refers to JSON Payload\nvar data = JSON.stringify(input);\n \n var xhr = new XMLHttpRequest();\n xhr.withCredentials = true;\n \n xhr.addEventListener(\"readystatechange\", function () {\n if (this.readyState === 4) {\n console.log(this.responseText);\n }\n });\n \n xhr.open(\"POST\", \"https://apis-sandbox.fedex.com/track/v1/associatedshipments\");\n xhr.setRequestHeader(\"Content-Type\", \"application/json\");\n xhr.setRequestHeader(\"X-locale\", \"en_US\");\n xhr.setRequestHeader(\"Authorization\", \"Bearer \");\n \n xhr.send(data);" + }, + { + "lang": "PHP", + "source": "setUrl('https://apis-sandbox.fedex.com/track/v1/associatedshipments');\n$request->setMethod(HTTP_METH_POST);\n\n$request->setHeaders(array(\n 'Authorization' => 'Bearer ',\n 'X-locale' => 'en_US',\n 'Content-Type' => 'application/json'\n));\n\n$request->setBody(input); // 'input' refers to JSON Payload\n\ntry {\n $response = $request->send();\n\n echo $response->getBody();\n} catch (HttpException $ex) {\n echo $ex;\n}" + }, + { + "lang": "PYTHON", + "source": "import requests\n\nurl = \"https://apis-sandbox.fedex.com/track/v1/associatedshipments\"\n\npayload = input # 'input' refers to JSON Payload\nheaders = {\n 'Content-Type': \"application/json\",\n 'X-locale': \"en_US\",\n 'Authorization': \"Bearer \"\n }\n\nresponse = requests.post(url, data=payload, headers=headers)\n\nprint(response.text)" + }, + { + "lang": "RUST", + "source": "extern crate reqwest;\n\nuse std::io::Read;\n\nfn construct_headers() -> HeaderMap {\n let mut headers = HeaderMap::new();\n headers.insert(\"Content-Type\", \"application/json\");\n headers.insert(\"X-locale\", \"en_US\");\n headers.insert(\"Authorization\", \"Bearer \");\n headers\n}\n\nfn run() -> Result<()> {\n let client = reqwest::Client::new();\n let mut res = client.post(\"https://apis-sandbox.fedex.com/track/v1/associatedshipments\")\n .body(input) // 'input' refers to JSON Payload\n .headers(construct_headers())\n .send()?;\n let mut body = String::new();\n res.read_to_string(&mut body)?;\n\n println!(\"Status: {}\", res.status());\n println!(\"Headers:\\n{:#?}\", res.headers());\n println!(\"Body:\\n{}\", body);\n\n Ok(())\n}" + }, + { + "lang": "SWIFT", + "source": "import Foundation\n\nlet headers = [\n \"Content-Type\": \"application/json\",\n \"X-locale\": \"en_US\",\n \"Authorization\": \"Bearer \"\n]\nlet parameters = [\n input // 'input' refers to JSON Payload\n] as [String : Any]\n\nlet postData = JSONSerialization.data(withJSONObject: parameters, options: [])\n\nlet request = NSMutableURLRequest(url: NSURL(string: \"https://apis-sandbox.fedex.com/track/v1/associatedshipments\")! as URL,\n cachePolicy: .useProtocolCachePolicy,\n timeoutInterval: 10.0)\nrequest.httpMethod = \"POST\"\nrequest.allHTTPHeaderFields = headers\nrequest.httpBody = postData as Data\n\nlet session = URLSession.shared\nlet dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in\n if (error != nil) {\n print(error)\n } else {\n let httpResponse = response as? HTTPURLResponse\n print(httpResponse)\n }\n})\n\ndataTask.resume()" + } + ] + } + }, + "/track/v1/notifications": { + "post": { + "summary": "Send Notification", + "description": "This endpoint helps you setup up, customize the tracking event notifications to be received for a shipment.
          Note: FedEx APIs do not support Cross-Origin Resource Sharing (CORS) mechanism.", + "operationId": "19f112535f47e237486334074740bb66", + "requestBody": { + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Full_Schema_Notification" + } + ] + } + } + }, + "required": false + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TrkcResponseVO_Notifications" + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseVO" + }, + "example": { + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "customerTransactionId": "AnyCo_order123456789", + "errors": [ + { + "code": "TRACKING.TRACKINGNUMBER.NOTFOUND", + "message": "Tracking number cannot be found. Please correct the tracking number and try again." + } + ] + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseVO401" + }, + "example": { + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "errors": [ + { + "code": "NOT.AUTHORIZED.ERROR", + "message": "Access token expired. Please modify your request and try again." + } + ] + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseVO403" + }, + "example": { + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "errors": [ + { + "code": "FORBIDDEN.ERROR", + "message": "We could not authorize your credentials. Please check your permissions and try again." + } + ] + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseVO404" + }, + "example": { + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "errors": [ + { + "code": "NOT.FOUND.ERROR", + "message": "The resource you requested is no longer available. Please modify your request and try again." + } + ] + } + } + } + }, + "500": { + "description": "Failure", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseVO500" + }, + "example": { + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "customerTransactionId": "AnyCo_order123456789", + "errors": [ + { + "code": "INTERNAL.SERVER.ERROR", + "message": "We encountered an unexpected error and are working to resolve the issue. We apologize for any inconvenience. Please check back at a later time." + } + ] + } + } + } + }, + "503": { + "description": "Service Unavailable", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseVO503" + }, + "example": { + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "customerTransactionId": "AnyCo_order123456789", + "errors": [ + { + "code": "SERVICE.UNAVAILABLE.ERROR", + "message": "The service is currently unavailable and we are working to resolve the issue. We apologize for any inconvenience. Please check back at a later time." + } + ] + } + } + } + } + }, + "parameters": [ + { + "in": "header", + "name": "x-customer-transaction-id", + "description": "This element allows you to assign a unique identifier to your transaction. This element is also returned in the reply and helps you match the request to the reply.", + "required": false, + "schema": { + "type": "string", + "example": "624deea6-b709-470c-8c39-4b5511281492" + } + }, + { + "in": "header", + "name": "content-type", + "description": "This is used to indicate the media type of the resource. The media type is a string sent along with the file indicating format of the file.", + "required": true, + "schema": { + "type": "string", + "example": "application/json" + } + }, + { + "in": "header", + "name": "x-locale", + "description": "This indicates the combination of language code and country code. Click here to see Locales", + "required": false, + "schema": { + "type": "string", + "example": "en_US" + } + }, + { + "in": "header", + "name": "authorization", + "description": "This indicates the authorization token for the input request.", + "required": true, + "schema": { + "type": "string", + "example": "Bearer XXX" + } + } + ], + "x-code-samples": [ + { + "lang": "C#", + "source": "var client = new RestClient(\"https://apis-sandbox.fedex.com/track/v1/notifications\");\nvar request = new RestRequest(Method.POST);\nrequest.AddHeader(\"Authorization\", \"Bearer \");\nrequest.AddHeader(\"X-locale\", \"en_US\");\nrequest.AddHeader(\"Content-Type\", \"application/json\");\n// 'input' refers to JSON Payload\nrequest.AddParameter(\"application/x-www-form-urlencoded\", input, ParameterType.RequestBody);\nIRestResponse response = client.Execute(request);\n\n\n\n\n" + }, + { + "lang": "JAVA", + "source": "OkHttpClient client = new OkHttpClient();\n\nMediaType mediaType = MediaType.parse(\"application/json\");\n// 'input' refers to JSON Payload\nRequestBody body = RequestBody.create(mediaType, input);\nRequest request = new Request.Builder()\n .url(\"https://apis-sandbox.fedex.com/track/v1/notifications\")\n .post(body)\n .addHeader(\"Content-Type\", \"application/json\")\n .addHeader(\"X-locale\", \"en_US\")\n .addHeader(\"Authorization\", \"Bearer \")\n .build();\n \nResponse response = client.newCall(request).execute();" + }, + { + "lang": "JAVASCRIPT", + "source": "// 'input' refers to JSON Payload\nvar data = JSON.stringify(input);\n \n var xhr = new XMLHttpRequest();\n xhr.withCredentials = true;\n \n xhr.addEventListener(\"readystatechange\", function () {\n if (this.readyState === 4) {\n console.log(this.responseText);\n }\n });\n \n xhr.open(\"POST\", \"https://apis-sandbox.fedex.com/track/v1/notifications\");\n xhr.setRequestHeader(\"Content-Type\", \"application/json\");\n xhr.setRequestHeader(\"X-locale\", \"en_US\");\n xhr.setRequestHeader(\"Authorization\", \"Bearer \");\n \n xhr.send(data);" + }, + { + "lang": "PHP", + "source": "setUrl('https://apis-sandbox.fedex.com/track/v1/notifications');\n$request->setMethod(HTTP_METH_POST);\n\n$request->setHeaders(array(\n 'Authorization' => 'Bearer ',\n 'X-locale' => 'en_US',\n 'Content-Type' => 'application/json'\n));\n\n$request->setBody(input); // 'input' refers to JSON Payload\n\ntry {\n $response = $request->send();\n\n echo $response->getBody();\n} catch (HttpException $ex) {\n echo $ex;\n}" + }, + { + "lang": "PYTHON", + "source": "import requests\n\nurl = \"https://apis-sandbox.fedex.com/track/v1/notifications\"\n\npayload = input # 'input' refers to JSON Payload\nheaders = {\n 'Content-Type': \"application/json\",\n 'X-locale': \"en_US\",\n 'Authorization': \"Bearer \"\n }\n\nresponse = requests.post(url, data=payload, headers=headers)\n\nprint(response.text)" + }, + { + "lang": "RUST", + "source": "extern crate reqwest;\n\nuse std::io::Read;\n\nfn construct_headers() -> HeaderMap {\n let mut headers = HeaderMap::new();\n headers.insert(\"Content-Type\", \"application/json\");\n headers.insert(\"X-locale\", \"en_US\");\n headers.insert(\"Authorization\", \"Bearer \");\n headers\n}\n\nfn run() -> Result<()> {\n let client = reqwest::Client::new();\n let mut res = client.post(\"https://apis-sandbox.fedex.com/track/v1/notifications\")\n .body(input) // 'input' refers to JSON Payload\n .headers(construct_headers())\n .send()?;\n let mut body = String::new();\n res.read_to_string(&mut body)?;\n\n println!(\"Status: {}\", res.status());\n println!(\"Headers:\\n{:#?}\", res.headers());\n println!(\"Body:\\n{}\", body);\n\n Ok(())\n}" + }, + { + "lang": "SWIFT", + "source": "import Foundation\n\nlet headers = [\n \"Content-Type\": \"application/json\",\n \"X-locale\": \"en_US\",\n \"Authorization\": \"Bearer \"\n]\nlet parameters = [\n input // 'input' refers to JSON Payload\n] as [String : Any]\n\nlet postData = JSONSerialization.data(withJSONObject: parameters, options: [])\n\nlet request = NSMutableURLRequest(url: NSURL(string: \"https://apis-sandbox.fedex.com/track/v1/notifications\")! as URL,\n cachePolicy: .useProtocolCachePolicy,\n timeoutInterval: 10.0)\nrequest.httpMethod = \"POST\"\nrequest.allHTTPHeaderFields = headers\nrequest.httpBody = postData as Data\n\nlet session = URLSession.shared\nlet dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in\n if (error != nil) {\n print(error)\n } else {\n let httpResponse = response as? HTTPURLResponse\n print(httpResponse)\n }\n})\n\ndataTask.resume()" + } + ] + } + }, + "/track/v1/referencenumbers": { + "post": { + "summary": "Track by References", + "description": "This endpoint returns tracking information based on alternate references other than Tracking Number such as Customer reference numbers, etc.
          Note: FedEx APIs do not support Cross-Origin Resource Sharing (CORS) mechanism.", + "operationId": "Track by References", + "requestBody": { + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Full_Schema_Tracking_References" + } + ] + } + } + }, + "required": false + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TrkcResponseVO_ReferenceNumber" + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseVO" + }, + "example": { + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "customerTransactionId": "AnyCo_order123456789", + "errors": [ + { + "code": "TRACKING.TRACKINGNUMBER.EMPTY", + "message": "Please provide tracking number." + } + ] + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseVO401" + }, + "example": { + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "errors": [ + { + "code": "NOT.AUTHORIZED.ERROR", + "message": "Access token expired. Please modify your request and try again." + } + ] + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseVO403" + }, + "example": { + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "errors": [ + { + "code": "FORBIDDEN.ERROR", + "message": "We could not authorize your credentials. Please check your permissions and try again." + } + ] + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseVO404" + }, + "example": { + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "errors": [ + { + "code": "NOT.FOUND.ERROR", + "message": "The resource you requested is no longer available. Please modify your request and try again." + } + ] + } + } + } + }, + "500": { + "description": "Failure", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseVO500" + }, + "example": { + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "customerTransactionId": "AnyCo_order123456789", + "errors": [ + { + "code": "INTERNAL.SERVER.ERROR", + "message": "We encountered an unexpected error and are working to resolve the issue. We apologize for any inconvenience. Please check back at a later time." + } + ] + } + } + } + }, + "503": { + "description": "Service Unavailable", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseVO503" + }, + "example": { + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "customerTransactionId": "AnyCo_order123456789", + "errors": [ + { + "code": "SERVICE.UNAVAILABLE.ERROR", + "message": "The service is currently unavailable and we are working to resolve the issue. We apologize for any inconvenience. Please check back at a later time." + } + ] + } + } + } + } + }, + "parameters": [ + { + "in": "header", + "name": "x-customer-transaction-id", + "description": "This element allows you to assign a unique identifier to your transaction. This element is also returned in the reply and helps you match the request to the reply.", + "required": false, + "schema": { + "type": "string", + "example": "624deea6-b709-470c-8c39-4b5511281492" + } + }, + { + "in": "header", + "name": "content-type", + "description": "This is used to indicate the media type of the resource. The media type is a string sent along with the file indicating format of the file.", + "required": true, + "schema": { + "type": "string", + "example": "application/json" + } + }, + { + "in": "header", + "name": "x-locale", + "description": "This indicates the combination of language code and country code. Click here to see Locales", + "required": false, + "schema": { + "type": "string", + "example": "en_US" + } + }, + { + "in": "header", + "name": "authorization", + "description": "This indicates the authorization token for the input request.", + "required": true, + "schema": { + "type": "string", + "example": "Bearer XXX" + } + } + ], + "x-code-samples": [ + { + "lang": "C#", + "source": "var client = new RestClient(\"https://apis-sandbox.fedex.com/track/v1/referencenumbers\");\nvar request = new RestRequest(Method.POST);\nrequest.AddHeader(\"Authorization\", \"Bearer \");\nrequest.AddHeader(\"X-locale\", \"en_US\");\nrequest.AddHeader(\"Content-Type\", \"application/json\");\n// 'input' refers to JSON Payload\nrequest.AddParameter(\"application/x-www-form-urlencoded\", input, ParameterType.RequestBody);\nIRestResponse response = client.Execute(request);\n\n\n\n\n" + }, + { + "lang": "JAVA", + "source": "OkHttpClient client = new OkHttpClient();\n\nMediaType mediaType = MediaType.parse(\"application/json\");\n// 'input' refers to JSON Payload\nRequestBody body = RequestBody.create(mediaType, input);\nRequest request = new Request.Builder()\n .url(\"https://apis-sandbox.fedex.com/track/v1/referencenumbers\")\n .post(body)\n .addHeader(\"Content-Type\", \"application/json\")\n .addHeader(\"X-locale\", \"en_US\")\n .addHeader(\"Authorization\", \"Bearer \")\n .build();\n \nResponse response = client.newCall(request).execute();" + }, + { + "lang": "JAVASCRIPT", + "source": "// 'input' refers to JSON Payload\nvar data = JSON.stringify(input);\n \n var xhr = new XMLHttpRequest();\n xhr.withCredentials = true;\n \n xhr.addEventListener(\"readystatechange\", function () {\n if (this.readyState === 4) {\n console.log(this.responseText);\n }\n });\n \n xhr.open(\"POST\", \"https://apis-sandbox.fedex.com/track/v1/referencenumbers\");\n xhr.setRequestHeader(\"Content-Type\", \"application/json\");\n xhr.setRequestHeader(\"X-locale\", \"en_US\");\n xhr.setRequestHeader(\"Authorization\", \"Bearer \");\n \n xhr.send(data);" + }, + { + "lang": "PHP", + "source": "setUrl('https://apis-sandbox.fedex.com/track/v1/referencenumbers');\n$request->setMethod(HTTP_METH_POST);\n\n$request->setHeaders(array(\n 'Authorization' => 'Bearer ',\n 'X-locale' => 'en_US',\n 'Content-Type' => 'application/json'\n));\n\n$request->setBody(input); // 'input' refers to JSON Payload\n\ntry {\n $response = $request->send();\n\n echo $response->getBody();\n} catch (HttpException $ex) {\n echo $ex;\n}" + }, + { + "lang": "PYTHON", + "source": "import requests\n\nurl = \"https://apis-sandbox.fedex.com/track/v1/referencenumbers\"\n\npayload = input # 'input' refers to JSON Payload\nheaders = {\n 'Content-Type': \"application/json\",\n 'X-locale': \"en_US\",\n 'Authorization': \"Bearer \"\n }\n\nresponse = requests.post(url, data=payload, headers=headers)\n\nprint(response.text)" + }, + { + "lang": "RUST", + "source": "extern crate reqwest;\n\nuse std::io::Read;\n\nfn construct_headers() -> HeaderMap {\n let mut headers = HeaderMap::new();\n headers.insert(\"Content-Type\", \"application/json\");\n headers.insert(\"X-locale\", \"en_US\");\n headers.insert(\"Authorization\", \"Bearer \");\n headers\n}\n\nfn run() -> Result<()> {\n let client = reqwest::Client::new();\n let mut res = client.post(\"https://apis-sandbox.fedex.com/track/v1/referencenumbers\")\n .body(input) // 'input' refers to JSON Payload\n .headers(construct_headers())\n .send()?;\n let mut body = String::new();\n res.read_to_string(&mut body)?;\n\n println!(\"Status: {}\", res.status());\n println!(\"Headers:\\n{:#?}\", res.headers());\n println!(\"Body:\\n{}\", body);\n\n Ok(())\n}" + }, + { + "lang": "SWIFT", + "source": "import Foundation\n\nlet headers = [\n \"Content-Type\": \"application/json\",\n \"X-locale\": \"en_US\",\n \"Authorization\": \"Bearer \"\n]\nlet parameters = [\n input // 'input' refers to JSON Payload\n] as [String : Any]\n\nlet postData = JSONSerialization.data(withJSONObject: parameters, options: [])\n\nlet request = NSMutableURLRequest(url: NSURL(string: \"https://apis-sandbox.fedex.com/track/v1/referencenumbers\")! as URL,\n cachePolicy: .useProtocolCachePolicy,\n timeoutInterval: 10.0)\nrequest.httpMethod = \"POST\"\nrequest.allHTTPHeaderFields = headers\nrequest.httpBody = postData as Data\n\nlet session = URLSession.shared\nlet dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in\n if (error != nil) {\n print(error)\n } else {\n let httpResponse = response as? HTTPURLResponse\n print(httpResponse)\n }\n})\n\ndataTask.resume()" + } + ] + } + }, + "/track/v1/tcn": { + "post": { + "summary": "Track by Tracking Control Number", + "description": "Use this endpoint to return tracking information based on a Tracking Control Number.
          Note: FedEx APIs do not support Cross-Origin Resource Sharing (CORS) mechanism.", + "operationId": "f1f9080e8452d9ac903f562a2d2626d0", + "requestBody": { + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Full_Schema_TCN" + } + ] + } + } + }, + "required": false + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TrkcResponseVO_TCN" + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseVO" + }, + "example": { + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "customerTransactionId": "AnyCo_order123456789", + "errors": [ + { + "code": "TRACKING.TCN.NOTFOUND", + "message": "Transportation control number cannot be found. Please correct the transportation control number and try again." + } + ] + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseVO401" + }, + "example": { + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "errors": [ + { + "code": "NOT.AUTHORIZED.ERROR", + "message": "Access token expired. Please modify your request and try again." + } + ] + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseVO403" + }, + "example": { + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "errors": [ + { + "code": "FORBIDDEN.ERROR", + "message": "We could not authorize your credentials. Please check your permissions and try again." + } + ] + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseVO404" + }, + "example": { + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "errors": [ + { + "code": "NOT.FOUND.ERROR", + "message": "The resource you requested is no longer available. Please modify your request and try again." + } + ] + } + } + } + }, + "500": { + "description": "Failure", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseVO500" + }, + "example": { + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "customerTransactionId": "AnyCo_order123456789", + "errors": [ + { + "code": "INTERNAL.SERVER.ERROR", + "message": "We encountered an unexpected error and are working to resolve the issue. We apologize for any inconvenience. Please check back at a later time." + } + ] + } + } + } + }, + "503": { + "description": "Service Unavailable", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseVO503" + }, + "example": { + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "customerTransactionId": "AnyCo_order123456789", + "errors": [ + { + "code": "SERVICE.UNAVAILABLE.ERROR", + "message": "The service is currently unavailable and we are working to resolve the issue. We apologize for any inconvenience. Please check back at a later time." + } + ] + } + } + } + } + }, + "parameters": [ + { + "in": "header", + "name": "x-customer-transaction-id", + "description": "This element allows you to assign a unique identifier to your transaction. This element is also returned in the reply and helps you match the request to the reply.", + "required": false, + "schema": { + "type": "string", + "example": "624deea6-b709-470c-8c39-4b5511281492" + } + }, + { + "in": "header", + "name": "content-type", + "description": "This is used to indicate the media type of the resource. The media type is a string sent along with the file indicating format of the file.", + "required": true, + "schema": { + "type": "string", + "example": "application/json" + } + }, + { + "in": "header", + "name": "x-locale", + "description": "This indicates the combination of language code and country code. Click here to see Locales", + "required": false, + "schema": { + "type": "string", + "example": "en_US" + } + }, + { + "in": "header", + "name": "authorization", + "description": "This indicates the authorization token for the input request.", + "required": true, + "schema": { + "type": "string", + "example": "Bearer XXX" + } + } + ], + "x-code-samples": [ + { + "lang": "C#", + "source": "var client = new RestClient(\"https://apis-sandbox.fedex.com/track/v1/tcn\");\nvar request = new RestRequest(Method.POST);\nrequest.AddHeader(\"Authorization\", \"Bearer \");\nrequest.AddHeader(\"X-locale\", \"en_US\");\nrequest.AddHeader(\"Content-Type\", \"application/json\");\n// 'input' refers to JSON Payload\nrequest.AddParameter(\"application/x-www-form-urlencoded\", input, ParameterType.RequestBody);\nIRestResponse response = client.Execute(request);\n\n\n\n\n" + }, + { + "lang": "JAVA", + "source": "OkHttpClient client = new OkHttpClient();\n\nMediaType mediaType = MediaType.parse(\"application/json\");\n// 'input' refers to JSON Payload\nRequestBody body = RequestBody.create(mediaType, input);\nRequest request = new Request.Builder()\n .url(\"https://apis-sandbox.fedex.com/track/v1/tcn\")\n .post(body)\n .addHeader(\"Content-Type\", \"application/json\")\n .addHeader(\"X-locale\", \"en_US\")\n .addHeader(\"Authorization\", \"Bearer \")\n .build();\n \nResponse response = client.newCall(request).execute();" + }, + { + "lang": "JAVASCRIPT", + "source": "// 'input' refers to JSON Payload\nvar data = JSON.stringify(input);\n \n var xhr = new XMLHttpRequest();\n xhr.withCredentials = true;\n \n xhr.addEventListener(\"readystatechange\", function () {\n if (this.readyState === 4) {\n console.log(this.responseText);\n }\n });\n \n xhr.open(\"POST\", \"https://apis-sandbox.fedex.com/track/v1/tcn\");\n xhr.setRequestHeader(\"Content-Type\", \"application/json\");\n xhr.setRequestHeader(\"X-locale\", \"en_US\");\n xhr.setRequestHeader(\"Authorization\", \"Bearer \");\n \n xhr.send(data);" + }, + { + "lang": "PHP", + "source": "setUrl('https://apis-sandbox.fedex.com/track/v1/tcn');\n$request->setMethod(HTTP_METH_POST);\n\n$request->setHeaders(array(\n 'Authorization' => 'Bearer ',\n 'X-locale' => 'en_US',\n 'Content-Type' => 'application/json'\n));\n\n$request->setBody(input); // 'input' refers to JSON Payload\n\ntry {\n $response = $request->send();\n\n echo $response->getBody();\n} catch (HttpException $ex) {\n echo $ex;\n}" + }, + { + "lang": "PYTHON", + "source": "import requests\n\nurl = \"https://apis-sandbox.fedex.com/track/v1/tcn\"\n\npayload = input # 'input' refers to JSON Payload\nheaders = {\n 'Content-Type': \"application/json\",\n 'X-locale': \"en_US\",\n 'Authorization': \"Bearer \"\n }\n\nresponse = requests.post(url, data=payload, headers=headers)\n\nprint(response.text)" + }, + { + "lang": "RUST", + "source": "extern crate reqwest;\n\nuse std::io::Read;\n\nfn construct_headers() -> HeaderMap {\n let mut headers = HeaderMap::new();\n headers.insert(\"Content-Type\", \"application/json\");\n headers.insert(\"X-locale\", \"en_US\");\n headers.insert(\"Authorization\", \"Bearer \");\n headers\n}\n\nfn run() -> Result<()> {\n let client = reqwest::Client::new();\n let mut res = client.post(\"https://apis-sandbox.fedex.com/track/v1/tcn\")\n .body(input) // 'input' refers to JSON Payload\n .headers(construct_headers())\n .send()?;\n let mut body = String::new();\n res.read_to_string(&mut body)?;\n\n println!(\"Status: {}\", res.status());\n println!(\"Headers:\\n{:#?}\", res.headers());\n println!(\"Body:\\n{}\", body);\n\n Ok(())\n}" + }, + { + "lang": "SWIFT", + "source": "import Foundation\n\nlet headers = [\n \"Content-Type\": \"application/json\",\n \"X-locale\": \"en_US\",\n \"Authorization\": \"Bearer \"\n]\nlet parameters = [\n input // 'input' refers to JSON Payload\n] as [String : Any]\n\nlet postData = JSONSerialization.data(withJSONObject: parameters, options: [])\n\nlet request = NSMutableURLRequest(url: NSURL(string: \"https://apis-sandbox.fedex.com/track/v1/tcn\")! as URL,\n cachePolicy: .useProtocolCachePolicy,\n timeoutInterval: 10.0)\nrequest.httpMethod = \"POST\"\nrequest.allHTTPHeaderFields = headers\nrequest.httpBody = postData as Data\n\nlet session = URLSession.shared\nlet dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in\n if (error != nil) {\n print(error)\n } else {\n let httpResponse = response as? HTTPURLResponse\n print(httpResponse)\n }\n})\n\ndataTask.resume()" + } + ] + } + }, + "/track/v1/trackingdocuments": { + "post": { + "summary": "Track Document", + "description": "This endpoint helps you to request a letter that includes the recipient's signature as a proof of delivery.
          Note: FedEx APIs do not support Cross-Origin Resource Sharing (CORS) mechanism.", + "operationId": "TrackingDocuments", + "requestBody": { + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Full_Schema_SPOD" + } + ] + } + } + }, + "required": false + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TrkcResponseVO_SPOD" + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseVO" + }, + "example": { + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "customerTransactionId": "AnyCo_order123456789", + "errors": [ + { + "code": "TRACKING.TRACKINGNUMBER.NOTFOUND", + "message": "Tracking number cannot be found. Please correct the tracking number and try again." + } + ] + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseVO401" + }, + "example": { + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "errors": [ + { + "code": "NOT.AUTHORIZED.ERROR", + "message": "Access token expired. Please modify your request and try again." + } + ] + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseVO403" + }, + "example": { + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "errors": [ + { + "code": "FORBIDDEN.ERROR", + "message": "We could not authorize your credentials. Please check your permissions and try again." + } + ] + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseVO404" + }, + "example": { + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "errors": [ + { + "code": "NOT.FOUND.ERROR", + "message": "The resource you requested is no longer available. Please modify your request and try again." + } + ] + } + } + } + }, + "500": { + "description": "Failure", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseVO500" + }, + "example": { + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "customerTransactionId": "AnyCo_order123456789", + "errors": [ + { + "code": "INTERNAL.SERVER.ERROR", + "message": "We encountered an unexpected error and are working to resolve the issue. We apologize for any inconvenience. Please check back at a later time." + } + ] + } + } + } + }, + "503": { + "description": "Service Unavailable", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseVO503" + }, + "example": { + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "customerTransactionId": "AnyCo_order123456789", + "errors": [ + { + "code": "SERVICE.UNAVAILABLE.ERROR", + "message": "The service is currently unavailable and we are working to resolve the issue. We apologize for any inconvenience. Please check back at a later time." + } + ] + } + } + } + } + }, + "parameters": [ + { + "in": "header", + "name": "x-customer-transaction-id", + "description": "This element allows you to assign a unique identifier to your transaction. This element is also returned in the reply and helps you match the request to the reply.", + "required": false, + "schema": { + "type": "string", + "example": "624deea6-b709-470c-8c39-4b5511281492" + } + }, + { + "in": "header", + "name": "content-type", + "description": "This is used to indicate the media type of the resource. The media type is a string sent along with the file indicating format of the file.", + "required": true, + "schema": { + "type": "string", + "example": "application/json" + } + }, + { + "in": "header", + "name": "x-locale", + "description": "This indicates the combination of language code and country code. Click here to see Locales", + "required": false, + "schema": { + "type": "string", + "example": "en_US" + } + }, + { + "in": "header", + "name": "authorization", + "description": "This indicates the authorization token for the input request.", + "required": true, + "schema": { + "type": "string", + "example": "Bearer XXX" + } + } + ], + "x-code-samples": [ + { + "lang": "C#", + "source": "var client = new RestClient(\"https://apis-sandbox.fedex.com/track/v1/trackingdocuments\");\nvar request = new RestRequest(Method.POST);\nrequest.AddHeader(\"Authorization\", \"Bearer \");\nrequest.AddHeader(\"X-locale\", \"en_US\");\nrequest.AddHeader(\"Content-Type\", \"application/json\");\n// 'input' refers to JSON Payload\nrequest.AddParameter(\"application/x-www-form-urlencoded\", input, ParameterType.RequestBody);\nIRestResponse response = client.Execute(request);\n\n\n\n\n" + }, + { + "lang": "JAVA", + "source": "OkHttpClient client = new OkHttpClient();\n\nMediaType mediaType = MediaType.parse(\"application/json\");\n// 'input' refers to JSON Payload\nRequestBody body = RequestBody.create(mediaType, input);\nRequest request = new Request.Builder()\n .url(\"https://apis-sandbox.fedex.com/track/v1/trackingdocuments\")\n .post(body)\n .addHeader(\"Content-Type\", \"application/json\")\n .addHeader(\"X-locale\", \"en_US\")\n .addHeader(\"Authorization\", \"Bearer \")\n .build();\n \nResponse response = client.newCall(request).execute();" + }, + { + "lang": "JAVASCRIPT", + "source": "// 'input' refers to JSON Payload\nvar data = JSON.stringify(input);\n \n var xhr = new XMLHttpRequest();\n xhr.withCredentials = true;\n \n xhr.addEventListener(\"readystatechange\", function () {\n if (this.readyState === 4) {\n console.log(this.responseText);\n }\n });\n \n xhr.open(\"POST\", \"https://apis-sandbox.fedex.com/track/v1/trackingdocuments\");\n xhr.setRequestHeader(\"Content-Type\", \"application/json\");\n xhr.setRequestHeader(\"X-locale\", \"en_US\");\n xhr.setRequestHeader(\"Authorization\", \"Bearer \");\n \n xhr.send(data);" + }, + { + "lang": "PHP", + "source": "setUrl('https://apis-sandbox.fedex.com/track/v1/trackingdocuments');\n$request->setMethod(HTTP_METH_POST);\n\n$request->setHeaders(array(\n 'Authorization' => 'Bearer ',\n 'X-locale' => 'en_US',\n 'Content-Type' => 'application/json'\n));\n\n$request->setBody(input); // 'input' refers to JSON Payload\n\ntry {\n $response = $request->send();\n\n echo $response->getBody();\n} catch (HttpException $ex) {\n echo $ex;\n}" + }, + { + "lang": "PYTHON", + "source": "import requests\n\nurl = \"https://apis-sandbox.fedex.com/track/v1/trackingdocuments\"\n\npayload = input # 'input' refers to JSON Payload\nheaders = {\n 'Content-Type': \"application/json\",\n 'X-locale': \"en_US\",\n 'Authorization': \"Bearer \"\n }\n\nresponse = requests.post(url, data=payload, headers=headers)\n\nprint(response.text)" + }, + { + "lang": "RUST", + "source": "extern crate reqwest;\n\nuse std::io::Read;\n\nfn construct_headers() -> HeaderMap {\n let mut headers = HeaderMap::new();\n headers.insert(\"Content-Type\", \"application/json\");\n headers.insert(\"X-locale\", \"en_US\");\n headers.insert(\"Authorization\", \"Bearer \");\n headers\n}\n\nfn run() -> Result<()> {\n let client = reqwest::Client::new();\n let mut res = client.post(\"https://apis-sandbox.fedex.com/track/v1/trackingdocuments\")\n .body(input) // 'input' refers to JSON Payload\n .headers(construct_headers())\n .send()?;\n let mut body = String::new();\n res.read_to_string(&mut body)?;\n\n println!(\"Status: {}\", res.status());\n println!(\"Headers:\\n{:#?}\", res.headers());\n println!(\"Body:\\n{}\", body);\n\n Ok(())\n}" + }, + { + "lang": "SWIFT", + "source": "import Foundation\n\nlet headers = [\n \"Content-Type\": \"application/json\",\n \"X-locale\": \"en_US\",\n \"Authorization\": \"Bearer \"\n]\nlet parameters = [\n input // 'input' refers to JSON Payload\n] as [String : Any]\n\nlet postData = JSONSerialization.data(withJSONObject: parameters, options: [])\n\nlet request = NSMutableURLRequest(url: NSURL(string: \"https://apis-sandbox.fedex.com/track/v1/trackingdocuments\")! as URL,\n cachePolicy: .useProtocolCachePolicy,\n timeoutInterval: 10.0)\nrequest.httpMethod = \"POST\"\nrequest.allHTTPHeaderFields = headers\nrequest.httpBody = postData as Data\n\nlet session = URLSession.shared\nlet dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in\n if (error != nil) {\n print(error)\n } else {\n let httpResponse = response as? HTTPURLResponse\n print(httpResponse)\n }\n})\n\ndataTask.resume()" + } + ] + } + }, + "/track/v1/trackingnumbers": { + "post": { + "summary": "Track by Tracking Number", + "description": "This endpoint provides customers package tracking information based on a tracking number for various shipping services.
          Note: FedEx APIs do not support Cross-Origin Resource Sharing (CORS) mechanism.", + "operationId": "Track by Tracking Number", + "requestBody": { + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/Full_Schema_Tracking_Numbers" + } + ] + } + } + }, + "required": false + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TrkcResponseVO_TrackingNumber" + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseVO" + }, + "example": { + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "customerTransactionId": "AnyCo_order123456789", + "errors": [ + { + "code": "TRACKING.TRACKINGNUMBER.EMPTY", + "message": "Please provide tracking number." + } + ] + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseVO401" + }, + "example": { + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "errors": [ + { + "code": "NOT.AUTHORIZED.ERROR", + "message": "Access token expired. Please modify your request and try again." + } + ] + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseVO403" + }, + "example": { + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "errors": [ + { + "code": "FORBIDDEN.ERROR", + "message": "We could not authorize your credentials. Please check your permissions and try again." + } + ] + } + } + } + }, + "404": { + "description": "Not Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseVO404" + }, + "example": { + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "errors": [ + { + "code": "NOT.FOUND.ERROR", + "message": "The resource you requested is no longer available. Please modify your request and try again." + } + ] + } + } + } + }, + "500": { + "description": "Failure", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseVO500" + }, + "example": { + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "customerTransactionId": "AnyCo_order123456789", + "errors": [ + { + "code": "INTERNAL.SERVER.ERROR", + "message": "We encountered an unexpected error and are working to resolve the issue. We apologize for any inconvenience. Please check back at a later time." + } + ] + } + } + } + }, + "503": { + "description": "Service Unavailable", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponseVO503" + }, + "example": { + "transactionId": "624deea6-b709-470c-8c39-4b5511281492", + "customerTransactionId": "AnyCo_order123456789", + "errors": [ + { + "code": "SERVICE.UNAVAILABLE.ERROR", + "message": "The service is currently unavailable and we are working to resolve the issue. We apologize for any inconvenience. Please check back at a later time." + } + ] + } + } + } + } + }, + "parameters": [ + { + "in": "header", + "name": "x-customer-transaction-id", + "description": "This element allows you to assign a unique identifier to your transaction. This element is also returned in the reply and helps you match the request to the reply.", + "required": false, + "schema": { + "type": "string", + "example": "624deea6-b709-470c-8c39-4b5511281492" + } + }, + { + "in": "header", + "name": "content-type", + "description": "This is used to indicate the media type of the resource. The media type is a string sent along with the file indicating format of the file.", + "required": true, + "schema": { + "type": "string", + "example": "application/json" + } + }, + { + "in": "header", + "name": "x-locale", + "description": "This indicates the combination of language code and country code. Click here to see Locales", + "required": false, + "schema": { + "type": "string", + "example": "en_US" + } + }, + { + "in": "header", + "name": "authorization", + "description": "This indicates the authorization token for the input request.", + "required": true, + "schema": { + "type": "string", + "example": "Bearer XXX" + } + } + ], + "x-code-samples": [ + { + "lang": "C#", + "source": "var client = new RestClient(\"https://apis-sandbox.fedex.com/track/v1/trackingnumbers\");\nvar request = new RestRequest(Method.POST);\nrequest.AddHeader(\"Authorization\", \"Bearer \");\nrequest.AddHeader(\"X-locale\", \"en_US\");\nrequest.AddHeader(\"Content-Type\", \"application/json\");\n// 'input' refers to JSON Payload\nrequest.AddParameter(\"application/x-www-form-urlencoded\", input, ParameterType.RequestBody);\nIRestResponse response = client.Execute(request);\n\n\n\n\n" + }, + { + "lang": "JAVA", + "source": "OkHttpClient client = new OkHttpClient();\n\nMediaType mediaType = MediaType.parse(\"application/json\");\n// 'input' refers to JSON Payload\nRequestBody body = RequestBody.create(mediaType, input);\nRequest request = new Request.Builder()\n .url(\"https://apis-sandbox.fedex.com/track/v1/trackingnumbers\")\n .post(body)\n .addHeader(\"Content-Type\", \"application/json\")\n .addHeader(\"X-locale\", \"en_US\")\n .addHeader(\"Authorization\", \"Bearer \")\n .build();\n \nResponse response = client.newCall(request).execute();" + }, + { + "lang": "JAVASCRIPT", + "source": "// 'input' refers to JSON Payload\nvar data = JSON.stringify(input);\n \n var xhr = new XMLHttpRequest();\n xhr.withCredentials = true;\n \n xhr.addEventListener(\"readystatechange\", function () {\n if (this.readyState === 4) {\n console.log(this.responseText);\n }\n });\n \n xhr.open(\"POST\", \"https://apis-sandbox.fedex.com/track/v1/trackingnumbers\");\n xhr.setRequestHeader(\"Content-Type\", \"application/json\");\n xhr.setRequestHeader(\"X-locale\", \"en_US\");\n xhr.setRequestHeader(\"Authorization\", \"Bearer \");\n \n xhr.send(data);" + }, + { + "lang": "PHP", + "source": "setUrl('https://apis-sandbox.fedex.com/track/v1/trackingnumbers');\n$request->setMethod(HTTP_METH_POST);\n\n$request->setHeaders(array(\n 'Authorization' => 'Bearer ',\n 'X-locale' => 'en_US',\n 'Content-Type' => 'application/json'\n));\n\n$request->setBody(input); // 'input' refers to JSON Payload\n\ntry {\n $response = $request->send();\n\n echo $response->getBody();\n} catch (HttpException $ex) {\n echo $ex;\n}" + }, + { + "lang": "PYTHON", + "source": "import requests\n\nurl = \"https://apis-sandbox.fedex.com/track/v1/trackingnumbers\"\n\npayload = input # 'input' refers to JSON Payload\nheaders = {\n 'Content-Type': \"application/json\",\n 'X-locale': \"en_US\",\n 'Authorization': \"Bearer \"\n }\n\nresponse = requests.post(url, data=payload, headers=headers)\n\nprint(response.text)" + }, + { + "lang": "RUST", + "source": "extern crate reqwest;\n\nuse std::io::Read;\n\nfn construct_headers() -> HeaderMap {\n let mut headers = HeaderMap::new();\n headers.insert(\"Content-Type\", \"application/json\");\n headers.insert(\"X-locale\", \"en_US\");\n headers.insert(\"Authorization\", \"Bearer \");\n headers\n}\n\nfn run() -> Result<()> {\n let client = reqwest::Client::new();\n let mut res = client.post(\"https://apis-sandbox.fedex.com/track/v1/trackingnumbers\")\n .body(input) // 'input' refers to JSON Payload\n .headers(construct_headers())\n .send()?;\n let mut body = String::new();\n res.read_to_string(&mut body)?;\n\n println!(\"Status: {}\", res.status());\n println!(\"Headers:\\n{:#?}\", res.headers());\n println!(\"Body:\\n{}\", body);\n\n Ok(())\n}" + }, + { + "lang": "SWIFT", + "source": "import Foundation\n\nlet headers = [\n \"Content-Type\": \"application/json\",\n \"X-locale\": \"en_US\",\n \"Authorization\": \"Bearer \"\n]\nlet parameters = [\n input // 'input' refers to JSON Payload\n] as [String : Any]\n\nlet postData = JSONSerialization.data(withJSONObject: parameters, options: [])\n\nlet request = NSMutableURLRequest(url: NSURL(string: \"https://apis-sandbox.fedex.com/track/v1/trackingnumbers\")! as URL,\n cachePolicy: .useProtocolCachePolicy,\n timeoutInterval: 10.0)\nrequest.httpMethod = \"POST\"\nrequest.allHTTPHeaderFields = headers\nrequest.httpBody = postData as Data\n\nlet session = URLSession.shared\nlet dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in\n if (error != nil) {\n print(error)\n } else {\n let httpResponse = response as? HTTPURLResponse\n print(httpResponse)\n }\n})\n\ndataTask.resume()" + } + ] + } + } + }, + "components": { + "schemas": { + "Full_Schema_Multiple_Piece_Shipment": { + "required": [ + "associatedType", + "masterTrackingNumberInfo" + ], + "type": "object", + "properties": { + "includeDetailedScans": { + "type": "boolean", + "description": "Indicates if detailed scans are requested or not.
          Valid values are True, or False.", + "example": true + }, + "masterTrackingNumberInfo": { + "$ref": "#/components/schemas/MasterTrackingInfo" + }, + "associatedType": { + "type": "string", + "description": "The associated shipment type, such as MPS, Group MPS, or an outbound shipment which is linked to a return shipment.
          Example: STANDARD_MPS
          STANDARD_MPS: Single shipment with multiple packages, where tracking number got assigned to all pieces, one tracking number is treated as master tracking number while others are child tracking numbers.
          Group MPS: Behavior is just like standard MPS but it’s created differently. The shipper must be enrolled for this by a particular reference type like ‘PO’ (purchase order).Then any package order create on the same day going to the same place that has the reference number will get grouped into GMPS relationships.
          OUTBOUND_LINK_TO_RETURN: is an RTRN relationship.Same concept as an MPS.the OUTBOUND_LINK_TO_RETURN is the Master outbound package tracking number, that when tracked with this indicator you can get all the child return pieces.", + "example": "STANDARD_MPS", + "enum": [ + "OUTBOUND_LINK_TO_RETURN", + "STANDARD_MPS", + "GROUP_MPS" + ] + }, + "pagingDetails": { + "$ref": "#/components/schemas/PagingDetails" + } + }, + "description": "The request elements for Tracking by associated shipment.", + "example": { + "includeDetailedScans": true, + "associatedType": "STANDARD_MPS", + "masterTrackingNumberInfo": { + "shipDateEnd": "2018-11-03", + "shipDateBegin": "2018-11-01", + "trackingNumberInfo": { + "trackingNumberUniqueId": "245822~123456789012~FDEG", + "carrierCode": "FDXE", + "trackingNumber": "858488600850" + } + }, + "pagingDetails": { + "resultsPerPage": 56, + "pagingToken": "38903279038" + } + } + }, + "MasterTrackingInfo": { + "description": "The detailed master tracking details for the shipment to be tracked.", + "allOf": [ + { + "$ref": "#/components/schemas/TrackingInfo" + } + ] + }, + "TrackingInfo": { + "required": [ + "trackingNumberInfo" + ], + "type": "object", + "properties": { + "shipDateBegin": { + "type": "string", + "description": "ShipDateBegin and ShipDateEnd are recommended to narrow the search, reduce lookup time, and avoid duplicates when searching for a specific tracking number within a specific date range.
          Format: YYYY-MM-DD
          Example: 2020-03-29", + "example": "2020-03-29" + }, + "shipDateEnd": { + "type": "string", + "description": "ShipDateBegin and ShipDateEnd are recommended to narrow the search, reduce lookup time, and avoid duplicates when searching for a specific tracking number within a specific date range.
          Format: YYYY-MM-DD
          Example: 2020-04-01", + "example": "2020-04-01" + }, + "trackingNumberInfo": { + "$ref": "#/components/schemas/TrackingNumberInfo" + } + }, + "description": "Tracking details for the shipment to be tracked" + }, + "TrackingNumberInfo": { + "required": [ + "trackingNumber" + ], + "type": "object", + "properties": { + "trackingNumber": { + "type": "string", + "description": "This is a Tracking number for FedEx packages used for tracking a single package or group of packages.
          Example: 128667043726
          Click here to see Mock Tracking Numbers.", + "example": "128667043726" + }, + "carrierCode": { + "type": "string", + "description": "This is a placeholder to provide the FedEx operating company (transportation) code used for package delivery.
          Example: FDXE", + "example": "FDXE", + "enum": [ + "FDXE", + "FDXG", + "FXSP", + "FXFR", + "FDXC", + "FXCC", + "FEDEX_CARGO", + "FEDEX_CUSTOM_CRITICAL", + "FEDEX_EXPRESS", + "FEDEX_FREIGHT", + "FEDEX_GROUND", + "FEDEX_OFFICE", + "FEDEX_KINKOS", + "FX", + "FDFR", + "FDEG", + "FXK", + "FDC", + "FDCC" + ] + }, + "trackingNumberUniqueId": { + "type": "string", + "description": "Unique identifier used to distinguish duplicate FedEx tracking numbers. This value will be set by FedEx systems.
          Example: 245822\\~123456789012\\~FDEG", + "example": "245822~123456789012~FDEG" + } + }, + "description": "Information uniquely identifying a shipment such as Tracking number, ShipDate, and Tracking number uniqueId." + }, + "PagingDetails": { + "description": "The details about how to retrieve the subsequent pages when there is more than one page in the TrackReply.", + "allOf": [ + { + "$ref": "#/components/schemas/PagingDetails_2" + } + ] + }, + "PagingDetails_2": { + "type": "object", + "properties": { + "resultsPerPage": { + "type": "integer", + "description": "

          Use this element to specify the number of Tracking results to be returned in the Tracking response. Use this and pagingToken elements, to retrieve remaining set of the track results.

          Here is how the paging works:
          For your first track request, send element resultsPerPage, with a number XX (5) and the response will return XX (5) results along with element pagingToken and moreDataAvailable = true or false based on the number of tracking results.

          • If moreDataAvailable = false, then there are no more track results can be retrieved further.
          • If moreDataAvailable = True, then it means there are more track results and hence send the next tracking request with resultsPerPage = YY (4) and pagingToken = XX + 1 (5) from Track Response element pagingToken. This can be continued until the moreDataAvailable becomes false or there are no more tracking results.

          Example: 10", + "format": "int32", + "example": 56 + }, + "pagingToken": { + "type": "string", + "description": "

          Use this element to specify the starting sequence for the next set of tracking results. This element can be specified if paging is used in the initial tracking request and you need to request next set of track results.

          Note: This element not to be used in the initial tracking request and only should be used in the subsequent track requests when there is paging (element resultsPerPage is specified) indicated.


          Example: 1234567890", + "example": "38903279038" + } + }, + "description": "Specify the details about how to retrieve the subsequent pages when there is more than one page in the TrackReply." + }, + "TrkcResponseVO_Associated": { + "type": "object", + "properties": { + "transactionId": { + "type": "string", + "description": "The transaction ID is a special set of numbers that defines each transaction.
          Example: 624deea6-b709-470c-8c39-4b5511281492", + "example": "624deea6-b709-470c-8c39-4b5511281492" + }, + "customerTransactionId": { + "type": "string", + "description": "This element allows you to assign a unique identifier to your transaction. This element is also returned in the reply and helps you match the request to the reply.
          Example: AnyCo_order123456789", + "example": "AnyCo_order123456789" + }, + "output": { + "$ref": "#/components/schemas/BaseProcessOutputVO_Associated" + } + }, + "description": "This is a wrapper class for outputVO" + }, + "BaseProcessOutputVO_Associated": { + "$ref": "#/components/schemas/TrackingMPSResponse" + }, + "TrackingMPSResponse": { + "type": "object", + "properties": { + "completeTrackResults": { + "type": "array", + "description": "Contains the detailed tracking entry information.", + "items": { + "$ref": "#/components/schemas/CompleteTrackResult" + } + }, + "alerts": { + "type": "array", + "description": "The cxs alert type, alert code, and alert messages.
          Example: example: TRACKING.DATA.NOTFOUND - Tracking data unavailable", + "example": "TRACKING.DATA.NOTFOUND - Tracking data unavailable", + "items": { + "$ref": "#/components/schemas/Alert" + } + } + }, + "description": "The response elements for Tracking by Associated Shipment request." + }, + "CompleteTrackResult": { + "type": "object", + "properties": { + "trackingNumber": { + "type": "string", + "description": "A tracking number to identify a package.
          Example: 123456789012", + "example": "123456789012" + }, + "trackResults": { + "type": "array", + "description": "An array of detailed tracking information for the requested packages(s). In case of duplicate shipments, multiple track details will be populated.", + "items": { + "$ref": "#/components/schemas/TrackResult" + } + } + }, + "description": "Detailed and complete track results" + }, + "TrackResult": { + "type": "object", + "properties": { + "trackingNumberInfo": { + "$ref": "#/components/schemas/TrackingNumberInfo_1" + }, + "additionalTrackingInfo": { + "$ref": "#/components/schemas/AdditionalTrackingInfo" + }, + "distanceToDestination": { + "$ref": "#/components/schemas/Distance" + }, + "consolidationDetail": { + "type": "array", + "description": "Indicates the consolidation details.", + "items": { + "$ref": "#/components/schemas/ConsolidationDetail" + } + }, + "meterNumber": { + "type": "string", + "description": "The associated meter number for your FedEx account number. Maximum of 9 characters.
          Example: 8468376", + "example": "8468376" + }, + "returnDetail": { + "$ref": "#/components/schemas/ReturnDetail" + }, + "serviceDetail": { + "$ref": "#/components/schemas/ServiceDescriptionDetail" + }, + "destinationLocation": { + "description": "Location details for the recipient where the package will be or has been delivered.", + "allOf": [ + { + "$ref": "#/components/schemas/LocationDetail1" + } + ] + }, + "latestStatusDetail": { + "$ref": "#/components/schemas/StatusDetail" + }, + "serviceCommitMessage": { + "$ref": "#/components/schemas/ServiceCommitMessage" + }, + "informationNotes": { + "type": "array", + "description": "Notifications to the end user that provide additional information relevant to the tracked shipment. For example, a notification may indicate that a change in behavior has occurred.", + "items": { + "$ref": "#/components/schemas/InformationNoteDetail" + } + }, + "error": { + "$ref": "#/components/schemas/CXSError" + }, + "specialHandlings": { + "type": "array", + "description": "Indicate the special handlings on the package being tracked. Includes Special handlings requested for the package like signature options, Broker select or COD etc.
          Click here to see FedEx Express Special Handling Codes.", + "items": { + "$ref": "#/components/schemas/TrackSpecialHandling" + } + }, + "availableImages": { + "type": "array", + "description": "The available tracking documents for the shipment being tracked. Available tracking documents includes SPOD and Bill of lading.", + "items": { + "$ref": "#/components/schemas/AvailableImagesDetail" + } + }, + "deliveryDetails": { + "$ref": "#/components/schemas/DeliveryDetails" + }, + "scanEvents": { + "type": "array", + "description": "FedEx scan event information for a shipment. Includes the list of events and/or scans applied.", + "items": { + "$ref": "#/components/schemas/ScanEvent" + } + }, + "dateAndTimes": { + "type": "array", + "description": "Date and time information for the tracked shipment. Date and time information for the tracked shipment includes various type of date time including when the package was shipped, when it is expected to deliver, when it is actually delivered etc.", + "items": { + "$ref": "#/components/schemas/TrackingDateAndTime" + } + }, + "packageDetails": { + "$ref": "#/components/schemas/PackageDetail" + }, + "goodsClassificationCode": { + "type": "string", + "description": "Classification codes for the goods in package. Goods classification codes required for clearance purpose.
          Example: goodsClassificationCode", + "example": "goodsClassificationCode" + }, + "holdAtLocation": { + "description": "Location details for the FedEx facility holding package for delivery. Populated only when REDIRECT_TO_HOLD_AT_LOCATION is available as custom delivery options.", + "allOf": [ + { + "$ref": "#/components/schemas/LocationDetail1" + } + ] + }, + "customDeliveryOptions": { + "type": "array", + "description": "List of delivery options that can be used to customize the delivery of the package.", + "items": { + "$ref": "#/components/schemas/CustomDeliveryOption" + } + }, + "estimatedDeliveryTimeWindow": { + "description": "The estimated window for time of delivery. May be periodically updated based on available in-flight shipment information.", + "allOf": [ + { + "$ref": "#/components/schemas/TimeWindow" + } + ] + }, + "pieceCounts": { + "type": "array", + "description": "Piece count information at origin and destination.", + "items": { + "$ref": "#/components/schemas/PieceCountDetail" + } + }, + "originLocation": { + "$ref": "#/components/schemas/OriginLocation" + }, + "recipientInformation": { + "description": "Contact and address information of recipient.", + "allOf": [ + { + "$ref": "#/components/schemas/ContactAndAddress1" + } + ] + }, + "standardTransitTimeWindow": { + "description": "The standard committed window of time by which the package is expected to be delivered.", + "allOf": [ + { + "$ref": "#/components/schemas/TimeWindow" + } + ] + }, + "shipmentDetails": { + "$ref": "#/components/schemas/TrackShipmentDetail" + }, + "reasonDetail": { + "$ref": "#/components/schemas/ReasonDetail" + }, + "availableNotifications": { + "type": "array", + "description": "The types of email notifications that are available for the package.
          Example:ON_DELIVERY", + "example": [ + "ON_DELIVERY", + "ON_EXCEPTION" + ], + "items": { + "type": "string" + } + }, + "shipperInformation": { + "description": "Contact and address information of shipper.", + "allOf": [ + { + "$ref": "#/components/schemas/ContactAndAddress1" + } + ] + }, + "lastUpdatedDestinationAddress": { + "description": "Last updated delivery address for the package.", + "allOf": [ + { + "$ref": "#/components/schemas/AddressVO1" + } + ] + } + }, + "description": "Contains detailed tracking information for the requested packages(s). In case of duplicates, multiple track details will be populated. " + }, + "AdditionalTrackingInfo": { + "type": "object", + "properties": { + "hasAssociatedShipments": { + "type": "boolean", + "description": "Field which indicates if the current shipment has associated shipments.
          Example: false", + "example": false + }, + "nickname": { + "type": "string", + "description": "Field which holds information about nickname of the shipment.
          Example: Shipment nickname", + "example": "shipment nickname" + }, + "packageIdentifiers": { + "type": "array", + "description": "Other related identifiers for this package such as reference numbers, purchase order number etc. Provides identifiers other than tracking number that can be used in order to track the shipment.", + "items": { + "$ref": "#/components/schemas/PackageIdentifier" + } + }, + "shipmentNotes": { + "type": "string", + "description": "Field which holds customer assigned notes for a package.
          Example: shipment notes", + "example": "shipment notes" + } + }, + "description": "Additional Tracking number information like nickname, notes, shipment attributes etc." + }, + "PackageIdentifier": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Indicate the package identifier to identify the package.
          Example: SHIPPER_REFERENCE", + "example": "SHIPPER_REFERENCE", + "enum": [ + "BILL_OF_LADING", + "COD_RETURN_TRACKING_NUMBER", + "CUSTOMER_AUTHORIZATION_NUMBER", + "CUSTOMER_REFERENCE", + "DEPARTMENT", + "DOCUMENT_AIRWAY_BILL", + "EXPRESS_ALTERNATE_REFERENCE", + "FEDEX_OFFICE_JOB_ORDER_NUMBER", + "FREE_FORM_REFERENCE", + "GROUND_INTERNATIONAL", + "GROUND_SHIPMENT_ID", + "GROUP_MPS", + "INTERNATIONAL_DISTRIBUTION", + "INVOICE", + "JOB_GLOBAL_TRACKING_NUMBER", + "ORDER_GLOBAL_TRACKING_NUMBER", + "ORDER_TO_PAY_NUMBER", + "OUTBOUND_LINK_TO_RETURN", + "PART_NUMBER", + "PARTNER_CARRIER_NUMBER", + "PURCHASE_ORDER", + "REROUTE_TRACKING_NUMBER", + "RETURN_MATERIALS_AUTHORIZATION", + "RETURNED_TO_SHIPPER_TRACKING_NUMBER", + "SHIPPER_REFERENCE", + "STANDARD_MPS", + "TRACKING_CONTROL_NUMBER", + "TRACKING_NUMBER_OR_DOORTAG", + "TRANSBORDER_DISTRIBUTION", + "TRANSPORTATION_CONTROL_NUMBER", + "VIRTUAL_CONSOLIDATION" + ] + }, + "value": { + "type": "array", + "description": "Field which holds the value of the identifier used to identify the package.
          Example: 'ASJFGVAS'", + "example": "ASJFGVAS", + "items": { + "type": "string" + } + }, + "trackingNumberUniqueId": { + "type": "string", + "description": "Unique identifier used to distinguish duplicate FedEx tracking numbers. This value will be set by FedEx systems.
          Example: 245822\\~123456789012\\~FDEG", + "example": "245822~123456789012~FDEG" + } + }, + "description": "The type and value of the package identifier that is to be used to retrieve the tracking information for a package or group of packages." + }, + "Distance": { + "type": "object", + "properties": { + "units": { + "type": "string", + "description": "Field which holds the distance unit type.", + "example": "KM", + "enum": [ + "KM", + "MI" + ] + }, + "value": { + "type": "number", + "description": "Field which holds the value for the distance.
          Example: 685.78", + "format": "double", + "example": 685.7 + } + }, + "description": "Distance remaining to the destination. Only returned for FedEx Custom Critical shipments." + }, + "ConsolidationDetail": { + "type": "object", + "properties": { + "timeStamp": { + "type": "string", + "description": "The timestamp for the consolidation.
          Example: 2020-10-13T03:54:44-06:00", + "example": "2020-10-13T03:54:44-06:00" + }, + "consolidationID": { + "type": "string", + "description": "The identifier for the consolidation.
          Example: 47936927", + "example": "47936927" + }, + "reasonDetail": { + "description": "Specifies the reason details for the consolidation event for a package.", + "allOf": [ + { + "$ref": "#/components/schemas/ReasonDetail" + } + ] + }, + "packageCount": { + "type": "integer", + "description": "Specifies the package count for the consolidation.
          Example: 25", + "format": "int32", + "example": 25 + }, + "eventType": { + "type": "string", + "description": "Specifies the consolidation event type for a package. A package can be ADDED to, REMOVED from, or EXCLUDED from a consolidation.
          Example: PACKAGE_ADDED_TO_CONSOLIDATION", + "example": "PACKAGE_ADDED_TO_CONSOLIDATION" + } + }, + "description": "This is the consolidation details for packages within a shipment identified as CONSOLIDATED." + }, + "ReasonDetail": { + "type": "object", + "properties": { + "description": { + "type": "string", + "description": "Field which holds the reason description.
          Example: Wrong color", + "example": "Wrong color" + }, + "type": { + "type": "string", + "description": "Field which holds the reason type.
          Example: REJECTED", + "example": "REJECTED" + } + }, + "description": "This object contains reason description and type." + }, + "ReturnDetail": { + "type": "object", + "properties": { + "authorizationName": { + "type": "string", + "description": "Name of person authorizing the return, entered by the customer.", + "example": "Sammy Smith" + }, + "reasonDetail": { + "type": "array", + "description": "Specifies the return reason details.", + "items": { + "$ref": "#/components/schemas/ReasonDetail" + } + } + }, + "description": "Specifies return information related to a return shipment." + }, + "ServiceDescriptionDetail": { + "type": "object", + "properties": { + "description": { + "type": "string", + "description": "Field which holds the text description of the service type of this package.
          Example: FedEx Freight Economy", + "example": "FedEx Freight Economy." + }, + "shortDescription": { + "type": "string", + "description": "Field which holds the abbreviated text description of the service type of this package.
          Example: FL", + "example": "FL" + }, + "type": { + "type": "string", + "description": "This is the service type.
          Example: FEDEX_FREIGHT_ECONOMY
          Click here to see Service Types", + "example": "FEDEX_FREIGHT_ECONOMY" + } + }, + "description": "This object contains service description details for the package." + }, + "LocationDetail_1": { + "required": [ + "locationContactAndAddress", + "locationType" + ], + "type": "object", + "properties": { + "locationId": { + "type": "string", + "description": "Location Identification for facilities identified by an alpha numeric location code. Passing Location Id of the Hold at Location (HAL) address is strongly recommended to ensure packages are delivered to the correct address.
          Example: SEA", + "example": "SEA" + }, + "locationContactAndAddress": { + "$ref": "#/components/schemas/ContactAndAddress_1" + }, + "locationType": { + "type": "string", + "description": "The FedEx Location Type.
          Example: PICKUP_LOCTION", + "example": "PICKUP_LOCATION", + "enum": [ + "FEDEX_AUTHORIZED_SHIP_CENTER", + "FEDEX_OFFICE", + "FEDEX_SELF_SERVICE_LOCATION", + "FEDEX_STAFFED", + "RETAIL_ALLICANCE_LOCATION", + "FEDEX_GROUND_TERMINAL", + "FEDEX_ONSITE" + ] + } + }, + "description": "Location details for the fedex facility." + }, + "ContactAndAddress_1": { + "required": [ + "address", + "contact" + ], + "type": "object", + "properties": { + "contact": { + "$ref": "#/components/schemas/ContactVO_1" + }, + "address": { + "description": "Required.\n\nDescriptive data for a physical location. may be used as an actual physical address(place to which one could go), or a container of 'address parts' which should be handled as a unit(such as a city-state-zip combination within the US).\n\nConditional when used with Payor object. Required if entering using RECIPIENT or THIRD_PARTY. Required if not-authenticated and SENDER is selected", + "allOf": [ + { + "$ref": "#/components/schemas/AddressVO_1" + } + ] + } + }, + "description": "Location Contact And Address." + }, + "ContactVO_1": { + "type": "object", + "properties": { + "personName": { + "type": "string", + "description": "Identifies the contact person's name. Max Length is 70.
          Example: John Taylor", + "example": "John Taylor" + }, + "phoneNumber": { + "type": "string", + "description": "Identifies the phone number associated with this contact. Max length is 15.
          Example: '1234567890'", + "example": "1234567890" + }, + "companyName": { + "type": "string", + "description": "Identifies the company this contact is associated with. Max length is 35.
          Example: Fedex", + "example": "Fedex" + } + }, + "description": "Indicate the contact details for this package.
          Note: contact is shown in response only in secured flow. For non secured flow, contact is not shown in the response.'" + }, + "AddressVO_1": { + "required": [ + "addressVerificationId", + "countryCode", + "streetLines" + ], + "type": "object", + "properties": { + "classification": { + "type": "string", + "description": "Specifies the FedEx classification type for an address.
          Valid values are BUSINESS, RESIDENTIAL, MIXED, UNKNOWN.
          Example: BUSINESS", + "example": "BUSINESS" + }, + "residential": { + "type": "boolean", + "description": "Placeholder to indicate whether the address is residential (as opposed to commercial).", + "example": false, + "enum": [ + true, + false + ] + }, + "streetLines": { + "type": "array", + "description": "Combination of number, street name, etc. At least one line is required for a valid physical address; empty lines should not be included.
          Example: [\"1043 North Easy Street\", \"Suite 999\"].
          Note: Street lines is shown in response only in secured flow. For non secured flow, street lines is not shown in the response.", + "example": [ + "1043 North Easy Street", + "Suite 999" + ], + "items": { + "type": "string" + } + }, + "city": { + "type": "string", + "description": "Conditional
          The name of the city, town, etc.
          Example: SEATTLE", + "example": "SEATTLE" + }, + "stateOrProvinceCode": { + "type": "string", + "description": "This is a placeholder for State or Province code.
          Example: CA
          Click here to see State/Province Code", + "example": "WA" + }, + "postalCode": { + "type": "string", + "description": "Placeholder to specify postal code for the address. Postal Code is required for postal-aware countries.
          Example: 98101
          Click here to see Postal aware countries", + "example": "98101" + }, + "countryCode": { + "type": "string", + "description": "Placeholder for country code (2 characters) for the address.
          Example: US
          Click here to see Country Codes", + "example": "US" + } + }, + "description": "Address where the package was actually delivered. Contrast with destinationAddress, which is the location to which the package was intended to be delivered. Addresses may differ due to delivery to a behavior, hold at FedEx location, etc." + }, + "StatusDetail": { + "type": "object", + "properties": { + "scanLocation": { + "description": "Address information related to the associated Status.", + "allOf": [ + { + "$ref": "#/components/schemas/AddressVO1" + } + ] + }, + "code": { + "type": "string", + "description": "A code that identifies this type of status.
          Example:PU,DE,DP,HL,OC", + "example": "PU" + }, + "derivedCode": { + "type": "string", + "description": "Specifies the latest status detail code of the package.
          Example:PU,DE,DP,HL,OC", + "example": "PU" + }, + "ancillaryDetails": { + "type": "array", + "description": "Specifies the cause of exception along with any action that needs to taken by customer.", + "items": { + "$ref": "#/components/schemas/StatusAncillaryDetail" + } + }, + "statusByLocale": { + "type": "string", + "description": "This is the latest tracking status by locale.
          Example: Picked up", + "example": "Picked up" + }, + "description": { + "type": "string", + "description": "A human-readable description of this status.
          Example: Picked up", + "example": "Picked up" + }, + "delayDetail": { + "$ref": "#/components/schemas/DelayDetail" + } + }, + "description": "Specifies details about the status of the track information for the shipment being tracked. AncilliaryDetails may also be available which describe the cause of exception along with any action that needs to taken by customer." + }, + "AddressVO": { + "required": [ + "addressVerificationId", + "countryCode", + "streetLines" + ], + "type": "object", + "properties": { + "classification": { + "type": "string", + "description": "Specifies the FedEx classification type for an address.
          Valid values are BUSINESS, RESIDENTIAL, MIXED, UNKNOWN.
          Example: BUSINESS", + "example": "BUSINESS" + }, + "residential": { + "type": "boolean", + "description": "Placeholder to indicate whether the address is residential (as opposed to commercial).", + "example": false, + "enum": [ + true, + false + ] + }, + "streetLines": { + "type": "array", + "description": "Combination of number, street name, etc. At least one line is required for a valid physical address; empty lines should not be included.
          Example: [\"1043 North Easy Street\", \"Suite 999\"]", + "example": [ + "1043 North Easy Street", + "Suite 999" + ], + "items": { + "type": "string" + } + }, + "city": { + "type": "string", + "description": "Conditional
          The name of the city, town, etc.
          Example: SEATTLE", + "example": "SEATTLE" + }, + "stateOrProvinceCode": { + "type": "string", + "description": "This is a placeholder for State or Province code.
          Example: CA
          Click here to see State/Province Code", + "example": "WA" + }, + "postalCode": { + "type": "string", + "description": "Placeholder to specify postal code for the address. Postal Code is required for postal-aware countries.
          Example: 98101
          Click here to see Postal aware countries", + "example": "98101" + }, + "countryCode": { + "type": "string", + "description": "Placeholder for country code (2 characters) for the address.
          Example: US
          Click here to see Country Codes", + "example": "US" + }, + "countryName": { + "type": "string", + "description": "Field holds the fully spelled out name of a country.
          Example: United States", + "example": "United States" + } + }, + "description": "Address where the package was actually delivered. Contrast with destinationAddress, which is the location to which the package was intended to be delivered. Addresses may differ due to delivery to a behavior, hold at FedEx location, etc." + }, + "StatusAncillaryDetail": { + "type": "object", + "properties": { + "reason": { + "type": "string", + "description": "Field which holds Reason code associated to the status of the shipment being tracked.
          Example: 15,84,IN001,015A,02", + "example": "15" + }, + "reasonDescription": { + "type": "string", + "description": "Field which holds Reason description associated to the status of the shipment being tracked.
          Example: Customer not available or business closed,Local delivery restriction, delivery not attempted,Package delivered to recipient address - release authorized", + "example": "Customer not available or business closed" + }, + "action": { + "type": "string", + "description": "Field which holds recommended action for customer to resolve reason.
          Example: Contact us at to discuss possible delivery or pickup alternatives.", + "example": "Contact us at to discuss possible delivery or pickup alternatives." + }, + "actionDescription": { + "type": "string", + "description": "Field which holds recommended action description for customer to resolve reason.
          Example: Customer not Available or Business Closed", + "example": "Customer not Available or Business Closed" + } + }, + "description": "Field which holds status code of the track information for the shipment being tracked." + }, + "DelayDetail": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Specifies the type of delay.", + "example": "WEATHER", + "enum": [ + "WEATHER", + "OPERATIONAL", + "LOCAL", + "GENERAL", + "CLEARANCE" + ] + }, + "subType": { + "type": "string", + "description": "Specifies the subType of delay.", + "example": "SNOW", + "enum": [ + "SNOW", + "TORNADO", + "EARTHQUAKE etc" + ] + }, + "status": { + "type": "string", + "description": "Specifies the status of package indicating whether a package is arriving early or is on time or has been delayed.", + "example": "DELAYED", + "enum": [ + "DELAYED", + "ON_TIME", + "EARLY" + ] + } + }, + "description": "Specifies the information about delays." + }, + "ServiceCommitMessage": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Field which holds the commitment message for this package.
          Example: No scheduled delivery date available at this time.", + "example": "No scheduled delivery date available at this time." + }, + "type": { + "type": "string", + "description": "Field which holds the type of service commit message.
          Example: ESTIMATED_DELIVERY_DATE_UNAVAILABLE", + "example": "ESTIMATED_DELIVERY_DATE_UNAVAILABLE", + "enum": [ + "BROKER_DELIVERED_DESCRIPTION", + "CANCELLED_DESCRIPTION", + "DELIVERY_IN_MULTIPLE_PIECE_SHIPMENT", + "ESTIMATED_DELIVERY_DATE_UNAVAILABLE", + "EXCEPTION_IN_MULTIPLE_PIECE_SHIPMENT", + "FINAL_DELIVERY_ATTEMPTED", + "FIRST_DELIVERY_ATTEMPTED", + "HELD_PACKAGE_AVAILABLE_FOR_RECIPIENT_PICKUP", + "HELD_PACKAGE_AVAILABLE_FOR_RECIPIENT_PICKUP_WITH_ADDRESS", + "HELD_PACKAGE_NOT_AVAILABLE_FOR_RECIPIENT_PICKUP", + "SHIPMENT_LABEL_CREATED", + "SUBSEQUENT_DELIVERY_ATTEMPTED", + "USPS_DELIVERED", + "USPS_DELIVERING\"" + ] + } + }, + "description": "Commitment message for this package. Informative messages related to the package. Used to convey information such as FedEx has received information about a package but has not yet taken possession of it. FedEx has handed the package off to a third party for final delivery. The package delivery has been cancelled." + }, + "InformationNoteDetail": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Field which holds the code that designates the type of informational message being returned.
          Example: 'CLEARANCE_ENTRY_FEE_APPLIES'", + "example": "CLEARANCE_ENTRY_FEE_APPLIES" + }, + "description": { + "type": "string", + "description": "Field which holds the The informational message in human readable form.
          Example: this is an informational message", + "example": "this is an informational message" + } + }, + "description": "Notifications to the end user that provide additional information relevant to the tracked shipment. For example, a notification may indicate that a change in behavior has occurred." + }, + "CXSError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Error Code.
          Example: TRACKING.TRACKINGNUMBER.EMPTY", + "example": "TRACKING.TRACKINGNUMBER.EMPTY" + }, + "parameterList": { + "type": "array", + "description": "List of parameters.", + "items": { + "$ref": "#/components/schemas/Parameter" + } + }, + "message": { + "type": "string", + "description": "Error Message.
          Example: Please provide tracking number.", + "example": "Please provide tracking number." + } + }, + "description": "Contains error details." + }, + "Parameter": { + "type": "object", + "properties": { + "value": { + "type": "string", + "description": "Identifies the error option to be applied.
          Example: value", + "example": "value" + }, + "key": { + "type": "string", + "description": "Indicates the value associated with the key.
          Example: key", + "example": "key" + } + }, + "description": "List of parameters which indicates the properties of the alert message." + }, + "TrackSpecialHandling": { + "type": "object", + "properties": { + "description": { + "type": "string", + "description": "Field which holds the text description of the special handling code.
          Example: Deliver Weekday", + "example": "Deliver Weekday" + }, + "type": { + "type": "string", + "description": "Field which holds type representing the special handling.
          Example: DELIVER_WEEKDAY", + "example": "DELIVER_WEEKDAY" + }, + "paymentType": { + "type": "string", + "description": "Field which holds information about the payment handling related to the special handling.
          Example: OTHER", + "example": "OTHER" + } + }, + "description": "Specify types of special handlings that are applied to this package.
          Click here to see FedEx Express Special Handling Codes." + }, + "AvailableImagesDetail": { + "type": "object", + "properties": { + "size": { + "type": "string", + "description": "Field which holds the size of available images for the shipment being tracked. Example: LARGE", + "example": "LARGE", + "enum": [ + "SMALL", + "LARGE" + ] + }, + "type": { + "type": "string", + "description": "Field which holds the type of available images for the shipment being tracked.
          Example: BILL_OF_LADING", + "example": "BILL_OF_LADING", + "enum": [ + "SIGNATURE_PROOF_OF_DELIVERY", + "BILL_OF_LADING" + ] + } + }, + "description": "The available tracking documents for the shipment being tracked. Available tracking documents includes SPOD and Bill of lading." + }, + "DeliveryDetails": { + "type": "object", + "properties": { + "receivedByName": { + "type": "string", + "description": "Field which holds the name of the person who received the package, if applicable.
          Example: Receiver", + "example": "Reciever" + }, + "destinationServiceArea": { + "type": "string", + "description": "Field which holds the destination service area code.
          Example: EDDUNAVAILABLE", + "example": "EDDUNAVAILABLE" + }, + "destinationServiceAreaDescription": { + "type": "string", + "description": "Field which holds the description corresponding to the destination service area.
          Example: Appointment Required", + "example": "Appointment required" + }, + "locationDescription": { + "type": "string", + "description": "Field which holds the FedEx location description for the package destination.
          Example: Receptionist/Front Desk", + "example": "Receptionist/Front Desk" + }, + "actualDeliveryAddress": { + "$ref": "#/components/schemas/AddressVO1" + }, + "deliveryToday": { + "type": "boolean", + "description": "This element indicates whether the package will be delivered today. The value 'True', indicates that today is package delivery.
          Example: true", + "example": false + }, + "locationType": { + "type": "string", + "description": "Field which holds the FedEx location type code for the package destination. If Location Type not available we will get empty value.", + "example": "APARTMENT_OFFICE", + "enum": [ + "RECEPTIONIST_OR_FRONT_DESK", + "SHIPPING_RECEIVING", + "MAILROOM", + "RESIDENCE", + "GUARD_OR_SECURITY_STATION", + "FEDEX_LOCATION", + "IN_BOND_OR_CAGE", + "PHARMACY", + "GATE_HOUSE", + "MANAGER_OFFICE", + "MAIN_OFFICE", + "LEASING_OFFICE", + "RENTAL_OFFICE", + "APARTMENT_OFFICE", + "OTHER" + ] + }, + "signedByName": { + "type": "string", + "description": "Field which holds the name of the person who signed for the package, if applicable.
          Example: Reciever", + "example": "Reciever" + }, + "officeOrderDeliveryMethod": { + "type": "string", + "description": "Field which identifies the method of office order delivery. 'Pickup' - the recipient will be picking up the office order from the FedEx Office Center. 'Shipment' - the office order will be delivered to the recipient as a FedEx shipment using the FedEx Service Type requested. 'Courier' - the office order will be delivered to the recipient by local courier.
          Example: Courier", + "example": "Courier" + }, + "deliveryAttempts": { + "type": "string", + "description": "Field which holds the number of delivery attempts made to deliver the package.
          Example: 0", + "example": "0" + }, + "deliveryOptionEligibilityDetails": { + "type": "array", + "description": "Specifies eligibility type for the different delivery option.", + "items": { + "$ref": "#/components/schemas/DeliveryOptionElgibilityDetails" + } + } + }, + "description": "Delivery related information for the tracked package. Provides delivery details as actual delivery address once the package is delivered, the number of delivery attempts made etc." + }, + "DeliveryOptionElgibilityDetails": { + "type": "object", + "properties": { + "option": { + "type": "string", + "description": "This is the type of delivery option.

          Note: For eligibile DISPUTE_DELIVERY, RETURN_TO_SHIPPER, SUPPLEMENT_ADDRESS go to fedex.com to perform the option/action.

          Example: INDIRECT_SIGNATURE_RELEASE", + "example": "INDIRECT_SIGNATURE_RELEASE", + "enum": [ + "DISPUTE_DELIVERY", + "INDIRECT_SIGNATURE_RELEASE", + "REDIRECT_TO_HOLD_AT_LOCATION", + "REROUTE", + "RESCHEDULE", + "RETURN_TO_SHIPPER", + "SUPPLEMENT_ADDRESS" + ] + }, + "eligibility": { + "type": "string", + "description": "Eligibility of the customer for the specific delivery options.
          Example: INELIGIBLE", + "example": "INELIGIBLE" + } + }, + "description": "Specifies details of delivery options and its eligibility type" + }, + "ScanEvent": { + "type": "object", + "properties": { + "date": { + "type": "string", + "description": "Date and time of the scan event.
          Example: '2018-02-02T12:01:00-07:00'", + "example": "2018-02-02T12:01:00-07:00" + }, + "derivedStatus": { + "type": "string", + "description": "Field which holds status description of the track information for the scan event.
          Example: 'Picked Up'", + "example": "Picked Up" + }, + "scanLocation": { + "description": "Location Details for the FedEx facility where the scan event occurred.", + "allOf": [ + { + "$ref": "#/components/schemas/AddressVO1" + } + ] + }, + "locationId": { + "type": "string", + "description": "Location Identification for facilities identified by an alpha numeric location code. Passing Location Id of the Hold at Location (HAL) address is strongly recommended to ensure packages are delivered to the correct address.
          Example: SEA", + "example": "SEA" + }, + "locationType": { + "type": "string", + "description": "This field holds Location Type. If Location Type not available we will get empty value", + "example": "CUSTOMS_BROKER", + "enum": [ + "AIRPORT", + "CUSTOMS_BROKER", + "CUSTOMER", + "DELIVERY_LOCATION", + "DESTINATION_AIRPORT", + "DROP_BOX", + "DESTINATION_FEDEX_FACILITY", + "ENROUTE", + "FEDEX_FACILITY", + "INTERLINE_CARRIER", + "FEDEX_OFFICE_LOCATION", + "NON_FEDEX_FACILITY", + "ORIGIN_AIRPORT", + "ORIGIN_FEDEX_FACILITY", + "PORT_OF_ENTRY", + "PICKUP_LOCATION", + "PLANE", + "SORT_FACILITY", + "SHIP_AND_GET_LOCATION", + "TURNPOINT", + "VEHICLE" + ] + }, + "exceptionDescription": { + "type": "string", + "description": "Field which holds the text description for the exception if the event was an exception .
          Example: Package available for clearance", + "example": "Package available for clearance" + }, + "eventDescription": { + "type": "string", + "description": "Field which holds the text description of the scan event.
          Example: 'Picked Up'", + "example": "Picked Up" + }, + "eventType": { + "type": "string", + "description": "Field which holds the code identifying the type of scan event.
          Example: 'PU'", + "example": "PU" + }, + "derivedStatusCode": { + "type": "string", + "description": "Field which holds status code of the track information for the scan event.
          Example: 'PU'", + "example": "PU" + }, + "exceptionCode": { + "type": "string", + "description": "Field which holds the code identifier for the exception if the event was an exception.
          Example: A25", + "example": "A25" + }, + "delayDetail": { + "$ref": "#/components/schemas/DelayDetail" + } + }, + "description": "FedEx scanning event information for a package.
          Click here to see Track Service Scan Codes." + }, + "TrackingDateAndTime": { + "type": "object", + "properties": { + "dateTime": { + "type": "string", + "description": "Field which holds the tracking date or timestamp in ISO format.
          Format: YYYY-MM-DD
          Example: '2019-05-07'", + "example": "2007-09-27T00:00:00" + }, + "type": { + "type": "string", + "description": "Field which holds information about the type of tracking date or timestamp.
          Example: 'ACTUAL_DELIVERY'", + "example": "ACTUAL_DELIVERY", + "enum": [ + "ACTUAL_DELIVERY", + "ACTUAL_PICKUP", + "ACTUAL_TENDER", + "ANTICIPATED_TENDER", + "APPOINTMENT_DELIVERY", + "ATTEMPTED_DELIVERY", + "COMMITMENT", + "ESTIMATED_ARRIVAL_AT_GATEWAY", + "ESTIMATED_DELIVERY", + "ESTIMATED_PICKUP", + "ESTIMATED_RETURN_TO_STATION", + "SHIP", + "SHIPMENT_DATA_RECEIVED" + ] + } + }, + "description": "Date and time information for the tracked shipment. Date and time information for the tracked shipment includes various type of date time including when the package was shipped, when it is expected to deliver, when it is actually delivered etc." + }, + "PackageDetail": { + "type": "object", + "properties": { + "physicalPackagingType": { + "type": "string", + "description": "Indicate the physical package type for non-Express shipments.
          Click here to see Available Types", + "example": "BARREL" + }, + "sequenceNumber": { + "type": "string", + "description": "Field which holds the number representing which package in a multi-piece shipment applies to this TrackDetail.
          Example: 45", + "example": "45" + }, + "undeliveredCount": { + "type": "string", + "description": "Field which holds information about total count of the undelivered packages in the shipment.
          Example: 7", + "example": "7" + }, + "packagingDescription": { + "$ref": "#/components/schemas/PackagingDescription" + }, + "count": { + "type": "string", + "description": "Field which holds the total number of pieces in the shipment which includes the package represented by this TrackDetail.
          Example: 1", + "example": "1" + }, + "weightAndDimensions": { + "$ref": "#/components/schemas/TrackingWeightAndDimensions" + }, + "packageContent": { + "type": "array", + "description": "Field which holds information about the package content of the shipment. Populated for secure users only.
          Example: wire hangers.", + "example": [ + "wire hangers", + "buttons" + ], + "items": { + "type": "string" + } + }, + "contentPieceCount": { + "type": "string", + "description": "Field which holds information about total count of the packages in the shipment.
          Example: 100", + "example": "100" + }, + "declaredValue": { + "description": "This is the declared value. Declared Value represents FedEx maximum liability in connection with a shipment of that Package, including but not limited to, any loss, damage, delay, misdelivery, any failure to provide information, or misdelivery of information relating to the Shipment.", + "allOf": [ + { + "$ref": "#/components/schemas/Amount" + } + ] + } + }, + "description": "Details of the packages in the shipment being tracked. Includes details like package type, weight, dimensions, declared value, etc." + }, + "PackagingDescription": { + "type": "object", + "properties": { + "description": { + "type": "string", + "description": "Indicate the packaging type description.
          Example: FedEx Pak", + "example": "FedEx Pak" + }, + "type": { + "type": "string", + "description": "Indicate the packaging type.
          Click here to see Package Types", + "example": "FEDEX_PAK" + } + }, + "description": "Description of the packaging used for this shipment." + }, + "TrackingWeightAndDimensions": { + "type": "object", + "properties": { + "weight": { + "type": "array", + "description": "Field which holds the weight of the package.", + "items": { + "$ref": "#/components/schemas/Weight" + } + }, + "dimensions": { + "type": "array", + "description": "Indicate the dimensions of the package.
          Following conditions will apply:
          • Dimensions are optional but when added, then all three dimensions must be indicated.
          • Dimensions are required with YOUR_PACKAGING package type.
          Note: The maximum/minimum dimension values varies based on the services and the packaging types. Refer FedEx Service Guide for service details related to DIM Weighting for FedEx Express and oversize conditions for FedEx Express and FedEx Ground.", + "items": { + "$ref": "#/components/schemas/Dimensions" + } + } + }, + "description": "Field which holds the weight and dimension information." + }, + "Weight": { + "type": "object", + "properties": { + "unit": { + "type": "string", + "description": "This is package weight type.", + "example": "LB", + "enum": [ + "KG", + "LB" + ] + }, + "value": { + "type": "string", + "description": "This is package weight. Max. Length is 99999.
          Example: 22222.0", + "example": "22222.0" + } + }, + "description": "These are the package weight details." + }, + "Dimensions": { + "type": "object", + "properties": { + "length": { + "type": "integer", + "description": "Indicate the length of the package. No implied decimal places. Maximum value: 999
          Example: 20", + "format": "int32", + "example": 100 + }, + "width": { + "type": "integer", + "description": "Indicate the width of the package. No implied decimal places. Maximum value: 999
          Example: 10", + "format": "int32", + "example": 50 + }, + "height": { + "type": "integer", + "description": "Indicate the height of the package. No implied decimal places. Maximum value: 999
          Example: 10", + "format": "int32", + "example": 30 + }, + "units": { + "type": "string", + "description": "Unit of measure for the provided dimensions.
          Valid Values are IN - inches, CM - centimeters.
          Note: Any value other than CM including blank/null will default to IN.
          Example: CM", + "example": "CM", + "enum": [ + "CM", + "IN" + ] + } + }, + "description": "Indicate the dimensions of the package.
          Following conditions will apply:
          • Dimensions are optional but when added, then all three dimensions must be indicated.
          • Dimensions are required with YOUR_PACKAGING package type.
          Note: The maximum/minimum dimension values varies based on the services and the packaging types. Refer FedEx Service Guide for service details related to DIM Weighting for FedEx Express and oversize conditions for FedEx Express and FedEx Ground.", + "example": { + "length": 100, + "width": 50, + "height": 30, + "units": "CM" + } + }, + "Amount": { + "type": "object", + "properties": { + "currency": { + "type": "string", + "description": "Indicate the currency code.
          Example: USD
          Click here to see Currency Codes", + "example": "USD" + }, + "value": { + "type": "number", + "description": "Field which holds the amount value.
          Example: 56.80", + "format": "double", + "example": 56.8 + } + } + }, + "LocationDetail": { + "required": [ + "locationContactAndAddress", + "locationType" + ], + "type": "object", + "properties": { + "locationId": { + "type": "string", + "description": "Location Identification for facilities identified by an alpha numeric location code. Passing Location Id of the Hold at Location (HAL) address is strongly recommended to ensure packages are delivered to the correct address.
          Example: SEA", + "example": "SEA" + }, + "locationContactAndAddress": { + "$ref": "#/components/schemas/ContactAndAddress" + }, + "locationType": { + "type": "string", + "description": "The FedEx Location Type.
          Example: PICKUP_LOCTION", + "example": "PICKUP_LOCATION", + "enum": [ + "FEDEX_AUTHORIZED_SHIP_CENTER", + "FEDEX_OFFICE", + "FEDEX_SELF_SERVICE_LOCATION", + "FEDEX_STAFFED", + "RETAIL_ALLICANCE_LOCATION", + "FEDEX_GROUND_TERMINAL", + "FEDEX_ONSITE" + ] + } + }, + "description": "Location details for the fedex facility." + }, + "ContactAndAddress": { + "required": [ + "address", + "contact" + ], + "type": "object", + "properties": { + "contact": { + "$ref": "#/components/schemas/ContactVO" + }, + "address": { + "description": "Required.\n\nDescriptive data for a physical location. may be used as an actual physical address(place to which one could go), or a container of 'address parts' which should be handled as a unit(such as a city-state-zip combination within the US).\n\nConditional when used with Payor object. Required if entering using RECIPIENT or THIRD_PARTY. Required if not-authenticated and SENDER is selected", + "allOf": [ + { + "$ref": "#/components/schemas/AddressVO" + } + ] + } + }, + "description": "Location Contact And Address." + }, + "ContactVO": { + "type": "object", + "properties": { + "personName": { + "type": "string", + "description": "Identifies the contact person's name. Max Length is 70.
          Example: John Taylor", + "example": "John Taylor" + }, + "phoneNumber": { + "type": "string", + "description": "Identifies the phone number associated with this contact. Max length is 15.
          Example: '1234567890'", + "example": "1234567890" + }, + "companyName": { + "type": "string", + "description": "Identifies the company this contact is associated with. Max length is 35.
          Example: Fedex", + "example": "Fedex" + } + }, + "description": "Indicate the contact details for this package." + }, + "CustomDeliveryOption": { + "type": "object", + "properties": { + "requestedAppointmentDetail": { + "$ref": "#/components/schemas/RequestedAppointmentDetail" + }, + "description": { + "type": "string", + "description": "Field which specifies the description of the custom delivery option requested
          Example: Redirect the package to the hold location.", + "example": "Redirect the package to the hold location." + }, + "type": { + "type": "string", + "description": "Field which specifies the type of the custom delivery option requested.
          Example: REDIRECT_TO_HOLD_AT_LOCATION", + "example": "REDIRECT_TO_HOLD_AT_LOCATION", + "enum": [ + "REROUTE", + "APPOINTMENT", + "DATE_CERTAIN", + "EVENING", + "REDIRECT_TO_HOLD_AT_LOCATION", + "ELECTRONIC_SIGNATURE_RELEASE" + ] + }, + "status": { + "type": "string", + "description": "Field which specifies the status of the custom delivery option requested.
          Example: HELD", + "example": "HELD" + } + }, + "description": "List of delivery options that can be used to customize the delivery of the package." + }, + "RequestedAppointmentDetail": { + "type": "object", + "properties": { + "date": { + "type": "string", + "description": "Field which holds the requested appointment date.
          Format: YYYY-MM-DD
          example: '2019-05-07'", + "example": "2019-05-07" + }, + "window": { + "type": "array", + "description": "Array of different appointment time windows available on the date specified such as, Morning, afternoon, mid-day.", + "items": { + "$ref": "#/components/schemas/TimeWindow" + } + } + }, + "description": "Field which specifies the details of the requested appointment." + }, + "TimeWindow": { + "type": "object", + "properties": { + "description": { + "type": "string", + "description": "Field which describes the time window provided.
          Example: Description field", + "example": "Description field" + }, + "window": { + "$ref": "#/components/schemas/TimeRange" + }, + "type": { + "type": "string", + "description": "Field which holds the code representing the description for the time window provided.
          Example: ESTIMATED_DELIVERY", + "example": "ESTIMATED_DELIVERY", + "enum": [ + "ACTUAL_DELIVERY", + "ACTUAL_PICKUP", + "ACTUAL_TENDER", + "ANTICIPATED_TENDER", + "APPOINTMENT_DELIVERY", + "ATTEMPTED_DELIVERY", + "COMMITMENT", + "ESTIMATED_ARRIVAL_AT_GATEWAY", + "ESTIMATED_DELIVERY", + "ESTIMATED_PICKUP", + "ESTIMATED_RETURN_TO_STATION", + "SHIP", + "SHIPMENT_DATA_RECEIVED" + ] + } + } + }, + "TimeRange": { + "type": "object", + "properties": { + "begins": { + "type": "string", + "description": "Field which holds the begin date/timestamp for a range.
          Example: '2021-10-01T08:00:00'", + "example": "2021-10-01T08:00:00" + }, + "ends": { + "type": "string", + "description": "Field which holds the end date/timestamp for a range.
          Example: '2021-10-15T00:00:00-06:00'", + "example": "2021-10-15T00:00:00-06:00" + } + }, + "description": "Field which holds a date/timestamp window." + }, + "PieceCountDetail": { + "type": "object", + "properties": { + "count": { + "type": "string", + "description": "Field which holds the piece count.
          Example: 35", + "example": "35" + }, + "description": { + "type": "string", + "description": "Field which holds the piece count description detail.
          Example: picec count description", + "example": "picec count description" + }, + "type": { + "type": "string", + "description": "Field which holds the piece count location type.
          Example: ORIGIN", + "example": "ORIGIN", + "enum": [ + "DESTINATION", + "ORIGIN" + ] + } + }, + "description": "Specifies the count of the packages delivered and the count of the packages at the origin which can be used for verification purposes. Populated for secure users only." + }, + "OriginLocation": { + "description": "Location details for the FedEx facility where the shipment originated.", + "allOf": [ + { + "$ref": "#/components/schemas/LocationDetail_origin" + } + ] + }, + "TrackShipmentDetail": { + "type": "object", + "properties": { + "contents": { + "type": "array", + "description": "Field which holds information about contents of the shipment. Populated for secure users only.", + "items": { + "$ref": "#/components/schemas/ShipmentContent" + } + }, + "beforePossessionStatus": { + "type": "boolean", + "description": "Indicates the shipment is not yet in FedEx possession, but is still in shipper's possession.
          Example: false", + "example": false + }, + "weight": { + "type": "array", + "description": "Array of package level weights, which represent the total weight of the shipment.", + "items": { + "$ref": "#/components/schemas/Weight" + } + }, + "contentPieceCount": { + "type": "string", + "description": "Field which holds information about content piece count of the shipment.
          Example: 3333", + "example": "3333" + }, + "splitShipments": { + "type": "array", + "description": "Field which holds information about split shipments.", + "items": { + "$ref": "#/components/schemas/TrackSplitShipment" + } + } + }, + "description": "Shipment level details for the shipment being tracked. Includes overall shipment weight, contents etc." + }, + "ShipmentContent": { + "type": "object", + "properties": { + "itemNumber": { + "type": "string", + "description": "Field holds the item number for the contents of shipment.
          Example: RZ5678 ", + "example": "RZ5678" + }, + "receivedQuantity": { + "type": "string", + "description": "Field which holds information about the quantity received.
          Example: 13", + "example": "13" + }, + "description": { + "type": "string", + "description": "Field which holds informative description about shipment content.
          Example: pulyurethane rope", + "example": "pulyurethane rope" + }, + "partNumber": { + "type": "string", + "description": "Holds the part number of the content in shipment.
          Example: RK1345", + "example": "RK1345" + } + }, + "description": "Field which holds information about contents of the shipment. Populated for secure users only." + }, + "TrackSplitShipment": { + "type": "object", + "properties": { + "pieceCount": { + "type": "string", + "description": "Field which holds the number of pieces in the part.
          Example: 10", + "example": "10" + }, + "statusDescription": { + "type": "string", + "description": "Field which holds human-readable description of the status.
          Example: status", + "example": "status" + }, + "timestamp": { + "type": "string", + "description": "Field which holds the date and time the status began.
          Example: '2019-05-07T08:00:07'", + "example": "2019-05-07T08:00:07" + }, + "statusCode": { + "type": "string", + "description": "Field which holds the status code.
          Example: statusCode", + "example": "statuscode" + } + }, + "description": "Holds the information about split shipments." + }, + "Alert": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Specifies the api alert code." + }, + "alertType": { + "type": "string", + "description": "Specifies the api alert type.", + "enum": [ + "NOTE", + "WARNING" + ] + }, + "message": { + "type": "string", + "description": "Specifies the api alert message." + } + }, + "description": "Specifies the api alerts." + }, + "ErrorResponseVO": { + "type": "object", + "properties": { + "transactionId": { + "type": "string", + "description": "The transaction ID is a special set of numbers that defines each transaction.
          Example: 624deea6-b709-470c-8c39-4b5511281492", + "example": "624deea6-b709-470c-8c39-4b5511281492" + }, + "customerTransactionId": { + "type": "string", + "description": "This element allows you to assign a unique identifier to your transaction. This element is also returned in the reply and helps you match the request to the reply.
          Example: AnyCo_order123456789", + "example": "AnyCo_order123456789" + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CXSError_2" + } + } + } + }, + "CXSError_2": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Indicates the error code.
          Example: TRACKING.TRACKINGNUMBER.EMPTY" + }, + "parameterList": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Parameter" + } + }, + "message": { + "type": "string", + "description": "Indicates the description of API error alert message.
          Example: Please provide tracking number." + } + }, + "description": "Indicates error alert when suspicious files, potential exploits and viruses found while scanning files , directories and user accounts. This includes code, message and parameter" + }, + "ErrorResponseVO401": { + "type": "object", + "properties": { + "transactionId": { + "type": "string", + "description": "The transaction ID is a special set of numbers that defines each transaction.
          Example: 624deea6-b709-470c-8c39-4b5511281492", + "example": "624deea6-b709-470c-8c39-4b5511281492" + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CXSError401" + } + } + } + }, + "CXSError401": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Indicates the error code.
          Example: NOT.AUTHORIZED.ERROR" + }, + "parameterList": { + "type": "array", + "description": "List of parameters.", + "items": { + "$ref": "#/components/schemas/Parameter" + } + }, + "message": { + "description": "Indicates the description of API error alert message.
          Example: Access token expired. Please modify your request and try again." + } + }, + "description": "Indicates error alert when suspicious files, potential exploits and viruses found while scanning files , directories and user accounts. This includes code, message and parameter" + }, + "ErrorResponseVO403": { + "type": "object", + "properties": { + "transactionId": { + "type": "string", + "description": "The transaction ID is a special set of numbers that defines each transaction.
          Example: 624deea6-b709-470c-8c39-4b5511281492", + "example": "624deea6-b709-470c-8c39-4b5511281492" + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CXSError403" + } + } + } + }, + "CXSError403": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Indicates the error code.
          Example: FORBIDDEN.ERROR" + }, + "parameterList": { + "type": "array", + "description": "List of parameters.", + "items": { + "$ref": "#/components/schemas/Parameter" + } + }, + "message": { + "description": "Indicates the description of API error alert message.
          Example: We could not authorize your credentials. Please check your permissions and try again" + } + }, + "description": "Indicates error alert when suspicious files, potential exploits and viruses found while scanning files , directories and user accounts. This includes code, message and parameter" + }, + "ErrorResponseVO404": { + "type": "object", + "properties": { + "transactionId": { + "type": "string", + "description": "The transaction ID is a special set of numbers that defines each transaction.
          Example: 624deea6-b709-470c-8c39-4b5511281492", + "example": "624deea6-b709-470c-8c39-4b5511281492" + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CXSError404" + } + } + } + }, + "CXSError404": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Indicates the error code.
          Example: NOT.FOUND.ERROR" + }, + "parameterList": { + "type": "array", + "description": "List of parameters.", + "items": { + "$ref": "#/components/schemas/Parameter" + } + }, + "message": { + "description": "Indicates the description of API error alert message.
          Example: The resource you requested is no longer available. Please modify your request and try again." + } + }, + "description": "Indicates error alert when suspicious files, potential exploits and viruses found while scanning files , directories and user accounts. This includes code, message and parameter" + }, + "ErrorResponseVO500": { + "type": "object", + "properties": { + "transactionId": { + "type": "string", + "description": "The transaction ID is a special set of numbers that defines each transaction.
          Example: 624deea6-b709-470c-8c39-4b5511281492", + "example": "624deea6-b709-470c-8c39-4b5511281492" + }, + "customerTransactionId": { + "type": "string", + "description": "This element allows you to assign a unique identifier to your transaction. This element is also returned in the reply and helps you match the request to the reply.
          Example: AnyCo_order123456789", + "example": "AnyCo_order123456789" + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CXSError500" + } + } + } + }, + "CXSError500": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Indicates the error code.
          Example: INTERNAL.SERVER.ERROR" + }, + "parameterList": { + "type": "array", + "description": "List of parameters.", + "items": { + "$ref": "#/components/schemas/Parameter" + } + }, + "message": { + "description": "Indicates the description of API error alert message.
          Example: We encountered an unexpected error and are working to resolve the issue. We apologize for any inconvenience. Please check back at a later time." + } + }, + "description": "Indicates error alert when suspicious files, potential exploits and viruses found while scanning files , directories and user accounts. This includes code, message and parameter" + }, + "ErrorResponseVO503": { + "type": "object", + "properties": { + "transactionId": { + "type": "string", + "description": "The transaction ID is a special set of numbers that defines each transaction.
          Example: 624deea6-b709-470c-8c39-4b5511281492", + "example": "624deea6-b709-470c-8c39-4b5511281492" + }, + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CXSError503" + } + } + } + }, + "CXSError503": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Indicates the error code.
          Example: SERVICE.UNAVAILABLE.ERROR" + }, + "parameterList": { + "type": "array", + "description": "List of parameters.", + "items": { + "$ref": "#/components/schemas/Parameter" + } + }, + "message": { + "description": "Indicates the description of API error alert message.
          Example: The service is currently unavailable and we are working to resolve the issue. We apologize for any inconvenience. Please check back at a later time." + } + }, + "description": "Indicates error alert when suspicious files, potential exploits and viruses found while scanning files , directories and user accounts. This includes code, message and parameter" + }, + "Full_Schema_Notification": { + "required": [ + "senderContactName", + "senderEMailAddress", + "trackingEventNotificationDetail", + "trackingNumberInfo" + ], + "type": "object", + "properties": { + "senderContactName": { + "type": "string", + "description": "Placeholder for Sender contact name.
          Example: Sam Smith", + "example": "Sam Smith" + }, + "senderEMailAddress": { + "type": "string", + "description": "Email address of the sender from which the shipment notification will be sent.
          Example: LSR123@gmail.com", + "example": "Lsr1234@gmail.com" + }, + "trackingEventNotificationDetail": { + "$ref": "#/components/schemas/TrackingEventNotificationDetail" + }, + "trackingNumberInfo": { + "$ref": "#/components/schemas/TrackingNumberInfo" + }, + "shipDateBegin": { + "type": "string", + "description": "ShipDateBegin and ShipDateEnd are recommended to narrow the search, reduce lookup time, and avoid duplicates when searching for a specific tracking number in a specific time range.
          Format: YYYY-MM-DD
          example:'2019-10-13'", + "example": "2019-10-13" + }, + "shipDateEnd": { + "type": "string", + "description": "ShipDateBegin and ShipDateEnd are recommended to narrow the search, reduce lookup time, and avoid duplicates when searching for a specific tracking number in a specific time range.
          Format: YYYY-MM-DD
          example:'2019-10-13'", + "example": "2019-10-31" + } + }, + "description": "The request to receive a tracking notification." + }, + "TrackingEventNotificationDetail": { + "description": "Object for holding tracking event Notification details.", + "allOf": [ + { + "$ref": "#/components/schemas/TrackingEventNotificationDetail_2" + } + ] + }, + "TrackingEventNotificationDetail_2": { + "required": [ + "trackingNotifications" + ], + "type": "object", + "properties": { + "trackingNotifications": { + "type": "array", + "description": "List of Tracking notifications requested for events like ON_DELIVERY, ON_ESTIMATED_DELIVERY, ON_EXCEPTION, ON_TENDER.", + "items": { + "$ref": "#/components/schemas/TrackingNotification" + } + }, + "personalMessage": { + "type": "string", + "description": "An optional message which will be included in the body of the email.", + "example": "Personal message content" + }, + "supportHTML": { + "title": "@Ignore4TPP", + "description": "If value is 'true' then html tags are included in the response date. If 'false' they are not provided in the response." + } + }, + "description": "Tracking Event Notification details." + }, + "TrackingNotification": { + "required": [ + "notificationDetail", + "notificationEventTypes" + ], + "type": "object", + "properties": { + "notificationDetail": { + "$ref": "#/components/schemas/TrackingNotificationDetail" + }, + "role": { + "type": "string", + "description": "This is to specify Recipient_Role in the shipment.
          Possible values - BROKER, OTHER, RECIPIENT, SHIPPER
          Example: SHIPPER", + "example": "SHIPPER" + }, + "notificationEventTypes": { + "type": "array", + "description": "Identifies the events for which the client is requesting notifications.
          Possible Values are: ON_DELIVERY, ON_ESTIMATED_DELIVERY, ON_EXCEPTION, ON_TENDER", + "example": [ + "ON_DELIVERY", + "ON_EXCEPTION", + "ON_ESTIMATED_DELIVERY" + ], + "items": { + "type": "string" + } + }, + "currentResultRequestedFlag": { + "type": "boolean", + "description": "If value is 'true' the current tracking results for the shipment along with notification details will be provided to the client. If 'false' only results for the notification request is provided.
          Defaults to 'false'
          Example: true", + "example": true + } + }, + "description": "Identifies a list of details for Tracking Notifications" + }, + "TrackingNotificationDetail": { + "required": [ + "emailDetail", + "localization", + "notificationType" + ], + "type": "object", + "properties": { + "localization": { + "$ref": "#/components/schemas/Localization" + }, + "emailDetail": { + "$ref": "#/components/schemas/EmailDetail" + }, + "notificationType": { + "type": "string", + "description": "Identifies the format of the notification.
          valid values are 'HTML' or 'TEXT'.", + "example": "HTML" + } + }, + "description": "Information about the notification email and the language of the notification requested." + }, + "Localization": { + "required": [ + "languageCode" + ], + "type": "object", + "properties": { + "languageCode": { + "type": "string", + "description": "Identifies two-letter code for the language (e.g. en/EN, fr/FR, es/ES etc..).
          Example: en", + "example": "en" + }, + "localeCode": { + "type": "string", + "description": "Identifies the two-letter code for the region, used to further identify the requested language. for example, if you request Spanish, you must include a locale code of US for North American Spanish, or MX for Mexico.
          Example: US
          Click here to see Locales", + "example": "US" + } + }, + "description": "Specifies the language details for email notification." + }, + "EmailDetail": { + "required": [ + "emailAddress" + ], + "type": "object", + "properties": { + "emailAddress": { + "type": "string", + "description": "Specifies email address on which user wants to get notified for various registered events.
          Example: p1@fedex.com", + "example": "p1@fedex.com" + }, + "name": { + "type": "string", + "description": "Specifies the name of the notification recipient.
          Example: Sam Smith", + "example": "Preethi" + } + }, + "description": "Specifies the Email Notification Details." + }, + "TrackingNumberInfo_2": { + "required": [ + "trackingNumber" + ], + "type": "object", + "properties": { + "trackingNumber": { + "type": "string", + "description": "This is a Tracking number for FedEx packages used for tracking a single package or group of packages.
          Example: 128667043726
          Click here to see Mock Tracking Numbers.", + "example": "128667043726" + }, + "carrierCode": { + "type": "string", + "description": "This is a placeholder to provide the FedEx operating company (transportation) code used for package delivery.
          Example: FDXE", + "example": "FDXE", + "enum": [ + "FDXE", + "FDXG", + "FXSP", + "FXFR", + "FDXC", + "FXCC", + "FEDEX_CARGO", + "FEDEX_CUSTOM_CRITICAL", + "FEDEX_EXPRESS", + "FEDEX_FREIGHT", + "FEDEX_GROUND", + "FEDEX_OFFICE", + "FEDEX_KINKOS", + "FX", + "FDFR", + "FDEG", + "FXK", + "FDC", + "FDCC" + ] + }, + "trackingNumberUniqueId": { + "type": "string", + "description": "Unique identifier used to distinguish duplicate FedEx tracking numbers. This value will be set by FedEx systems.
          Example: 245822\\~123456789012\\~FDEG", + "example": "245822~123456789012~FDEG" + } + }, + "description": "Information uniquely identifying a shipment such as Tracking number, ShipDate, and Tracking number uniqueId." + }, + "TrkcResponseVO_Notifications": { + "type": "object", + "properties": { + "transactionId": { + "type": "string", + "description": "The transaction ID is a special set of numbers that defines each transaction.
          Example: 624deea6-b709-470c-8c39-4b5511281492", + "example": "624deea6-b709-470c-8c39-4b5511281492" + }, + "customerTransactionId": { + "type": "string", + "description": "This element allows you to assign a unique identifier to your transaction. This element is also returned in the reply and helps you match the request to the reply.
          Example: AnyCo_order123456789", + "example": "AnyCo_order123456789" + }, + "output": { + "$ref": "#/components/schemas/BaseProcessOutputVO_Notification" + } + }, + "description": "This is a wrapper class for outputVO" + }, + "BaseProcessOutputVO_Notification": { + "$ref": "#/components/schemas/SendNotificationOutputVO" + }, + "SendNotificationOutputVO": { + "properties": { + "TrackingNumberInfo": { + "description": "Tracking number information which uniquely identifies a package. Tracking number information includes tracking number, carrier code and a unique qualifier.", + "allOf": [ + { + "$ref": "#/components/schemas/TrackingNumberInfo_2" + } + ] + }, + "destinationAddress": { + "description": "Address where the package was actually delivered. Contrast with destination Address, which is the location to which the package was intended to be delivered. Addresses may differ due to delivery to a neighbor, hold at FedEx location, etc.", + "allOf": [ + { + "$ref": "#/components/schemas/AddressVO" + } + ] + }, + "recipientDetails": { + "type": "array", + "description": "Details of the recipient notification events. Possible events are - ON_DELIVERY, ON_ESTIMATED_DELIVERY, ON_EXCEPTION, ON_TENDER.", + "items": { + "$ref": "#/components/schemas/notificationEventTypes" + } + }, + "alerts": { + "type": "array", + "description": "The cxs shipment alerts. This includes the alert type, code, and message.
          example: TRACKING.DATA.NOTFOUND - Tracking data unavailable", + "example": "TRACKING.DATA.NOTFOUND - Tracking data unavailable", + "items": { + "$ref": "#/components/schemas/Alert" + } + } + } + }, + "notificationEventTypes": { + "type": "array", + "description": "Identifies the events for which the client is requesting notifications. Possible events are - ON_DELIVERY, ON_ESTIMATED_DELIVERY, ON_EXCEPTION, ON_TENDER
          Example: [ON_DELIVERY,ON_ESTIMATED_DELIVERY,ON_EXCEPTION]", + "items": { + "type": "string", + "example": "[\"ON_ESTIMATED_DELIVERY\"]" + } + }, + "Full_Schema_Tracking_References": { + "required": [ + "referencesInformation" + ], + "type": "object", + "properties": { + "referencesInformation": { + "$ref": "#/components/schemas/ReferenceInformation" + }, + "includeDetailedScans": { + "type": "boolean", + "description": "Indicates if the detailed scans are being requested or not. If true, the detailed scans will be included in the response returned.
          Valid values are True or False.", + "example": true + } + }, + "description": "Specifies the request elements for Track by alternate reference.
          For a valid request there are two combinations:
          1.) A referenceValue and accountNumber is required OR
          2.) referenceType & carrierCode, shipdateBegin and shipDateEnd, destinationPostalCode and destinationCountryCode are required.", + "example": { + "referencesInformation": { + "type": "BILL_OF_LADING", + "value": "56754674567546754", + "accountNumber": "XXX61073", + "carrierCode": "FDXE", + "shipDateBegin": "2019-02-13", + "shipDateEnd": "2019-02-13", + "destinationCountryCode": "US", + "destinationPostalCode": "75063" + }, + "includeDetailedScans": "true" + } + }, + "ReferenceInformation": { + "required": [ + "shipDateBegin", + "shipDateEndDate", + "value" + ], + "type": "object", + "properties": { + "carrierCode": { + "type": "string", + "description": "Specifies which carrier should be included.
          Example: FDXE", + "example": "FDXE" + }, + "type": { + "type": "string", + "description": "Specify the type of alternate reference used. This is Conditionally required.
          Valid Values :
          • BILL_OF_LADING
          • COD_RETURN_TRACKING_NUMBER
          • CUSTOMER_AUTHORIZATION_NUMBER
          • CUSTOMER_REFERENCE
          • DEPARTMENT
          • DOCUMENT_AIRWAY_BILL
          • EXPRESS_ALTERNATE_REFERENCE
          • FEDEX_OFFICE_JOB_ORDER_NUMBER
          • FREE_FORM_REFERENCE
          • GROUND_INTERNATIONAL
          • GROUND_SHIPMENT_ID
          • INTERNATIONAL_DISTRIBUTION
          • INVOICE
          • JOB_GLOBAL_TRACKING_NUMBER
          • ORDER_GLOBAL_TRACKING_NUMBER
          • ORDER_TO_PAY_NUMBER
          • PART_NUMBER
          • PARTNER_CARRIER_NUMBER
          • PURCHASE_ORDER
          • REROUTE_TRACKING_NUMBER
          • RETURN_MATERIALS_AUTHORIZATION
          • RETURNED_TO_SHIPPER_TRACKING_NUMBER
          • SHIPPER_REFERENCE
          • TRANSBORDER_DISTRIBUTION
          • TRANSPORTATION_CONTROL_NUMBER
          • VIRTUAL_CONSOLIDATION
          ", + "example": " BILL_OF_LADING" + }, + "value": { + "type": "string", + "description": "Conditionally required.
          Specifies the alternate reference value.
          Example: 56754674567546754", + "example": "56754674567546754" + }, + "accountNumber": { + "type": "string", + "description": "Conditionally required.
          Specifies the shipper's account number.
          Note: Either account number or destination postal code and country code are mandatory to track by reference.
          Example: 697561862", + "example": "XXX61073" + }, + "shipDateBegin": { + "type": "string", + "description": "ShipDateBegin and ShipDateEnd are recommended to narrow the search, reduce lookup time, and avoid duplicates when searching for a specific tracking number within a specific date range.
          Format: YYYY-MM-DD
          Example: 2020-03-29", + "example": "2020-03-29" + }, + "shipDateEndDate": { + "type": "string", + "description": "ShipDateBegin and ShipDateEnd are recommended to narrow the search, reduce lookup time, and avoid duplicates when searching for a specific tracking number within a specific date range.
          Format: YYYY-MM-DD
          Example: 2020-04-01", + "example": "2020-04-01" + }, + "destinationCountryCode": { + "type": "string", + "description": "Conditionally required.
          Specifies the recipient's country code.
          Note: Either account number or destination postal code and country code are mandatory to track by reference.
          Example: US
          Click here to see Country Codes", + "example": "US" + }, + "destinationPostalCode": { + "type": "string", + "description": "Conditionally required.
          Indicate recipient postal code. Required for postal-aware countries.
          Note: Either account number or destination postal code and country code are mandatory to track by reference.
          Example: 75063
          Click here to see Postal aware countries", + "example": "75063" + } + }, + "description": "Specifies the reference details for the tracked shipment. The following rules apply
          - Either shipper.AccountNumber or Destination.countryCode(and postal for postal aware countries) are required
          - If ShipDateRangeBegin and End are not present, shipDateRangeBegin will be set to the current date minus 30 days, and shipDdateRangeEnd will default to current date plus one day." + }, + "TrkcResponseVO_ReferenceNumber": { + "type": "object", + "properties": { + "transactionId": { + "type": "string", + "description": "The transaction ID is a special set of numbers that defines each transaction.
          Example: 624deea6-b709-470c-8c39-4b5511281492", + "example": "624deea6-b709-470c-8c39-4b5511281492" + }, + "customerTransactionId": { + "type": "string", + "description": "This element allows you to assign a unique identifier to your transaction. This element is also returned in the reply and helps you match the request to the reply.
          Example: AnyCo_order123456789", + "example": "AnyCo_order123456789" + }, + "output": { + "$ref": "#/components/schemas/BaseProcessOutputVO_ReferenceNumber" + } + }, + "description": "This is a wrapper class for outputVO" + }, + "BaseProcessOutputVO_ReferenceNumber": { + "$ref": "#/components/schemas/TrackingReferencesResponse" + }, + "TrackingReferencesResponse": { + "type": "object", + "properties": { + "cxsErrors": { + "type": "array", + "description": "Indicates error alert when suspicious files, potential exploits and viruses found while scanning files , directories and user accounts. This includes code, message and parameter.", + "items": { + "$ref": "#/components/schemas/CXSError" + } + }, + "completeTrackResults": { + "type": "array", + "description": "Contains detailed tracking entry information.
          Valid values: ACTUAL_DELIVERY, ACTUAL_PICKKUP, ACTUAL_TENDER, ANTICIPATED_TENDER, APPOINTMENT_DELIVERY, ATTEMPTED_DELIVERY, COMMITMENT, ESTIMATED_ARRIVAL_AT_GATEWAY, ESTIMATED_DELIVERY, ESTIMATED_PICKUP, ESTIMATED_RETURN_TO_STATION, SHIP, SHIPMENT_DATE_RECEIVED", + "items": { + "$ref": "#/components/schemas/CompleteTrackResult" + } + }, + "alerts": { + "type": "array", + "description": "The cxs alert type, alert code, and alert message that is received.
          example: TRACKING.DATA.NOTFOUND - Tracking data unavailable", + "example": "TRACKING.DATA.NOTFOUND - Tracking data unavailable", + "items": { + "$ref": "#/components/schemas/Alert" + } + }, + "successful": { + "type": "boolean", + "description": "Indicates whether the tracking is successful." + } + }, + "description": "Specifies the response elements for Track by alternate reference request." + }, + "Full_Schema_TCN": { + "required": [ + "tcnInfo" + ], + "type": "object", + "properties": { + "tcnInfo": { + "description": "The information associated with the transportation control number.
          Only 1 TCN is supported per request.", + "allOf": [ + { + "$ref": "#/components/schemas/TCNInfo" + } + ] + }, + "includeDetailedScans": { + "type": "boolean", + "description": "Indicates if detailed scans are requested or not.
          Valid values are True, or False.", + "example": true + } + }, + "description": "The request elements for Tracking by TCN request type.", + "example": { + "tcnInfo": { + "value": "N552428361Y555XXX", + "carrierCode": "FDXE", + "shipDateBegin": "2019-02-13", + "shipDateEnd": "2019-02-13" + }, + "includeDetailedScans": true + } + }, + "TCNInfo": { + "required": [ + "value" + ], + "type": "object", + "properties": { + "value": { + "type": "string", + "description": "Field which holds the Transportation Control Number value.
          Example: N552428361Y555XXX", + "example": "N552428361Y555XXX" + }, + "carrierCode": { + "type": "string", + "description": "Field which holds information about carrier code of the shipment.
          Example: FDXE", + "example": "FDXE" + }, + "shipDateBegin": { + "type": "string", + "description": "ShipDateBegin and ShipDateEnd are recommended to narrow the search, reduce lookup time, and avoid duplicates when searching for a specific tracking number within a specific date range.
          Format: YYYY-MM-DD
          Example: 2020-03-29", + "example": "2020-03-29" + }, + "shipDateEnd": { + "type": "string", + "description": "ShipDateBegin and ShipDateEnd are recommended to narrow the search, reduce lookup time, and avoid duplicates when searching for a specific tracking number within a specific date range.
          Format: YYYY-MM-DD
          Example: 2020-04-01", + "example": "2020-04-01" + } + } + }, + "TrkcResponseVO_TCN": { + "type": "object", + "properties": { + "transactionId": { + "type": "string", + "description": "The transaction ID is a special set of numbers that defines each transaction.
          Example: 624deea6-b709-470c-8c39-4b5511281492", + "example": "624deea6-b709-470c-8c39-4b5511281492" + }, + "customerTransactionId": { + "type": "string", + "description": "This element allows you to assign a unique identifier to your transaction. This element is also returned in the reply and helps you match the request to the reply.
          Example: AnyCo_order123456789", + "example": "AnyCo_order123456789" + }, + "output": { + "$ref": "#/components/schemas/BaseProcessOutputVO_TCN" + } + }, + "description": "This is a wrapper class for outputVO" + }, + "BaseProcessOutputVO_TCN": { + "$ref": "#/components/schemas/TrackingNumbersResponse_TCN" + }, + "TrackingNumbersResponse_TCN": { + "type": "object", + "properties": { + "completeTrackResults": { + "type": "array", + "description": "Contains detailed tracking entry information.", + "items": { + "$ref": "#/components/schemas/CompleteTrackResult" + } + }, + "alerts": { + "type": "array", + "description": "alert type, alert code, and alert message
          Example: TRACKING.DATA.NOTFOUND - Tracking data unavailable", + "example": "TRACKING.DATA.NOTFOUND - Tracking data unavailable", + "items": { + "$ref": "#/components/schemas/Alert" + } + } + }, + "description": "The response elements for the Track by TCN request." + }, + "Parameter_2": { + "type": "object", + "properties": { + "value": { + "type": "string", + "example": "value" + }, + "key": { + "type": "string", + "example": "key" + } + }, + "description": "Parameter is a class having key-value pair." + }, + "Full_Schema_SPOD": { + "required": [ + "trackDocumentDetail", + "trackDocumentSpecification" + ], + "type": "object", + "properties": { + "trackDocumentDetail": { + "description": "This object specifies the tracking document details such as types of documents, for example, SIGNATURE_PROOF_OF_DELIVERY and also the format of tracking document. Supported values are PDF and PNG. Default is PDF.", + "allOf": [ + { + "$ref": "#/components/schemas/TrackDocumentDetail" + } + ] + }, + "trackDocumentSpecification": { + "type": "array", + "description": "This is the placeholder for document specification details required to identify the shipment being tracked. This includes tracking information such as tracking qualifier, carrier code, and tracking number.
          At least one trackDocumentSpecification is required. Maximum limit is 30.", + "items": { + "$ref": "#/components/schemas/TrackDocumentSpecification" + } + } + } + }, + "TrackDocumentDetail": { + "required": [ + "documentType" + ], + "type": "object", + "properties": { + "documentType": { + "type": "string", + "description": "Indicate the Tracking Document.
          Valid values are SIGNATURE_PROOF_OF_DELIVERY, BILL_OF_LADING and FREIGHT_BILLING_DOCUMENT.
          Example: SIGNATURE_PROOF_OF_DELIVERY.
          Note: The SPOD information will be presented as a byte array instead of an image. The byte array is a base64 encoded string, which should be decoded to get the final signature image in PDF or PNG format", + "example": "SIGNATURE_PROOF_OF_DELIVERY" + }, + "documentFormat": { + "type": "string", + "description": "Specifies the format of tracking document.
          Valid values are PDF or PNG.
          The values are key sensitive.
          Note: documentTypes BILL_OF_LADING and FREIGHT_BILLING_DOCUMENT does not support PNG.", + "example": "PNG" + } + }, + "description": "Specifies the tracking document details." + }, + "TrackDocumentSpecification": { + "required": [ + "trackingNumberInfo" + ], + "type": "object", + "properties": { + "trackingNumberInfo": { + "allOf": [ + { + "description": "Information uniquely identifying the shipment such as Tracking number, Carrier Code, and Tracking number uniqueId." + }, + { + "$ref": "#/components/schemas/TrackingNumberInfo" + } + ] + }, + "shipDateBegin": { + "type": "string", + "description": "ShipDateBegin and ShipDateEnd are used to narrow the search, reduce lookup time, and avoid duplicates when searching for a specific tracking number during a specific date range.
          Format: YYYY-MM-DD
          example: '2020-03-29'", + "example": "2020-03-29" + }, + "shipDateEnd": { + "type": "string", + "description": "ShipDateBegin and ShipDateEnd are recommended to narrow the search, reduce lookup time, and avoid duplicates when searching for a specific tracking number during a specific date range.
          Format: YYYY-MM-DD
          example: '2020-04-01'", + "example": "2020-04-01" + }, + "accountNumber": { + "type": "string", + "description": "Specifies Signature Proof of Delivery(SPOD) account number for the shipment being tracked.
          Conditionally required when documentType is BILL_OF_LADING or FREIGHT_BILLING_DOCUMENT
          Example: 123456789", + "example": "XXX61073" + } + } + }, + "TrkcResponseVO_SPOD": { + "type": "object", + "properties": { + "transactionId": { + "type": "string", + "description": "The transaction ID is a special set of numbers that defines each transaction.
          Example: 624deea6-b709-470c-8c39-4b5511281492", + "example": "624deea6-b709-470c-8c39-4b5511281492" + }, + "customerTransactionId": { + "type": "string", + "description": "This element allows you to assign a unique identifier to your transaction. This element is also returned in the reply and helps you match the request to the reply.
          Example: AnyCo_order123456789", + "example": "AnyCo_order123456789" + }, + "output": { + "$ref": "#/components/schemas/BaseProcessOutputVO_SPOD" + } + }, + "description": "This is a wrapper class for outputVO" + }, + "BaseProcessOutputVO_SPOD": { + "$ref": "#/components/schemas/SPODResponseVO" + }, + "SPODResponseVO": { + "type": "object", + "properties": { + "localization": { + "$ref": "#/components/schemas/Localization" + }, + "documentType": { + "type": "string", + "description": "The types of tracking document.
          Example: SIGNATURE_PROOF_OF_DELIVERY" + }, + "documentFormat": { + "type": "string", + "description": "The format of the tracking document.
          Valid values are PDF and PNG.", + "example": "PNG" + }, + "document": { + "type": "array", + "format": "base64", + "description": "This field holds the list of byte array(base64) which specifies the image of the recipient's signature (if the signature is available) once the shipment has been delivered.
          Example: [iVBORw0KGgoAAAANSUhEUgAABX0AAAfECAIAAACJ1ysDAACAAElEQVR42uzdeXxM9/4/8EhC3ZZkskmotlpuq6227r1ur6KqrSXLZLHvhKyIndJy7ZLMlgiy2BJ71E4QewmCICUqJAiCIIgkM3P2M/P7nDkxHQm97b0339b9vZ6P92MeM3P2kX8+L5/FzgQAAAAAAAAAUDvs8BMAAAAAAAAAQC1B7gAAAAAAAAAAtQW5AwAAAAAAAADUFuQOAAAAAAAAAFBbkDsAAAAAAAAAQG1B7gAAAAAAAAAAtQW5AwAAAAAAAADUFuQOAAAAAAAAAFBbkDsAAAAAAAAAQG1B7gAAAAAAAAAAtQW5AwAAAAAAAADUFuQOAAAAAAAAAFBbkDsAAAAAAAAAQG1B7gAAAAAAAAAAtQW5AwAAAAAAAADUFuQOAAAAAAAAAFBbkDsAAAAAAAAAQG1B7gAAAAAAAAAAtQW5AwAAAAAAAADUFuQOAAAAAAAAAFBbkDsAAAAAAAAAQG1B7gAAAAAAAAAAtQW5AwAAAAAAAADUFuQOAAAAAAAAAFBbkDsAAAAAAAAAQG1B7gAAAAAAAAAAtQW5AwAAAAAAAADUFuQOAAAAAAAAAFBbkDsAAAAAAAAAQG1B7gAAAAAAAAAAtQW5AwAAAAAAAADUFuQO/6bl0/+dhCEfLh7eOonUsE8S5RouFfly8YD34od8lKAK23ruUKGhXO7v8CtzB1Mt5A6FP+cOLuRxrLmDLtBD1d9rtmWcxRf6Yba5g6MlenAwRdTlo5zoyU2N0/5snPYe9d179Hfvst+1YL9rznwrFT2pKf1tCyqlN3V8BVOcKxjLkDsAAAAAAAAgd4B/J3dQukiv/d5eGPH3ZdMCNySO27du/vH10cdXzzm6ek6Wba345+HUWT/sXZ17K/8uYzSIAmey5A6m58cKctwgWsry/tmbeXGL+l+nFKKcOwyTcodeTeOUUu6gepo7aAM9YmrmDqawuqYw6VUMqy+MUHD//J]", + "items": { + "type": "string", + "format": "byte" + } + }, + "alerts": { + "type": "array", + "description": "Specifies the alert received when the recipient's signature has been taken as a proof of shipment delivery.
          Example: TRACKING.DATA.NOTFOUND - Tracking data unavailable", + "example": "TRACKING.DATA.NOTFOUND - Tracking data unavailable", + "items": { + "$ref": "#/components/schemas/Alert" + } + } + } + }, + "Full_Schema_Tracking_Numbers": { + "required": [ + "includeDetailedScans", + "trackingInfo" + ], + "type": "object", + "properties": { + "includeDetailedScans": { + "type": "boolean", + "description": "Indicates if detailed scans are requested or not.
          Valid values are True, or False." + }, + "trackingInfo": { + "type": "array", + "description": "The tracking information of the shipment to be tracked. At least one occurrence of TrackingInfo is required. Maximum limit is 30.", + "items": { + "$ref": "#/components/schemas/TrackingInfo" + } + } + }, + "description": "The request elements for Tracking by Tracking Number. " + }, + "TrackingNumberInfo_1": { + "type": "object", + "properties": { + "trackingNumber": { + "type": "string", + "description": "This is a Tracking number for FedEx packages used for tracking a single package or group of packages.
          Example: 128667043726
          Click here to see Mock Tracking Numbers.", + "example": "128667043726" + }, + "carrierCode": { + "type": "string", + "description": "This is a placeholder to provide the FedEx operating company (transportation) code used for package delivery.
          Example: FDXE", + "example": "FDXE", + "enum": [ + "FDXE", + "FDXG", + "FXSP", + "FXFR", + "FDXC", + "FXCC", + "FEDEX_CARGO", + "FEDEX_CUSTOM_CRITICAL", + "FEDEX_EXPRESS", + "FEDEX_FREIGHT", + "FEDEX_GROUND", + "FEDEX_OFFICE", + "FEDEX_KINKOS", + "FX", + "FDFR", + "FDEG", + "FXK", + "FDC", + "FDCC" + ] + }, + "trackingNumberUniqueId": { + "type": "string", + "description": "Unique identifier used to distinguish duplicate FedEx tracking numbers. This value will be set by FedEx systems.
          Example: 245822\\~123456789012\\~FDEG", + "example": "245822~123456789012~FDEG" + } + }, + "description": "Information uniquely identifying a shipment such as Tracking number, ShipDate, and Tracking number uniqueId." + }, + "TrkcResponseVO_TrackingNumber": { + "type": "object", + "properties": { + "transactionId": { + "type": "string", + "description": "The transaction ID is a special set of numbers that defines each transaction.
          Example: 624deea6-b709-470c-8c39-4b5511281492", + "example": "624deea6-b709-470c-8c39-4b5511281492" + }, + "customerTransactionId": { + "type": "string", + "description": "This element allows you to assign a unique identifier to your transaction. This element is also returned in the reply and helps you match the request to the reply.
          Example: AnyCo_order123456789", + "example": "AnyCo_order123456789" + }, + "output": { + "$ref": "#/components/schemas/BaseProcessOutputVO_TrackingNumber" + } + }, + "description": "This is a wrapper class for outputVO" + }, + "BaseProcessOutputVO_TrackingNumber": { + "$ref": "#/components/schemas/TrackingNumbersResponse" + }, + "TrackingNumbersResponse": { + "type": "object", + "properties": { + "completeTrackResults": { + "type": "array", + "description": "Contains detailed tracking entry information.
          Valid values are- ACTUAL_DELIVERY, ACTUAL_PICKUP, ACTUAL_TENDER, ANTICIPATED_TENDER, APPOINTMENT_DELIVERY, ATTEMPTED_DELIVERY, COMMITMENT, ESTIMATED_ARRIVAL_AT_GATEWAY, ESTIMATED_DELIVERY, ESTIMATED_PICKUP, ESTIMATED_RETURN_TO_STATION, SHIP, SHIPMENT_DATA_RECEIVED.", + "items": { + "$ref": "#/components/schemas/CompleteTrackResult" + } + }, + "alerts": { + "type": "array", + "description": "The cxs alert type, alert code and alert message
          Example: TRACKING.DATA.NOTFOUND - Tracking data unavailable", + "example": "TRACKING.DATA.NOTFOUND - Tracking data unavailable", + "items": { + "$ref": "#/components/schemas/Alert" + } + } + }, + "description": "The response elements for Tracking by tracking number request", + "xml": { + "name": "TrackingNumbersResponse" + } + }, + "LocationDetail_origin": { + "type": "object", + "properties": { + "locationId": { + "type": "string", + "description": "Location Identification for facilities identified by an alpha numeric location code. Passing Location Id of the Hold at Location (HAL) address is strongly recommended to ensure packages are delivered to the correct address.
          Example: SEA", + "example": "SEA" + }, + "locationContactAndAddress": { + "$ref": "#/components/schemas/ContactAndAddress1" + } + }, + "description": "Location details for the fedex facility." + }, + "LocationDetail1": { + "type": "object", + "properties": { + "locationId": { + "type": "string", + "description": "Location Identification for facilities identified by an alpha numeric location code. Passing Location Id of the Hold at Location (HAL) address is strongly recommended to ensure packages are delivered to the correct address.
          Example: SEA", + "example": "SEA" + }, + "locationContactAndAddress": { + "$ref": "#/components/schemas/ContactAndAddress1" + }, + "locationType": { + "type": "string", + "description": "This field holds FedEx Location Type. If Location Type not available we will get empty value.", + "example": "FEDEX_SHIPSITE", + "enum": [ + "FEDEX_AUTHORIZED_SHIP_CENTER", + "FEDEX_OFFICE", + "FEDEX_SELF_SERVICE_LOCATION", + "FEDEX_GROUND_TERMINAL", + "FEDEX_ONSITE", + "FEDEX_EXPRESS_STATION", + "FEDEX_FACILITY", + "FEDEX_FREIGHT_SERVICE_CENTER", + "FEDEX_HOME_DELIVERY_STATION", + "FEDEX_SHIP_AND_GET", + "FEDEX_SHIPSITE", + "FEDEX_SMART_POST_HUB" + ] + } + }, + "description": "Location details for the fedex facility." + }, + "ContactAndAddress1": { + "type": "object", + "properties": { + "address": { + "description": "Required.\n\nDescriptive data for a physical location. may be used as an actual physical address(place to which one could go), or a container of 'address parts' which should be handled as a unit(such as a city-state-zip combination within the US).\n\nConditional when used with Payor object. Required if entering using RECIPIENT or THIRD_PARTY. Required if not-authenticated and SENDER is selected", + "allOf": [ + { + "$ref": "#/components/schemas/AddressVO1" + } + ] + } + }, + "description": "Location Contact And Address." + }, + "ContactVO1": { + "type": "object", + "properties": { + "personName": { + "type": "string", + "description": "Identifies the contact person's name. Max Length is 70.
          Example: John Taylor", + "example": "John Taylor" + }, + "phoneNumber": { + "type": "string", + "description": "Identifies the phone number associated with this contact. Max length is 15.
          Example: '1234567890'", + "example": "1234567890" + }, + "companyName": { + "type": "string", + "description": "Identifies the company this contact is associated with. Max length is 35.
          Example: Fedex", + "example": "Fedex" + } + }, + "description": "Indicate the contact details for this package.
          Note: contact is shown in response only in secured flow. For non secured flow, contact is not shown in the response.'" + }, + "AddressVO1": { + "type": "object", + "properties": { + "addressClassification": { + "type": "string", + "description": "Specifies the FedEx classification type for an address.
          Valid values are BUSINESS, RESIDENTIAL, MIXED, UNKNOWN.
          Example: BUSINESS", + "example": "BUSINESS" + }, + "residential": { + "type": "boolean", + "description": "Placeholder to indicate whether the address is residential (as opposed to commercial).", + "example": false, + "enum": [ + true, + false + ] + }, + "streetLines": { + "type": "array", + "description": "Combination of number, street name, etc. At least one line is required for a valid physical address; empty lines should not be included.
          Example: [\"1043 North Easy Street\", \"Suite 999\"].
          Note: Street lines is shown in response only in secured flow. For non secured flow, street lines is not shown in the response.", + "example": [ + "1043 North Easy Street", + "Suite 999" + ], + "items": { + "type": "string" + } + }, + "city": { + "type": "string", + "description": "Conditional
          The name of the city, town, etc.
          Example: SEATTLE", + "example": "SEATTLE" + }, + "stateOrProvinceCode": { + "type": "string", + "description": "This is a placeholder for State or Province code.
          Example: CA
          Click here to see State/Province Code", + "example": "WA" + }, + "postalCode": { + "type": "string", + "description": "Placeholder to specify postal code for the address. Postal Code is required for postal-aware countries.
          Example: 98101
          Click here to see Postal aware countries", + "example": "98101" + }, + "countryCode": { + "type": "string", + "description": "Placeholder for country code (2 characters) for the address.
          Example: US
          Click here to see Country Codes", + "example": "US" + }, + "countryName": { + "type": "string", + "description": "Field holds the fully spelled out name of a country.
          Example: United States", + "example": "United States" + } + }, + "description": "Address where the package was actually delivered. Contrast with destinationAddress, which is the location to which the package was intended to be delivered. Addresses may differ due to delivery to a behavior, hold at FedEx location, etc." + } + } + } +} \ No newline at end of file diff --git a/openapi/src/test/scala/io/apibuilder/openapi/ConversionReportSpec.scala b/openapi/src/test/scala/io/apibuilder/openapi/ConversionReportSpec.scala new file mode 100644 index 000000000..4583a2fe6 --- /dev/null +++ b/openapi/src/test/scala/io/apibuilder/openapi/ConversionReportSpec.scala @@ -0,0 +1,71 @@ +package io.apibuilder.openapi + +import org.scalatest.matchers.must.Matchers +import org.scalatest.wordspec.AnyWordSpec + +class ConversionReportSpec extends AnyWordSpec with Matchers { + + private val emptyReport = ConversionReport( + schemas = Seq.empty, + fields = Seq.empty, + paths = Seq.empty, + unsupportedFeatures = Seq.empty, + ) + + private def fieldReport(schema: String, field: String, kind: Option[FieldKind]) = + FieldReport(schema, field, kind) + + "briefSummary" must { + + "return clean message when there are no issues" in { + emptyReport.briefSummary must be("Imported from OpenAPI.") + } + + "include unmapped field count" in { + val report = emptyReport.copy(fields = Seq(fieldReport("Foo", "bar", None))) + report.briefSummary must include("1 unmapped fields") + } + + "include defaulted-to-string field count" in { + val report = emptyReport.copy(fields = Seq(fieldReport("Foo", "bar", Some(FieldKind.DefaultedString)))) + report.briefSummary must include("1 fields defaulted to string") + } + + "include ignored format count" in { + val report = emptyReport.copy(fields = Seq( + FieldReport("Foo", "ts", Some(FieldKind.DefaultedString), ignoredFormat = Some("unixtime")), + )) + report.briefSummary must include("1 ignored formats") + } + + "include path issue count" in { + val report = emptyReport.copy(paths = Seq( + PathReport("/foo", Seq("GET"), unsupported = Seq("GET /foo: some issue")), + )) + report.briefSummary must include("1 path issues") + } + + "include unsupported feature count" in { + val report = emptyReport.copy(unsupportedFeatures = Seq("webhooks: not converted")) + report.briefSummary must include("1 unsupported features") + } + + "combine multiple issue types in one sentence" in { + val report = emptyReport.copy( + fields = Seq(fieldReport("Foo", "bar", None)), + unsupportedFeatures = Seq("webhooks: not converted"), + ) + val summary = report.briefSummary + summary must include("1 unmapped fields") + summary must include("1 unsupported features") + summary must startWith("Imported from OpenAPI. Conversion issues:") + } + + "omit zero-count categories" in { + val report = emptyReport.copy(fields = Seq(fieldReport("Foo", "bar", None))) + report.briefSummary must not include "defaulted" + report.briefSummary must not include "ignored" + report.briefSummary must not include "path issues" + } + } +} diff --git a/openapi/src/test/scala/io/apibuilder/openapi/ConverterMainSpec.scala b/openapi/src/test/scala/io/apibuilder/openapi/ConverterMainSpec.scala new file mode 100644 index 000000000..0860d4d5a --- /dev/null +++ b/openapi/src/test/scala/io/apibuilder/openapi/ConverterMainSpec.scala @@ -0,0 +1,53 @@ +package io.apibuilder.openapi + +import org.scalatest.matchers.must.Matchers +import org.scalatest.wordspec.AnyWordSpec + +class ConverterMainSpec extends AnyWordSpec with Matchers { + + "parseArgs" must { + + "parse valid --file and --organization flags" in { + val result = ConverterMain.parseArgs(List("foo.json", "--organization", "my-org")) + result must be(Symbol("right")) + val opts = result.toOption.get + opts.input must be(Some("foo.json")) + opts.organization must be(Some("my-org")) + } + + "return Left when --organization is missing" in { + val result = ConverterMain.parseArgs(List("foo.json")) + result must be(Symbol("left")) + result.left.get must include("--organization") + } + + "return Left when no input is provided" in { + val result = ConverterMain.parseArgs(List("--organization", "my-org")) + result must be(Symbol("left")) + result.left.get must include("input") + } + + "return Left for an unknown flag" in { + val result = ConverterMain.parseArgs(List("foo.json", "--organization", "my-org", "--unknown-flag")) + result must be(Symbol("left")) + result.left.get must include("--unknown-flag") + } + + "accumulate multiple --filter-header values" in { + val result = ConverterMain.parseArgs( + List( + "foo.json", + "--organization", + "my-org", + "--filter-header", + "X-Api-Key", + "--filter-header", + "X-Trace-Id", + ), + ) + result must be(Symbol("right")) + val opts = result.toOption.get + opts.filterHeaders must be(Set("X-Api-Key", "X-Trace-Id")) + } + } +} diff --git a/openapi/src/test/scala/io/apibuilder/openapi/ConverterSpec.scala b/openapi/src/test/scala/io/apibuilder/openapi/ConverterSpec.scala new file mode 100644 index 000000000..807d5840b --- /dev/null +++ b/openapi/src/test/scala/io/apibuilder/openapi/ConverterSpec.scala @@ -0,0 +1,194 @@ +package io.apibuilder.openapi + +import lib.ServiceConfiguration +import org.scalatest.matchers.must.Matchers +import org.scalatest.wordspec.AnyWordSpec +import sttp.apispec.{Schema, SchemaType, SecurityScheme} +import sttp.apispec.openapi.{Components, Info, _} + +import scala.collection.immutable.ListMap + +class ConverterSpec extends AnyWordSpec with Matchers { + + private val testConfig = ServiceConfiguration(orgKey = "test", orgNamespace = "io.test", version = "0.0.1") + + "OpenApiParser" must { + "parse fedex-ship-api.json" in { + val result = OpenApiParser.fromResource("fedex-ship-api.json") + result must be(Symbol("right")) + val openApi = result.toOption.get + openApi.info.title must not be empty + openApi.components must be(Symbol("defined")) + openApi.components.get.schemas must not be empty + openApi.paths.pathItems must not be empty + } + + "parse fedex-track.json" in { + OpenApiParser.fromResource("fedex-track.json") must be(Symbol("right")) + } + + "parse fedex-eei-filing.json" in { + OpenApiParser.fromResource("fedex-eei-filing.json") must be(Symbol("right")) + } + } + + "Converter" must { + "convert fedex-ship-api" in { + val openApi = OpenApiParser.fromResource("fedex-ship-api.json").toOption.get + val service = Converter.convert(openApi, testConfig) + + service.models must not be empty + service.models.map(_.name) must contain("money") + service.resources must not be empty + } + + "convert fedex-track" in { + val openApi = OpenApiParser.fromResource("fedex-track.json").toOption.get + val service = Converter.convert(openApi, testConfig) + + service.models must not be empty + service.models.map(_.name) must contain("tracking_info") + service.resources must not be empty + } + + "convert fedex-eei-filing" in { + val openApi = OpenApiParser.fromResource("fedex-eei-filing.json").toOption.get + val service = Converter.convert(openApi, testConfig) + + service.models must not be empty + service.models.map(_.name) must contain("gtic_response_vo") + service.resources must not be empty + } + + "convert security schemes to headers: apiKey and http produce distinct headers; oauth2 is deduped" in { + val openApi = OpenAPI( + info = Info("test", "1.0"), + components = Some( + Components( + securitySchemes = ListMap( + "api_key" -> Right(SecurityScheme(`type` = "apiKey", name = Some("X-Api-Key"), in = Some("header"))), + "bearer" -> Right(SecurityScheme(`type` = "http", scheme = Some("bearer"))), + "oauth" -> Right(SecurityScheme(`type` = "oauth2")), + ), + ), + ), + ) + val service = Converter.convert(openApi, testConfig) + + service.headers must have size 2 + service.headers.map(_.name).toSet must be(Set("X-Api-Key", "Authorization")) + service.headers.foreach { h => + h.`type` must be("string") + h.required must be(true) + } + } + + "oauth2 scheme emits degraded note in openapi_conversion attribute" in { + val openApi = OpenAPI( + info = Info("test", "1.0"), + components = Some( + Components( + securitySchemes = ListMap( + "oauth" -> Right(SecurityScheme(`type` = "oauth2")), + ), + ), + ), + ) + val service = Converter.convert(openApi, testConfig) + + val attr = service.attributes.find(_.name == "openapi_conversion").get + attr.value.toString must include("oauth2") + } + + "filterHeaders: header parameter is excluded from converted operations" in { + val headerParam = Parameter( + name = "X-Trace-Id", + in = ParameterIn.Header, + schema = Some(Schema(`type` = Some(List(SchemaType.String)))), + ) + val operation = Operation( + parameters = List(Right(headerParam)), + responses = Responses( + responses = ListMap( + ResponsesCodeKey(200) -> Right( + Response( + description = "ok", + content = ListMap( + "application/json" -> MediaType( + schema = Some(Schema($ref = Some("#/components/schemas/Widget"))), + ), + ), + ), + ), + ), + ), + ) + val openApi = OpenAPI( + info = Info("test", "1.0"), + paths = Paths(pathItems = ListMap("/widgets" -> PathItem(get = Some(operation)))), + ) + + val service = Converter.convert(openApi, testConfig, filterHeaders = Set("X-Trace-Id")) + + val params = service.resources.flatMap(_.operations).flatMap(_.parameters) + params.exists(_.name == "X-Trace-Id") must be(false) + } + + "set org key and namespace from ServiceConfiguration" in { + val openApi = OpenAPI(info = Info("My Service", "1.0")) + val config = ServiceConfiguration(orgKey = "myorg", orgNamespace = "io.myorg", version = "1.2.3") + val service = Converter.convert(openApi, config) + + service.organization.key must be("myorg") + service.namespace must startWith("io.myorg") + service.version must be("1.2.3") + } + + "description: appends brief summary to existing description" in { + val openApi = OpenAPI(info = Info("My Service", "1.0", description = Some("Original description."))) + val service = Converter.convert(openApi, testConfig) + + service.description must be(Symbol("defined")) + service.description.get must startWith("Original description.") + service.description.get must include("Imported from OpenAPI.") + } + + "description: contains only brief summary when no original description" in { + val openApi = OpenAPI(info = Info("My Service", "1.0")) + val service = Converter.convert(openApi, testConfig) + + service.description must be(Some("Imported from OpenAPI.")) + } + + "attributes: includes openapi_conversion attribute" in { + val openApi = OpenAPI(info = Info("My Service", "1.0")) + val service = Converter.convert(openApi, testConfig) + + service.attributes must have size 1 + service.attributes.head.name must be("openapi_conversion") + } + + "attributes: openapi_conversion value contains expected keys" in { + val openApi = OpenAPI(info = Info("My Service", "1.0")) + val service = Converter.convert(openApi, testConfig) + + val attrValue = service.attributes.head.value + (attrValue \ "unmapped_fields").isDefined must be(true) + (attrValue \ "defaulted_fields").isDefined must be(true) + (attrValue \ "ignored_formats").isDefined must be(true) + (attrValue \ "path_issues").isDefined must be(true) + (attrValue \ "unsupported_features").isDefined must be(true) + } + } + + "OpenApiServiceValidator" must { + "validate a valid OpenAPI 3 JSON spec" in { + val spec = OpenApiParser.fromResource("fedex-ship-api.json").toOption.get + import io.circe.syntax._ + import sttp.apispec.openapi.circe._ + val json = spec.asJson.noSpaces + val result = OpenApiServiceValidator(testConfig).validate(json) + result.isValid must be(true) + } + } +} diff --git a/openapi/src/test/scala/io/apibuilder/openapi/NamingUtilsSpec.scala b/openapi/src/test/scala/io/apibuilder/openapi/NamingUtilsSpec.scala new file mode 100644 index 000000000..21a13c10b --- /dev/null +++ b/openapi/src/test/scala/io/apibuilder/openapi/NamingUtilsSpec.scala @@ -0,0 +1,81 @@ +package io.apibuilder.openapi + +import org.scalatest.matchers.must.Matchers +import org.scalatest.wordspec.AnyWordSpec + +class NamingUtilsSpec extends AnyWordSpec with Matchers { + + import NamingUtils._ + + "toSnakeCase" must { + "convert camelCase" in { + toSnakeCase("FooBar") must be("foo_bar") + } + "convert with hyphens" in { + toSnakeCase("foo-bar") must be("foo_bar") + } + "convert with dots" in { + toSnakeCase("foo.bar") must be("foo_bar") + } + "handle acronyms" in { + toSnakeCase("HTTPSConnection") must be("https_connection") + } + "handle all-caps word" in { + toSnakeCase("URL") must be("url") + } + "handle identifier with embedded number" in { + toSnakeCase("Foo2Bar") must be("foo2_bar") + } + } + + "ApibuilderPrimitiveTypes" must { + "contain 'string'" in { + ApibuilderPrimitiveTypes.contains("string") must be(true) + } + "not contain an unknown type" in { + ApibuilderPrimitiveTypes.contains("unknown_xyz") must be(false) + } + } + + "uniqueSnakeCase" must { + val uniqueConfig = NamingConfig(uniqueNames = true) + val normalConfig = NamingConfig(uniqueNames = false) + + "convert to snake_case with consistent hash suffix" in { + val a1 = uniqueSnakeCase("FooBar", uniqueConfig) + val a2 = uniqueSnakeCase("FooBar", uniqueConfig) + val a3 = uniqueSnakeCase("foo_bar", uniqueConfig) + + a1 must be(a2) + a1 must be(a3) + a1 must startWith("foo_bar_") + } + + "correctly handle arrays" in { + uniqueSnakeCase("[foo_bar]", uniqueConfig) must be("[foo_bar_vouy]") + uniqueSnakeCase("[BazQux]", uniqueConfig) must be("[baz_qux_bykv]") + uniqueSnakeCase("[ BazQux ]", uniqueConfig) must be("[baz_qux_bykv]") + } + + "do not hash primitive types" in { + uniqueSnakeCase("string", uniqueConfig) must be("string") + uniqueSnakeCase("[boolean]", uniqueConfig) must be("[boolean]") + } + + "just convert to snake_case when uniqueNames is false" in { + uniqueSnakeCase("FooBar", normalConfig) must be("foo_bar") + } + } + + "sanitizeEnumName" must { + "remove quotes" in { + sanitizeEnumName("USPS_DELIVERING\"") must be("USPS_DELIVERING") + } + "replace spaces with underscores" in { + sanitizeEnumName("foo bar") must be("foo_bar") + } + "trim whitespace" in { + sanitizeEnumName(" foo ") must be("foo") + } + } +} diff --git a/openapi/src/test/scala/io/apibuilder/openapi/OpenApiParserSpec.scala b/openapi/src/test/scala/io/apibuilder/openapi/OpenApiParserSpec.scala new file mode 100644 index 000000000..eff6c1368 --- /dev/null +++ b/openapi/src/test/scala/io/apibuilder/openapi/OpenApiParserSpec.scala @@ -0,0 +1,58 @@ +package io.apibuilder.openapi + +import org.scalatest.matchers.must.Matchers +import org.scalatest.wordspec.AnyWordSpec + +import java.nio.file.Paths + +class OpenApiParserSpec extends AnyWordSpec with Matchers { + + private val minimalJsonSpec = + """|{ + | "openapi": "3.0.0", + | "info": { "title": "Test API", "version": "1.0.0" }, + | "paths": {} + |}""".stripMargin + + private val minimalYamlSpec = + """|openapi: "3.0.0" + |info: + | title: Test API + | version: "1.0.0" + |paths: {} + |""".stripMargin + + "OpenApiParser" must { + + "parse a valid minimal JSON OpenAPI string" in { + val result = OpenApiParser.fromString(minimalJsonSpec) + result must be(Symbol("right")) + result.toOption.get.info.title must be("Test API") + } + + "parse a valid minimal YAML OpenAPI string" in { + val result = OpenApiParser.fromString(minimalYamlSpec) + result must be(Symbol("right")) + result.toOption.get.info.title must be("Test API") + } + + "return Left for invalid JSON containing context message" in { + val result = OpenApiParser.fromString("{ not valid json }") + result must be(Symbol("left")) + result.left.get must include("Failed to parse input as JSON") + } + + "return Left for invalid YAML containing context message" in { + val result = OpenApiParser.fromString(":\n - bad: [unclosed") + result must be(Symbol("left")) + result.left.get must include("Failed to parse input as YAML") + } + + "fromFile with non-existent path returns Left containing exception class name" in { + val path = Paths.get("/no/such/file/does/not/exist.json") + val result = OpenApiParser.fromFile(path) + result must be(Symbol("left")) + result.left.get must include("Exception") + } + } +} diff --git a/openapi/src/test/scala/io/apibuilder/openapi/PathConverterSpec.scala b/openapi/src/test/scala/io/apibuilder/openapi/PathConverterSpec.scala new file mode 100644 index 000000000..9d9d8cc0c --- /dev/null +++ b/openapi/src/test/scala/io/apibuilder/openapi/PathConverterSpec.scala @@ -0,0 +1,319 @@ +package io.apibuilder.openapi + +import io.apibuilder.spec.v0.{models => ab} +import org.scalatest.matchers.must.Matchers +import org.scalatest.wordspec.AnyWordSpec +import sttp.apispec.openapi._ +import sttp.apispec.{Schema, SchemaType} + +import scala.collection.immutable.ListMap + +class PathConverterSpec extends AnyWordSpec with Matchers { + + private def makeConverter(filterHeaders: Set[String] = Set.empty): PathConverter = + new PathConverter(Map.empty, NamingConfig(), filterHeaders) + + private def makeResponse(schemaName: String): Response = + Response( + description = "ok", + content = ListMap( + "application/json" -> MediaType( + schema = Some(Schema($ref = Some(s"#/components/schemas/$schemaName"))), + ), + ), + ) + + private def makePathsWith200( + path: String, + pathParams: List[Parameter] = Nil, + opParams: List[Parameter] = Nil, + ): Paths = { + val operation = Operation( + parameters = opParams.map(Right(_)), + responses = Responses( + responses = ListMap(ResponsesCodeKey(200) -> Right(makeResponse("Widget"))), + ), + ) + val pathItem = PathItem( + get = Some(operation), + parameters = pathParams.map(Right(_)), + ) + Paths(pathItems = ListMap(path -> pathItem)) + } + + "PathConverter" must { + + "rewrite {id} path parameters to :id" in { + val paths = makePathsWith200("/widgets/{id}") + val result = makeConverter().convertPaths(paths) + + result.resources must not be empty + val ops = result.resources.head.operations + ops must not be empty + ops.head.path must be("/widgets/:id") + } + + "mergeParameters: operation-level parameter overrides path-level with same (name, in)" in { + val pathParam = Parameter( + name = "limit", + in = ParameterIn.Query, + description = Some("path-level"), + schema = Some(Schema(`type` = Some(List(SchemaType.Integer)))), + ) + val opParam = Parameter( + name = "limit", + in = ParameterIn.Query, + description = Some("op-level"), + schema = Some(Schema(`type` = Some(List(SchemaType.Integer)))), + ) + val paths = makePathsWith200("/widgets", pathParams = List(pathParam), opParams = List(opParam)) + val result = makeConverter().convertPaths(paths) + + val params = result.resources.head.operations.head.parameters + params.count(_.name == "limit") must be(1) + params.find(_.name == "limit").flatMap(_.description) must be(Some("op-level")) + } + + "filterHeaders: header parameter matching filter is excluded" in { + val headerParam = Parameter( + name = "X-Api-Key", + in = ParameterIn.Header, + schema = Some(Schema(`type` = Some(List(SchemaType.String)))), + ) + val paths = makePathsWith200("/widgets", opParams = List(headerParam)) + + val withFilter = new PathConverter(Map.empty, NamingConfig(), filterHeaders = Set("X-Api-Key")) + val result = withFilter.convertPaths(paths) + + val params = result.resources.head.operations.head.parameters + params.exists(_.name == "X-Api-Key") must be(false) + } + + "filterHeaders: matching is case-insensitive" in { + val headerParam = Parameter( + name = "x-api-key", + in = ParameterIn.Header, + schema = Some(Schema(`type` = Some(List(SchemaType.String)))), + ) + val paths = makePathsWith200("/widgets", opParams = List(headerParam)) + + val withFilter = new PathConverter(Map.empty, NamingConfig(), filterHeaders = Set("X-API-KEY")) + val result = withFilter.convertPaths(paths) + + val params = result.resources.head.operations.head.parameters + params.exists(_.name == "x-api-key") must be(false) + } + + "no typed response: spec with only 204 responses produces no resources" in { + val operation = Operation( + responses = Responses( + responses = ListMap(ResponsesCodeKey(204) -> Right(Response(description = "no content"))), + ), + ) + val pathItem = PathItem(delete = Some(operation)) + val paths = Paths(pathItems = ListMap("/widgets/{id}" -> pathItem)) + + val result = makeConverter().convertPaths(paths) + result.resources must be(empty) + } + + "non-JSON response with no JSON alternative reports one consolidated issue" in { + val operation = Operation( + responses = Responses(responses = ListMap( + ResponsesCodeKey(200) -> Right(Response( + description = "video", + content = ListMap("video/mp4" -> MediaType()), + )), + )), + ) + val paths = Paths(pathItems = ListMap("/videos/:id/content" -> PathItem(get = Some(operation)))) + val report = makeConverter().convertPaths(paths).pathReports.head + + report.unsupported.count(_.contains("no JSON content")) must be(1) + report.unsupported.find(_.contains("no JSON content")).get must include("video/mp4") + } + + "non-JSON response with multiple content types consolidates into one issue" in { + val operation = Operation( + responses = Responses(responses = ListMap( + ResponsesCodeKey(200) -> Right(Response( + description = "media", + content = ListMap("video/mp4" -> MediaType(), "image/webp" -> MediaType()), + )), + )), + ) + val paths = Paths(pathItems = ListMap("/videos/:id/content" -> PathItem(get = Some(operation)))) + val report = makeConverter().convertPaths(paths).pathReports.head + + val contentIssues = report.unsupported.filter(_.contains("no JSON content")) + contentIssues must have size 1 + contentIssues.head must include("video/mp4") + contentIssues.head must include("image/webp") + } + + "response with both JSON and non-JSON content types reports no content-type issue" in { + val operation = Operation( + responses = Responses(responses = ListMap( + ResponsesCodeKey(200) -> Right(Response( + description = "ok", + content = ListMap( + "application/json" -> MediaType(schema = Some(Schema($ref = Some("#/components/schemas/Widget")))), + "text/event-stream" -> MediaType(), + ), + )), + )), + ) + val paths = Paths(pathItems = ListMap("/widgets" -> PathItem(get = Some(operation)))) + val report = makeConverter().convertPaths(paths).pathReports.head + + report.unsupported.filter(_.contains("no JSON content")) must be(empty) + } + + "non-JSON request body with no JSON alternative reports one consolidated issue" in { + val operation = Operation( + requestBody = Some(Right(RequestBody( + content = ListMap("multipart/form-data" -> MediaType()), + ))), + responses = Responses(responses = ListMap( + ResponsesCodeKey(200) -> Right(makeResponse("Widget")), + )), + ) + val paths = Paths(pathItems = ListMap("/uploads" -> PathItem(post = Some(operation)))) + val report = makeConverter().convertPaths(paths).pathReports.head + + report.unsupported.count(_.contains("no JSON request body")) must be(1) + report.unsupported.find(_.contains("no JSON request body")).get must include("multipart/form-data") + } + + "multipart/form-data with $ref schema extracts body type" in { + val operation = Operation( + requestBody = Some(Right(RequestBody( + content = ListMap("multipart/form-data" -> MediaType( + schema = Some(Schema($ref = Some("#/components/schemas/UploadRequest"))), + )), + ))), + responses = Responses(responses = ListMap( + ResponsesCodeKey(200) -> Right(makeResponse("Widget")), + )), + ) + val paths = Paths(pathItems = ListMap("/uploads" -> PathItem(post = Some(operation)))) + val result = makeConverter().convertPaths(paths) + + val body = result.resources.head.operations.head.body + body.map(_.`type`) must be(Some("upload_request")) + } + + "multipart/form-data with $ref schema suppresses the non-JSON body warning" in { + val operation = Operation( + requestBody = Some(Right(RequestBody( + content = ListMap("multipart/form-data" -> MediaType( + schema = Some(Schema($ref = Some("#/components/schemas/UploadRequest"))), + )), + ))), + responses = Responses(responses = ListMap( + ResponsesCodeKey(200) -> Right(makeResponse("Widget")), + )), + ) + val paths = Paths(pathItems = ListMap("/uploads" -> PathItem(post = Some(operation)))) + val report = makeConverter().convertPaths(paths).pathReports.head + + report.unsupported.filter(_.contains("no JSON request body")) must be(empty) + } + + "multipart/form-data with inline object schema produces no body" in { + val operation = Operation( + requestBody = Some(Right(RequestBody( + content = ListMap("multipart/form-data" -> MediaType( + schema = Some(Schema(`type` = Some(List(SchemaType.Object)))), + )), + ))), + responses = Responses(responses = ListMap( + ResponsesCodeKey(200) -> Right(makeResponse("Widget")), + )), + ) + val paths = Paths(pathItems = ListMap("/uploads" -> PathItem(post = Some(operation)))) + val result = makeConverter().convertPaths(paths) + + result.resources.head.operations.head.body must be(None) + } + + "application/x-www-form-urlencoded with $ref schema extracts body type" in { + val operation = Operation( + requestBody = Some(Right(RequestBody( + content = ListMap("application/x-www-form-urlencoded" -> MediaType( + schema = Some(Schema($ref = Some("#/components/schemas/FormRequest"))), + )), + ))), + responses = Responses(responses = ListMap( + ResponsesCodeKey(200) -> Right(makeResponse("Widget")), + )), + ) + val paths = Paths(pathItems = ListMap("/submit" -> PathItem(post = Some(operation)))) + val result = makeConverter().convertPaths(paths) + + val body = result.resources.head.operations.head.body + body.map(_.`type`) must be(Some("form_request")) + } + + "request body with both JSON and non-JSON content types reports no body issue" in { + val operation = Operation( + requestBody = Some(Right(RequestBody( + content = ListMap( + "application/json" -> MediaType(schema = Some(Schema($ref = Some("#/components/schemas/Widget")))), + "multipart/form-data" -> MediaType(), + ), + ))), + responses = Responses(responses = ListMap( + ResponsesCodeKey(200) -> Right(makeResponse("Widget")), + )), + ) + val paths = Paths(pathItems = ListMap("/widgets" -> PathItem(post = Some(operation)))) + val report = makeConverter().convertPaths(paths).pathReports.head + + report.unsupported.filter(_.contains("no JSON request body")) must be(empty) + } + + "security requirements: suppressed when all schemes are convertible" in { + val operation = Operation( + security = List(ListMap("api_key" -> Vector.empty)), + responses = Responses(responses = ListMap(ResponsesCodeKey(200) -> Right(makeResponse("Widget")))), + ) + val paths = Paths(pathItems = ListMap("/widgets" -> PathItem(get = Some(operation)))) + val converter = new PathConverter(Map.empty, NamingConfig(), convertibleSchemeNames = Set("api_key")) + val report = converter.convertPaths(paths).pathReports.head + + report.unsupported.exists(_.contains("security")) must be(false) + } + + "security requirements: warn only for scheme names not in convertible set" in { + val operation = Operation( + security = List(ListMap("bearer_auth" -> Vector.empty, "custom_oauth" -> Vector.empty)), + responses = Responses(responses = ListMap(ResponsesCodeKey(200) -> Right(makeResponse("Widget")))), + ) + val paths = Paths(pathItems = ListMap("/widgets" -> PathItem(get = Some(operation)))) + val converter = new PathConverter(Map.empty, NamingConfig(), convertibleSchemeNames = Set("bearer_auth")) + val report = converter.convertPaths(paths).pathReports.head + + val secIssues = report.unsupported.filter(_.contains("security")) + secIssues must have size 1 + secIssues.head must include("custom_oauth") + secIssues.head must not include "bearer_auth" + } + + "response key is formatted as numeric code not as case class" in { + val operation = Operation( + responses = Responses(responses = ListMap( + ResponsesCodeKey(200) -> Right(Response( + description = "video", + content = ListMap("video/mp4" -> MediaType()), + )), + )), + ) + val paths = Paths(pathItems = ListMap("/videos/:id" -> PathItem(get = Some(operation)))) + val report = makeConverter().convertPaths(paths).pathReports.head + + report.unsupported.exists(_.contains("ResponsesCodeKey")) must be(false) + report.unsupported.exists(_.contains("response 200:")) must be(true) + } + } +} diff --git a/openapi/src/test/scala/io/apibuilder/openapi/SchemaConverterSpec.scala b/openapi/src/test/scala/io/apibuilder/openapi/SchemaConverterSpec.scala new file mode 100644 index 000000000..cb7b82aed --- /dev/null +++ b/openapi/src/test/scala/io/apibuilder/openapi/SchemaConverterSpec.scala @@ -0,0 +1,371 @@ +package io.apibuilder.openapi + +import io.apibuilder.validation.ScalarType +import org.scalatest.matchers.must.Matchers +import org.scalatest.wordspec.AnyWordSpec +import sttp.apispec.{ExampleSingleValue, Schema, SchemaType} + +import scala.collection.immutable.ListMap + +class SchemaConverterSpec extends AnyWordSpec with Matchers { + + "classify" must { + + "Object when schema has properties" in { + SchemaClassifier.classifySchema(Schema(properties = ListMap("id" -> Schema()))) must be(SchemaKind.Object) + } + + "Object when schema has type object" in { + SchemaClassifier.classifySchema(Schema(`type` = Some(List(SchemaType.Object)))) must be(SchemaKind.Object) + } + + "Object when schema has both type object and properties" in { + val s = Schema( + `type` = Some(List(SchemaType.Object)), + properties = ListMap("name" -> Schema(`type` = Some(List(SchemaType.String)))), + ) + SchemaClassifier.classifySchema(s) must be(SchemaKind.Object) + } + + "StringEnum when schema is string with enum values" in { + val s = Schema( + `type` = Some(List(SchemaType.String)), + `enum` = Some(List(ExampleSingleValue("A"), ExampleSingleValue("B"))), + ) + SchemaClassifier.classifySchema(s) must be(SchemaKind.StringEnum) + } + + "Array when schema has type array" in { + SchemaClassifier.classifySchema(Schema(`type` = Some(List(SchemaType.Array)))) must be(SchemaKind.Array) + } + + "Alias when schema is a pure $ref" in { + SchemaClassifier.classifySchema(Schema($ref = Some("#/components/schemas/Foo"))) must be(SchemaKind.Alias) + } + + "Alias when schema is allOf without properties" in { + val s = Schema(allOf = List(Schema($ref = Some("#/components/schemas/Bar")))) + SchemaClassifier.classifySchema(s) must be(SchemaKind.Alias) + } + + "Union when schema is oneOf without properties" in { + val s = Schema(oneOf = List(Schema($ref = Some("#/components/schemas/Baz")))) + SchemaClassifier.classifySchema(s) must be(SchemaKind.Union) + } + + "Alias when schema is plain string without enum" in { + SchemaClassifier.classifySchema(Schema(`type` = Some(List(SchemaType.String)))) must be(SchemaKind.Alias) + } + + "Object takes priority over allOf when properties are present" in { + val s = Schema( + properties = ListMap("id" -> Schema()), + allOf = List(Schema($ref = Some("#/components/schemas/Base"))), + ) + SchemaClassifier.classifySchema(s) must be(SchemaKind.Object) + } + + "Skip when schema has only examples and no type" in { + val s = Schema(examples = Some(List(ExampleSingleValue("example")))) + SchemaClassifier.classifySchema(s) must be(SchemaKind.Skip) + } + + "Skip for empty schema" in { + SchemaClassifier.classifySchema(Schema()) must be(SchemaKind.Skip) + } + } + + "classifyField" must { + + "Ref for schema with $ref" in { + SchemaClassifier.classifyField(Schema($ref = Some("#/components/schemas/Address"))) must be( + Some(FieldKind.Ref("Address")), + ) + } + + "AllOfRef for schema with allOf containing $ref" in { + val s = Schema(allOf = List( + Schema($ref = Some("#/components/schemas/Base")), + Schema(description = Some("extra")), + )) + SchemaClassifier.classifyField(s) must be(Some(FieldKind.AllOfRef("Base"))) + } + + "Number for number type" in { + SchemaClassifier.classifyField(Schema(`type` = Some(List(SchemaType.Number)))) must be( + Some(FieldKind.Number), + ) + } + + "ArrayRef for array with $ref items" in { + val s = Schema( + `type` = Some(List(SchemaType.Array)), + items = Some(Schema($ref = Some("#/components/schemas/LineItem"))), + ) + SchemaClassifier.classifyField(s) must be(Some(FieldKind.ArrayRef("LineItem"))) + } + + "ArrayEnum for array with inline string enum items" in { + val items = Schema( + `type` = Some(List(SchemaType.String)), + `enum` = Some(List(ExampleSingleValue("A"), ExampleSingleValue("B"))), + ) + val s = Schema(`type` = Some(List(SchemaType.Array)), items = Some(items)) + SchemaClassifier.classifyField(s) must be(Some(FieldKind.ArrayEnum(items))) + } + + "InlineEnum for string with enum values" in { + val s = Schema( + `type` = Some(List(SchemaType.String)), + `enum` = Some(List(ExampleSingleValue("X"), ExampleSingleValue("Y"))), + ) + SchemaClassifier.classifyField(s) must be(Some(FieldKind.InlineEnum(s))) + } + + "ArraySimple for array with simple string items" in { + val s = Schema( + `type` = Some(List(SchemaType.Array)), + items = Some(Schema(`type` = Some(List(SchemaType.String)))), + ) + SchemaClassifier.classifyField(s) must be(Some(FieldKind.ArraySimple(ScalarType.StringType))) + } + + "ArraySimple for array with integer items" in { + val s = Schema( + `type` = Some(List(SchemaType.Array)), + items = Some(Schema(`type` = Some(List(SchemaType.Integer)))), + ) + SchemaClassifier.classifyField(s) must be(Some(FieldKind.ArraySimple(ScalarType.IntegerType))) + } + + "Primitive for boolean" in { + SchemaClassifier.classifyField(Schema(`type` = Some(List(SchemaType.Boolean)))) must be( + Some(FieldKind.Primitive(ScalarType.BooleanType)), + ) + } + + "Primitive for string" in { + SchemaClassifier.classifyField(Schema(`type` = Some(List(SchemaType.String)))) must be( + Some(FieldKind.Primitive(ScalarType.StringType)), + ) + } + + "Primitive for integer" in { + SchemaClassifier.classifyField(Schema(`type` = Some(List(SchemaType.Integer)))) must be( + Some(FieldKind.Primitive(ScalarType.IntegerType)), + ) + } + + "None for empty schema" in { + SchemaClassifier.classifyField(Schema()) must be(None) + } + + "Ref takes priority over simple type" in { + val s = Schema( + $ref = Some("#/components/schemas/Foo"), + `type` = Some(List(SchemaType.String)), + ) + SchemaClassifier.classifyField(s) must be(Some(FieldKind.Ref("Foo"))) + } + + "AllOfRef takes priority over number" in { + val s = Schema( + allOf = List(Schema($ref = Some("#/components/schemas/Amount"))), + `type` = Some(List(SchemaType.Number)), + ) + SchemaClassifier.classifyField(s) must be(Some(FieldKind.AllOfRef("Amount"))) + } + + "Number takes priority over simple" in { + val s = Schema(`type` = Some(List(SchemaType.Number))) + SchemaClassifier.classifyField(s) must be(Some(FieldKind.Number)) + SchemaConverter.simpleType(s) must be(Some(ScalarType.DecimalType)) + } + + "ArrayRef takes priority over ArraySimple" in { + val s = Schema( + `type` = Some(List(SchemaType.Array)), + items = Some(Schema($ref = Some("#/components/schemas/Thing"))), + ) + SchemaClassifier.classifyField(s) must be(Some(FieldKind.ArrayRef("Thing"))) + } + + "InlineEnum takes priority over Simple string" in { + val s = Schema( + `type` = Some(List(SchemaType.String)), + `enum` = Some(List(ExampleSingleValue("on"), ExampleSingleValue("off"))), + ) + SchemaClassifier.classifyField(s) must be(Some(FieldKind.InlineEnum(s))) + } + + "Primitive for oneOf number and null (nullable number)" in { + val s = Schema(oneOf = List( + Schema(`type` = Some(List(SchemaType.Number))), + Schema(`type` = Some(List(SchemaType.Null))), + )) + SchemaClassifier.classifyField(s) must be(Some(FieldKind.Primitive(ScalarType.DecimalType))) + } + + "Primitive for oneOf string and null (nullable string)" in { + val s = Schema(oneOf = List( + Schema(`type` = Some(List(SchemaType.String))), + Schema(`type` = Some(List(SchemaType.Null))), + )) + SchemaClassifier.classifyField(s) must be(Some(FieldKind.Primitive(ScalarType.StringType))) + } + + "Primitive for oneOf integer and null (nullable integer)" in { + val s = Schema(oneOf = List( + Schema(`type` = Some(List(SchemaType.Integer))), + Schema(`type` = Some(List(SchemaType.Null))), + )) + SchemaClassifier.classifyField(s) must be(Some(FieldKind.Primitive(ScalarType.IntegerType))) + } + + "Primitive for anyOf boolean and null (nullable boolean)" in { + val s = Schema(anyOf = List( + Schema(`type` = Some(List(SchemaType.Boolean))), + Schema(`type` = Some(List(SchemaType.Null))), + )) + SchemaClassifier.classifyField(s) must be(Some(FieldKind.Primitive(ScalarType.BooleanType))) + } + + "Ref for oneOf ref and null (nullable ref)" in { + val s = Schema(oneOf = List( + Schema($ref = Some("#/components/schemas/Foo")), + Schema(`type` = Some(List(SchemaType.Null))), + )) + SchemaClassifier.classifyField(s) must be(Some(FieldKind.Ref("Foo"))) + } + + "None for anyOf with two non-null primitive types" in { + val s = Schema(anyOf = List( + Schema(`type` = Some(List(SchemaType.String))), + Schema(`type` = Some(List(SchemaType.Integer))), + )) + SchemaClassifier.classifyField(s) must be(None) + } + } + + "convert" must { + + "filter skipped schemas from union members" in { + val schemas: ListMap[String, Schema] = ListMap( + "FullSchema" -> Schema( + `type` = Some(List(SchemaType.Object)), + properties = ListMap("id" -> Schema(`type` = Some(List(SchemaType.String)))), + ), + "ExampleOnly" -> Schema(examples = Some(List(ExampleSingleValue("sample")))), + "MyUnion" -> Schema(oneOf = List( + Schema($ref = Some("#/components/schemas/FullSchema")), + Schema($ref = Some("#/components/schemas/ExampleOnly")), + )), + ) + + val classification = SchemaClassifier.classify(schemas) + val result = new SchemaConverter(Map.empty, NamingConfig()).convert(classification) + + result.unions must have size 1 + result.unions.head.types.map(_.`type`) must be(Seq("full_schema")) + } + + "SchemaConverter.convert: object schema with two properties produces a Model with correct field names and types" in { + val schemas: ListMap[String, Schema] = ListMap( + "Widget" -> Schema( + `type` = Some(List(SchemaType.Object)), + properties = ListMap( + "id" -> Schema(`type` = Some(List(SchemaType.String))), + "count" -> Schema(`type` = Some(List(SchemaType.Integer))), + ), + ), + ) + val classification = SchemaClassifier.classify(schemas) + val result = new SchemaConverter(Map.empty, NamingConfig()).convert(classification) + + result.models must have size 1 + val model = result.models.head + model.name must be("widget") + val fieldNames = model.fields.map(_.name) + fieldNames must contain("id") + fieldNames must contain("count") + model.fields.find(_.name == "id").map(_.`type`) must be(Some("string")) + model.fields.find(_.name == "count").map(_.`type`) must be(Some("integer")) + } + + "SchemaConverter.convert: string enum schema produces an Enum with the right values" in { + val schemas: ListMap[String, Schema] = ListMap( + "Status" -> Schema( + `type` = Some(List(SchemaType.String)), + `enum` = Some(List(ExampleSingleValue("active"), ExampleSingleValue("inactive"))), + ), + ) + val classification = SchemaClassifier.classify(schemas) + val result = new SchemaConverter(Map.empty, NamingConfig()).convert(classification) + + result.enums must have size 1 + val enumDef = result.enums.head + enumDef.name must be("status") + enumDef.values.map(_.name) must contain allOf ("active", "inactive") + } + + "SchemaConverter.convert: field with unresolvable type is omitted" in { + val schemas: ListMap[String, Schema] = ListMap( + "Widget" -> Schema( + `type` = Some(List(SchemaType.Object)), + properties = ListMap( + "name" -> Schema(`type` = Some(List(SchemaType.String))), + "mystery" -> Schema(), + ), + ), + ) + val classification = SchemaClassifier.classify(schemas) + val result = new SchemaConverter(Map.empty, NamingConfig()).convert(classification) + + result.models must have size 1 + val model = result.models.head + model.fields.map(_.name) must contain("name") + model.fields.map(_.name) must not contain "mystery" + } + } + + "simpleType" must { + + "return LongType for format unixtime, overriding base integer type" in { + SchemaConverter.simpleType(Schema( + `type` = Some(List(SchemaType.Integer)), + format = Some("unixtime"), + )) must be(Some(ScalarType.LongType)) + } + } + + "ignoredFormat" must { + + "return None for unixtime" in { + SchemaConverter.ignoredFormat(Schema(format = Some("unixtime"))) must be(None) + } + + "return None for uri" in { + SchemaConverter.ignoredFormat(Schema(format = Some("uri"))) must be(None) + } + + "return None for binary" in { + SchemaConverter.ignoredFormat(Schema(format = Some("binary"))) must be(None) + } + + "return None for byte" in { + SchemaConverter.ignoredFormat(Schema(format = Some("byte"))) must be(None) + } + + "return None for password" in { + SchemaConverter.ignoredFormat(Schema(format = Some("password"))) must be(None) + } + + "return None for email" in { + SchemaConverter.ignoredFormat(Schema(format = Some("email"))) must be(None) + } + + "return Some for an unrecognised format" in { + SchemaConverter.ignoredFormat(Schema(format = Some("x-custom"))) must be(Some("x-custom")) + } + } +} diff --git a/openapi/src/test/scala/io/apibuilder/openapi/SchemaResolverSpec.scala b/openapi/src/test/scala/io/apibuilder/openapi/SchemaResolverSpec.scala new file mode 100644 index 000000000..8d6f9b2a3 --- /dev/null +++ b/openapi/src/test/scala/io/apibuilder/openapi/SchemaResolverSpec.scala @@ -0,0 +1,44 @@ +package io.apibuilder.openapi + +import org.scalatest.matchers.must.Matchers +import org.scalatest.wordspec.AnyWordSpec + +class SchemaResolverSpec extends AnyWordSpec with Matchers { + + import SchemaResolver._ + + "refName" must { + + "strip the #/components/schemas/ prefix" in { + refName("#/components/schemas/Foo") must be("Foo") + } + + "return the raw string for a non-standard ref" in { + refName("./other.yaml#/Foo") must be("./other.yaml#/Foo") + } + } + + "resolveReference" must { + + "resolve a direct alias" in { + val refs = Map("MyAlias" -> "Widget") + resolveReference("MyAlias", refs) must be(Right("Widget")) + } + + "resolve a chain of aliases" in { + val refs = Map("A" -> "B", "B" -> "C") + resolveReference("A", refs) must be(Right("C")) + } + + "return Right(name) when name is not in refs" in { + resolveReference("Unknown", Map.empty) must be(Right("Unknown")) + } + + "detect a cycle and return Left" in { + val refs = Map("A" -> "B", "B" -> "A") + val result = resolveReference("A", refs) + result must be(Symbol("left")) + result.left.get must include("Cycle detected") + } + } +} diff --git a/openapi/src/test/scala/io/apibuilder/openapi/SecurityConverterSpec.scala b/openapi/src/test/scala/io/apibuilder/openapi/SecurityConverterSpec.scala new file mode 100644 index 000000000..4750f19f7 --- /dev/null +++ b/openapi/src/test/scala/io/apibuilder/openapi/SecurityConverterSpec.scala @@ -0,0 +1,218 @@ +package io.apibuilder.openapi + +import org.scalatest.matchers.must.Matchers +import org.scalatest.wordspec.AnyWordSpec +import play.api.libs.json.Json +import sttp.apispec.{OAuthFlow, OAuthFlows, SecurityScheme} +import sttp.apispec.openapi.Reference + +import scala.collection.immutable.ListMap + +class SecurityConverterSpec extends AnyWordSpec with Matchers { + + private def convert(schemes: ListMap[String, Either[Reference, SecurityScheme]]): SecurityConversionResult = + SecurityConverter.convertSecuritySchemes(schemes) + + "SecurityConverter" must { + + "convert apiKey with in=header" in { + val result = convert(ListMap( + "api_key" -> Right(SecurityScheme(`type` = "apiKey", name = Some("X-Api-Key"), in = Some("header"))), + )) + result.headers must have size 1 + result.headers.head.name must be("X-Api-Key") + result.headers.head.`type` must be("string") + result.headers.head.required must be(true) + result.degradedNotes must be(empty) + } + + "convert apiKey with description" in { + val result = convert(ListMap( + "api_key" -> Right(SecurityScheme( + `type` = "apiKey", name = Some("X-Api-Key"), in = Some("header"), + description = Some("Your API key"), + )), + )) + result.headers.head.description must be(Some("Your API key")) + } + + "skip apiKey with in=query" in { + convert(ListMap( + "api_key" -> Right(SecurityScheme(`type` = "apiKey", name = Some("api_key"), in = Some("query"))), + )).headers must be(empty) + } + + "skip apiKey with in=cookie" in { + convert(ListMap( + "api_key" -> Right(SecurityScheme(`type` = "apiKey", name = Some("session"), in = Some("cookie"))), + )).headers must be(empty) + } + + "convert http bearer" in { + val result = convert(ListMap("bearer" -> Right(SecurityScheme(`type` = "http", scheme = Some("bearer"))))) + result.headers must have size 1 + result.headers.head.name must be("Authorization") + result.headers.head.description must be(Some("Bearer token")) + result.degradedNotes must be(empty) + } + + "convert http basic" in { + val result = convert(ListMap("basic" -> Right(SecurityScheme(`type` = "http", scheme = Some("basic"))))) + result.headers.head.name must be("Authorization") + result.headers.head.description must be(Some("Basic authentication")) + } + + "use explicit description over default for http scheme" in { + val result = convert(ListMap( + "bearer" -> Right(SecurityScheme(`type` = "http", scheme = Some("bearer"), description = Some("JWT access token"))), + )) + result.headers.head.description must be(Some("JWT access token")) + } + + "deduplicate Authorization headers from multiple http schemes" in { + val result = convert(ListMap( + "bearer" -> Right(SecurityScheme(`type` = "http", scheme = Some("bearer"))), + "basic" -> Right(SecurityScheme(`type` = "http", scheme = Some("basic"))), + )) + result.headers must have size 1 + result.headers.head.name must be("Authorization") + } + + "convert oauth2 to Authorization header" in { + val result = convert(ListMap("oauth" -> Right(SecurityScheme(`type` = "oauth2")))) + result.headers must have size 1 + result.headers.head.name must be("Authorization") + } + + "convert oauth2 with clientCredentials flow: include flow details in description" in { + val flows = OAuthFlows(clientCredentials = Some(OAuthFlow( + tokenUrl = Some("https://auth.example.com/token"), + scopes = ListMap("read:widgets" -> "Read widgets", "write:widgets" -> "Write widgets"), + ))) + val result = convert(ListMap("oauth" -> Right(SecurityScheme(`type` = "oauth2", flows = Some(flows))))) + val desc = result.headers.head.description.getOrElse("") + desc must include("clientCredentials") + desc must include("https://auth.example.com/token") + desc must include("read:widgets") + } + + "convert oauth2 with clientCredentials flow: persist flow details in oauth2 attribute" in { + val flows = OAuthFlows(clientCredentials = Some(OAuthFlow( + tokenUrl = Some("https://auth.example.com/token"), + scopes = ListMap("read:widgets" -> "Read widgets", "write:widgets" -> "Write widgets"), + ))) + val result = convert(ListMap("oauth" -> Right(SecurityScheme(`type` = "oauth2", flows = Some(flows))))) + val attr = result.headers.head.attributes.find(_.name == "oauth2").get + val attrStr = attr.value.toString + attrStr must include("client_credentials") + attrStr must include("https://auth.example.com/token") + attrStr must include("read:widgets") + } + + "convert oauth2 with authorizationCode flow: persists both URLs in attribute" in { + val flows = OAuthFlows(authorizationCode = Some(OAuthFlow( + authorizationUrl = Some("https://auth.example.com/authorize"), + tokenUrl = Some("https://auth.example.com/token"), + scopes = ListMap("openid" -> "OpenID"), + ))) + val result = convert(ListMap("oauth" -> Right(SecurityScheme(`type` = "oauth2", flows = Some(flows))))) + val attrStr = result.headers.head.attributes.find(_.name == "oauth2").get.value.toString + attrStr must include("authorization_code") + attrStr must include("authorization_url") + attrStr must include("token_url") + } + + "convert oauth2 with no flows: oauth2 attribute has empty flows object" in { + val result = convert(ListMap("oauth" -> Right(SecurityScheme(`type` = "oauth2")))) + val attr = result.headers.head.attributes.find(_.name == "oauth2").get + attr.value must be(Json.obj("flows" -> Json.obj())) + } + + "convert oauth2: emit degraded note referencing the attribute" in { + val result = convert(ListMap("myOAuth" -> Right(SecurityScheme(`type` = "oauth2")))) + result.degradedNotes must have size 1 + result.degradedNotes.head must include("myOAuth") + result.degradedNotes.head must include("oauth2") + result.degradedNotes.head must include("attribute") + } + + "convert openIdConnect to Authorization header with discovery URL in description" in { + val result = convert(ListMap( + "oidc" -> Right(SecurityScheme( + `type` = "openIdConnect", + openIdConnectUrl = Some("https://auth.example.com/.well-known/openid-configuration"), + )), + )) + result.headers must have size 1 + result.headers.head.name must be("Authorization") + result.headers.head.description.getOrElse("") must include("https://auth.example.com/.well-known/openid-configuration") + } + + "convert openIdConnect: persists discovery URL in openid_connect attribute" in { + val result = convert(ListMap( + "oidc" -> Right(SecurityScheme( + `type` = "openIdConnect", + openIdConnectUrl = Some("https://auth.example.com/.well-known/openid-configuration"), + )), + )) + val attr = result.headers.head.attributes.find(_.name == "openid_connect").get + attr.value.toString must include("https://auth.example.com/.well-known/openid-configuration") + } + + "convert openIdConnect with no discovery URL: openid_connect attribute has empty object" in { + val result = convert(ListMap("oidc" -> Right(SecurityScheme(`type` = "openIdConnect")))) + val attr = result.headers.head.attributes.find(_.name == "openid_connect").get + attr.value must be(Json.obj()) + } + + "convert openIdConnect: emit degraded note referencing the attribute" in { + val result = convert(ListMap("myOidc" -> Right(SecurityScheme(`type` = "openIdConnect")))) + result.degradedNotes must have size 1 + result.degradedNotes.head must include("myOidc") + result.degradedNotes.head must include("openIdConnect") + result.degradedNotes.head must include("attribute") + } + + "skip references" in { + convert(ListMap("ref" -> Left(Reference("#/components/securitySchemes/other")))).headers must be(empty) + } + + "convert all scheme types to at most two distinct headers" in { + val result = convert(ListMap( + "api_key" -> Right(SecurityScheme(`type` = "apiKey", name = Some("X-Api-Key"), in = Some("header"))), + "bearer" -> Right(SecurityScheme(`type` = "http", scheme = Some("bearer"))), + "oauth" -> Right(SecurityScheme(`type` = "oauth2")), + "query_key" -> Right(SecurityScheme(`type` = "apiKey", name = Some("key"), in = Some("query"))), + )) + result.headers must have size 2 + result.headers.map(_.name).toSet must be(Set("X-Api-Key", "Authorization")) + } + } + + "isConvertible" must { + + "return true for apiKey with in=header" in { + SecurityConverter.isConvertible( + SecurityScheme(`type` = "apiKey", name = Some("X-Key"), in = Some("header")), + ) must be(true) + } + + "return false for apiKey with in=query" in { + SecurityConverter.isConvertible( + SecurityScheme(`type` = "apiKey", name = Some("key"), in = Some("query")), + ) must be(false) + } + + "return true for http" in { + SecurityConverter.isConvertible(SecurityScheme(`type` = "http", scheme = Some("bearer"))) must be(true) + } + + "return true for oauth2" in { + SecurityConverter.isConvertible(SecurityScheme(`type` = "oauth2")) must be(true) + } + + "return true for openIdConnect" in { + SecurityConverter.isConvertible(SecurityScheme(`type` = "openIdConnect")) must be(true) + } + } +}