Skip to main content
Skip to main content

OrderEditsResource

This class is used to send requests to Store Order Edits API Routes. All its method are available in the JS Client under the medusa.orderEdits property.

Order edits are changes made to items in an order such as adding, updating their quantity, or deleting them. Order edits are created by the admin. A customer can review order edit requests created by an admin and confirm or decline them.

Related Guide: How to handle order edits in a storefront.

Methods

retrieve

Retrieve an Order Edit's details.

Example

import Medusa from "@medusajs/medusa-js"
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
medusa.orderEdits.retrieve(orderEditId)
.then(({ order_edit }) => {
console.log(order_edit.id);
})

Parameters

idstringRequired
The ID of the order edit.
customHeadersRecord<string, any>Required
Custom headers to attach to the request.

Default: {}

Returns

ResponsePromiseResponsePromise<StoreOrderEditsRes>Required
Resolves to the order edit's details.

decline

Decline an Order Edit. The changes are not reflected on the original order.

Example

import Medusa from "@medusajs/medusa-js"
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
medusa.orderEdits.decline(orderEditId)
.then(({ order_edit }) => {
console.log(order_edit.id);
})

Parameters

idstringRequired
The ID of the order edit.
The decline details.
customHeadersRecord<string, any>Required
Custom headers to attach to the request.

Default: {}

Returns

ResponsePromiseResponsePromise<StoreOrderEditsRes>Required
Resolves to the order edit's details.

complete

Complete and confirm an Order Edit and reflect its changes on the original order. Any additional payment required must be authorized first using the PaymentCollectionsResource routes.

Example

import Medusa from "@medusajs/medusa-js"
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
medusa.orderEdits.complete(orderEditId)
.then(({ order_edit }) => {
console.log(order_edit.id)
})

Parameters

idstringRequired
The ID of the order edit.
customHeadersRecord<string, any>Required
Custom headers to attach to the request.

Default: {}

Returns

ResponsePromiseResponsePromise<StoreOrderEditsRes>Required
Resolves to the order edit's details.
Was this section helpful?