Estimate shipping by address and return list of available shipping methods

POST /V1/guest-carts/{cartId}/estimate-shipping-methods

Estimate shipping by address and return list of available shipping methods

Path parameters

  • cartId string Required

Body

  • address object Required

    Interface AddressInterface

    Hide address attributes Show address attributes object
    • id integer

      Id

    • region string Required

      Region name

    • region_id integer Required

      Region id

    • region_code string Required

      Region code

    • country_id string Required

      Country id

    • street array[string] Required

      Street

    • company string

      Company

    • telephone string Required

      Telephone number

    • fax string

      Fax number

    • postcode string Required

      Postcode

    • city string Required

      City name

    • firstname string Required

      First name

    • lastname string Required

      Last name

    • middlename string

      Middle name

    • prefix string

      Prefix

    • suffix string

      Suffix

    • vat_id string

      Vat id

    • customer_id integer

      Customer id

    • email string Required

      Billing/shipping email

    • same_as_billing integer

      Same as billing flag

    • customer_address_id integer

      Customer address id

    • save_in_address_book integer

      Save in address book flag

    • extension_attributes object

      ExtensionInterface class for @see \Magento\Quote\Api\Data\AddressInterface

      Hide extension_attributes attributes Show extension_attributes attributes object
      • discounts array[object]
        Hide discounts attributes Show discounts attributes object

        Rule discount Interface

        • discount_data object Required

          Discount Data Interface

          Hide discount_data attributes Show discount_data attributes object
          • amount number Required

            Amount

          • base_amount number Required

            Base Amount

          • original_amount number Required

            Original Amount

          • base_original_amount number Required

            Base Original Amount

        • rule_label string Required

          Rule Label

        • rule_i_d integer Required

          Rule ID

      • gift_registry_id integer
      • pickup_location_code string
    • custom_attributes array[object]

      Custom attributes values.

      Hide custom_attributes attributes Show custom_attributes attributes object

      Interface for custom attribute value.

      • attribute_code string Required

        Attribute code

      • value string Required

        Attribute value

Body

  • address object Required

    Interface AddressInterface

    Hide address attributes Show address attributes object
    • id integer

      Id

    • region string Required

      Region name

    • region_id integer Required

      Region id

    • region_code string Required

      Region code

    • country_id string Required

      Country id

    • street array[string] Required

      Street

    • company string

      Company

    • telephone string Required

      Telephone number

    • fax string

      Fax number

    • postcode string Required

      Postcode

    • city string Required

      City name

    • firstname string Required

      First name

    • lastname string Required

      Last name

    • middlename string

      Middle name

    • prefix string

      Prefix

    • suffix string

      Suffix

    • vat_id string

      Vat id

    • customer_id integer

      Customer id

    • email string Required

      Billing/shipping email

    • same_as_billing integer

      Same as billing flag

    • customer_address_id integer

      Customer address id

    • save_in_address_book integer

      Save in address book flag

    • extension_attributes object

      ExtensionInterface class for @see \Magento\Quote\Api\Data\AddressInterface

      Hide extension_attributes attributes Show extension_attributes attributes object
      • discounts array[object]
        Hide discounts attributes Show discounts attributes object

        Rule discount Interface

        • discount_data object Required

          Discount Data Interface

          Hide discount_data attributes Show discount_data attributes object
          • amount number Required

            Amount

          • base_amount number Required

            Base Amount

          • original_amount number Required

            Original Amount

          • base_original_amount number Required

            Base Original Amount

        • rule_label string Required

          Rule Label

        • rule_i_d integer Required

          Rule ID

      • gift_registry_id integer
      • pickup_location_code string
    • custom_attributes array[object]

      Custom attributes values.

      Hide custom_attributes attributes Show custom_attributes attributes object

      Interface for custom attribute value.

      • attribute_code string Required

        Attribute code

      • value string Required

        Attribute value

Responses

  • 200 Success.

    Hide response attributes Show response attributes object
    • carrier_code string Required

      Shipping carrier code.

    • method_code string Required

      Shipping method code.

    • carrier_title string

      Shipping carrier title. Otherwise, null.

    • method_title string

      Shipping method title. Otherwise, null.

    • amount number Required

      Shipping amount in store currency.

    • base_amount number Required

      Shipping amount in base currency.

    • available boolean Required

      The value of the availability flag for the current shipping method.

    • extension_attributes object

      ExtensionInterface class for @see \Magento\Quote\Api\Data\ShippingMethodInterface

      Hide extension_attributes attributes Show extension_attributes attributes object
      • carrier_codes array[object]
        Hide carrier_codes attributes Show carrier_codes attributes object
        • code string Required
        • name string Required
      • delivery_window_dates array[object]
        Hide delivery_window_dates attributes Show delivery_window_dates attributes object
        • carrier_code string Required
        • from string Required
        • to string Required
        • method_title string Required
        • expires string Required
      • is_pickup_point boolean
      • pickup_point object
        Hide pickup_point attributes Show pickup_point attributes object
        • pick_up_point_id string Required
        • carrier_method string Required
        • name string
        • address_lines array[string] Required
        • city string Required
        • state string
        • country string Required
        • postal string Required
        • telephone string
        • fax string
    • error_message string Required

      Shipping Error message.

    • price_excl_tax number Required

      Shipping price excl tax.

    • price_incl_tax number Required

      Shipping price incl tax.

    Hide response attributes Show response attributes object
    • carrier_code string Required

      Shipping carrier code.

    • method_code string Required

      Shipping method code.

    • carrier_title string

      Shipping carrier title. Otherwise, null.

    • method_title string

      Shipping method title. Otherwise, null.

    • amount number Required

      Shipping amount in store currency.

    • base_amount number Required

      Shipping amount in base currency.

    • available boolean Required

      The value of the availability flag for the current shipping method.

    • extension_attributes object

      ExtensionInterface class for @see \Magento\Quote\Api\Data\ShippingMethodInterface

      Hide extension_attributes attributes Show extension_attributes attributes object
      • carrier_codes array[object]
        Hide carrier_codes attributes Show carrier_codes attributes object
        • code string Required
        • name string Required
      • delivery_window_dates array[object]
        Hide delivery_window_dates attributes Show delivery_window_dates attributes object
        • carrier_code string Required
        • from string Required
        • to string Required
        • method_title string Required
        • expires string Required
      • is_pickup_point boolean
      • pickup_point object
        Hide pickup_point attributes Show pickup_point attributes object
        • pick_up_point_id string Required
        • carrier_method string Required
        • name string
        • address_lines array[string] Required
        • city string Required
        • state string
        • country string Required
        • postal string Required
        • telephone string
        • fax string
    • error_message string Required

      Shipping Error message.

    • price_excl_tax number Required

      Shipping price excl tax.

    • price_incl_tax number Required

      Shipping price incl tax.

  • 400 Bad Request

    Hide response attributes Show response attributes object
    • message string Required

      Error message

    • errors array[object]

      Errors list

      Hide errors attributes Show errors attributes object

      Error details

      • message string

        Error message

      • parameters array[object]

        Error parameters list

        Hide parameters attributes Show parameters attributes object

        Error parameters item

        • resources string

          ACL resource

        • fieldName string

          Missing or invalid field name

        • fieldValue string

          Incorrect field value

    • code integer

      Error code

    • parameters array[object]

      Error parameters list

      Hide parameters attributes Show parameters attributes object

      Error parameters item

      • resources string

        ACL resource

      • fieldName string

        Missing or invalid field name

      • fieldValue string

        Incorrect field value

    • trace string

      Stack trace

    Hide response attributes Show response attributes object
    • message string Required

      Error message

    • errors array[object]

      Errors list

      Hide errors attributes Show errors attributes object

      Error details

      • message string

        Error message

      • parameters array[object]

        Error parameters list

        Hide parameters attributes Show parameters attributes object

        Error parameters item

        • resources string

          ACL resource

        • fieldName string

          Missing or invalid field name

        • fieldValue string

          Incorrect field value

    • code integer

      Error code

    • parameters array[object]

      Error parameters list

      Hide parameters attributes Show parameters attributes object

      Error parameters item

      • resources string

        ACL resource

      • fieldName string

        Missing or invalid field name

      • fieldValue string

        Incorrect field value

    • trace string

      Stack trace

  • Unexpected error

    Hide response attributes Show response attributes object
    • message string Required

      Error message

    • errors array[object]

      Errors list

      Hide errors attributes Show errors attributes object

      Error details

      • message string

        Error message

      • parameters array[object]

        Error parameters list

        Hide parameters attributes Show parameters attributes object

        Error parameters item

        • resources string

          ACL resource

        • fieldName string

          Missing or invalid field name

        • fieldValue string

          Incorrect field value

    • code integer

      Error code

    • parameters array[object]

      Error parameters list

      Hide parameters attributes Show parameters attributes object

      Error parameters item

      • resources string

        ACL resource

      • fieldName string

        Missing or invalid field name

      • fieldValue string

        Incorrect field value

    • trace string

      Stack trace

    Hide response attributes Show response attributes object
    • message string Required

      Error message

    • errors array[object]

      Errors list

      Hide errors attributes Show errors attributes object

      Error details

      • message string

        Error message

      • parameters array[object]

        Error parameters list

        Hide parameters attributes Show parameters attributes object

        Error parameters item

        • resources string

          ACL resource

        • fieldName string

          Missing or invalid field name

        • fieldValue string

          Incorrect field value

    • code integer

      Error code

    • parameters array[object]

      Error parameters list

      Hide parameters attributes Show parameters attributes object

      Error parameters item

      • resources string

        ACL resource

      • fieldName string

        Missing or invalid field name

      • fieldValue string

        Incorrect field value

    • trace string

      Stack trace

POST /V1/guest-carts/{cartId}/estimate-shipping-methods
curl \
 --request POST 'https://magento2.winkelstraat.mac/rest/all/V1/guest-carts/{cartId}/estimate-shipping-methods' \
 --header "Content-Type: application/json" \
 --data '{"address":{"id":42,"region":"string","region_id":42,"region_code":"string","country_id":"string","street":["string"],"company":"string","telephone":"string","fax":"string","postcode":"string","city":"string","firstname":"string","lastname":"string","middlename":"string","prefix":"string","suffix":"string","vat_id":"string","customer_id":42,"email":"string","same_as_billing":42,"customer_address_id":42,"save_in_address_book":42,"extension_attributes":{"discounts":[{"discount_data":{"amount":42.0,"base_amount":42.0,"original_amount":42.0,"base_original_amount":42.0},"rule_label":"string","rule_i_d":42}],"gift_registry_id":42,"pickup_location_code":"string"},"custom_attributes":[{"attribute_code":"string","value":"string"}]}}'
curl \
 --request POST 'https://magento2.winkelstraat.mac/rest/all/V1/guest-carts/{cartId}/estimate-shipping-methods' \
 --header "Content-Type: application/xml"
Request examples
{
  "address": {
    "id": 42,
    "region": "string",
    "region_id": 42,
    "region_code": "string",
    "country_id": "string",
    "street": [
      "string"
    ],
    "company": "string",
    "telephone": "string",
    "fax": "string",
    "postcode": "string",
    "city": "string",
    "firstname": "string",
    "lastname": "string",
    "middlename": "string",
    "prefix": "string",
    "suffix": "string",
    "vat_id": "string",
    "customer_id": 42,
    "email": "string",
    "same_as_billing": 42,
    "customer_address_id": 42,
    "save_in_address_book": 42,
    "extension_attributes": {
      "discounts": [
        {
          "discount_data": {
            "amount": 42.0,
            "base_amount": 42.0,
            "original_amount": 42.0,
            "base_original_amount": 42.0
          },
          "rule_label": "string",
          "rule_i_d": 42
        }
      ],
      "gift_registry_id": 42,
      "pickup_location_code": "string"
    },
    "custom_attributes": [
      {
        "attribute_code": "string",
        "value": "string"
      }
    ]
  }
}
Request examples
<?xml version="1.0" encoding="UTF-8"?>
<root>
  <address>
    <id type="integer">42</id>
    <region>string</region>
    <region-id type="integer">42</region-id>
    <region-code>string</region-code>
    <country-id>string</country-id>
    <street type="array">
      <street>string</street>
    </street>
    <company>string</company>
    <telephone>string</telephone>
    <fax>string</fax>
    <postcode>string</postcode>
    <city>string</city>
    <firstname>string</firstname>
    <lastname>string</lastname>
    <middlename>string</middlename>
    <prefix>string</prefix>
    <suffix>string</suffix>
    <vat-id>string</vat-id>
    <customer-id type="integer">42</customer-id>
    <email>string</email>
    <same-as-billing type="integer">42</same-as-billing>
    <customer-address-id type="integer">42</customer-address-id>
    <save-in-address-book type="integer">42</save-in-address-book>
    <extension-attributes>
      <discounts type="array">
        <discount>
          <discount-data>
            <amount type="float">42.0</amount>
            <base-amount type="float">42.0</base-amount>
            <original-amount type="float">42.0</original-amount>
            <base-original-amount type="float">42.0</base-original-amount>
          </discount-data>
          <rule-label>string</rule-label>
          <rule-i-d type="integer">42</rule-i-d>
        </discount>
      </discounts>
      <gift-registry-id type="integer">42</gift-registry-id>
      <pickup-location-code>string</pickup-location-code>
    </extension-attributes>
    <custom-attributes type="array">
      <custom-attribute>
        <attribute-code>string</attribute-code>
        <value>string</value>
      </custom-attribute>
    </custom-attributes>
  </address>
</root>
Response examples (200)
[
  {
    "carrier_code": "string",
    "method_code": "string",
    "carrier_title": "string",
    "method_title": "string",
    "amount": 42.0,
    "base_amount": 42.0,
    "available": true,
    "extension_attributes": {
      "carrier_codes": [
        {
          "code": "string",
          "name": "string"
        }
      ],
      "delivery_window_dates": [
        {
          "carrier_code": "string",
          "from": "string",
          "to": "string",
          "method_title": "string",
          "expires": "string"
        }
      ],
      "is_pickup_point": true,
      "pickup_point": {
        "pick_up_point_id": "string",
        "carrier_method": "string",
        "name": "string",
        "address_lines": [
          "string"
        ],
        "city": "string",
        "state": "string",
        "country": "string",
        "postal": "string",
        "telephone": "string",
        "fax": "string"
      }
    },
    "error_message": "string",
    "price_excl_tax": 42.0,
    "price_incl_tax": 42.0
  }
]
Response examples (200)
<?xml version="1.0" encoding="UTF-8"?>
<root type="array">
  <root>
    <carrier-code>string</carrier-code>
    <method-code>string</method-code>
    <carrier-title>string</carrier-title>
    <method-title>string</method-title>
    <amount type="float">42.0</amount>
    <base-amount type="float">42.0</base-amount>
    <available type="boolean">true</available>
    <extension-attributes>
      <carrier-codes type="array">
        <carrier-code>
          <code>string</code>
          <name>string</name>
        </carrier-code>
      </carrier-codes>
      <delivery-window-dates type="array">
        <delivery-window-date>
          <carrier-code>string</carrier-code>
          <from>string</from>
          <to>string</to>
          <method-title>string</method-title>
          <expires>string</expires>
        </delivery-window-date>
      </delivery-window-dates>
      <is-pickup-point type="boolean">true</is-pickup-point>
      <pickup-point>
        <pick-up-point-id>string</pick-up-point-id>
        <carrier-method>string</carrier-method>
        <name>string</name>
        <address-lines type="array">
          <address-line>string</address-line>
        </address-lines>
        <city>string</city>
        <state>string</state>
        <country>string</country>
        <postal>string</postal>
        <telephone>string</telephone>
        <fax>string</fax>
      </pickup-point>
    </extension-attributes>
    <error-message>string</error-message>
    <price-excl-tax type="float">42.0</price-excl-tax>
    <price-incl-tax type="float">42.0</price-incl-tax>
  </root>
</root>
Response examples (400)
{
  "message": "string",
  "errors": [
    {
      "message": "string",
      "parameters": [
        {
          "resources": "string",
          "fieldName": "string",
          "fieldValue": "string"
        }
      ]
    }
  ],
  "code": 42,
  "parameters": [
    {
      "resources": "string",
      "fieldName": "string",
      "fieldValue": "string"
    }
  ],
  "trace": "string"
}
Response examples (400)
<?xml version="1.0" encoding="UTF-8"?>
<root>
  <message>string</message>
  <errors type="array">
    <error>
      <message>string</message>
      <parameters type="array">
        <parameter>
          <resources>string</resources>
          <fieldName>string</fieldName>
          <fieldValue>string</fieldValue>
        </parameter>
      </parameters>
    </error>
  </errors>
  <code type="integer">42</code>
  <parameters type="array">
    <parameter>
      <resources>string</resources>
      <fieldName>string</fieldName>
      <fieldValue>string</fieldValue>
    </parameter>
  </parameters>
  <trace>string</trace>
</root>
Response examples (default)
{
  "message": "string",
  "errors": [
    {
      "message": "string",
      "parameters": [
        {
          "resources": "string",
          "fieldName": "string",
          "fieldValue": "string"
        }
      ]
    }
  ],
  "code": 42,
  "parameters": [
    {
      "resources": "string",
      "fieldName": "string",
      "fieldValue": "string"
    }
  ],
  "trace": "string"
}
Response examples (default)
<?xml version="1.0" encoding="UTF-8"?>
<root>
  <message>string</message>
  <errors type="array">
    <error>
      <message>string</message>
      <parameters type="array">
        <parameter>
          <resources>string</resources>
          <fieldName>string</fieldName>
          <fieldValue>string</fieldValue>
        </parameter>
      </parameters>
    </error>
  </errors>
  <code type="integer">42</code>
  <parameters type="array">
    <parameter>
      <resources>string</resources>
      <fieldName>string</fieldName>
      <fieldValue>string</fieldValue>
    </parameter>
  </parameters>
  <trace>string</trace>
</root>