Requires write_draft_orders access scope.
For more info , refer to:
PUT https://{handle}.myshopline.com/admin/openapi/v20220901/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 .
Update draft single
Request Headers
  • Content-Type required
    The value of this field is fixed to application/json; charset=utf-8
  • Authorization string required
    The access token for the API. Please refer to App authorization to obtain the access token, and then put the obtained access token into the API request header in Bearer Token.
    Example:
    Bearer eyJhbGciOiJIUzUxMiJ9.eyJhcHBLZXkiOiJmMjM3OWQyMTYyOGMzM2QxMWRiMWZkYjY5N2EzZjdjMjZlNGMwYTA5Iiwic2VsbGVySWQiOiIyMDAwMjM0ODgwIiwic3RvcmVJZCI6IjE2NzIzNjk3Mjk2MDYiLCJ2ZXJzaW9uIjoiVjIiLCJkb21haW4iOiJodHRwczovL3NsLW9wZW4tc2cubXlzaG9wbGluZS5jb20iLCJ0aW1lc3RhbXAiOjE2NzUzMTk0OTI0MzksImlzcyI6Inlzb3VsIiwiZXhwIjoxNzY5OTI3NDkyfQ.UwQzomM2veGCUaOZ0paUxq5dpc7DXuhHYFvsQ_uIAKduzWcb_j2E4q_36El83sp145D4cKbpcE5KCeeIz-JNQw
