jemee tala
jemee tala

Reputation: 11

Fedex Rest Create Shipment API NVALID.INPUT.EXCEPTION error coming

i am trying to integrate call FedEx Create Shipment API. this is my req body

{
    "mergeLabelDocOption": "LABELS_AND_DOCS",
    "requestedShipment": {
        "shipDatestamp": "2023-05-17",
        "shipper": {
            "address": {
                "streetLines": [
                    "1309 S Agnew Avenue",
                    "Apt 303"
                ],
                "city": "Oklahoma City",
                "stateOrProvinceCode": "OK",
                "postalCode": "73108",
                "countryCode": "US"
            },
            "contact": {
                "personName": "Kattie Ortiz",
                "emailAddress": "[email protected]",
                "phoneNumber": "17182934300",
                "companyName": "Kyle Wilderman LLC"
            }
        },
        "soldTo": {
            "address": {
                "streetLines": [
                    "1309 S Agnew Avenue",
                    "Apt 303"
                ],
                "city": "Oklahoma City",
                "stateOrProvinceCode": "OK",
                "postalCode": "73108",
                "countryCode": "US"
            },
            "contact": {
                "personName": "Kattie Ortiz",
                "emailAddress": "[email protected]",
                "phoneNumber": "17182934300",
                "companyName": "Kyle Wilderman LLC"
            },
            "accountNumber": {
                "value": "740561073"
            }
        },
        "recipients": {
            "address": {
                "streetLines": [
                    "13450 Farmcrest Ct"
                ],
                "city": "Herndon",
                "stateOrProvinceCode": "VA",
                "postalCode": "20171",
                "countryCode": "US"
            },
            "contact": {
                "personName": "Kattie Ortiz",
                "emailAddress": "[email protected]",
                "phoneNumber": "17182934300"
            }
        },
        "pickupType": "USE_SCHEDULED_PICKUP",
        "serviceType": "FEDEX_GROUND",
        "packagingType": "YOUR_PACKAGING",
        "totalWeight": 50,
        "origin": {
            "address": {
                "streetLines": [
                    "1309 S Agnew Avenue",
                    "Apt 303"
                ],
                "city": "Oklahoma City",
                "stateOrProvinceCode": "OK",
                "postalCode": "73108",
                "countryCode": "US"
            },
            "contact": {
                "personName": "Kattie Ortiz",
                "emailAddress": "[email protected]",
                "phoneNumber": "17182934300",
                "companyName": "Kyle Wilderman LLC"
            }
        },
        "shippingChargesPayment": {
            "paymentType": "SENDER",
            "payor": {
                "responsibleParty": {
                    "address": {
                        "streetLines": [
                            "1309 S Agnew Avenue",
                            "Apt 303"
                        ],
                        "city": "Oklahoma City",
                        "stateOrProvinceCode": "OK",
                        "postalCode": "73108",
                        "countryCode": "US"
                    },
                    "contact": {
                        "personName": "Kattie Ortiz",
                        "emailAddress": "[email protected]",
                        "phoneNumber": "17182934300",
                        "companyName": "Kyle Wilderman LLC"
                    },
                    "accountNumber": {
                        "value": "740561073"
                    }
                }
            }
        },
        "emailNotificationDetail": {
            "aggregationType": "PER_PACKAGE",
            "emailNotificationRecipients": [
                {
                    "name": "Kattie Ortiz",
                    "emailNotificationRecipientType": "RECIPIENT",
                    "emailAddress": "[email protected]",
                    "notificationFormatType": "HTML",
                    "notificationType": "EMAIL",
                    "notificationEventType": [
                        "ON_DELIVERY",
                        "ON_EXCEPTION",
                        "ON_SHIPMENT",
                        "ON_TENDER",
                        "ON_PICKUP",
                        "ON_ESTIMATED_DELIVERY",
                        "ON_LABEL",
                        "ON_PICKUP_DRIVER_ARRIVED",
                        "ON_PICKUP_DRIVER_ASSIGNED",
                        "ON_PICKUP_DRIVER_DEPARTED",
                        "ON_PICKUP_DRIVER_EN_ROUTE"
                    ]
                },
                {
                    "name": "Kattie Ortiz",
                    "emailNotificationRecipientType": "SHIPPER",
                    "emailAddress": "[email protected]",
                    "notificationFormatType": "HTML",
                    "notificationType": "EMAIL",
                    "notificationEventType": [
                        "ON_DELIVERY",
                        "ON_EXCEPTION",
                        "ON_SHIPMENT",
                        "ON_TENDER",
                        "ON_PICKUP",
                        "ON_ESTIMATED_DELIVERY",
                        "ON_LABEL",
                        "ON_PICKUP_DRIVER_ARRIVED",
                        "ON_PICKUP_DRIVER_ASSIGNED",
                        "ON_PICKUP_DRIVER_DEPARTED",
                        "ON_PICKUP_DRIVER_EN_ROUTE"
                    ]
                }
            ]
        },
        "blockInsightVisibility": false,
        "labelSpecification": {
            "labelFormatType": "COMMON2D",
            "labelStockType": "PAPER_7X475",
            "labelRotation": "LEFT",
            "imageType": "PDF"
        },
        "rateRequestType": "PREFERRED",
        "preferredCurrency": "USD",
        "totalPackageCount": 1,
        "requestedPackageLineItems": [
            {
                "sequenceNumber": 7,
                "groupPackageCount": 1,
                "weight": {
                    "units": "LB",
                    "value": 50
                },
                "dimensions": {
                    "length": 20,
                    "width": 20,
                    "height": 10,
                    "units": "IN"
                },
                "itemDescription": "Ea exercitation impe"
            }
        ]
    },
    "labelResponseOptions": "URL_ONLY",
    "accountNumber": {
        "value": "740561073"
    },
    "shipAction": "CONFIRM",
    "processingOptionType": "SYNCHRONOUS_ONLY",
    "oneLabelAtATime": false
}

I can't find what the issue is it's working in the developer.fedex.com portal with try now on their panel so? How should anybody determine what is wrong with messages like this?

{
    "transactionId": "61be5128-1ccd-44e5-9a44-52ac93b8xxx",
    "errors": [
        {
            "code": "INVALID.INPUT.EXCEPTION",
            "message": "Invalid field value in the input"
        }
    ]
}

Upvotes: 1

Views: 306

Answers (1)

The Intern
The Intern

Reputation: 1

recipients needs to be an array. For some reason shipper does not require it but recipients does.

{
    "mergeLabelDocOption": "LABELS_AND_DOCS",
    "requestedShipment": {
        ...
        "recipients": [...],
        ...
    }
}

Upvotes: 0

Related Questions