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)
+ }
+ }
+}