Request Body
  • draft_orderobject
    Draft order object
  • billing_addressobject
    Payment slip address
  • address1 string
    Pay the bill recipient detail address ( 255 characters max )
    Example: 8899 Garfield Street
  • address2 string
    Pay the bill recipient detail address additional ( 255 characters max )
    Example: Apartment 5
  • area string
    Administrative region name ( up to 64 characters )
  • area_code string
    Administrative district encoding , custom number
    Example: 4200006
  • city string
    City name ( up to 64 characters )
  • city_code string
    City coding , custom number
  • company string
    Company name
    Example: SHOPLINE
  • country string
    Country name ( up to 64 characters )
    Example: Usa
  • country_code string
    Country or region code , two ISO-3166-1
    Example: US
  • email string
    User mailbox
    Example: test@shoplineapp.com
  • first_name string
    User name ( up to 64 characters )
    Example: Tom
  • last_name string
    User last name ( up to 64 characters )
    Example: Washington
  • phone string
    Contact number ( 32 characters max )
    Example: 13100000000
  • province string
    State or provincial encoding , custom number ( up to 64 characters )
    Example: California
  • province_code string
    Payment slip consignee provincial coding
    Example: 4200006
  • same_as_receiver boolean
    Same as the delivery information? (if they are same, parameters below may not be transmitted)
  • zip string
    Shipping address postal number
    Example: 92503
  • calc_sku_stock_mode string required
    Calculate inventory mode : not_limit , Infinity inventory ; real , real inventory ; reserve_real : reserve inventory + real inventory
    Example: not_limit
  • customerobject
    Buyer information
  • area_code string
    Contact area id
  • email string
    User mailbox
  • id string required
    User ID
  • phone string
    User mobile phone number
  • discount_amount_ext string
    Order Discount amount , double type string for accuracy 2 , eg : " 12.41 "
    Example: 2.00
  • discount_amount_ext_name string
    Order discount name (less than 64 characters)
  • id string required
    Draft order number
    Example: 2505659131831930856670
  • language_infoobject
    Language information
  • customer_language string
    Buyer side checkout language (preferred)
  • merchant_language string
    Seller side checkout language (buyer side preferred)
  • line_itemsobject[] required
    Listing list
  • applied_discountobject
    Product discount information
  • description string
    Discount description
  • title string
    Discount name
  • value long
    Discount amount, discount value, when the discount type is DISCOUNT_AMOUNT_PERCENTAGE, the minimum value is 0 and the maximum value is 100 by default
  • value_type string
    Discount type : fixed_amount ( fixed amount ) 、percentage ( % )
  • gift_card boolean
    Whether it is a gift card product
  • id string
    Order Product line id , unique confirm a Product line
  • price string
    Product selling price , double type string for precision 2 , eg : " 12.41 "
  • product_id string required
    Product ID
  • product_source string required
    Product source main_site main station product、customize custom product
  • quantity integer required
    Product quantity
  • title string
    Product name
  • variant_id string required
    Product SKUID
  • note string
    Draft order note
    Example: Customer wants to ship asap
  • note_attributesobject[]
    Additional information
  • name string
    Name
  • value string
    value
  • outer_id string
    The only identification of operation , the same id can only perform one operation
  • payment_termsobject
    Payment information
  • pay_channel_id string required
    Payment method ID
  • pay_status string required
    Payment status
  • payment_channel_name string
    Payment channel name
  • shipping_addressobject
    Consignee address information
  • address1 string
    Detailed address information 1 , used as a complementary information ( up to 255 characters )
    Example: 8899 Garfield Street
  • address2 string
    Detailed address information 2 , used as a complementary information ( up to 255 characters )
    Example: Apartment 5
  • city string
    City name ( up to 64 characters )
    Example: Riverside
  • company string
    Company name
    Example: SHOPLINE
  • country string
    Country name ( up to 64 characters )
    Example: Usa
  • country_code string
    Country or region code , two ISO-3166-1
  • district string
    Administrative region name ( up to 64 characters )
  • district_code string
    Administrative district encoding , custom number
    Example: 4200006
  • first_name string
    Name ( up to 64 characters )
    Example: Tom
  • last_name string
    Last name ( up to 64 characters )
    Example: Washington
  • phone string
    Contact number ( 32 characters max )
    Example: 13100000000
  • province string
    State or provincial name ( up to 64 characters )
    Example: California
  • province_code string
    State or provincial code , custom number
    Example: 4200006
  • zip string
    Shipping address postal number
    Example: 92503
  • shipping_linesobject
    Logistics information
  • delivery_id string
    Shipping method id , shipping template id
  • price string
    Custom shipping , DOUBLE type string with accuracy 2 , eg : 12.41
  • shipping_type string required
    Logistics type system- system logistics; custom- custom logistics. When logistics is system logistics, you only need to transmit delivery_id , and when logistics type is custom logistics, transmit the fields of title and price
  • title string
    Customize shipping name
  • stock_reserved boolean required
    Order dimension inventory reserve mark : true、flase
    Example: true
  • stock_reserved_time long
    Order dimension inventory pre-reserved time
    Example: 1669280400000
  • tags array
    The draft order tag uses separated by ',' between multiple tag rooms , and the shop dimension supports up to 99 tag
    Example: shine,bili
Response
For more information about status codes, see Http status code.

Response Headers
  • traceId
    traceId
