medusajs / medusa

The world's most flexible commerce platform.
https://medusajs.com
MIT License
25.93k stars 2.6k forks source link

Issue in Medusa V2 Learning Resources - Unit Price cannot be added during Cart Creation but document says so #8776

Closed sidd-kulk closed 2 months ago

sidd-kulk commented 2 months ago

What Medusa version and documentation are you using?

v2

Preliminary Checks

Issue Summary

In the V2 documentation mentioned below: https://docs.medusajs.com/v2/resources/commerce-modules/cart https://docs.medusajs.com/v2/api/store#carts_postcarts

It shows that Cart accepts Unit Price for an item, but as per discussion with team, it does not. The documentation needs to be updated.

How can this issue be resolved?

  1. Access the documentation as mentioned in the summary above.
  2. Access the cart payload
  3. It shows Unit Price under items node.

Are you interested in working on this issue?

shahednasser commented 2 months ago

Thank you for opening this issue @sidd-kulk ! I've opened the PR #8820 to fix the request type of the API route, which will fix the API reference once the OpenAPI Specs are generated.

Regarding the example in https://docs.medusajs.com/v2/resources/commerce-modules/cart, I've checked with the team, and providing the unit_price is accepted for the module's main service method. so, no changes will be made there.

sidd-kulk commented 2 months ago

Thanks for your response. Does this mean that we can pass unit_price to override the price in price domain in Medusa 2.0?

shahednasser commented 2 months ago

Not in the API route provided by Medusa.