Edit draft order
PUT https://{handle}.myshopline.com/admin/openapi/v20260301/orders/draft_orders.json
handle : The store's unique identifier, which is the prefix of the store's domain name. For example, if a store's domain name is open001.myshopline.com , the store handle is open001 .Modify the content of the draft order, such as product list, shipping address, etc.
Request Headers
- Content-Type string requiredThe field must be set to the fixed value application/json; charset=utf-8.
- Authorization string requiredThe access token for the API resource. Refer to App authorizationto obtain the access token, and then pass the obtained token in the Bearer format.Example:
Bearer eyJhbGciOiJIUzUxMiJ9.eyJhcHBLZXkiOiJmMjM3OWQyMTYyOGMzM2QxMWRiMWZkYjY5N2EzZjdjMjZlNGMwYTA5Iiwic2VsbGVySWQiOiIyMDAwMjM0ODgwIiwic3RvcmVJZCI6IjE2NzIzNjk3Mjk2MDYiLCJ2ZXJzaW9uIjoiVjIiLCJkb21haW4iOiJodHRwczovL3NsLW9wZW4tc2cubXlzaG9wbGluZS5jb20iLCJ0aW1lc3RhbXAiOjE2NzUzMTk0OTI0MzksImlzcyI6Inlzb3VsIiwiZXhwIjoxNzY5OTI3NDkyfQ.UwQzomM2veGCUaOZ0paUxq5dpc7DXuhHYFvsQ_uIAKduzWcb_j2E4q_36El83sp145D4cKbpcE5KCeeIz-JNQw
Request Body
draft_orderobject
Draft order object.billing_addressobject
Billing address information.address1 stringThe first line of the payment billing address. This typically includes information such as the street address or a post office box number. Maximum length: 255address2 stringThe second line of the payment billing address. This typically includes information such as apartment, suite, or unit number. Maximum length: 255area stringThe administrative region name in payment billing address.area_code stringThe code for administrative district, custom number.city stringThe city in the payment billing address.city_code stringThe code for city in the payment billing address.company stringThe country in the payment billing address.country stringThe country in the payment billing address.country_code stringThe country code in the payment billing address. A two-letter country or region code that follows the ISO 3166-1 (alpha 2) standard, used to identify a specific market's country or region.email stringBuyer's email address.first_name stringThe buyer's first name.last_name stringThe buyer's last name.phone stringThe user's mobile phone number.province stringThe province in the payment billing address.province_code stringThe code for the province in the payment billing address, which can be a custom code or a two-digit ISO 3166-2 international code.same_as_receiver booleanIndicates whether the address is the same as the shipping information. •true: Same •false: Differentzip stringThe postal code information of the address.calc_sku_stock_mode string requiredCalculate inventory mode. •not_limit : Infinity inventory •real : real inventory •reserve_real : reserve inventory + real inventoryExample:stringcustomerobject
Buyer's information.area_code stringArea code of the buyer's contact address.email stringBuyer's email address.first_name stringUser's first name.id string requiredThe unique identifier for user.Example:stringlast_name stringUser's last name.phone stringUser's mobile phone number.discount_amount_ext stringOrder discount amount, represented as a string of type double with a precision of 2. For example, 12.41。discount_amount_ext_name stringOrder discount name. Maximum length: 64discountable booleanIndicates whether marketing discounts can be stacked. •true: Stackable •false: Not stackableid string requiredDraft order ID.Example:stringlanguage_infoobject
The language information.customer_language stringBuyer side checkout language, prefer using this language.merchant_language stringMerchant side checkout language, prefer using the buyer-side language.line_itemsobject[] required
List of product.applied_discountobject
Product discount information.description stringThe discount description.title stringThe discount title.value longDiscount value amount. When the discount type is DISCOUNT_AMOUNT_PERCENTAGE, this value can range from a minimum of 0 to a maximum default of 100.value_type stringDiscount type. Valid values are: · fixed_amount:Fixed amount · percentage: Percentagediscountable booleanIndicates whether to use online store marketing campaigns. •true: Used •false: Not usedgift_card booleanIndicates whether the product is a gift card item. •true: Gift card item •false: Not a gift card itemid stringOrder product line ID. The unique identifier for the product line in the order.price stringThe selling price of the product in two-digit precision, such as '12.41'.product_id string requiredThe product ID.Example:stringproduct_source string requiredProduct source。 •main_site: main station product •customize: custom productExample:stringpropertiesobject[]
Product customization information.name stringCustom attribute name.show booleanIndicates whether this message should be displayed on the frontend. •true: Displayed •false: Not displayedtype stringProduct attribute types. Valid values are: ● text: Text type ● picture:Image type ● link:Link typeurls arrayThe list of the URL resources.value stringThe value of custom attribute.quantity integer requiredProduct quantity. Value range: 0-120requires_shipping booleanIndicates whether shipping is required. •true: Required •false: Not requiredsku stringA unique identifier for the item in the fulfillment. Applicable only to custom line items. The maximum length is 255.title stringThe title of the product.variant_id string requiredProduct SKU serial number.Example:stringmarket_region_country_code stringMarket country.note stringDraft order note.note_attributesobject[]
The additional information.name stringThe name of the additional information.value stringThe value of the additional information.outer_id stringThe unique identifier for the operation. Each ID can only be used to perform the operation once.payment_termsobject
Payment information.pay_channel_id string requiredThe unique identifier for the payment channel.Example:stringpay_status stringPayment status. •unpaid •paidpayment_channel_name stringThe name of the payment channel.shipping_addressobject
Buyer's shipping address information.address1 stringThe first line of the address. This typically includes information such as the street address or a post office box number.address2 stringThe second line of the address. This typically includes information such as apartment, suite, or unit number.city stringThe city in the shipping address.city_code stringThe city code in the shipping address.company stringThe company name of the receiver in the shipping address.country stringThe country or district in the shipping address.country_code stringThe country code in the shipping address. A two-letter country or region code that follows the ISO 3166-1 (alpha 2) standard, used to identify a specific market's country or region.district stringDistrict of the shipping address.district_code stringThe code for the district in the shipping address, custom identifier.first_name stringThe buyer's first name.last_name stringThe buyer's last name.phone stringThe buyer's phone number.province stringThe province in the shipping address.province_code string创建草稿单 API 整改 100% district 4 of 7 E215 district J222The code for the province in the shipping address, which can be a custom code or a two-digit ISO 3166-2 international code. Summarize this tableThe code for the province in the shipping address, which can be a custom code or a two-digit ISO 3166-2 international code. Turn on screen reader support To enable screen reader support, press ⌘+Option+Z To learn about keyboard shortcuts, press ⌘slashzip stringThe postal code for the shipping address.shipping_linesobject
Logistics information.delivery_id stringShipping method ID, shipping template ID.price stringThe shipping cost for logistics, double type string with accuracy 2.shipping_type string requiredLogistics types. Valid values are: · system: System logistics · custom: Custom logistics When the logistics type is system, only the delivery_id needs to be provided. When the logistics type is custom, both the title and price fields must be provided.Example:stringtitle stringLogistics name.stock_reserved boolean requiredIndicates whether there is a stock reservation identifier at the order level. •true: Present •false: Nostock_reserved_time longOrder dimension inventory pre-reserved time.tags arrayDraft order tags. Multiple tags should be separated by commas.tax_exempt stringIndicates whether the product is subject to tax. •true: Tax is required. •false: No tax is required.
Status Codes
- 200
- 401
- 429
For the complete list of codes and messages, see Http status code.
Response Headers
traceId
A globally unique identifier for the request. It is used to track the request flow throughout the system, allowing for easy location and debugging when issues arise.
Response Body
draft_orderobject
Draft order object.billing_addressobject
Billing address information.address1 stringThe first line of the payment billing address. This typically includes information such as the street address or a post office box number. Maximum length: 255address2 stringThe second line of the payment billing address. This typically includes information such as apartment, suite, or unit number. Maximum length: 255area stringThe administrative region name in payment billing address.area_code stringThe code for administrative district, custom number.city stringThe city in the payment billing address.city_code stringThe code for city in the payment billing address.company stringThe country in the payment billing address.country stringThe country in the payment billing address.country_code stringThe country code in the payment billing address. A two-letter country or region code that follows the ISO 3166-1 (alpha 2) standard, used to identify a specific market's country or region.email stringThe buyer's email.first_name stringThe buyer's first name.last_name stringThe buyer's last name.phone stringThe buyer's phone number.province stringThe province in the billing payment address.province_code stringThe country code in the payment billing address. A two-letter country or region code that follows the ISO 3166-1 (alpha 2) standard, used to identify a specific market's country or region.same_as_receiver booleanIndicates whether the address is the same as the shipping information. •true: Same •false: Different Defalut value: falsestandard_province_code stringThe code for the province in the billing address, which is a two-digit ISO 3166-2 international code.This differs fromprovince_code- theprovince_coderesponse field uses a custom code.zip stringThe postal code for the shipping address.create_time longThe date and time when the draft order is created. Format: ISO 8601. Example: 2024-08-31T02:20:26+08:00currency stringThe store currency. The value of this parameter is a three-letter currency code that follows the ISO 4217 standard. For example, USD .customerobject
The buyer's information.area_code stringArea code of the buyer's contact address.email stringThe buyer's email address.first_name stringThe buyer's first name.id stringThe unique identifier for the buyer.last_name stringThe buyer's last name.phone stringThe buyer's phone number.discount_amount_ext stringOrder discount amount, represented as a string of type double with a precision of 2. For example, 12.41。discount_amount_ext_name stringOrder discount name.discount_amount_ext_setobject
The discount amount, displayed in both the buyer's currency and the store's currency.presentment_moneyobject
Buyer-side amount information.amount stringSeller-side amount. The value is rounded to two decimal places.currency_code stringThe buyer side currency. The value of this parameter is a three-letter currency code that follows the ISO 4217 standard. For example, USD.shop_moneyobject
Seller-side amount information.amount stringSeller-side amount. The value is rounded to two decimal places.currency_code stringThe store's used currency. The value of this parameter is a three-letter currency code that follows the ISO 4217 standard. For example, USD.id stringThe unique identifier for the draft order.invoice_url stringInvoice URL.line_itemsobject[]
List of product.applied_discountobject
Product custom discount information.amount stringDiscount amount , double type string for accuracy 2. For example: 12.41amount_setobject
Detailed information of discount amount, displayed in both the buyer's currency and the store's currency.presentment_moneyobject
Buyer-side amount information.amount stringBuyer-side amount.The value is rounded to two decimal places.currency_code stringThe buyer's used currency. The value of this parameter is a three-letter currency code that follows the ISO 4217 standard. For example, USD.shop_moneyobject
Seller-side amount information.amount stringSeller-side Amount. The value is rounded to two decimal places.currency_code stringThe store's used currency. The value of this parameter is a three-letter currency code that follows the ISO 4217 standard. For example, USD.before_amount stringThe original price of the product, a string of double type with two-digit precision.before_amount_setobject
Original price information of the product, displayed in both the buyer's currency and the store's currency.presentment_moneyobject
Buyer-side amount information.amount stringBuyer-side amount.The value is rounded to two decimal places.currency_code stringThe buyer's used currency. The value of this parameter is a three-letter currency code that follows the ISO 4217 standard. For example, USD.shop_moneyobject
Seller-side amount information.amount stringSeller-side Amount. The value is rounded to two decimal places.currency_code stringThe store's used currency. The value of this parameter is a three-letter currency code that follows the ISO 4217 standard. For example, USD.description stringThe discount description.title stringThe discount name.value longDiscount amount. When the discount type is percentage, the minimum value is 0 and the maximum value is 100 by default.value_type stringDiscount type. •fixed_amount •percentagegift_card booleanIndicates whether the product is a gift card item. •true: Gift card item •false: Not a gift card itemid stringProduct line ID, unique confirm a Product line.image_url stringThe image URL of the product picture.price stringProduct amount after participating in custom discounts.price_setobject
Product amount after participating in custom discounts, displayed in both the buyer's currency and the store's currency.presentment_moneyobject
Buyer's amount information.amount stringBuyer-side amount.The value is rounded to two decimal places.currency_code stringThe buyer's used currency. The value of this parameter is a three-letter currency code that follows the ISO 4217 standard. For example, USD.shop_moneyobject
Seller's amount information.amount stringSeller-side Amount. The value is rounded to two decimal places.currency_code stringThe store's used currency. The value of this parameter is a three-letter currency code that follows the ISO 4217 standard. For example, USD.product_id stringThe SPU serial number of the product.product_source stringProduct source。 •main_site: main product •customize: customize productpropertiesobject[]
The custom properties of the product.name stringCustom attribute name.show booleanIndicates whether this message should be displayed on the frontend. •true: Displayed •false: Not displayedtype stringAttribute type: ● text ● picture ● linkurls arrayThe URL resouces list.value stringThe value of the custom attribute.quantity integerProduct quantity. Value range: 0-120requires_shipping booleanIndicates whether physical shipping is required. •true: Required •false: Not required Default value: falsesku stringThe SKU of the product. The unique identifier for the product variant. Maximum length: 64tax_linesobject[]
Tax information.name stringThe name of the tax fee.price stringThe amount of the tax fee.price_setobject
The amount information.presentment_moneyobject
Buyer's amount information.amount stringBuyer-side amount.The value is rounded to two decimal places.currency_code stringThe buyer's used currency. The value of this parameter is a three-letter currency code that follows the ISO 4217 standard. For example, USD.shop_moneyobject
Seller's amount information.amount stringSeller-side Amount. The value is rounded to two decimal places.currency_code stringThe store's used currency. The value of this parameter is a three-letter currency code that follows the ISO 4217 standard. For example, USD.rate doubleThe tax rate, for display only. For Example, if the tax rate is 2%, specify this field as 0.02. Example: 0.02type stringTax fee type used to distinguish between commodity tax and freight tax. product_tax: commodity tax shipping_tax: freight taxtitle stringProduct title.variant_id stringProduct SKU serial number.variant_title stringProduct SKU title.logistics_price stringTotal shipping amount.logistics_price_setobject
The total shipping amount in multi-currency.presentment_moneyobject
Buyer's amount information.amount stringBuyer-side amount.The value is rounded to two decimal places.currency_code stringThe buyer's used currency. The value of this parameter is a three-letter currency code that follows the ISO 4217 standard. For example, USD.shop_moneyobject
Seller's amount information.amount stringBuyer-side amount.The value is rounded to two decimal places.currency_code stringThe buyer's used currency. The value of this parameter is a three-letter currency code that follows the ISO 4217 standard. For example, USD.logistics_tax stringTotal shipping tax fee.logistics_tax_setobject
The total shipping tax fee in muti-currency.presentment_moneyobject
Buyer's amount information.amount stringBuyer-side amount.The value is rounded to two decimal places.currency_code stringThe buyer's used currency. The value of this parameter is a three-letter currency code that follows the ISO 4217 standard. For example, USD.shop_moneyobject
Seller's amount information.amount stringSeller-side amount.The value is rounded to two decimal places.currency_code stringThe seller's used currency. The value of this parameter is a three-letter currency code that follows the ISO 4217 standard. For example, USD.market_name stringMarket name.market_region_country_code stringMarket country.note stringThe note of the draft order.note_attributesobject[]
Additional information for the draft order.name stringThe name of the additional attribute.value stringThe value of the additional attribute.payment_termsobject
Payment terms and Payment information.created_at stringThe date and time when the payment term is created. Format: ISO 8601. Example: 2024-08-31T02:20:26+08:00due_in_days integerWhen the terms type is NET, the payment is due after how many days if the payment is not madeid stringThe unique identifier for the payment iterm.overdue booleanIndicates whether the payment terms have expired. •true: Expired •false: Not expiredpay_channel_id stringThe unique identifier for the payment channel.pay_status stringPayment slip status. After the status is paid, this status will not synchronize with the payment status of the final order. •unpaid •paidpayment_channel_name stringPayment channel name.payment_schedulesobject[]
A set of schedules associated with the payment terms.completed_at stringPayment completion date.due_at stringThe due date and time for the payment.Calculate based on issued_at and due_in_days. If the type is fixed, calculate based on a custom fixed date.issued_at stringThe date and time when the payment term is activated. Format: ISO 8601. Example: 2024-08-31T02:20:26+08:00payment_terms_name stringThe name used to create the payment term template.payment_terms_type stringThe type of payment terms template used to create the payment terms: •FIXED: Merchant specified date •FULFILLMENT: Fulfillment (Shipment) completion date •NET: Fixed condition date •RECEIPT: Billing sent date •UNKNOWN: Unknown typeupdated_at stringThe date and time when the payment term is last updated. Format: ISO 8601. Example: 2024-08-31T02:20:26+08:00po_number stringPurchase order number recorded on the order in B2B scenarios.presentment_currency_code stringMarket currency.product_tax stringProduct total tax fee.product_tax_setobject
Product total tax fee, displayed in both the buyer's currency and the store's currency.presentment_moneyobject
Buyer's amount information.amount stringBuyer-side amount.The value is rounded to two decimal places.currency_code stringThe buyer's used currency. The value of this parameter is a three-letter currency code that follows the ISO 4217 standard. For example, USD.shop_moneyobject
Merchant's amount information.amount stringSeller-side amount.The value is rounded to two decimal places.currency_code stringThe buyer's used currency. The value of this parameter is a three-letter currency code that follows the ISO 4217 standard. For example, USD.shipping_addressobject
Shipping address.address1 stringThe first line of the address. This typically includes information such as the street address or a post office box number.address2 stringThe second line of the address. This typically includes information such as apartment, suite, or unit number.city stringThe city in the shipping address.city_code stringThe code for city in the shipping address.company stringThe company name of the receiver in shipping address.country stringThe country in the payment shipping address.country_code stringA two-letter country or region code that follows the ISO 3166-1 (alpha 2) standard, used to identify a specific country or region in the address. For example, US.district stringDistrict of the shipping address.district_code stringThe code for the district in the shipping address, custom identifier.first_name stringThe buyer's first name.last_name stringThe buyer's last name.phone stringThe buyer's phone number.province stringThe province in the shipping address.province_code stringThe code for the province in the shipping address, which can be a custom code or a two-digit ISO 3166-2 international code.standard_province_code stringThe code for the province in the shipping address, which is a two-digit ISO 3166-2 international code.This differs fromprovince_code- theprovince_coderesponse field uses a custom code.zip stringThe postal code for the shipping address.shipping_linesobject
Logistics information.delivery_id stringShipping method ID, shipping template ID.price longThe shipping cost for logistics, double type string with accuracy 2.price_setobject
The shipping cost for logistics in multi-currency.presentment_moneyobject
Buyer's amount information.amount stringBuyer-side amount.The value is rounded to two decimal places.currency_code stringThe buyer's used currency. The value of this parameter is a three-letter currency code that follows the ISO 4217 standard. For example, USD.shop_moneyobject
Merchant's amount information.amount stringSeller-side amount.The value is rounded to two decimal places.currency_code stringThe seller's used currency. The value of this parameter is a three-letter currency code that follows the ISO 4217 standard. For example, USD.shipping_type stringLogistics type: •system : system logistics •custom : custom logisticstitle stringLogistics name.status integerThe draft order statu: •completed •openstock_reserved booleanIndicates whether there is a stock reservation identifier at the order level. •true: Present •false: Nostock_reserved_time longThe time reserved for stock at the order level.store_id stringThe unique identifier for the store.tags arrayThe tags for draft orders that separated by a comma between multiple tags. The maximum number of tags is 99 for one store.tax_linesobject[]
The tax information.name stringTax name.price stringThe tax amount.price_setobject
The price information.presentment_moneyobject
Buyer's amount information.amount stringBuyer-side amount.The value is rounded to two decimal places.currency_code stringThe buyer's used currency. The value of this parameter is a three-letter currency code that follows the ISO 4217 standard. For example, USD.shop_moneyobject
Merchant's amount information.amount stringSeller-side amount.The value is rounded to two decimal places.currency_code stringThe seller's used currency. The value of this parameter is a three-letter currency code that follows the ISO 4217 standard. For example, USD.rate doubleThe tax rate.type stringTax fee type, used to distinguish between commodity tax and freight tax. · product_tax: commodity tax · shipping_tax: freight taxtotal_duties_setobject
Total Duties.presentment_moneyobject
Buyer's amount information.amount stringBuyer-side amount.The value is rounded to two decimal places.currency_code stringThe buyer's used currency. The value of this parameter is a three-letter currency code that follows the ISO 4217 standard. For example, USD.shop_moneyobject
Merchant's amount information.amount stringSeller-side amount.The value is rounded to two decimal places.currency_code stringThe seller's used currency. The value of this parameter is a three-letter currency code that follows the ISO 4217 standard. For example, USD.total_line_items_price stringThe total amount of products in the current draft order.total_line_items_price_setobject
The total amount of products.presentment_moneyobject
Buyer's amount information.amount stringBuyer-side amount.The value is rounded to two decimal places.currency_code stringThe buyer's used currency. The value of this parameter is a three-letter currency code that follows the ISO 4217 standard. For example, USD.shop_moneyobject
Merchant's amount information.amount stringSeller-side amount.The value is rounded to two decimal places.currency_code stringThe seller's used currency. The value of this parameter is a three-letter currency code that follows the ISO 4217 standard. For example, USD.total_price stringThe total amount of draft order: Product selling price - discount + tax + shipping.total_price_setobject
Draft order total amount, displayed in both the buyer's currency and the store's currency.presentment_moneyobject
Buyer's amount information.amount stringBuyer-side amount.The value is rounded to two decimal places.currency_code stringThe buyer's used currency. The value of this parameter is a three-letter currency code that follows the ISO 4217 standard. For example, USD.shop_moneyobject
Merchant's amount information.amount stringSeller-side amount.The value is rounded to two decimal places.currency_code stringThe seller's used currency. The value of this parameter is a three-letter currency code that follows the ISO 4217 standard. For example, USD.update_time longThe date and time when the draft order is last updated. Format: ISO 8601. Example: 2024-08-31T02:20:26+08:00
API Explorer
Debugger
Was this article helpful to you?