Response Body
  • draft_orderobject
    Draft order
  • billing_addressobject
    Payment slip address
  • address1 string
    Detailed address information 1 , used as complementary information
    Example: 8899 Garfield Street
  • address2 string
    Detailed address information 2 , used as complementary information
    Example: Apartment 5
  • area string
    Administrative region name
  • area_code string
    Administrative district encoding , custom number
    Example: 4200006
  • city string
    City name
    Example: Riverside
  • city_code string
    City coding , custom number
    Example: 4200006
  • company string
    Company name
    Example: SHOPLINE
  • country string
    Country name
    Example: Usa
  • country_code string
    Country or region code , two ISO-3166-1
    Example: US
  • email string
    User mailbox
    Example: test@shoplineapp.com
  • first_name string
    User name
    Example: Tom
  • last_name string
    User last name
    Example: Washington
  • phone string
    Contact number
    Example: 13100000000
  • province string
    State or provincial name
    Example: California
  • province_code string
    State or provincial code , custom number
    Example: 4200006
  • same_as_receiver boolean
    Same as receiving information : true、false
    Example: true
  • zip string
    Shipping address postal number
    Example: 92503
  • buyer_infoobject
    Buyer information
  • area_code string
    Contact area id
  • email string
    User mailbox
  • id string
    User ID
  • phone string
    User mobile phone number
  • create_time long
    Create time , time stamp format
    Example: 1667638652832
  • currency string
    Store currency
    Example: USD
  • discount_amount_ext string
    Order Discount amount , double type string for accuracy 2 , eg : " 12.41 "
  • discount_amount_ext_name string
    Order Discount name
  • id string
    Draft order number
    Example: 2505659131831930856670
  • invoice_url string
    Invoice link
  • line_itemsobject[]
    Listing list
  • applied_discountobject
    Product custom discount information
  • amount string
    Discount amount , double type string for accuracy 2 , eg : " 12.41 "
    Example: 1.00
  • before_amount string
    Product selling price , double type string for precision 2 , eg : " 12.41 "
    Example: 3.00
  • description string
    Discount description
    Example: 5 yuan off for two more pieces
  • title string
    Discount name
    Example: Full reduction
  • value long
    Discount amount, discount value, when the discount type is DISCOUNT_AMOUNT_PERCENTAGE, the minimum value is 0 and the maximum value is 100 by default
    Example: 1
  • value_type string
    Discount type : fixed_amount ( fixed amount ) 、percentage ( % )
    Example: fixed_amount
  • gift_card boolean
    Wei for gift cards or not : true、false
    Example: true
  • id string
    Product line id , unique confirm a Product line
  • price string
    Product amount after participating in custom discounts
    Example: 2.00
  • product_id string
    Product s pu serial number
    Example: 16056577393789045351043258
  • product_source string
    Product source main_site main station product、customize custom product
    Example: main_site
  • quantity integer
    Product quantity
    Example: 1
  • requires_shipping boolean
    Needs physical transportation and delivery or not : true、false
    Example: true
  • title string
    Product title
  • variant_id string
    Product SKU serial number
    Example: 18056577393793239655103258
  • variant_title string
    Commercial sku title
  • logistics_price string
    Total shipping amount
    Example: 2.00
  • logistics_tax string
    Total shipping tax
    Example: 2.00
  • note string
    Draft order note
    Example: Customer wants to ship asap
  • note_attributesobject[]
    Additional information
  • name string
    Name
  • value string
    value
  • payment_termsobject
    Payment information
  • pay_channel_id string
    Payment channel id
  • pay_status string
    Payment slip status : after not paying for the paid draft order and generating the order , the payment slip state will not synchronize the payment status of the order
    Example: unpaid
  • payment_channel_name string
    Payment channel name
  • product_tax string
    Product total tax
    Example: 2.00
  • shipping_addressobject
    Shipping address
  • address1 string
    Detailed address information 1 , used as complementary information
    Example: 8899 Garfield Street
  • address2 string
    Detailed address information 2 , used as complementary information
    Example: Apartment 5
  • city string
    City name
    Example: Riverside
  • company string
    Company name
    Example: SHOPLINE
  • country string
    Country name
    Example: Usa
  • country_code string
    Country or region code , two ISO-3166-1
    Example: US
  • district string
    Administrative region name
  • district_code string
    Administrative district encoding , custom number
  • first_name string
    First name
    Example: Tom
  • last_name string
    Last name
    Example: Washington
  • phone string
    Contact number
  • province string
    State or provincial name
    Example: California
  • province_code string
    State or provincial code , custom number
    Example: 4200006
  • zip string
    Shipping address postal number
    Example: 92503
  • shipping_linesobject
    Logistics information
  • delivery_id string
    Shipping method id , shipping template id
  • price long
    Logistics shipping , double type string with accuracy 2.
  • shipping_type string
    Logistics type system- system logistics ; custom- custom logistics
    Example: system
  • title string
    Logistics name
  • status integer
    Draft order status : open 、 complete
  • stock_reserved boolean
    Order dimension inventory reserve mark : true、flase
    Example: true
  • stock_reserved_time long
    Order dimension inventory pre-reserved time
    Example: 1669280400000
  • store_id string
    store ID
  • tags array
    The draft order tag uses separated by ',' between multiple tag rooms , and the shop dimension supports up to 99 tag
    Example: shine,bili
  • total_line_items_price string
    Current draft order Product total amount
    Example: 2.00
  • total_price string
    Current total draft order amount , Product selling price-discount + tax + shipping
    Example: 2.00
  • update_time long
    Update time , time stamp format
    Example: 1667638652832
