Skip to content

POST /rest/V1/carts/1/items #2782

Closed
Closed
@pborges

Description

@pborges

Posting

{
    "cartItem": {
        "itemId":1,
        "qty": 1
    }
}

to

/rest/V1/carts/1/items

results in

{
  "message": "No such entity with %fieldName = %fieldValue",
  "parameters": {
    "fieldName": "cartId",
    "fieldValue": null
  }
}

and sending

{
    "cartItem": {
        "itemId":1,
        "cartId":1,
        "qty": 1
    }
}

results in

{
  "message": "Internal Error. Details are available in Magento log file. Report ID: webapi-5678ac6216cf5"
}

log excerpt

[2015-12-22 01:50:26] main.CRITICAL: exception 'LogicException' with message 'Report ID: webapi-5678ac6216cf5; Message: Property "CartId" does not have corresponding setter in class "Magento\Quote\Api\Data\CartItemInterface".' in /var/www/magento2/lib/internal/Magento/Framework/Webapi/ErrorProcessor.php:194
Stack trace:
#0 /var/www/magento2/lib/internal/Magento/Framework/Webapi/ErrorProcessor.php(139): Magento\Framework\Webapi\ErrorProcessor->_critical(Object(LogicException))
#1 /var/www/magento2/app/code/Magento/Webapi/Controller/Rest.php(163): Magento\Framework\Webapi\ErrorProcessor->maskException(Object(LogicException))
#2 /var/www/magento2/var/generation/Magento/Webapi/Controller/Rest/Interceptor.php(24): Magento\Webapi\Controller\Rest->dispatch(Object(Magento\Framework\App\Request\Http))
#3 /var/www/magento2/lib/internal/Magento/Framework/App/Http.php(115): Magento\Webapi\Controller\Rest\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#4 /var/www/magento2/lib/internal/Magento/Framework/App/Bootstrap.php(258): Magento\Framework\App\Http->launch()
#5 /var/www/magento2/index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))
#6 {main} [] []

Sending the following works as expected

{
    "cartItem": {
        "itemId":1,
        "quoteId":1,
        "qty": 1
    }
}
``

Metadata

Metadata

Assignees

Labels

Issue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentbug report

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions