Skip to content

GET /V1/carts/mine/items is returning "cartId is a required field" #1443

@sauberia

Description

@sauberia

The webapi.xml for Quote specifies the getList method but I believe this should be getListForCustomer instead.

    <route url="/V1/carts/mine/items" method="GET">
        <service class="Magento\Quote\Api\CartItemRepositoryInterface" method="getList"/>
        <resources>
            <resource ref="self" />
        </resources>
        <data>
            <parameter name="customerId" force="true">%customer_id%</parameter>
        </data>
    </route>

Likewise, PUT /V1/carts/mine/items/:itemId should use saveForCustomer and DELETE /V1/carts/mine/items/:itemId should use deleteByIdForCustomer.


Here is a ruby hash of the the request and response:

{
            :method => :get,
              :body => "{\"message\":\"%fieldName is a required field.\",\"parameters\":{\"fieldName\":\"cartId\"}}",
               :url => #<URI::HTTP http://localhost/magento2/rest/V1/carts/mine/items>,
           :request => {
    :params_encoder => nil,
             :proxy => nil,
              :bind => nil,
           :timeout => nil,
      :open_timeout => nil,
          :boundary => nil,
             :oauth => nil
  },
   :request_headers => {
       "User-Agent" => "Faraday v0.9.1",
    "Authorization" => "Bearer e9txps1sw6mrv1qf48ihrrx9rtku3uj2",
     "Content-Type" => "application/json"
  },
               :ssl => {
          :verify => nil,
         :ca_file => nil,
         :ca_path => nil,
     :verify_mode => nil,
      :cert_store => nil,
     :client_cert => nil,
      :client_key => nil,
     :certificate => nil,
     :private_key => nil,
    :verify_depth => nil,
         :version => nil
  },
  :response_headers => {
              "date" => "Sun, 05 Jul 2015 16:31:00 GMT",
            "server" => "Apache/2.2.26 (Unix) DAV/2 PHP/5.6.10 mod_ssl/2.2.26 OpenSSL/0.9.8za",
      "x-powered-by" => "PHP/5.6.10",
        "set-cookie" => "PHPSESSID=ou53q01g0kvemeq6dm1ho2r7b0; expires=Sun, 05-Jul-2015 17:31:01 GMT; Max-Age=3600; path=/magento2; domain=localhost; HttpOnly",
           "expires" => "Thu, 19 Nov 1981 08:52:00 GMT",
     "cache-control" => "no-store, no-cache, must-revalidate, post-check=0, pre-check=0",
            "pragma" => "no-cache",
    "content-length" => "81",
        "connection" => "close",
      "content-type" => "application/json; charset=utf-8"
  },
            :status => 400
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions