0

V1/carts/mine/shipping-information for this service which parameter are required.. I had given below parameters

{
  "addressInformation": {
    "shippingAddress": {
      "id": 0,
      "region": "string",
      "regionId": 0,
      "regionCode": "string",
      "countryId": "IN",
      "street": [
        "Lane5 pune"
      ],
      "company": "string",
      "telephone": "9494949494",
      "fax": "string",
      "postcode": "411001",
      "city": "pune",
      "firstname": "vaibhav",
      "lastname": "kapoor",
      "middlename": "string",
      "prefix": "string",
      "suffix": "string",
      "vatId": "string",
      "customerId": 2,
      "email": "[email protected]",
      "sameAsBilling": 0,
      "customerAddressId": 0,
      "saveInAddressBook": 0,
      "extensionAttributes": {},
      "customAttributes": [
        {
          "attributeCode": "string",
          "value": "string"
        }
      ]
    },
    "billingAddress": {
      "id": 0,
      "region": "string",
      "regionId": 0,
      "regionCode": "string",
      "countryId": "IN",
      "street": [
        "Lane5 une"
      ],
      "company": "string",
      "telephone": "9494949494",
      "fax": "string",
      "postcode": "411001",
      "city": "pune",
      "firstname": "vaibhav",
      "lastname": "kapoor",
      "middlename": "string",
      "prefix": "string",
      "suffix": "string",
      "vatId": "string",
      "customerId": 2,
      "email": "[email protected]",
      "sameAsBilling": 0,
      "customerAddressId": 0,
      "saveInAddressBook": 0,
      "extensionAttributes": {},
      "customAttributes": [
        {
          "attributeCode": "string",
          "value": "string"
        }
      ]
    },
    "shippingMethodCode": "freeshipping",
    "shippingCarrierCode": "freeshipping",
    "extensionAttributes": {},
    "customAttributes": [
      {
        "attributeCode": "string",
        "value": "string"
      }
    ]
  }
}

Error message is:

"message": "Unable to save shipping information. Please, check input data." 

1 Answer 1

0

Can you try the below?

    {
    "addressInformation": {
        "shipping_address": {
            "firstname": "Your name",
            "lastname": "your last name",
            "city": "India",
            "country_id": "IN",
            "region": "Region",
            "postcode": "123456",
            "telephone": "1234567",
            "region_id": 0,
            "street": ["Line1", "Line2"],
            "customer_id": 1,
            "customer_address_id": 1
        },
        "billing_address": {
            "firstname": "Your name",
            "lastname": "your last name",
            "city": "India",
            "country_id": "IN",
            "region": "Region",
            "postcode": "123456",
            "telephone": "1234567",
            "region_id": 0,
            "street": ["Line1", "Line2"],
            "customer_id": 1,
            "customer_address_id": 1
        },
        "shipping_method_code": "freeshipping",
        "shipping_carrier_code": "freeshipping"
    }
}

Make sure the

"shippingMethodCode": "freeshipping",
"shippingCarrierCode": "freeshipping",

are the code(s) available when you retrieve using the shipping methods API: http://magento2_path/index.php/rest/V1/carts/mine/shipping-methods

Hope this helps.

Joemar

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.