diff --git a/docs/api/admin.oas.json b/docs/api/admin.oas.json index bc9b8d85b7..9d2ae8e874 100644 --- a/docs/api/admin.oas.json +++ b/docs/api/admin.oas.json @@ -5791,8 +5791,8 @@ "/admin/inventory-items": { "get": { "operationId": "GetInventoryItems", - "summary": "List inventory items.", - "description": "Lists inventory items.", + "summary": "List Inventory Items", + "description": "Lists inventory items with the ability to apply filters or search queries on them.", "x-authenticated": true, "parameters": [ { @@ -5947,12 +5947,12 @@ { "lang": "JavaScript", "label": "JS Client", - "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.inventoryItems.list()\n.then(({ inventory_items }) => {\n console.log(inventory_items.length);\n});\n" + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.inventoryItems.list()\n.then(({ inventory_items, count, offset, limit }) => {\n console.log(inventory_items.length);\n});\n" }, { "lang": "Shell", "label": "cURL", - "source": "curl --location --request GET 'https://medusa-url.com/admin/inventory-items' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json'\n" + "source": "curl --location --request GET 'https://medusa-url.com/admin/inventory-items' \\\n--header 'Authorization: Bearer {api_token}'\n" } ], "security": [ @@ -5999,7 +5999,7 @@ }, "post": { "operationId": "PostInventoryItems", - "summary": "Create an Inventory Item.", + "summary": "Create an Inventory Item", "description": "Creates an Inventory Item.", "x-authenticated": true, "parameters": [ @@ -6037,12 +6037,12 @@ { "lang": "JavaScript", "label": "JS Client", - "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.inventoryItems.create(inventoryItemId, {\n variant_id: 'variant_123',\n sku: \"sku-123\",\n})\n.then(({ inventory_item }) => {\n console.log(inventory_item.id);\n});\n" + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.inventoryItems.create({\n variant_id: 'variant_123',\n})\n.then(({ inventory_item }) => {\n console.log(inventory_item.id);\n});\n" }, { "lang": "Shell", "label": "cURL", - "source": "curl --location --request POST 'https://medusa-url.com/admin/inventory-items' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"variant_id\": \"variant_123\",\n \"sku\": \"sku-123\",\n}'\n" + "source": "curl --location --request POST 'https://medusa-url.com/admin/inventory-items' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"variant_id\": \"variant_123\",\n}'\n" } ], "security": [ @@ -6091,8 +6091,8 @@ "/admin/inventory-items/{id}": { "get": { "operationId": "GetInventoryItemsInventoryItem", - "summary": "Retrive an Inventory Item.", - "description": "Retrives an Inventory Item.", + "summary": "Get an Inventory Item", + "description": "Retrieves an Inventory Item.", "x-authenticated": true, "parameters": [ { @@ -6134,7 +6134,7 @@ { "lang": "Shell", "label": "cURL", - "source": "curl --location --request GET 'https://medusa-url.com/admin/inventory-items/{id}' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json'\n" + "source": "curl --location --request GET 'https://medusa-url.com/admin/inventory-items/{id}' \\\n--header 'Authorization: Bearer {api_token}'\n" } ], "security": [ @@ -6181,7 +6181,7 @@ }, "post": { "operationId": "PostInventoryItemsInventoryItem", - "summary": "Update an Inventory Item.", + "summary": "Update an Inventory Item", "description": "Updates an Inventory Item.", "x-authenticated": true, "parameters": [ @@ -6340,8 +6340,8 @@ "/admin/inventory-items/{id}/location-levels": { "get": { "operationId": "GetInventoryItemsInventoryItemLocationLevels", - "summary": "List stock levels of a given location.", - "description": "Lists stock levels of a given location.", + "summary": "List Inventory Levels", + "description": "Lists inventory levels of an inventory item.", "x-authenticated": true, "parameters": [ { @@ -6353,24 +6353,6 @@ "type": "string" } }, - { - "in": "query", - "name": "offset", - "description": "How many stock locations levels to skip in the result.", - "schema": { - "type": "integer", - "default": 0 - } - }, - { - "in": "query", - "name": "limit", - "description": "Limit the number of stock locations levels returned.", - "schema": { - "type": "integer", - "default": 20 - } - }, { "in": "query", "name": "expand", @@ -6401,7 +6383,7 @@ { "lang": "Shell", "label": "cURL", - "source": "curl --location --request GET 'https://medusa-url.com/admin/inventory-items/{id}/location-levels' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json'\n" + "source": "curl --location --request GET 'https://medusa-url.com/admin/inventory-items/{id}/location-levels' \\\n--header 'Authorization: Bearer {api_token}'\n" } ], "security": [ @@ -6448,8 +6430,8 @@ }, "post": { "operationId": "PostInventoryItemsInventoryItemLocationLevels", - "summary": "Create an Inventory Location Level for a given Inventory Item.", - "description": "Creates an Inventory Location Level for a given Inventory Item.", + "summary": "Create an Inventory Level", + "description": "Creates an Inventory Level for a given Inventory Item.", "x-authenticated": true, "parameters": [ { @@ -6495,12 +6477,12 @@ { "lang": "JavaScript", "label": "JS Client", - "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.inventoryItems.createLocationLevel(inventoryItemId, {\n location_id: 'sloc',\n stocked_quantity: 10,\n})\n.then(({ inventory_item }) => {\n console.log(inventory_item.id);\n});\n" + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.inventoryItems.createLocationLevel(inventoryItemId, {\n location_id: 'sloc_123',\n stocked_quantity: 10,\n})\n.then(({ inventory_item }) => {\n console.log(inventory_item.id);\n});\n" }, { "lang": "Shell", "label": "cURL", - "source": "curl --location --request POST 'https://medusa-url.com/admin/inventory-items/{id}/location-levels' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"location_id\": \"sloc\",\n \"stocked_quantity\": 10\n}'\n" + "source": "curl --location --request POST 'https://medusa-url.com/admin/inventory-items/{id}/location-levels' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"location_id\": \"sloc_123\",\n \"stocked_quantity\": 10\n}'\n" } ], "security": [ @@ -6549,8 +6531,8 @@ "/admin/inventory-items/{id}/location-levels/{location_id}": { "post": { "operationId": "PostInventoryItemsInventoryItemLocationLevelsLocationLevel", - "summary": "Update an Inventory Location Level for a given Inventory Item.", - "description": "Updates an Inventory Location Level for a given Inventory Item.", + "summary": "Update an Inventory Level", + "description": "Updates an Inventory Level for a given Inventory Item.", "x-authenticated": true, "parameters": [ { @@ -6657,7 +6639,7 @@ }, "delete": { "operationId": "DeleteInventoryItemsInventoryIteLocationLevelsLocation", - "summary": "Delete a location level of an Inventory Item.", + "summary": "Delete a Location Level", "description": "Delete a location level of an Inventory Item.", "x-authenticated": true, "parameters": [ @@ -6692,7 +6674,7 @@ { "lang": "Shell", "label": "cURL", - "source": "curl --location --request DELETE 'https://medusa-url.com/admin/inventory-items/{id}/location-levels/{location_id}' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json'\n" + "source": "curl --location --request DELETE 'https://medusa-url.com/admin/inventory-items/{id}/location-levels/{location_id}' \\\n--header 'Authorization: Bearer {api_token}'\n" } ], "security": [ @@ -10450,15 +10432,10 @@ } }, "x-codeSamples": [ - { - "lang": "JavaScript", - "label": "JS Client", - "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.orders.createReservation(order_id, line_item_id, {\n location_id\n})\n.then(({ reservation }) => {\n console.log(reservation.id);\n});\n" - }, { "lang": "Shell", "label": "cURL", - "source": "curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/line-items/{line_item_id}/reservations' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"location_id\": \"loc_1\"\n}'\n" + "source": "curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/line-items/{line_item_id}/reserve' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"location_id\": \"loc_1\"\n}'\n" } ], "security": [ @@ -10608,8 +10585,8 @@ "/admin/orders/{id}/reservations": { "get": { "operationId": "GetOrdersOrderReservations", - "summary": "Get reservations for an Order", - "description": "Retrieves reservations for an Order", + "summary": "Get reservations of an Order", + "description": "Retrieves reservations of an Order", "x-authenticated": true, "parameters": [ { @@ -10641,11 +10618,6 @@ } ], "x-codeSamples": [ - { - "lang": "JavaScript", - "label": "JS Client", - "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.orders.retrieveReservations(order_id)\n.then(({ reservations }) => {\n console.log(reservations[0].id);\n});\n" - }, { "lang": "Shell", "label": "cURL", @@ -13654,7 +13626,7 @@ { "lang": "JavaScript", "label": "JS Client", - "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.productCategories.retrieve(product_category_id)\n.then(({ product_category }) => {\n console.log(product_category.id);\n});\n" + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.productCategories.retrieve(productCategoryId)\n.then(({ product_category }) => {\n console.log(product_category.id);\n});\n" }, { "lang": "Shell", @@ -13753,7 +13725,7 @@ { "lang": "JavaScript", "label": "JS Client", - "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.productCategories.update(product_category_id, {\n name: \"Skinny Jeans\"\n})\n.then(({ product_category }) => {\n console.log(product_category.id);\n});\n" + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.productCategories.update(productCategoryId, {\n name: \"Skinny Jeans\"\n})\n.then(({ product_category }) => {\n console.log(product_category.id);\n});\n" }, { "lang": "Shell", @@ -13806,7 +13778,7 @@ "delete": { "operationId": "DeleteProductCategoriesCategory", "summary": "Delete a Product Category", - "description": "Deletes a ProductCategory.", + "description": "Deletes a Product Category.", "x-authenticated": true, "parameters": [ { @@ -13826,7 +13798,7 @@ { "lang": "JavaScript", "label": "JS Client", - "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.productCategories.delete(product_category_id)\n.then(({ id, object, deleted }) => {\n console.log(id);\n});\n" + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.productCategories.delete(productCategoryId)\n.then(({ id, object, deleted }) => {\n console.log(id);\n});\n" }, { "lang": "Shell", @@ -13880,7 +13852,7 @@ "/admin/product-categories/{id}/products/batch": { "post": { "operationId": "PostProductCategoriesCategoryProductsBatch", - "summary": "Add Products to a category", + "summary": "Add Products to a Category", "description": "Assign a batch of products to a product category.", "x-authenticated": true, "parameters": [ @@ -13927,12 +13899,12 @@ { "lang": "JavaScript", "label": "JS Client", - "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.productCategories.addProducts(product_category_id, {\n product_ids: [\n {\n id: product_id\n }\n ]\n})\n.then(({ product_category }) => {\n console.log(product_category.id);\n});\n" + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.productCategories.addProducts(productCategoryId, {\n product_ids: [\n {\n id: productId\n }\n ]\n})\n.then(({ product_category }) => {\n console.log(product_category.id);\n});\n" }, { "lang": "Shell", "label": "cURL", - "source": "curl --location \\\n--request POST 'https://medusa-url.com/admin/product-categories/{product_category_id}/products/batch' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"product_ids\": [\n {\n \"id\": \"{product_id}\"\n }\n ]\n}'\n" + "source": "curl --location \\\n--request POST 'https://medusa-url.com/admin/product-categories/{id}/products/batch' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"product_ids\": [\n {\n \"id\": \"{product_id}\"\n }\n ]\n}'\n" } ], "security": [ @@ -13979,7 +13951,7 @@ }, "delete": { "operationId": "DeleteProductCategoriesCategoryProductsBatch", - "summary": "Delete Products", + "summary": "Remove Products from Category", "description": "Remove a list of products from a product category.", "x-authenticated": true, "parameters": [ @@ -14026,7 +13998,7 @@ { "lang": "JavaScript", "label": "JS Client", - "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.productCategories.removeProducts(product_category_id, {\n product_ids: [\n {\n id: product_id\n }\n ]\n})\n.then(({ product_category }) => {\n console.log(product_category.id);\n});\n" + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.productCategories.removeProducts(productCategoryId, {\n product_ids: [\n {\n id: productId\n }\n ]\n})\n.then(({ product_category }) => {\n console.log(product_category.id);\n});\n" }, { "lang": "Shell", @@ -17808,6 +17780,11 @@ "queryParams": "AdminGetReservationsParams" }, "x-codeSamples": [ + { + "lang": "JavaScript", + "label": "JS Client", + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.reservations.list()\n.then(({ reservations, count, limit, offset }) => {\n console.log(reservations.length)\n})\n" + }, { "lang": "Shell", "label": "cURL", @@ -17858,8 +17835,8 @@ }, "post": { "operationId": "PostReservations", - "summary": "Creates a Reservation", - "description": "Creates a Reservation which can be associated with any resource as required.", + "summary": "Create a Reservation", + "description": "Create a Reservation which can be associated with any resource as required.", "x-authenticated": true, "requestBody": { "content": { @@ -17874,12 +17851,12 @@ { "lang": "JavaScript", "label": "JS Client", - "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.reservations.create({\n})\n.then(({ reservations }) => {\n console.log(reservations.id);\n});\n" + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.reservations.create({\n line_item_id: 'item_123',\n location_id: 'loc_123',\n inventory_item_id: 'iitem_123',\n quantity: 1\n})\n.then(({ reservation }) => {\n console.log(reservation.id);\n});\n" }, { "lang": "Shell", "label": "cURL", - "source": "curl --location --request POST 'https://medusa-url.com/admin/reservations' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"resource_id\": \"{resource_id}\",\n \"resource_type\": \"order\",\n \"value\": \"We delivered this order\"\n}'\n" + "source": "curl --location --request POST 'https://medusa-url.com/admin/reservations' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"line_item_id\": \"item_123\",\n \"location_id\": \"loc_123\",\n \"inventory_item_id\": \"iitem_123\",\n \"quantity\": 1\n}'\n" } ], "security": [ @@ -17929,7 +17906,7 @@ "get": { "operationId": "GetReservationsReservation", "summary": "Get a Reservation", - "description": "Retrieves a single reservation using its id", + "description": "Retrieves a single reservation using its ID", "x-authenticated": true, "parameters": [ { @@ -17946,7 +17923,7 @@ { "lang": "JavaScript", "label": "JS Client", - "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.reservations.retrieve(reservation_id)\n.then(({ reservation }) => {\n console.log(reservation.id);\n});\n" + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.reservations.retrieve(reservationId)\n.then(({ reservation }) => {\n console.log(reservation.id);\n});\n" }, { "lang": "Shell", @@ -17998,7 +17975,7 @@ }, "post": { "operationId": "PostReservationsReservation", - "summary": "Updates a Reservation", + "summary": "Update a Reservation", "description": "Updates a Reservation which can be associated with any resource as required.", "x-authenticated": true, "parameters": [ @@ -18025,7 +18002,7 @@ { "lang": "JavaScript", "label": "JS Client", - "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.reservations.update(reservation.id, {\n quantity: 3\n})\n.then(({ reservations }) => {\n console.log(reservations.id);\n});\n" + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.reservations.update(reservationId, {\n quantity: 3\n})\n.then(({ reservation }) => {\n console.log(reservation.id);\n});\n" }, { "lang": "Shell", @@ -18098,7 +18075,7 @@ { "lang": "JavaScript", "label": "JS Client", - "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.reservations.delete(reservation.id)\n.then(({ id, object, deleted }) => {\n console.log(id);\n});\n" + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.reservations.delete(reservationId)\n.then(({ id, object, deleted }) => {\n console.log(id);\n});\n" }, { "lang": "Shell", @@ -19456,8 +19433,8 @@ "/admin/sales-channels/{id}/stock-locations": { "post": { "operationId": "PostSalesChannelsSalesChannelStockLocation", - "summary": "Associate a stock location to a Sales Channel", - "description": "Associates a stock location to a Sales Channel.", + "summary": "Associate a Stock Location", + "description": "Associates a stock location with a Sales Channel.", "x-authenticated": true, "parameters": [ { @@ -19486,12 +19463,12 @@ { "lang": "JavaScript", "label": "JS Client", - "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.salesChannels.addLocation(sales_channel_id, {\n location_id: 'App'\n})\n.then(({ sales_channel }) => {\n console.log(sales_channel.id);\n});\n" + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.salesChannels.addLocation(salesChannelId, {\n location_id: 'loc_123'\n})\n.then(({ sales_channel }) => {\n console.log(sales_channel.id);\n});\n" }, { "lang": "Shell", "label": "cURL", - "source": "curl --location --request POST 'https://medusa-url.com/admin/sales-channels/{id}/stock-locations' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"locaton_id\": \"stock_location_id\"\n}'\n" + "source": "curl --location --request POST 'https://medusa-url.com/admin/sales-channels/{id}/stock-locations' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"locaton_id\": \"loc_123\"\n}'\n" } ], "security": [ @@ -19538,7 +19515,7 @@ }, "delete": { "operationId": "DeleteSalesChannelsSalesChannelStockLocation", - "summary": "Remove a stock location from a Sales Channel", + "summary": "Remove a Stock Location Association", "description": "Removes a stock location from a Sales Channel.", "x-authenticated": true, "parameters": [ @@ -19568,12 +19545,12 @@ { "lang": "JavaScript", "label": "JS Client", - "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.salesChannels.removeLocation(sales_channel_id, {\n location_id: 'App'\n})\n.then(({ sales_channel }) => {\n console.log(sales_channel.id);\n});\n" + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.salesChannels.removeLocation(salesChannelId, {\n location_id: 'loc_id'\n})\n.then(({ sales_channel }) => {\n console.log(sales_channel.id);\n});\n" }, { "lang": "Shell", "label": "cURL", - "source": "curl --location --request DELETE 'https://medusa-url.com/admin/sales-channels/{id}/stock-locations' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"locaton_id\": \"stock_location_id\"\n}'\n" + "source": "curl --location --request DELETE 'https://medusa-url.com/admin/sales-channels/{id}/stock-locations' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"locaton_id\": \"loc_id\"\n}'\n" } ], "security": [ @@ -20628,7 +20605,7 @@ { "lang": "JavaScript", "label": "JS Client", - "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.stockLocations.create({\n name: 'Main Warehouse',\n location_id: 'sloc'\n})\n.then(({ stock_location }) => {\n console.log(stock_location.id);\n});\n" + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.stockLocations.create({\n name: 'Main Warehouse',\n})\n.then(({ stock_location }) => {\n console.log(stock_location.id);\n});\n" }, { "lang": "Shell", @@ -20720,7 +20697,7 @@ { "lang": "JavaScript", "label": "JS Client", - "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.stockLocations.retrieve(stock_location_id)\n.then(({ stock_location }) => {\n console.log(stock_location.id);\n});\n" + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.stockLocations.retrieve(stockLocationId)\n.then(({ stock_location }) => {\n console.log(stock_location.id);\n});\n" }, { "lang": "Shell", @@ -20800,12 +20777,12 @@ { "lang": "JavaScript", "label": "JS Client", - "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.stockLocations.update(stock_location_id, {\n name: 'App'\n})\n.then(({ stock_location }) => {\n console.log(stock_location.id);\n});\n" + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.stockLocations.update(stockLocationId, {\n name: 'Main Warehouse'\n})\n.then(({ stock_location }) => {\n console.log(stock_location.id);\n});\n" }, { "lang": "Shell", "label": "cURL", - "source": "curl --location --request POST 'https://medusa-url.com/admin/stock-locations/{id}' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"name\": \"App\"\n}'\n" + "source": "curl --location --request POST 'https://medusa-url.com/admin/stock-locations/{id}' \\\n--header 'Authorization: Bearer {api_token}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"name\": \"Main Warehouse\"\n}'\n" } ], "security": [ @@ -20870,7 +20847,7 @@ { "lang": "JavaScript", "label": "JS Client", - "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.stockLocations.delete(stock_location_id)\n .then(({ id, object, deleted }) => {\n console.log(id)\n })\n" + "source": "import Medusa from \"@medusajs/medusa-js\"\nconst medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })\n// must be previously logged in or use api token\nmedusa.admin.stockLocations.delete(stock_location_id)\n.then(({ id, object, deleted }) => {\n console.log(id)\n})\n" }, { "lang": "Shell", diff --git a/docs/api/admin.oas.yaml b/docs/api/admin.oas.yaml index 415beed096..30b0fbd255 100644 --- a/docs/api/admin.oas.yaml +++ b/docs/api/admin.oas.yaml @@ -4574,8 +4574,8 @@ paths: /admin/inventory-items: get: operationId: GetInventoryItems - summary: List inventory items. - description: Lists inventory items. + summary: List Inventory Items + description: Lists inventory items with the ability to apply filters or search queries on them. x-authenticated: true parameters: - in: query @@ -4680,15 +4680,14 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token medusa.admin.inventoryItems.list() - .then(({ inventory_items }) => { + .then(({ inventory_items, count, offset, limit }) => { console.log(inventory_items.length); }); - lang: Shell label: cURL source: | curl --location --request GET 'https://medusa-url.com/admin/inventory-items' \ - --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' + --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] @@ -4715,7 +4714,7 @@ paths: $ref: '#/components/responses/500_error' post: operationId: PostInventoryItems - summary: Create an Inventory Item. + summary: Create an Inventory Item description: Creates an Inventory Item. x-authenticated: true parameters: @@ -4744,9 +4743,8 @@ paths: import Medusa from "@medusajs/medusa-js" const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.inventoryItems.create(inventoryItemId, { + medusa.admin.inventoryItems.create({ variant_id: 'variant_123', - sku: "sku-123", }) .then(({ inventory_item }) => { console.log(inventory_item.id); @@ -4759,7 +4757,6 @@ paths: --header 'Content-Type: application/json' \ --data-raw '{ "variant_id": "variant_123", - "sku": "sku-123", }' security: - api_token: [] @@ -4788,8 +4785,8 @@ paths: /admin/inventory-items/{id}: get: operationId: GetInventoryItemsInventoryItem - summary: Retrive an Inventory Item. - description: Retrives an Inventory Item. + summary: Get an Inventory Item + description: Retrieves an Inventory Item. x-authenticated: true parameters: - in: path @@ -4826,8 +4823,7 @@ paths: label: cURL source: | curl --location --request GET 'https://medusa-url.com/admin/inventory-items/{id}' \ - --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' + --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] @@ -4854,7 +4850,7 @@ paths: $ref: '#/components/responses/500_error' post: operationId: PostInventoryItemsInventoryItem - summary: Update an Inventory Item. + summary: Update an Inventory Item description: Updates an Inventory Item. x-authenticated: true parameters: @@ -4975,8 +4971,8 @@ paths: /admin/inventory-items/{id}/location-levels: get: operationId: GetInventoryItemsInventoryItemLocationLevels - summary: List stock levels of a given location. - description: Lists stock levels of a given location. + summary: List Inventory Levels + description: Lists inventory levels of an inventory item. x-authenticated: true parameters: - in: path @@ -4985,18 +4981,6 @@ paths: description: The ID of the Inventory Item. schema: type: string - - in: query - name: offset - description: How many stock locations levels to skip in the result. - schema: - type: integer - default: 0 - - in: query - name: limit - description: Limit the number of stock locations levels returned. - schema: - type: integer - default: 20 - in: query name: expand description: Comma separated list of relations to include in the results. @@ -5025,8 +5009,7 @@ paths: label: cURL source: | curl --location --request GET 'https://medusa-url.com/admin/inventory-items/{id}/location-levels' \ - --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' + --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] @@ -5053,8 +5036,8 @@ paths: $ref: '#/components/responses/500_error' post: operationId: PostInventoryItemsInventoryItemLocationLevels - summary: Create an Inventory Location Level for a given Inventory Item. - description: Creates an Inventory Location Level for a given Inventory Item. + summary: Create an Inventory Level + description: Creates an Inventory Level for a given Inventory Item. x-authenticated: true parameters: - in: path @@ -5089,7 +5072,7 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token medusa.admin.inventoryItems.createLocationLevel(inventoryItemId, { - location_id: 'sloc', + location_id: 'sloc_123', stocked_quantity: 10, }) .then(({ inventory_item }) => { @@ -5102,7 +5085,7 @@ paths: --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "location_id": "sloc", + "location_id": "sloc_123", "stocked_quantity": 10 }' security: @@ -5132,8 +5115,8 @@ paths: /admin/inventory-items/{id}/location-levels/{location_id}: post: operationId: PostInventoryItemsInventoryItemLocationLevelsLocationLevel - summary: Update an Inventory Location Level for a given Inventory Item. - description: Updates an Inventory Location Level for a given Inventory Item. + summary: Update an Inventory Level + description: Updates an Inventory Level for a given Inventory Item. x-authenticated: true parameters: - in: path @@ -5214,7 +5197,7 @@ paths: $ref: '#/components/responses/500_error' delete: operationId: DeleteInventoryItemsInventoryIteLocationLevelsLocation - summary: Delete a location level of an Inventory Item. + summary: Delete a Location Level description: Delete a location level of an Inventory Item. x-authenticated: true parameters: @@ -5247,8 +5230,7 @@ paths: label: cURL source: | curl --location --request DELETE 'https://medusa-url.com/admin/inventory-items/{id}/location-levels/{location_id}' \ - --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' + --header 'Authorization: Bearer {api_token}' security: - api_token: [] - cookie_auth: [] @@ -8055,22 +8037,10 @@ paths: schema: $ref: '#/components/schemas/AdminOrdersOrderLineItemReservationReq' x-codeSamples: - - lang: JavaScript - label: JS Client - source: | - import Medusa from "@medusajs/medusa-js" - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - // must be previously logged in or use api token - medusa.admin.orders.createReservation(order_id, line_item_id, { - location_id - }) - .then(({ reservation }) => { - console.log(reservation.id); - }); - lang: Shell label: cURL source: | - curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/line-items/{line_item_id}/reservations' \ + curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/line-items/{line_item_id}/reserve' \ --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ @@ -8182,8 +8152,8 @@ paths: /admin/orders/{id}/reservations: get: operationId: GetOrdersOrderReservations - summary: Get reservations for an Order - description: Retrieves reservations for an Order + summary: Get reservations of an Order + description: Retrieves reservations of an Order x-authenticated: true parameters: - in: path @@ -8205,16 +8175,6 @@ paths: type: integer default: 20 x-codeSamples: - - lang: JavaScript - label: JS Client - source: | - import Medusa from "@medusajs/medusa-js" - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - // must be previously logged in or use api token - medusa.admin.orders.retrieveReservations(order_id) - .then(({ reservations }) => { - console.log(reservations[0].id); - }); - lang: Shell label: cURL source: | @@ -10491,7 +10451,7 @@ paths: import Medusa from "@medusajs/medusa-js" const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.productCategories.retrieve(product_category_id) + medusa.admin.productCategories.retrieve(productCategoryId) .then(({ product_category }) => { console.log(product_category.id); }); @@ -10561,7 +10521,7 @@ paths: import Medusa from "@medusajs/medusa-js" const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.productCategories.update(product_category_id, { + medusa.admin.productCategories.update(productCategoryId, { name: "Skinny Jeans" }) .then(({ product_category }) => { @@ -10603,7 +10563,7 @@ paths: delete: operationId: DeleteProductCategoriesCategory summary: Delete a Product Category - description: Deletes a ProductCategory. + description: Deletes a Product Category. x-authenticated: true parameters: - in: path @@ -10621,7 +10581,7 @@ paths: import Medusa from "@medusajs/medusa-js" const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.productCategories.delete(product_category_id) + medusa.admin.productCategories.delete(productCategoryId) .then(({ id, object, deleted }) => { console.log(id); }); @@ -10657,7 +10617,7 @@ paths: /admin/product-categories/{id}/products/batch: post: operationId: PostProductCategoriesCategoryProductsBatch - summary: Add Products to a category + summary: Add Products to a Category description: Assign a batch of products to a product category. x-authenticated: true parameters: @@ -10692,10 +10652,10 @@ paths: import Medusa from "@medusajs/medusa-js" const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.productCategories.addProducts(product_category_id, { + medusa.admin.productCategories.addProducts(productCategoryId, { product_ids: [ { - id: product_id + id: productId } ] }) @@ -10706,7 +10666,7 @@ paths: label: cURL source: | curl --location \ - --request POST 'https://medusa-url.com/admin/product-categories/{product_category_id}/products/batch' \ + --request POST 'https://medusa-url.com/admin/product-categories/{id}/products/batch' \ --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ @@ -10742,7 +10702,7 @@ paths: $ref: '#/components/responses/500_error' delete: operationId: DeleteProductCategoriesCategoryProductsBatch - summary: Delete Products + summary: Remove Products from Category description: Remove a list of products from a product category. x-authenticated: true parameters: @@ -10777,10 +10737,10 @@ paths: import Medusa from "@medusajs/medusa-js" const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.productCategories.removeProducts(product_category_id, { + medusa.admin.productCategories.removeProducts(productCategoryId, { product_ids: [ { - id: product_id + id: productId } ] }) @@ -13684,6 +13644,16 @@ paths: method: list queryParams: AdminGetReservationsParams x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.reservations.list() + .then(({ reservations, count, limit, offset }) => { + console.log(reservations.length) + }) - lang: Shell label: cURL source: | @@ -13715,8 +13685,8 @@ paths: $ref: '#/components/responses/500_error' post: operationId: PostReservations - summary: Creates a Reservation - description: Creates a Reservation which can be associated with any resource as required. + summary: Create a Reservation + description: Create a Reservation which can be associated with any resource as required. x-authenticated: true requestBody: content: @@ -13731,9 +13701,13 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token medusa.admin.reservations.create({ + line_item_id: 'item_123', + location_id: 'loc_123', + inventory_item_id: 'iitem_123', + quantity: 1 }) - .then(({ reservations }) => { - console.log(reservations.id); + .then(({ reservation }) => { + console.log(reservation.id); }); - lang: Shell label: cURL @@ -13742,9 +13716,10 @@ paths: --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "resource_id": "{resource_id}", - "resource_type": "order", - "value": "We delivered this order" + "line_item_id": "item_123", + "location_id": "loc_123", + "inventory_item_id": "iitem_123", + "quantity": 1 }' security: - api_token: [] @@ -13774,7 +13749,7 @@ paths: get: operationId: GetReservationsReservation summary: Get a Reservation - description: Retrieves a single reservation using its id + description: Retrieves a single reservation using its ID x-authenticated: true parameters: - in: path @@ -13790,7 +13765,7 @@ paths: import Medusa from "@medusajs/medusa-js" const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.reservations.retrieve(reservation_id) + medusa.admin.reservations.retrieve(reservationId) .then(({ reservation }) => { console.log(reservation.id); }); @@ -13825,7 +13800,7 @@ paths: $ref: '#/components/responses/500_error' post: operationId: PostReservationsReservation - summary: Updates a Reservation + summary: Update a Reservation description: Updates a Reservation which can be associated with any resource as required. x-authenticated: true parameters: @@ -13847,11 +13822,11 @@ paths: import Medusa from "@medusajs/medusa-js" const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.reservations.update(reservation.id, { + medusa.admin.reservations.update(reservationId, { quantity: 3 }) - .then(({ reservations }) => { - console.log(reservations.id); + .then(({ reservation }) => { + console.log(reservation.id); }); - lang: Shell label: cURL @@ -13907,7 +13882,7 @@ paths: import Medusa from "@medusajs/medusa-js" const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.reservations.delete(reservation.id) + medusa.admin.reservations.delete(reservationId) .then(({ id, object, deleted }) => { console.log(id); }); @@ -14958,8 +14933,8 @@ paths: /admin/sales-channels/{id}/stock-locations: post: operationId: PostSalesChannelsSalesChannelStockLocation - summary: Associate a stock location to a Sales Channel - description: Associates a stock location to a Sales Channel. + summary: Associate a Stock Location + description: Associates a stock location with a Sales Channel. x-authenticated: true parameters: - in: path @@ -14982,8 +14957,8 @@ paths: import Medusa from "@medusajs/medusa-js" const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.salesChannels.addLocation(sales_channel_id, { - location_id: 'App' + medusa.admin.salesChannels.addLocation(salesChannelId, { + location_id: 'loc_123' }) .then(({ sales_channel }) => { console.log(sales_channel.id); @@ -14995,7 +14970,7 @@ paths: --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "locaton_id": "stock_location_id" + "locaton_id": "loc_123" }' security: - api_token: [] @@ -15023,7 +14998,7 @@ paths: $ref: '#/components/responses/500_error' delete: operationId: DeleteSalesChannelsSalesChannelStockLocation - summary: Remove a stock location from a Sales Channel + summary: Remove a Stock Location Association description: Removes a stock location from a Sales Channel. x-authenticated: true parameters: @@ -15047,8 +15022,8 @@ paths: import Medusa from "@medusajs/medusa-js" const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.salesChannels.removeLocation(sales_channel_id, { - location_id: 'App' + medusa.admin.salesChannels.removeLocation(salesChannelId, { + location_id: 'loc_id' }) .then(({ sales_channel }) => { console.log(sales_channel.id); @@ -15060,7 +15035,7 @@ paths: --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "locaton_id": "stock_location_id" + "locaton_id": "loc_id" }' security: - api_token: [] @@ -15868,7 +15843,6 @@ paths: // must be previously logged in or use api token medusa.admin.stockLocations.create({ name: 'Main Warehouse', - location_id: 'sloc' }) .then(({ stock_location }) => { console.log(stock_location.id); @@ -15939,7 +15913,7 @@ paths: import Medusa from "@medusajs/medusa-js" const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.stockLocations.retrieve(stock_location_id) + medusa.admin.stockLocations.retrieve(stockLocationId) .then(({ stock_location }) => { console.log(stock_location.id); }); @@ -15996,8 +15970,8 @@ paths: import Medusa from "@medusajs/medusa-js" const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.stockLocations.update(stock_location_id, { - name: 'App' + medusa.admin.stockLocations.update(stockLocationId, { + name: 'Main Warehouse' }) .then(({ stock_location }) => { console.log(stock_location.id); @@ -16009,7 +15983,7 @@ paths: --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "name": "App" + "name": "Main Warehouse" }' security: - api_token: [] @@ -16055,9 +16029,9 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token medusa.admin.stockLocations.delete(stock_location_id) - .then(({ id, object, deleted }) => { - console.log(id) - }) + .then(({ id, object, deleted }) => { + console.log(id) + }) - lang: Shell label: cURL source: | diff --git a/docs/api/admin/code_samples/JavaScript/admin_inventory-items/get.js b/docs/api/admin/code_samples/JavaScript/admin_inventory-items/get.js index d9b7ee9805..373f7a8ba5 100644 --- a/docs/api/admin/code_samples/JavaScript/admin_inventory-items/get.js +++ b/docs/api/admin/code_samples/JavaScript/admin_inventory-items/get.js @@ -2,6 +2,6 @@ import Medusa from "@medusajs/medusa-js" const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token medusa.admin.inventoryItems.list() -.then(({ inventory_items }) => { +.then(({ inventory_items, count, offset, limit }) => { console.log(inventory_items.length); }); diff --git a/docs/api/admin/code_samples/JavaScript/admin_inventory-items/post.js b/docs/api/admin/code_samples/JavaScript/admin_inventory-items/post.js index 9140b639da..8d669627e9 100644 --- a/docs/api/admin/code_samples/JavaScript/admin_inventory-items/post.js +++ b/docs/api/admin/code_samples/JavaScript/admin_inventory-items/post.js @@ -1,9 +1,8 @@ import Medusa from "@medusajs/medusa-js" const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token -medusa.admin.inventoryItems.create(inventoryItemId, { +medusa.admin.inventoryItems.create({ variant_id: 'variant_123', - sku: "sku-123", }) .then(({ inventory_item }) => { console.log(inventory_item.id); diff --git a/docs/api/admin/code_samples/JavaScript/admin_inventory-items_{id}_location-levels/post.js b/docs/api/admin/code_samples/JavaScript/admin_inventory-items_{id}_location-levels/post.js index 4767c9aa6c..d9f6a41693 100644 --- a/docs/api/admin/code_samples/JavaScript/admin_inventory-items_{id}_location-levels/post.js +++ b/docs/api/admin/code_samples/JavaScript/admin_inventory-items_{id}_location-levels/post.js @@ -2,7 +2,7 @@ import Medusa from "@medusajs/medusa-js" const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token medusa.admin.inventoryItems.createLocationLevel(inventoryItemId, { - location_id: 'sloc', + location_id: 'sloc_123', stocked_quantity: 10, }) .then(({ inventory_item }) => { diff --git a/docs/api/admin/code_samples/JavaScript/admin_orders_{id}_line-items_{line_item_id}_reserve/post.js b/docs/api/admin/code_samples/JavaScript/admin_orders_{id}_line-items_{line_item_id}_reserve/post.js deleted file mode 100644 index 4c75d1a71e..0000000000 --- a/docs/api/admin/code_samples/JavaScript/admin_orders_{id}_line-items_{line_item_id}_reserve/post.js +++ /dev/null @@ -1,9 +0,0 @@ -import Medusa from "@medusajs/medusa-js" -const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) -// must be previously logged in or use api token -medusa.admin.orders.createReservation(order_id, line_item_id, { - location_id -}) -.then(({ reservation }) => { - console.log(reservation.id); -}); diff --git a/docs/api/admin/code_samples/JavaScript/admin_product-categories_{id}/delete.js b/docs/api/admin/code_samples/JavaScript/admin_product-categories_{id}/delete.js index 3f79a9da46..0282324e2a 100644 --- a/docs/api/admin/code_samples/JavaScript/admin_product-categories_{id}/delete.js +++ b/docs/api/admin/code_samples/JavaScript/admin_product-categories_{id}/delete.js @@ -1,7 +1,7 @@ import Medusa from "@medusajs/medusa-js" const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token -medusa.admin.productCategories.delete(product_category_id) +medusa.admin.productCategories.delete(productCategoryId) .then(({ id, object, deleted }) => { console.log(id); }); diff --git a/docs/api/admin/code_samples/JavaScript/admin_product-categories_{id}/get.js b/docs/api/admin/code_samples/JavaScript/admin_product-categories_{id}/get.js index bc47b70712..85b6eef992 100644 --- a/docs/api/admin/code_samples/JavaScript/admin_product-categories_{id}/get.js +++ b/docs/api/admin/code_samples/JavaScript/admin_product-categories_{id}/get.js @@ -1,7 +1,7 @@ import Medusa from "@medusajs/medusa-js" const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token -medusa.admin.productCategories.retrieve(product_category_id) +medusa.admin.productCategories.retrieve(productCategoryId) .then(({ product_category }) => { console.log(product_category.id); }); diff --git a/docs/api/admin/code_samples/JavaScript/admin_product-categories_{id}/post.js b/docs/api/admin/code_samples/JavaScript/admin_product-categories_{id}/post.js index 29d4d9363f..96498da4ad 100644 --- a/docs/api/admin/code_samples/JavaScript/admin_product-categories_{id}/post.js +++ b/docs/api/admin/code_samples/JavaScript/admin_product-categories_{id}/post.js @@ -1,7 +1,7 @@ import Medusa from "@medusajs/medusa-js" const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token -medusa.admin.productCategories.update(product_category_id, { +medusa.admin.productCategories.update(productCategoryId, { name: "Skinny Jeans" }) .then(({ product_category }) => { diff --git a/docs/api/admin/code_samples/JavaScript/admin_product-categories_{id}_products_batch/delete.js b/docs/api/admin/code_samples/JavaScript/admin_product-categories_{id}_products_batch/delete.js index dc9b2d99f1..bd80d72094 100644 --- a/docs/api/admin/code_samples/JavaScript/admin_product-categories_{id}_products_batch/delete.js +++ b/docs/api/admin/code_samples/JavaScript/admin_product-categories_{id}_products_batch/delete.js @@ -1,10 +1,10 @@ import Medusa from "@medusajs/medusa-js" const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token -medusa.admin.productCategories.removeProducts(product_category_id, { +medusa.admin.productCategories.removeProducts(productCategoryId, { product_ids: [ { - id: product_id + id: productId } ] }) diff --git a/docs/api/admin/code_samples/JavaScript/admin_product-categories_{id}_products_batch/post.js b/docs/api/admin/code_samples/JavaScript/admin_product-categories_{id}_products_batch/post.js index 48204cd6e4..bb1b11aeb5 100644 --- a/docs/api/admin/code_samples/JavaScript/admin_product-categories_{id}_products_batch/post.js +++ b/docs/api/admin/code_samples/JavaScript/admin_product-categories_{id}_products_batch/post.js @@ -1,10 +1,10 @@ import Medusa from "@medusajs/medusa-js" const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token -medusa.admin.productCategories.addProducts(product_category_id, { +medusa.admin.productCategories.addProducts(productCategoryId, { product_ids: [ { - id: product_id + id: productId } ] }) diff --git a/docs/api/admin/code_samples/JavaScript/admin_orders_{id}_reservations/get.js b/docs/api/admin/code_samples/JavaScript/admin_reservations/get.js similarity index 57% rename from docs/api/admin/code_samples/JavaScript/admin_orders_{id}_reservations/get.js rename to docs/api/admin/code_samples/JavaScript/admin_reservations/get.js index 5e6366e2a6..a868f35485 100644 --- a/docs/api/admin/code_samples/JavaScript/admin_orders_{id}_reservations/get.js +++ b/docs/api/admin/code_samples/JavaScript/admin_reservations/get.js @@ -1,7 +1,7 @@ import Medusa from "@medusajs/medusa-js" const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token -medusa.admin.orders.retrieveReservations(order_id) -.then(({ reservations }) => { - console.log(reservations[0].id); -}); +medusa.admin.reservations.list() +.then(({ reservations, count, limit, offset }) => { + console.log(reservations.length) +}) diff --git a/docs/api/admin/code_samples/JavaScript/admin_reservations/post.js b/docs/api/admin/code_samples/JavaScript/admin_reservations/post.js index 380666feb8..0b4c16132f 100644 --- a/docs/api/admin/code_samples/JavaScript/admin_reservations/post.js +++ b/docs/api/admin/code_samples/JavaScript/admin_reservations/post.js @@ -2,7 +2,11 @@ import Medusa from "@medusajs/medusa-js" const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token medusa.admin.reservations.create({ + line_item_id: 'item_123', + location_id: 'loc_123', + inventory_item_id: 'iitem_123', + quantity: 1 }) -.then(({ reservations }) => { - console.log(reservations.id); +.then(({ reservation }) => { + console.log(reservation.id); }); diff --git a/docs/api/admin/code_samples/JavaScript/admin_reservations_{id}/delete.js b/docs/api/admin/code_samples/JavaScript/admin_reservations_{id}/delete.js index 82df0d5cf3..fe4e71e55d 100644 --- a/docs/api/admin/code_samples/JavaScript/admin_reservations_{id}/delete.js +++ b/docs/api/admin/code_samples/JavaScript/admin_reservations_{id}/delete.js @@ -1,7 +1,7 @@ import Medusa from "@medusajs/medusa-js" const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token -medusa.admin.reservations.delete(reservation.id) +medusa.admin.reservations.delete(reservationId) .then(({ id, object, deleted }) => { console.log(id); }); diff --git a/docs/api/admin/code_samples/JavaScript/admin_reservations_{id}/get.js b/docs/api/admin/code_samples/JavaScript/admin_reservations_{id}/get.js index 88002aba3b..9030b12152 100644 --- a/docs/api/admin/code_samples/JavaScript/admin_reservations_{id}/get.js +++ b/docs/api/admin/code_samples/JavaScript/admin_reservations_{id}/get.js @@ -1,7 +1,7 @@ import Medusa from "@medusajs/medusa-js" const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token -medusa.admin.reservations.retrieve(reservation_id) +medusa.admin.reservations.retrieve(reservationId) .then(({ reservation }) => { console.log(reservation.id); }); diff --git a/docs/api/admin/code_samples/JavaScript/admin_reservations_{id}/post.js b/docs/api/admin/code_samples/JavaScript/admin_reservations_{id}/post.js index ea5604352a..804742a276 100644 --- a/docs/api/admin/code_samples/JavaScript/admin_reservations_{id}/post.js +++ b/docs/api/admin/code_samples/JavaScript/admin_reservations_{id}/post.js @@ -1,9 +1,9 @@ import Medusa from "@medusajs/medusa-js" const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token -medusa.admin.reservations.update(reservation.id, { +medusa.admin.reservations.update(reservationId, { quantity: 3 }) -.then(({ reservations }) => { - console.log(reservations.id); +.then(({ reservation }) => { + console.log(reservation.id); }); diff --git a/docs/api/admin/code_samples/JavaScript/admin_sales-channels_{id}_stock-locations/delete.js b/docs/api/admin/code_samples/JavaScript/admin_sales-channels_{id}_stock-locations/delete.js index b844ab0556..f586d778bc 100644 --- a/docs/api/admin/code_samples/JavaScript/admin_sales-channels_{id}_stock-locations/delete.js +++ b/docs/api/admin/code_samples/JavaScript/admin_sales-channels_{id}_stock-locations/delete.js @@ -1,8 +1,8 @@ import Medusa from "@medusajs/medusa-js" const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token -medusa.admin.salesChannels.removeLocation(sales_channel_id, { - location_id: 'App' +medusa.admin.salesChannels.removeLocation(salesChannelId, { + location_id: 'loc_id' }) .then(({ sales_channel }) => { console.log(sales_channel.id); diff --git a/docs/api/admin/code_samples/JavaScript/admin_sales-channels_{id}_stock-locations/post.js b/docs/api/admin/code_samples/JavaScript/admin_sales-channels_{id}_stock-locations/post.js index e7f6ce2ec5..c8a2c42f34 100644 --- a/docs/api/admin/code_samples/JavaScript/admin_sales-channels_{id}_stock-locations/post.js +++ b/docs/api/admin/code_samples/JavaScript/admin_sales-channels_{id}_stock-locations/post.js @@ -1,8 +1,8 @@ import Medusa from "@medusajs/medusa-js" const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token -medusa.admin.salesChannels.addLocation(sales_channel_id, { - location_id: 'App' +medusa.admin.salesChannels.addLocation(salesChannelId, { + location_id: 'loc_123' }) .then(({ sales_channel }) => { console.log(sales_channel.id); diff --git a/docs/api/admin/code_samples/JavaScript/admin_stock-locations/post.js b/docs/api/admin/code_samples/JavaScript/admin_stock-locations/post.js index 9086456b5a..65f4a5d3eb 100644 --- a/docs/api/admin/code_samples/JavaScript/admin_stock-locations/post.js +++ b/docs/api/admin/code_samples/JavaScript/admin_stock-locations/post.js @@ -3,7 +3,6 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token medusa.admin.stockLocations.create({ name: 'Main Warehouse', - location_id: 'sloc' }) .then(({ stock_location }) => { console.log(stock_location.id); diff --git a/docs/api/admin/code_samples/JavaScript/admin_stock-locations_{id}/delete.js b/docs/api/admin/code_samples/JavaScript/admin_stock-locations_{id}/delete.js index b7e33b5af8..0de3cba4e0 100644 --- a/docs/api/admin/code_samples/JavaScript/admin_stock-locations_{id}/delete.js +++ b/docs/api/admin/code_samples/JavaScript/admin_stock-locations_{id}/delete.js @@ -2,6 +2,6 @@ import Medusa from "@medusajs/medusa-js" const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token medusa.admin.stockLocations.delete(stock_location_id) - .then(({ id, object, deleted }) => { - console.log(id) - }) +.then(({ id, object, deleted }) => { + console.log(id) +}) diff --git a/docs/api/admin/code_samples/JavaScript/admin_stock-locations_{id}/get.js b/docs/api/admin/code_samples/JavaScript/admin_stock-locations_{id}/get.js index 166e58a981..a0656b1086 100644 --- a/docs/api/admin/code_samples/JavaScript/admin_stock-locations_{id}/get.js +++ b/docs/api/admin/code_samples/JavaScript/admin_stock-locations_{id}/get.js @@ -1,7 +1,7 @@ import Medusa from "@medusajs/medusa-js" const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token -medusa.admin.stockLocations.retrieve(stock_location_id) +medusa.admin.stockLocations.retrieve(stockLocationId) .then(({ stock_location }) => { console.log(stock_location.id); }); diff --git a/docs/api/admin/code_samples/JavaScript/admin_stock-locations_{id}/post.js b/docs/api/admin/code_samples/JavaScript/admin_stock-locations_{id}/post.js index 50563ddc97..f3ad1429e3 100644 --- a/docs/api/admin/code_samples/JavaScript/admin_stock-locations_{id}/post.js +++ b/docs/api/admin/code_samples/JavaScript/admin_stock-locations_{id}/post.js @@ -1,8 +1,8 @@ import Medusa from "@medusajs/medusa-js" const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token -medusa.admin.stockLocations.update(stock_location_id, { - name: 'App' +medusa.admin.stockLocations.update(stockLocationId, { + name: 'Main Warehouse' }) .then(({ stock_location }) => { console.log(stock_location.id); diff --git a/docs/api/admin/code_samples/Shell/admin_inventory-items/get.sh b/docs/api/admin/code_samples/Shell/admin_inventory-items/get.sh index e5f3f47681..41c223bd88 100644 --- a/docs/api/admin/code_samples/Shell/admin_inventory-items/get.sh +++ b/docs/api/admin/code_samples/Shell/admin_inventory-items/get.sh @@ -1,3 +1,2 @@ curl --location --request GET 'https://medusa-url.com/admin/inventory-items' \ ---header 'Authorization: Bearer {api_token}' \ ---header 'Content-Type: application/json' +--header 'Authorization: Bearer {api_token}' diff --git a/docs/api/admin/code_samples/Shell/admin_inventory-items/post.sh b/docs/api/admin/code_samples/Shell/admin_inventory-items/post.sh index ec74487c85..53ad14d589 100644 --- a/docs/api/admin/code_samples/Shell/admin_inventory-items/post.sh +++ b/docs/api/admin/code_samples/Shell/admin_inventory-items/post.sh @@ -3,5 +3,4 @@ curl --location --request POST 'https://medusa-url.com/admin/inventory-items' \ --header 'Content-Type: application/json' \ --data-raw '{ "variant_id": "variant_123", - "sku": "sku-123", }' diff --git a/docs/api/admin/code_samples/Shell/admin_inventory-items_{id}/get.sh b/docs/api/admin/code_samples/Shell/admin_inventory-items_{id}/get.sh index 04db2a5dca..7867b5ca65 100644 --- a/docs/api/admin/code_samples/Shell/admin_inventory-items_{id}/get.sh +++ b/docs/api/admin/code_samples/Shell/admin_inventory-items_{id}/get.sh @@ -1,3 +1,2 @@ curl --location --request GET 'https://medusa-url.com/admin/inventory-items/{id}' \ ---header 'Authorization: Bearer {api_token}' \ ---header 'Content-Type: application/json' +--header 'Authorization: Bearer {api_token}' diff --git a/docs/api/admin/code_samples/Shell/admin_inventory-items_{id}_location-levels/get.sh b/docs/api/admin/code_samples/Shell/admin_inventory-items_{id}_location-levels/get.sh index 75b3d173e5..c87c428b34 100644 --- a/docs/api/admin/code_samples/Shell/admin_inventory-items_{id}_location-levels/get.sh +++ b/docs/api/admin/code_samples/Shell/admin_inventory-items_{id}_location-levels/get.sh @@ -1,3 +1,2 @@ curl --location --request GET 'https://medusa-url.com/admin/inventory-items/{id}/location-levels' \ ---header 'Authorization: Bearer {api_token}' \ ---header 'Content-Type: application/json' +--header 'Authorization: Bearer {api_token}' diff --git a/docs/api/admin/code_samples/Shell/admin_inventory-items_{id}_location-levels/post.sh b/docs/api/admin/code_samples/Shell/admin_inventory-items_{id}_location-levels/post.sh index 04c6e149ed..9a560ddcb8 100644 --- a/docs/api/admin/code_samples/Shell/admin_inventory-items_{id}_location-levels/post.sh +++ b/docs/api/admin/code_samples/Shell/admin_inventory-items_{id}_location-levels/post.sh @@ -2,6 +2,6 @@ curl --location --request POST 'https://medusa-url.com/admin/inventory-items/{id --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "location_id": "sloc", + "location_id": "sloc_123", "stocked_quantity": 10 }' diff --git a/docs/api/admin/code_samples/Shell/admin_inventory-items_{id}_location-levels_{location_id}/delete.sh b/docs/api/admin/code_samples/Shell/admin_inventory-items_{id}_location-levels_{location_id}/delete.sh index d6334d7d66..1c3c778d46 100644 --- a/docs/api/admin/code_samples/Shell/admin_inventory-items_{id}_location-levels_{location_id}/delete.sh +++ b/docs/api/admin/code_samples/Shell/admin_inventory-items_{id}_location-levels_{location_id}/delete.sh @@ -1,3 +1,2 @@ curl --location --request DELETE 'https://medusa-url.com/admin/inventory-items/{id}/location-levels/{location_id}' \ ---header 'Authorization: Bearer {api_token}' \ ---header 'Content-Type: application/json' +--header 'Authorization: Bearer {api_token}' diff --git a/docs/api/admin/code_samples/Shell/admin_orders_{id}_line-items_{line_item_id}_reserve/post.sh b/docs/api/admin/code_samples/Shell/admin_orders_{id}_line-items_{line_item_id}_reserve/post.sh index 4fb8ce478d..4d1bc40c86 100644 --- a/docs/api/admin/code_samples/Shell/admin_orders_{id}_line-items_{line_item_id}_reserve/post.sh +++ b/docs/api/admin/code_samples/Shell/admin_orders_{id}_line-items_{line_item_id}_reserve/post.sh @@ -1,4 +1,4 @@ -curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/line-items/{line_item_id}/reservations' \ +curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/line-items/{line_item_id}/reserve' \ --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ diff --git a/docs/api/admin/code_samples/Shell/admin_product-categories_{id}_products_batch/post.sh b/docs/api/admin/code_samples/Shell/admin_product-categories_{id}_products_batch/post.sh index 2ddb1ae898..5d27b9dd49 100644 --- a/docs/api/admin/code_samples/Shell/admin_product-categories_{id}_products_batch/post.sh +++ b/docs/api/admin/code_samples/Shell/admin_product-categories_{id}_products_batch/post.sh @@ -1,5 +1,5 @@ curl --location \ ---request POST 'https://medusa-url.com/admin/product-categories/{product_category_id}/products/batch' \ +--request POST 'https://medusa-url.com/admin/product-categories/{id}/products/batch' \ --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ diff --git a/docs/api/admin/code_samples/Shell/admin_reservations/post.sh b/docs/api/admin/code_samples/Shell/admin_reservations/post.sh index 4246a90ec4..a8884bbf3d 100644 --- a/docs/api/admin/code_samples/Shell/admin_reservations/post.sh +++ b/docs/api/admin/code_samples/Shell/admin_reservations/post.sh @@ -2,7 +2,8 @@ curl --location --request POST 'https://medusa-url.com/admin/reservations' \ --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "resource_id": "{resource_id}", - "resource_type": "order", - "value": "We delivered this order" + "line_item_id": "item_123", + "location_id": "loc_123", + "inventory_item_id": "iitem_123", + "quantity": 1 }' diff --git a/docs/api/admin/code_samples/Shell/admin_sales-channels_{id}_stock-locations/delete.sh b/docs/api/admin/code_samples/Shell/admin_sales-channels_{id}_stock-locations/delete.sh index 08fc0f518a..6e0655dc26 100644 --- a/docs/api/admin/code_samples/Shell/admin_sales-channels_{id}_stock-locations/delete.sh +++ b/docs/api/admin/code_samples/Shell/admin_sales-channels_{id}_stock-locations/delete.sh @@ -2,5 +2,5 @@ curl --location --request DELETE 'https://medusa-url.com/admin/sales-channels/{i --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "locaton_id": "stock_location_id" + "locaton_id": "loc_id" }' diff --git a/docs/api/admin/code_samples/Shell/admin_sales-channels_{id}_stock-locations/post.sh b/docs/api/admin/code_samples/Shell/admin_sales-channels_{id}_stock-locations/post.sh index 55c2aaabfc..9f7b721d5c 100644 --- a/docs/api/admin/code_samples/Shell/admin_sales-channels_{id}_stock-locations/post.sh +++ b/docs/api/admin/code_samples/Shell/admin_sales-channels_{id}_stock-locations/post.sh @@ -2,5 +2,5 @@ curl --location --request POST 'https://medusa-url.com/admin/sales-channels/{id} --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "locaton_id": "stock_location_id" + "locaton_id": "loc_123" }' diff --git a/docs/api/admin/code_samples/Shell/admin_stock-locations_{id}/post.sh b/docs/api/admin/code_samples/Shell/admin_stock-locations_{id}/post.sh index b0130c506d..1a75bca338 100644 --- a/docs/api/admin/code_samples/Shell/admin_stock-locations_{id}/post.sh +++ b/docs/api/admin/code_samples/Shell/admin_stock-locations_{id}/post.sh @@ -2,5 +2,5 @@ curl --location --request POST 'https://medusa-url.com/admin/stock-locations/{id --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "name": "App" + "name": "Main Warehouse" }' diff --git a/docs/api/admin/paths/admin_inventory-items.yaml b/docs/api/admin/paths/admin_inventory-items.yaml index 5262a40947..94da2a29a8 100644 --- a/docs/api/admin/paths/admin_inventory-items.yaml +++ b/docs/api/admin/paths/admin_inventory-items.yaml @@ -1,7 +1,9 @@ get: operationId: GetInventoryItems - summary: List inventory items. - description: Lists inventory items. + summary: List Inventory Items + description: >- + Lists inventory items with the ability to apply filters or search queries on + them. x-authenticated: true parameters: - in: query @@ -134,7 +136,7 @@ get: $ref: ../components/responses/500_error.yaml post: operationId: PostInventoryItems - summary: Create an Inventory Item. + summary: Create an Inventory Item description: Creates an Inventory Item. x-authenticated: true parameters: diff --git a/docs/api/admin/paths/admin_inventory-items_{id}.yaml b/docs/api/admin/paths/admin_inventory-items_{id}.yaml index 9d9300a108..0834e0bbcc 100644 --- a/docs/api/admin/paths/admin_inventory-items_{id}.yaml +++ b/docs/api/admin/paths/admin_inventory-items_{id}.yaml @@ -1,7 +1,7 @@ get: operationId: GetInventoryItemsInventoryItem - summary: Retrive an Inventory Item. - description: Retrives an Inventory Item. + summary: Get an Inventory Item + description: Retrieves an Inventory Item. x-authenticated: true parameters: - in: path @@ -58,7 +58,7 @@ get: $ref: ../components/responses/500_error.yaml post: operationId: PostInventoryItemsInventoryItem - summary: Update an Inventory Item. + summary: Update an Inventory Item description: Updates an Inventory Item. x-authenticated: true parameters: diff --git a/docs/api/admin/paths/admin_inventory-items_{id}_location-levels.yaml b/docs/api/admin/paths/admin_inventory-items_{id}_location-levels.yaml index 1af91cb642..212ef052bf 100644 --- a/docs/api/admin/paths/admin_inventory-items_{id}_location-levels.yaml +++ b/docs/api/admin/paths/admin_inventory-items_{id}_location-levels.yaml @@ -1,7 +1,7 @@ get: operationId: GetInventoryItemsInventoryItemLocationLevels - summary: List stock levels of a given location. - description: Lists stock levels of a given location. + summary: List Inventory Levels + description: Lists inventory levels of an inventory item. x-authenticated: true parameters: - in: path @@ -10,18 +10,6 @@ get: description: The ID of the Inventory Item. schema: type: string - - in: query - name: offset - description: How many stock locations levels to skip in the result. - schema: - type: integer - default: 0 - - in: query - name: limit - description: Limit the number of stock locations levels returned. - schema: - type: integer - default: 20 - in: query name: expand description: Comma separated list of relations to include in the results. @@ -72,8 +60,8 @@ get: $ref: ../components/responses/500_error.yaml post: operationId: PostInventoryItemsInventoryItemLocationLevels - summary: Create an Inventory Location Level for a given Inventory Item. - description: Creates an Inventory Location Level for a given Inventory Item. + summary: Create an Inventory Level + description: Creates an Inventory Level for a given Inventory Item. x-authenticated: true parameters: - in: path diff --git a/docs/api/admin/paths/admin_inventory-items_{id}_location-levels_{location_id}.yaml b/docs/api/admin/paths/admin_inventory-items_{id}_location-levels_{location_id}.yaml index f6263f2c11..398f68a2f6 100644 --- a/docs/api/admin/paths/admin_inventory-items_{id}_location-levels_{location_id}.yaml +++ b/docs/api/admin/paths/admin_inventory-items_{id}_location-levels_{location_id}.yaml @@ -1,7 +1,7 @@ post: operationId: PostInventoryItemsInventoryItemLocationLevelsLocationLevel - summary: Update an Inventory Location Level for a given Inventory Item. - description: Updates an Inventory Location Level for a given Inventory Item. + summary: Update an Inventory Level + description: Updates an Inventory Level for a given Inventory Item. x-authenticated: true parameters: - in: path @@ -72,7 +72,7 @@ post: $ref: ../components/responses/500_error.yaml delete: operationId: DeleteInventoryItemsInventoryIteLocationLevelsLocation - summary: Delete a location level of an Inventory Item. + summary: Delete a Location Level description: Delete a location level of an Inventory Item. x-authenticated: true parameters: diff --git a/docs/api/admin/paths/admin_orders_{id}_line-items_{line_item_id}_reserve.yaml b/docs/api/admin/paths/admin_orders_{id}_line-items_{line_item_id}_reserve.yaml index de5c19f75c..62f4695009 100644 --- a/docs/api/admin/paths/admin_orders_{id}_line-items_{line_item_id}_reserve.yaml +++ b/docs/api/admin/paths/admin_orders_{id}_line-items_{line_item_id}_reserve.yaml @@ -24,11 +24,6 @@ post: schema: $ref: ../components/schemas/AdminOrdersOrderLineItemReservationReq.yaml x-codeSamples: - - lang: JavaScript - label: JS Client - source: - $ref: >- - ../code_samples/JavaScript/admin_orders_{id}_line-items_{line_item_id}_reserve/post.js - lang: Shell label: cURL source: diff --git a/docs/api/admin/paths/admin_orders_{id}_reservations.yaml b/docs/api/admin/paths/admin_orders_{id}_reservations.yaml index ee4eacdca8..697aaaa549 100644 --- a/docs/api/admin/paths/admin_orders_{id}_reservations.yaml +++ b/docs/api/admin/paths/admin_orders_{id}_reservations.yaml @@ -1,7 +1,7 @@ get: operationId: GetOrdersOrderReservations - summary: Get reservations for an Order - description: Retrieves reservations for an Order + summary: Get reservations of an Order + description: Retrieves reservations of an Order x-authenticated: true parameters: - in: path @@ -23,10 +23,6 @@ get: type: integer default: 20 x-codeSamples: - - lang: JavaScript - label: JS Client - source: - $ref: ../code_samples/JavaScript/admin_orders_{id}_reservations/get.js - lang: Shell label: cURL source: diff --git a/docs/api/admin/paths/admin_product-categories_{id}.yaml b/docs/api/admin/paths/admin_product-categories_{id}.yaml index eb4079c382..8dead6227f 100644 --- a/docs/api/admin/paths/admin_product-categories_{id}.yaml +++ b/docs/api/admin/paths/admin_product-categories_{id}.yaml @@ -126,7 +126,7 @@ post: delete: operationId: DeleteProductCategoriesCategory summary: Delete a Product Category - description: Deletes a ProductCategory. + description: Deletes a Product Category. x-authenticated: true parameters: - in: path diff --git a/docs/api/admin/paths/admin_product-categories_{id}_products_batch.yaml b/docs/api/admin/paths/admin_product-categories_{id}_products_batch.yaml index 178c3b328e..72717738ec 100644 --- a/docs/api/admin/paths/admin_product-categories_{id}_products_batch.yaml +++ b/docs/api/admin/paths/admin_product-categories_{id}_products_batch.yaml @@ -1,6 +1,6 @@ post: operationId: PostProductCategoriesCategoryProductsBatch - summary: Add Products to a category + summary: Add Products to a Category description: Assign a batch of products to a product category. x-authenticated: true parameters: @@ -66,7 +66,7 @@ post: $ref: ../components/responses/500_error.yaml delete: operationId: DeleteProductCategoriesCategoryProductsBatch - summary: Delete Products + summary: Remove Products from Category description: Remove a list of products from a product category. x-authenticated: true parameters: diff --git a/docs/api/admin/paths/admin_reservations.yaml b/docs/api/admin/paths/admin_reservations.yaml index b9e6b80063..631eedd313 100644 --- a/docs/api/admin/paths/admin_reservations.yaml +++ b/docs/api/admin/paths/admin_reservations.yaml @@ -81,6 +81,10 @@ get: method: list queryParams: AdminGetReservationsParams x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/admin_reservations/get.js - lang: Shell label: cURL source: @@ -111,8 +115,8 @@ get: $ref: ../components/responses/500_error.yaml post: operationId: PostReservations - summary: Creates a Reservation - description: Creates a Reservation which can be associated with any resource as required. + summary: Create a Reservation + description: Create a Reservation which can be associated with any resource as required. x-authenticated: true requestBody: content: diff --git a/docs/api/admin/paths/admin_reservations_{id}.yaml b/docs/api/admin/paths/admin_reservations_{id}.yaml index aa0cf2fe6c..0a0e95d28e 100644 --- a/docs/api/admin/paths/admin_reservations_{id}.yaml +++ b/docs/api/admin/paths/admin_reservations_{id}.yaml @@ -1,7 +1,7 @@ get: operationId: GetReservationsReservation summary: Get a Reservation - description: Retrieves a single reservation using its id + description: Retrieves a single reservation using its ID x-authenticated: true parameters: - in: path @@ -45,7 +45,7 @@ get: $ref: ../components/responses/500_error.yaml post: operationId: PostReservationsReservation - summary: Updates a Reservation + summary: Update a Reservation description: Updates a Reservation which can be associated with any resource as required. x-authenticated: true parameters: diff --git a/docs/api/admin/paths/admin_sales-channels_{id}_stock-locations.yaml b/docs/api/admin/paths/admin_sales-channels_{id}_stock-locations.yaml index 0f1681ac84..2318225997 100644 --- a/docs/api/admin/paths/admin_sales-channels_{id}_stock-locations.yaml +++ b/docs/api/admin/paths/admin_sales-channels_{id}_stock-locations.yaml @@ -1,7 +1,7 @@ post: operationId: PostSalesChannelsSalesChannelStockLocation - summary: Associate a stock location to a Sales Channel - description: Associates a stock location to a Sales Channel. + summary: Associate a Stock Location + description: Associates a stock location with a Sales Channel. x-authenticated: true parameters: - in: path @@ -55,7 +55,7 @@ post: $ref: ../components/responses/500_error.yaml delete: operationId: DeleteSalesChannelsSalesChannelStockLocation - summary: Remove a stock location from a Sales Channel + summary: Remove a Stock Location Association description: Removes a stock location from a Sales Channel. x-authenticated: true parameters: diff --git a/docs/content/modules/overview.mdx b/docs/content/modules/overview.mdx index 247a9e3ba8..31a8b19042 100644 --- a/docs/content/modules/overview.mdx +++ b/docs/content/modules/overview.mdx @@ -103,7 +103,7 @@ Medusa's products configuration allows managing products of different types incl > - Create products with unlimited variants and options. - - Organize products into nested categories of different heirarchies. + - Organize products into nested categories of different hierarchies. - Associate products with collections, types, and tags. - Manage a product’s inventory, pricing, sales channels, and more. - Import and export products to and from Medusa using CSV files.