Closed VrajPatelK closed 4 weeks ago
v2
In the Medusa documentation, the current curl example for creating a product via the Admin API is missing the options field, which is required for the product. This results in an error when attempting to create a product.
curl
options
curl -X POST 'http://localhost:9000/admin/products' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer {token}' \ --data '{ "title": "Product 1", "additional_data": { "brand_id": "01J7AX9ES4X113HKY6C681KDZ2J" } }'
curl -X POST 'http://localhost:9000/admin/products' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer {your_token}' \ -d '{ "title": "Product 1", "options": [ { "title": "Default option", "values": ["Default option value"] } ], "additional_data": { "brand_id": "01J7AX9ES4X113HKY6C681KDZ2J" } }'
This missing field leads to the following error:
{ "type": "invalid_data", "message": "Product options are not provided for: [Product 1]." }
Update the documentation with the correct curl example, including the options field:
Thanks for submitting this issue @VrajPatelK ! This is due to a new update that requires an option to be passed.
Will open a PR to fix it
What Medusa version and documentation are you using?
v2
Preliminary Checks
Issue Summary
In the Medusa documentation, the current
curl
example for creating a product via the Admin API is missing theoptions
field, which is required for the product. This results in an error when attempting to create a product.Current Example:
Expected Example:
This missing field leads to the following error:
Code Example:
Steps to Reproduce:
How can this issue be resolved?
Resolution Suggestion:
Update the documentation with the correct
curl
example, including theoptions
field:Are you interested in working on this issue?