amzn / selling-partner-api-models

This repository contains OpenAPI models for developers to use when developing software to call Selling Partner APIs.
Apache License 2.0
569 stars 730 forks source link

Unable to get MFN Eligible Shipment Services #365

Closed quanlndzt closed 4 months ago

quanlndzt commented 4 months ago

Hey team I try to get MFN Eligible Shipment via api but it not work API :

{{baseUrl}}/mfn/v0/eligibleShippingServices

Request body:

{
  "ShipmentRequestDetails": {
    "AmazonOrderId": "112-3861871-6830603",
    "ItemList": [
      {
        "OrderItemId": "97755198622321",
        "Quantity": 1,
        "ItemWeight": {
          "Unit": "lb",
          "Value":10
        },
        "ItemDescription": "My test item"
      }
    ],
    "PackageDimensions": {
      "Length": 100,
      "Width": 100,
      "Height": 50,
      "Unit": "centimeters",
      "PredefinedPackageDimensions": "FedEx_Pak_1"
    },
    "ShipFromAddress": {
      "AddressLine1": "so 100",
      "City": "Ha Noi",
      "CountryCode": "VN",
      "Email": "test@example.com",
      "Name": "Test stock",
      "Phone": "0987654321",
      "PostalCode": "100000",
      "AddressLine2": "Dich Vong Hau",
      "AddressLine3": "Cau Giay"
    },
    "Weight": {
      "Unit": "g",
      "Value": 222
    },
    "SellerOrderId": "test-seller-order-id",
    "LabelCustomization": {
      "CustomTextForLabel": "Test MFN",
      "StandardIdForLabel": "112-3861871-6830603"
    }
  },
  "ShippingOfferingFilter": {
    "IncludePackingSlipWithLabel": false,
    "CarrierWillPickUp": "CarrierWillPickUp"
  }
}

And I got error

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

My api key seem have permission to it image

Please help me fix this issue Thank you

shreeharsh-a commented 4 months ago

Hi @quanlndzt, Per the docs, you will need access to the Direct to Consumer Shipping (Restricted) role to access this API (see under section Prerequisites).