Atul Vishwakarma
Atul Vishwakarma

Reputation: 1

Facing an issue in hitting the amazon selling partner api

Error Details:

Endpoint: POST https://sandbox.sellingpartnerapi-eu.amazon.com/shipping/v2/shipments/rates

Error Message:

{
   "errors":[
      {
         "code":"Unauthorized",
         "message":"Access to requested resource is denied.",
         "details":""
      }
   ]
}

Request Details:

Headers:

Request Body:

{
    "shipTo": {
        "name": "Pavan",
        "addressLine1": "Shop No 4",
        "addressLine2": "Sec No 11",
        "postalCode": "500032",
        "city": "Hyderabad",
        "countryCode": "IN",
        "email": "[email protected]",
        "phoneNumber": "9999999999"
    },
    "shipFrom": {
        "name": "A1",
        "addressLine1": "1141,Maker Chambers V",
        "addressLine2": "J Bajaj Road, Nariman Point",
        "postalCode": "500032",
        "city": "Hyderabad",
        "countryCode": "IN",
        "email": "[email protected]",
        "phoneNumber": "9999999999"
    },
    "packages": [
        {
            "dimensions": {
                "length": 3.14,
                "width": 3.14,
                "height": 3.14,
                "unit": "INCH"
            },
            "weight": {
                "unit": "KILOGRAM",
                "value": 3.14159
            },
            "items": [
                {
                    "quantity": 1,
                    "weight": {
                        "unit": "KILOGRAM",
                        "value": 1.14159
                    },
                    "isHazmat": false
                },
                {
                    "quantity": 1,
                    "weight": {
                        "unit": "KILOGRAM",
                        "value": 1.14159
                    }
                }
            ],
            "insuredValue": {
                "unit": "INR",
                "value": 29.98
            },
            "isHazmat": false,
            "packageClientReferenceId": "abcd"
        }
    ],
    "valueAddedServices": {
        "collectOnDelivery": {
            "amount": {
                "value": 10,
                "unit": "INR"
            }
        }
    },
    "taxDetails": [
        {
            "taxType": "GST",
            "taxRegistrationNumber": "87878"
        }
    ],
    "channelDetails": {
        "channelType": "EXTERNAL"
    }
}

Testing in Postman

enter image description here

Troubleshooting Steps Taken:

  1. Verified that the x-amz-access-token is correct and not expired.
  2. Ensured the x-amzn-shipping-business-id is accurate.
  3. Double-checked the endpoint URL and headers.

Despite these efforts, the issue persists.

Upvotes: 0

Views: 88

Answers (1)

Marconline
Marconline

Reputation: 1451

Please, check that your application on Seller Central has the Direct-to-Consumer Shipping role and, if the request of that role has been sent, that it has been approved, the case is closed and the application is out of the Draft mode.

Upvotes: 0

Related Questions