chore(docs): Generated API Reference (#3061)
Co-authored-by: olivermrbl <olivermrbl@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
3a0f37ef02
commit
296d6e229f
@@ -0,0 +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.orders.createReservation(order_id, line_item_id, {
|
||||
location_id
|
||||
})
|
||||
.then(({ reservation }) => {
|
||||
console.log(reservation.id);
|
||||
});
|
||||
@@ -0,0 +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);
|
||||
});
|
||||
@@ -0,0 +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.reservations.create({
|
||||
})
|
||||
.then(({ reservations }) => {
|
||||
console.log(reservations.id);
|
||||
});
|
||||
@@ -0,0 +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)
|
||||
.then(({ id, object, deleted }) => {
|
||||
console.log(id);
|
||||
});
|
||||
@@ -0,0 +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)
|
||||
.then(({ reservation }) => {
|
||||
console.log(reservation.id);
|
||||
});
|
||||
@@ -0,0 +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, {
|
||||
quantity: 3
|
||||
})
|
||||
.then(({ reservations }) => {
|
||||
console.log(reservations.id);
|
||||
});
|
||||
@@ -0,0 +1,6 @@
|
||||
curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/line-items/{line_item_id}/reservations' \
|
||||
--header 'Authorization: Bearer {api_token}' \
|
||||
--header 'Content-Type: application/json' \
|
||||
--data-raw '{
|
||||
"location_id": "loc_1"
|
||||
}'
|
||||
@@ -0,0 +1,2 @@
|
||||
curl --location --request GET 'https://medusa-url.com/admin/orders/{id}/reservations' \
|
||||
--header 'Authorization: Bearer {api_token}'
|
||||
@@ -0,0 +1,6 @@
|
||||
curl --location --request POST 'https://medusa-url.com/admin/product-categories/{id}' \
|
||||
--header 'Authorization: Bearer {api_token}' \
|
||||
--header 'Content-Type: application/json' \
|
||||
--data-raw '{
|
||||
"name": "Skinny Jeans"
|
||||
}'
|
||||
@@ -0,0 +1,2 @@
|
||||
curl --location --request GET 'https://medusa-url.com/admin/product-categories' \
|
||||
--header 'Authorization: Bearer {api_token}'
|
||||
@@ -0,0 +1,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"
|
||||
}'
|
||||
@@ -0,0 +1,2 @@
|
||||
curl --location --request DELETE 'https://medusa-url.com/admin/reservations/{id}' \
|
||||
--header 'Authorization: Bearer {api_token}'
|
||||
@@ -0,0 +1,2 @@
|
||||
curl --location --request GET 'https://medusa-url.com/admin/reservations/{id}' \
|
||||
--header 'Authorization: Bearer {api_token}'
|
||||
@@ -0,0 +1,6 @@
|
||||
curl --location --request POST 'https://medusa-url.com/admin/reservations/{id}' \
|
||||
--header 'Authorization: Bearer {api_token}' \
|
||||
--header 'Content-Type: application/json' \
|
||||
--data-raw '{
|
||||
"quantity": 3,
|
||||
}'
|
||||
Reference in New Issue
Block a user