Open dupuisbenjamin opened 1 month ago
@dupuisbenjamin, the error message describes the issue quite well, and, at first glance, this is expected behavior. Your sales channel (the default one) is not associated with any stock location and can, therefore, not be used to fulfill orders.
Have you tried to configure a stock location for the sales channel? You do that in Settings > Locations & Shipping in the admin dashboard.
@olivermrbl, thank you for your answer.
I succeed in associating a stock_location to a sales_channel through both the Admin dashboard and API! However, I still have the same error while trying to create a draft-order:
{
"type": "invalid_data",
"message": "Sales channel sc_01J9NWRZSRXF469CB7ZH95Y95V is not associated with any stock location."
}
My products have their field "sales_channels" with the right sales_channels_id.
@dupuisbenjamin can you please check what's inside the sales_channel_stock_location
table in your DB?
@sradevski Hi, here is the sales_channel_stock_location
table in my DB.
I have noticed that the error doesn't occur when I create a draft order without items. However, my goal is to create the draft order with items, and by trying to do so the error still occurs.
I made sure the variant_id
of the item in my draft order corresponded to a variant where its product has the same sales_channel linked to a stock_location (in this case I am putting sc_01J9NWRZSRXF469CB7ZH95Y95V
for the sales_channel id of my products).
Bug report
Describe the bug
Hi,
When creating a Draft Order with the API, it is impossible to create it. My request input is the following:
Which gives the error, "Sales channel sc_01J9NWRZSRXF469CB7ZH95Y95V is not associated with any stock location." (where
sc_01J9NWRZSRXF469CB7ZH95Y95V
is the default Medusa sales channel)The fields in the request body are optional in the API documentation but some are still required once called.
System information
Medusa version (including plugins): v2.0.1 Node.js version: v20.17.0 Database: Postgres v10.4 Operating system: Windows 11
Steps to reproduce the behavior
{MEDUSA_SERVER}/admin/draft-orders
{ "type": "invalid_data", "message": "Sales channel sc_01J9NWRZSRXF469CB7ZH95Y95V is not associated with any stock location." }