> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # GetOrderDraftabilityStatus # Package: orders # Namespace: DraftOrders # Method link: https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/orders/draft-orders/get-order-draftability-status.md ## Permission Scopes: Manage eCommerce - all permissions: SCOPE.DC-ECOM-MEGA.MANAGE-ECOM ## Introduction Checks whether a draft can be created for an order. If `orderDraftable` returns as `true`, the order can be used to create a draft order. If `orderDraftable` returns as `false`, refer to the `nonDraftableReasons` array in the response to understand why the order is not draftable. --- ## REST API ### Schema ``` Method: getOrderDraftabilityStatus Description: Checks whether a draft can be created for an order. If `orderDraftable` returns as `true`, the order can be used to create a draft order. If `orderDraftable` returns as `false`, refer to the `nonDraftableReasons` array in the response to understand why the order is not draftable. URL: https://www.wixapis.com/ecom/v1/draft-orders/{orderId}/draftability Method: GET # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: orderId Method parameters: param name: orderId | type: none | required: true Return type: GetOrderDraftabilityStatusResponse - name: orderId | type: string | description: Order GUID. - name: orderDraftable | type: boolean | description: Whether a draft can be created based on the order. - name: nonDraftableReasons | type: array | description: Reasons why a draft order cannot be created from the order. - enum: - PARTIALLY_OR_FULLY_REFUNDED: Modifications of refunded orders are not supported. - UNSUPPORTED_CHANNEL_TYPE: Original order must be created via one of the following channel types: + WEB + POS + BACKOFFICE_MERCHANT + WIX_APP_STORE - ORDER_STATUS_IS_NOT_SUPPORTED: Order status is not APPROVED. - ORDER_AND_SITE_CURRENCIES_ARE_INCONSISTENT: Site and order currencies are different. - ORDER_AND_SITE_WEIGHT_UNITS_ARE_INCONSISTENT: Site and order weight units are different. - ORDER_NOT_FOUND: Order not found. - SUBSCRIPTION_LINE_ITEM_EXISTS: Modifications of orders with subscription items are not supported. Possible Errors: HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: | Description: Couldn't find the order. ``` ### Examples ### Get Order Draftability Status Example of non-draftable order. ```curl curl -X GET \ 'https://www.wixapis.com/ecom/v1/draft-orders/1f187cab-27b0-48ba-854d-ad882edbc21f/draftability' \ -H 'Authorization: ' \ -H 'Content-type: application/json' ``` ### Get Order Draftability Status Checks whether a draft can be created for an order. ```curl curl -X GET \ 'https://www.wixapis.com/ecom/v1/draft-orders/15d18c8e-44cd-4790-85a6-c0ebc1dc5ace/draftability' \ -H 'Authorization: ' \ -H 'Content-type: application/json' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.orders.DraftOrders.getOrderDraftabilityStatus(orderId) Description: Checks whether a draft can be created for an order. If `orderDraftable` returns as `true`, the order can be used to create a draft order. If `orderDraftable` returns as `false`, refer to the `nonDraftableReasons` array in the response to understand why the order is not draftable. # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: orderId Method parameters: param name: orderId | type: string | description: Order GUID. | required: true Return type: PROMISE - name: orderId | type: string | description: Order GUID. - name: orderDraftable | type: boolean | description: Whether a draft can be created based on the order. - name: nonDraftableReasons | type: array | description: Reasons why a draft order cannot be created from the order. - enum: - PARTIALLY_OR_FULLY_REFUNDED: Modifications of refunded orders are not supported. - UNSUPPORTED_CHANNEL_TYPE: Original order must be created via one of the following channel types: + WEB + POS + BACKOFFICE_MERCHANT + WIX_APP_STORE - ORDER_STATUS_IS_NOT_SUPPORTED: Order status is not APPROVED. - ORDER_AND_SITE_CURRENCIES_ARE_INCONSISTENT: Site and order currencies are different. - ORDER_AND_SITE_WEIGHT_UNITS_ARE_INCONSISTENT: Site and order weight units are different. - ORDER_NOT_FOUND: Order not found. - SUBSCRIPTION_LINE_ITEM_EXISTS: Modifications of orders with subscription items are not supported. Possible Errors: HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: | Description: Couldn't find the order. ``` ### Examples ### getOrderDraftabilityStatus ```javascript import { draftOrders } from '@wix/ecom'; async function getOrderDraftabilityStatus(orderId) { const response = await draftOrders.getOrderDraftabilityStatus(orderId); }; ``` ### getOrderDraftabilityStatus (with elevated permissions) ```javascript import { draftOrders } from '@wix/ecom'; import { auth } from '@wix/essentials'; async function myGetOrderDraftabilityStatusMethod(orderId) { const elevatedGetOrderDraftabilityStatus = auth.elevate(draftOrders.getOrderDraftabilityStatus); const response = await elevatedGetOrderDraftabilityStatus(orderId); } ``` ### getOrderDraftabilityStatus (self-hosted) Self-hosted SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md). ```javascript import { createClient } from '@wix/sdk'; import { draftOrders } from '@wix/ecom'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { draftOrders }, // Include the auth strategy and host as relevant }); async function getOrderDraftabilityStatus(orderId) { const response = await myWixClient.draftOrders.getOrderDraftabilityStatus(orderId); }; ``` ---