API Explorer
https://openapiceshidianpu.myshopline.com/admin/openapi/v20220901

ParamOptions

— header required

Body

required
{
  "draft_order": {
    "billing_address": {
      "address1": "8899 Garfield Street",
      "address2": "Apartment 5",
      "area": "",
      "area_code": "4200006",
      "city": "",
      "city_code": "",
      "company": "SHOPLINE",
      "country": "Usa",
      "country_code": "US",
      "email": "test@shoplineapp.com",
      "first_name": "Tom",
      "last_name": "Washington",
      "phone": "13100000000",
      "province": "California",
      "province_code": "4200006",
      "same_as_receiver": false,
      "zip": "92503"
    },
    "calc_sku_stock_mode": "not_limit",
    "customer": {
      "area_code": "",
      "email": "",
      "id": "",
      "phone": ""
    },
    "discount_amount_ext": "2.00",
    "discount_amount_ext_name": "",
    "id": "2505659131831930856670",
    "language_info": {
      "customer_language": "",
      "merchant_language": ""
    },
    "line_items": [
      {
        "applied_discount": {
          "description": "",
          "title": "",
          "value": 0,
          "value_type": ""
        },
        "gift_card": false,
        "id": "",
        "price": "",
        "product_id": "",
        "product_source": "",
        "quantity": 0,
        "title": "",
        "variant_id": ""
      }
    ],
    "note": "Customer wants to ship asap",
    "note_attributes": [
      {
        "name": "",
        "value": ""
      }
    ],
    "outer_id": "",
    "payment_terms": {
      "pay_channel_id": "",
      "pay_status": "",
      "payment_channel_name": ""
    },
    "shipping_address": {
      "address1": "8899 Garfield Street",
      "address2": "Apartment 5",
      "city": "Riverside",
      "company": "SHOPLINE",
      "country": "Usa",
      "country_code": "",
      "district": "",
      "district_code": "4200006",
      "first_name": "Tom",
      "last_name": "Washington",
      "phone": "13100000000",
      "province": "California",
      "province_code": "4200006",
      "zip": "92503"
    },
    "shipping_lines": {
      "delivery_id": "",
      "price": "",
      "shipping_type": "",
      "title": ""
    },
    "stock_reserved": true,
    "stock_reserved_time": 1669280400000,
    "tags": [
      "shine,bili"
    ]
  }
}

Language

curl --request PUT \
--url https://openapiceshidianpu.myshopline.com/admin/openapi/v20220901/orders/draft_orders.json \
--header 'Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJhcHBLZXkiOiJmMjM3OWQyMTYyOGMzM2QxMWRiMWZkYjY5N2EzZjdjMjZlNGMwYTA5Iiwic2VsbGVySWQiOiIyMDAwMjM0ODgwIiwic3RvcmVJZCI6IjE2NzIzNjk3Mjk2MDYiLCJ2ZXJzaW9uIjoiVjIiLCJkb21haW4iOiJodHRwczovL3NsLW9wZW4tc2cubXlzaG9wbGluZS5jb20iLCJ0aW1lc3RhbXAiOjE2NzUzMTk0OTI0MzksImlzcyI6Inlzb3VsIiwiZXhwIjoxNzY5OTI3NDkyfQ.UwQzomM2veGCUaOZ0paUxq5dpc7DXuhHYFvsQ_uIAKduzWcb_j2E4q_36El83sp145D4cKbpcE5KCeeIz-JNQw' \
--header 'Content-Type: application/json; charset=utf-8' \
--header 'accept: application/json'
Was this article helpful to you?

Error loading component.

Error loading component.