chore(docs): Generated API Reference (#5601)
Co-authored-by: olivermrbl <olivermrbl@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
02e2ee4e8a
commit
01d4047976
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
medusa.admin.auth.getSession()
|
||||
.then(({ user }) => {
|
||||
console.log(user.id);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -6,4 +6,4 @@ medusa.admin.auth.createSession({
|
||||
})
|
||||
.then(({ user }) => {
|
||||
console.log(user.id);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -6,4 +6,4 @@ medusa.admin.auth.getToken({
|
||||
})
|
||||
.then(({ access_token }) => {
|
||||
console.log(access_token);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -7,4 +7,4 @@ medusa.admin.batchJobs.create({
|
||||
dry_run: false
|
||||
}).then((({ batch_job }) => {
|
||||
console.log(batch_job.id);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
medusa.admin.batchJobs.retrieve(batchJobId)
|
||||
.then(({ batch_job }) => {
|
||||
console.log(batch_job.id);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
medusa.admin.batchJobs.cancel(batchJobId)
|
||||
.then(({ batch_job }) => {
|
||||
console.log(batch_job.id);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
medusa.admin.batchJobs.confirm(batchJobId)
|
||||
.then(({ batch_job }) => {
|
||||
console.log(batch_job.id);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
medusa.admin.collections.list()
|
||||
.then(({ collections, limit, offset, count }) => {
|
||||
console.log(collections.length);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -6,4 +6,4 @@ medusa.admin.collections.create({
|
||||
})
|
||||
.then(({ collection }) => {
|
||||
console.log(collection.id);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
medusa.admin.collections.delete(collectionId)
|
||||
.then(({ id, object, deleted }) => {
|
||||
console.log(id);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
medusa.admin.collections.retrieve(collectionId)
|
||||
.then(({ collection }) => {
|
||||
console.log(collection.id);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -6,4 +6,4 @@ medusa.admin.collections.update(collectionId, {
|
||||
})
|
||||
.then(({ collection }) => {
|
||||
console.log(collection.id);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
medusa.admin.currencies.list()
|
||||
.then(({ currencies, count, offset, limit }) => {
|
||||
console.log(currencies.length);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -6,4 +6,4 @@ medusa.admin.currencies.update(code, {
|
||||
})
|
||||
.then(({ currency }) => {
|
||||
console.log(currency.code);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
medusa.admin.customerGroups.list()
|
||||
.then(({ customer_groups, limit, offset, count }) => {
|
||||
console.log(customer_groups.length);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -6,4 +6,4 @@ medusa.admin.customerGroups.create({
|
||||
})
|
||||
.then(({ customer_group }) => {
|
||||
console.log(customer_group.id);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
medusa.admin.customerGroups.delete(customerGroupId)
|
||||
.then(({ id, object, deleted }) => {
|
||||
console.log(id);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
medusa.admin.customerGroups.retrieve(customerGroupId)
|
||||
.then(({ customer_group }) => {
|
||||
console.log(customer_group.id);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -6,4 +6,4 @@ medusa.admin.customerGroups.update(customerGroupId, {
|
||||
})
|
||||
.then(({ customer_group }) => {
|
||||
console.log(customer_group.id);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
medusa.admin.customerGroups.listCustomers(customerGroupId)
|
||||
.then(({ customers }) => {
|
||||
console.log(customers.length);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -10,4 +10,4 @@ medusa.admin.customerGroups.removeCustomers(customerGroupId, {
|
||||
})
|
||||
.then(({ customer_group }) => {
|
||||
console.log(customer_group.id);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -10,4 +10,4 @@ medusa.admin.customerGroups.addCustomers(customerGroupId, {
|
||||
})
|
||||
.then(({ customer_group }) => {
|
||||
console.log(customer_group.id);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
medusa.admin.customers.list()
|
||||
.then(({ customers, limit, offset, count }) => {
|
||||
console.log(customers.length);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -9,4 +9,4 @@ medusa.admin.customers.create({
|
||||
})
|
||||
.then(({ customer }) => {
|
||||
console.log(customer.id);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
medusa.admin.customers.retrieve(customerId)
|
||||
.then(({ customer }) => {
|
||||
console.log(customer.id);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -6,4 +6,4 @@ medusa.admin.customers.update(customerId, {
|
||||
})
|
||||
.then(({ customer }) => {
|
||||
console.log(customer.id);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
medusa.admin.discounts.list()
|
||||
.then(({ discounts, limit, offset, count }) => {
|
||||
console.log(discounts.id);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -15,4 +15,4 @@ medusa.admin.discounts.create({
|
||||
})
|
||||
.then(({ discount }) => {
|
||||
console.log(discount.id);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
medusa.admin.discounts.retrieveByCode(code)
|
||||
.then(({ discount }) => {
|
||||
console.log(discount.id);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -3,8 +3,9 @@ import { DiscountConditionOperator } from "@medusajs/medusa"
|
||||
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
// must be previously logged in or use api token
|
||||
medusa.admin.discounts.createCondition(discountId, {
|
||||
operator: DiscountConditionOperator.IN
|
||||
operator: DiscountConditionOperator.IN,
|
||||
products: [productId]
|
||||
})
|
||||
.then(({ discount }) => {
|
||||
console.log(discount.id);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
medusa.admin.discounts.deleteCondition(discountId, conditionId)
|
||||
.then(({ id, object, deleted }) => {
|
||||
console.log(id);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
medusa.admin.discounts.getCondition(discountId, conditionId)
|
||||
.then(({ discount_condition }) => {
|
||||
console.log(discount_condition.id);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -8,4 +8,4 @@ medusa.admin.discounts.updateCondition(discountId, conditionId, {
|
||||
})
|
||||
.then(({ discount }) => {
|
||||
console.log(discount.id);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -6,4 +6,4 @@ medusa.admin.discounts.deleteConditionResourceBatch(discountId, conditionId, {
|
||||
})
|
||||
.then(({ discount }) => {
|
||||
console.log(discount.id);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -6,4 +6,4 @@ medusa.admin.discounts.addConditionResourceBatch(discountId, conditionId, {
|
||||
})
|
||||
.then(({ discount }) => {
|
||||
console.log(discount.id);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
medusa.admin.discounts.delete(discountId)
|
||||
.then(({ id, object, deleted }) => {
|
||||
console.log(id);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
medusa.admin.discounts.retrieve(discountId)
|
||||
.then(({ discount }) => {
|
||||
console.log(discount.id);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -6,4 +6,4 @@ medusa.admin.discounts.update(discountId, {
|
||||
})
|
||||
.then(({ discount }) => {
|
||||
console.log(discount.id);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -7,4 +7,4 @@ medusa.admin.discounts.createDynamicCode(discountId, {
|
||||
})
|
||||
.then(({ discount }) => {
|
||||
console.log(discount.id);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
medusa.admin.discounts.deleteDynamicCode(discountId, code)
|
||||
.then(({ discount }) => {
|
||||
console.log(discount.id);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
medusa.admin.discounts.removeRegion(discountId, regionId)
|
||||
.then(({ discount }) => {
|
||||
console.log(discount.id);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
medusa.admin.discounts.addRegion(discountId, regionId)
|
||||
.then(({ discount }) => {
|
||||
console.log(discount.id);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
medusa.admin.draftOrders.list()
|
||||
.then(({ draft_orders, limit, offset, count }) => {
|
||||
console.log(draft_orders.length);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -17,4 +17,4 @@ medusa.admin.draftOrders.create({
|
||||
})
|
||||
.then(({ draft_order }) => {
|
||||
console.log(draft_order.id);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
medusa.admin.draftOrders.delete(draftOrderId)
|
||||
.then(({ id, object, deleted }) => {
|
||||
console.log(id);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
medusa.admin.draftOrders.retrieve(draftOrderId)
|
||||
.then(({ draft_order }) => {
|
||||
console.log(draft_order.id);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -6,4 +6,4 @@ medusa.admin.draftOrders.update(draftOrderId, {
|
||||
})
|
||||
.then(({ draft_order }) => {
|
||||
console.log(draft_order.id);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -6,4 +6,4 @@ medusa.admin.draftOrders.addLineItem(draftOrderId, {
|
||||
})
|
||||
.then(({ draft_order }) => {
|
||||
console.log(draft_order.id);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
medusa.admin.draftOrders.removeLineItem(draftOrderId, itemId)
|
||||
.then(({ draft_order }) => {
|
||||
console.log(draft_order.id);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -6,4 +6,4 @@ medusa.admin.draftOrders.updateLineItem(draftOrderId, lineId, {
|
||||
})
|
||||
.then(({ draft_order }) => {
|
||||
console.log(draft_order.id);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
medusa.admin.draftOrders.markPaid(draftOrderId)
|
||||
.then(({ order }) => {
|
||||
console.log(order.id);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
medusa.admin.giftCards.list()
|
||||
.then(({ gift_cards, limit, offset, count }) => {
|
||||
console.log(gift_cards.length);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -6,4 +6,4 @@ medusa.admin.giftCards.create({
|
||||
})
|
||||
.then(({ gift_card }) => {
|
||||
console.log(gift_card.id);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
medusa.admin.giftCards.delete(giftCardId)
|
||||
.then(({ id, object, deleted }) => {
|
||||
console.log(id);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
medusa.admin.giftCards.retrieve(giftCardId)
|
||||
.then(({ gift_card }) => {
|
||||
console.log(gift_card.id);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -6,4 +6,4 @@ medusa.admin.giftCards.update(giftCardId, {
|
||||
})
|
||||
.then(({ gift_card }) => {
|
||||
console.log(gift_card.id);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
medusa.admin.inventoryItems.list()
|
||||
.then(({ inventory_items, count, offset, limit }) => {
|
||||
console.log(inventory_items.length);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -6,4 +6,4 @@ medusa.admin.inventoryItems.create({
|
||||
})
|
||||
.then(({ inventory_item }) => {
|
||||
console.log(inventory_item.id);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -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.delete(inventoryItemId)
|
||||
.then(({ id, object, deleted }) => {
|
||||
console.log(id)
|
||||
})
|
||||
.then(({ id, object, deleted }) => {
|
||||
console.log(id)
|
||||
})
|
||||
|
||||
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
medusa.admin.inventoryItems.retrieve(inventoryItemId)
|
||||
.then(({ inventory_item }) => {
|
||||
console.log(inventory_item.id);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -6,4 +6,4 @@ medusa.admin.inventoryItems.update(inventoryItemId, {
|
||||
})
|
||||
.then(({ inventory_item }) => {
|
||||
console.log(inventory_item.id);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
medusa.admin.inventoryItems.listLocationLevels(inventoryItemId)
|
||||
.then(({ inventory_item }) => {
|
||||
console.log(inventory_item.location_levels);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -7,4 +7,4 @@ medusa.admin.inventoryItems.createLocationLevel(inventoryItemId, {
|
||||
})
|
||||
.then(({ inventory_item }) => {
|
||||
console.log(inventory_item.id);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
medusa.admin.inventoryItems.deleteLocationLevel(inventoryItemId, locationId)
|
||||
.then(({ inventory_item }) => {
|
||||
console.log(inventory_item.id);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -6,4 +6,4 @@ medusa.admin.inventoryItems.updateLocationLevel(inventoryItemId, locationId, {
|
||||
})
|
||||
.then(({ inventory_item }) => {
|
||||
console.log(inventory_item.id);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
medusa.admin.invites.list()
|
||||
.then(({ invites }) => {
|
||||
console.log(invites.length);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -10,4 +10,4 @@ medusa.admin.invites.create({
|
||||
})
|
||||
.catch(() => {
|
||||
// an error occurred
|
||||
});
|
||||
})
|
||||
|
||||
@@ -14,4 +14,4 @@ medusa.admin.invites.accept({
|
||||
})
|
||||
.catch(() => {
|
||||
// an error occurred
|
||||
});
|
||||
})
|
||||
|
||||
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
medusa.admin.invites.delete(inviteId)
|
||||
.then(({ id, object, deleted }) => {
|
||||
console.log(id);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -7,4 +7,4 @@ medusa.admin.invites.resend(inviteId)
|
||||
})
|
||||
.catch(() => {
|
||||
// an error occurred
|
||||
});
|
||||
})
|
||||
|
||||
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
medusa.admin.notes.list()
|
||||
.then(({ notes, limit, offset, count }) => {
|
||||
console.log(notes.length);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -8,4 +8,4 @@ medusa.admin.notes.create({
|
||||
})
|
||||
.then(({ note }) => {
|
||||
console.log(note.id);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
medusa.admin.notes.delete(noteId)
|
||||
.then(({ id, object, deleted }) => {
|
||||
console.log(id);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
medusa.admin.notes.retrieve(noteId)
|
||||
.then(({ note }) => {
|
||||
console.log(note.id);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -6,4 +6,4 @@ medusa.admin.notes.update(noteId, {
|
||||
})
|
||||
.then(({ note }) => {
|
||||
console.log(note.id);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
medusa.admin.notifications.list()
|
||||
.then(({ notifications }) => {
|
||||
console.log(notifications.length);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
medusa.admin.notifications.resend(notificationId)
|
||||
.then(({ notification }) => {
|
||||
console.log(notification.id);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -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.orderEdits.list()
|
||||
.then(({ order_edits, count, limit, offset }) => {
|
||||
console.log(order_edits.length)
|
||||
})
|
||||
.then(({ order_edits, count, limit, offset }) => {
|
||||
console.log(order_edits.length)
|
||||
})
|
||||
|
||||
@@ -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.orderEdits.create({ orderId })
|
||||
.then(({ order_edit }) => {
|
||||
console.log(order_edit.id)
|
||||
})
|
||||
.then(({ order_edit }) => {
|
||||
console.log(order_edit.id)
|
||||
})
|
||||
|
||||
@@ -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.orderEdits.delete(orderEditId)
|
||||
.then(({ id, object, deleted }) => {
|
||||
console.log(id)
|
||||
})
|
||||
.then(({ id, object, deleted }) => {
|
||||
console.log(id)
|
||||
})
|
||||
|
||||
@@ -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.orderEdits.retrieve(orderEditId)
|
||||
.then(({ order_edit }) => {
|
||||
console.log(order_edit.id)
|
||||
})
|
||||
.then(({ order_edit }) => {
|
||||
console.log(order_edit.id)
|
||||
})
|
||||
|
||||
@@ -4,6 +4,6 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
medusa.admin.orderEdits.update(orderEditId, {
|
||||
internal_note: "internal reason XY"
|
||||
})
|
||||
.then(({ order_edit }) => {
|
||||
console.log(order_edit.id)
|
||||
})
|
||||
.then(({ order_edit }) => {
|
||||
console.log(order_edit.id)
|
||||
})
|
||||
|
||||
@@ -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.orderEdits.cancel(orderEditId)
|
||||
.then(({ order_edit }) => {
|
||||
console.log(order_edit.id)
|
||||
})
|
||||
.then(({ order_edit }) => {
|
||||
console.log(order_edit.id)
|
||||
})
|
||||
|
||||
@@ -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.orderEdits.deleteItemChange(orderEdit_id, itemChangeId)
|
||||
.then(({ id, object, deleted }) => {
|
||||
console.log(id)
|
||||
})
|
||||
.then(({ id, object, deleted }) => {
|
||||
console.log(id)
|
||||
})
|
||||
|
||||
@@ -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.orderEdits.confirm(orderEditId)
|
||||
.then(({ order_edit }) => {
|
||||
console.log(order_edit.id)
|
||||
})
|
||||
.then(({ order_edit }) => {
|
||||
console.log(order_edit.id)
|
||||
})
|
||||
|
||||
@@ -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.orderEdits.removeLineItem(orderEditId, lineItemId)
|
||||
.then(({ order_edit }) => {
|
||||
console.log(order_edit.id)
|
||||
})
|
||||
.then(({ order_edit }) => {
|
||||
console.log(order_edit.id)
|
||||
})
|
||||
|
||||
@@ -2,8 +2,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.orderEdits.updateLineItem(orderEditId, lineItemId, {
|
||||
quantity: 5
|
||||
})
|
||||
.then(({ order_edit }) => {
|
||||
console.log(order_edit.id)
|
||||
})
|
||||
quantity: 5
|
||||
})
|
||||
.then(({ order_edit }) => {
|
||||
console.log(order_edit.id)
|
||||
})
|
||||
|
||||
@@ -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.orderEdits.requestConfirmation(orderEditId)
|
||||
.then({ order_edit }) => {
|
||||
console.log(order_edit.id)
|
||||
})
|
||||
.then({ order_edit }) => {
|
||||
console.log(order_edit.id)
|
||||
})
|
||||
|
||||
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
medusa.admin.orders.list()
|
||||
.then(({ orders, limit, offset, count }) => {
|
||||
console.log(orders.length);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
medusa.admin.orders.retrieve(orderId)
|
||||
.then(({ order }) => {
|
||||
console.log(order.id);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -6,4 +6,4 @@ medusa.admin.orders.update(orderId, {
|
||||
})
|
||||
.then(({ order }) => {
|
||||
console.log(order.id);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
medusa.admin.orders.archive(orderId)
|
||||
.then(({ order }) => {
|
||||
console.log(order.id);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
medusa.admin.orders.cancel(orderId)
|
||||
.then(({ order }) => {
|
||||
console.log(order.id);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
medusa.admin.orders.capturePayment(orderId)
|
||||
.then(({ order }) => {
|
||||
console.log(order.id);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -12,4 +12,4 @@ medusa.admin.orders.createClaim(orderId, {
|
||||
})
|
||||
.then(({ order }) => {
|
||||
console.log(order.id);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -6,4 +6,4 @@ medusa.admin.orders.updateClaim(orderId, claimId, {
|
||||
})
|
||||
.then(({ order }) => {
|
||||
console.log(order.id);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
medusa.admin.orders.cancelClaim(orderId, claimId)
|
||||
.then(({ order }) => {
|
||||
console.log(order.id);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -5,4 +5,4 @@ medusa.admin.orders.fulfillClaim(orderId, claimId, {
|
||||
})
|
||||
.then(({ order }) => {
|
||||
console.log(order.id);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -4,4 +4,4 @@ const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
medusa.admin.orders.cancelClaimFulfillment(orderId, claimId, fulfillmentId)
|
||||
.then(({ order }) => {
|
||||
console.log(order.id);
|
||||
});
|
||||
})
|
||||
|
||||
@@ -6,4 +6,4 @@ medusa.admin.orders.createClaimShipment(orderId, claimId, {
|
||||
})
|
||||
.then(({ order }) => {
|
||||
console.log(order.id);
|
||||
});
|
||||
})
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user