Requires write_draft_orders access scope.
For more info , refer to:
PUT https://{handle}.myshopline.com/admin/openapi/v20230901/orders/draft_orders/:id/complete.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 .
Push draft single into order
Path Parameters
  • id string required
    Draft order number
    Example: 2505751787769346133516
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
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
  • street_name string
    Street name
  • street_number string
    Street encoding , custom numbering
    Example: 4200006
  • zip string
    Shipping address postal number
    Example: 92503
  • create_at long
    Create time , time stamp format
    Example: 1667638652832
  • currency string
    Store currency
    Example: USD
  • customerobject
    Buyer information
  • area_code string
    Contact area id
  • email string
    User mailbox
  • first_name string
    User's first name
    Example: Xiaoliu
  • id string
    User ID
  • last_name string
    User's last name
    Example: Wang
  • phone string
    User mobile phone number
  • 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
  • note string
    Draft order note
    Example: Customer wants to ship asap
  • note_attributesobject[]
    Additional information
  • name string
    Name
  • value string
    value
  • order_id string
    Order number generated by current draft order
    Example: 21056577640603870897253153
  • 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
  • seller_id string
    Merchant id
  • 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
  • city_code string
    City coding , custom number
    Example: 4200006
  • company string
    Company name
  • country string
    Country name
    Example: Usa
  • country_code string
    Country or region code , two ISO-3166-1
    Example: US
  • delivery_store_code string
    Store code , custom number
    Example: 4200006
  • delivery_store_name string
    Store name
  • district string
    Administrative region name
  • district_code string
    Administrative district encoding , custom number
    Example: 4200006
  • first_name string
    First name
    Example: Tom
  • last_name string
    Last name
    Example: Washington
  • phone string
    Contact number
    Example: 13100000000
  • province string
    Province
  • province_code string
    Province-coding
  • street_name string
    Street name
  • street_number string
    Street encoding , custom numbering
    Example: 4200006
  • zip string
    Shipping address postal number
    Example: 92503
  • shipping_linesobject
    Logistics information
  • delivery_id string
    Shipping method id , shipping template id
  • express_type_source string
    Logistics type system- system logistics ; custom- custom logistics
    Example: system
  • price string
    Logistics shipping , double type string with accuracy 2
    Example: 12.41
  • title string
    Shipping template name
  • status string
    Draft order status : open 、 complete
    Example: open
  • stock_reserved boolean
    Order dimension inventory reserve mark : true、flase
    Example: true
  • stock_reserved_time long
    Order dimension inventory pre-reserved time
    Example: 1669280400000
  • subtotal_price string
    Order amount , double type string for accuracy 2 , eg : " 12.41 "
  • 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_discounts string
    Total discount amount , double type string for precision 2 , eg : " 12.41 "
  • total_duties_setobject
    Total duty
  • presentment_moneyobject
    Buyer side amount information
  • amount string
    Amount
  • currency_code string
    Currency
  • shop_moneyobject
    Sell side amount information
  • amount string
    Amount
  • currency_code string
    Currency
  • total_line_items_price string
    Current draft order Product total amount
    Example: 2.00
  • total_tax string
    Total tax , double type string for precision 2 , eg : " 12.41 "
  • update_at long
    Update time , time stamp format
    Example: 1667638652832
API Explorer
https://openapiceshidianpu.myshopline.com/admin/openapi/v20230901

ParamOptions

— path required
— header required

Language

curl --request PUT \
--url https://openapiceshidianpu.myshopline.com/admin/openapi/v20230901/orders/draft_orders/id/complete.json \
--header 'Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJhcHBLZXkiOiJmMjM3OWQyMTYyOGMzM2QxMWRiMWZkYjY5N2EzZjdjMjZlNGMwYTA5Iiwic2VsbGVySWQiOiIyMDAwMjM0ODgwIiwic3RvcmVJZCI6IjE2NzIzNjk3Mjk2MDYiLCJ2ZXJzaW9uIjoiVjIiLCJkb21haW4iOiJodHRwczovL3NsLW9wZW4tc2cubXlzaG9wbGluZS5jb20iLCJ0aW1lc3RhbXAiOjE2NzUzMTk0OTI0MzksImlzcyI6Inlzb3VsIiwiZXhwIjoxNzY5OTI3NDkyfQ.UwQzomM2veGCUaOZ0paUxq5dpc7DXuhHYFvsQ_uIAKduzWcb_j2E4q_36El83sp145D4cKbpcE5KCeeIz-JNQw' \
--header 'Content-Type: application/json; charset=utf-8' \
--header 'accept: application/json'
Examples
Complete draft order
Response
{
"draft_order": {
"billing_address": {
"same_as_receiver": true
},
"create_at": 1673161376418,
"currency": "USD",
"customer": {
"email": "test@test.com",
"id": "2200103332"
},
"discount_amount_ext": "0.0",
"id": "2505751787769346133516",
"invoice_url": "https://us-store.myshopline.com/invoices/2505751787769346133516?secret=53B1B0ECBBBA017342417F777C8C1DDF33851178BD6523B2814C8D4922070D13",
"line_items": [
{
"gift_card": false,
"id": "16057477328340821055433562180574773283446798151735620",
"price": "1.0",
"product_id": "16057477328340821055433562",
"product_source": "main_site",
"quantity": 1,
"requires_shipping": true,
"title": "哈密瓜",
"variant_id": "18057477328344679815173562"
}
],
"order_id": "21057517879819638275887587",
"payment_terms": {
"pay_channel_id": "5748627027600126224",
"pay_status": "unpaid",
"payment_channel_name": "ACH Direct Debit"
},
"seller_id": "3400002118",
"shipping_address": {
"address1": "123 Java Road",
"address2": "street2",
"city": "Batu Pahat",
"city_code": "1100016",
"company": "",
"country": "马来西亚",
"country_code": "MY",
"district": "Ayer Hitam",
"district_code": "1100120",
"first_name": "test",
"last_name": "test",
"phone": "1111",
"province": "Johor",
"province_code": "1100001",
"zip": "112233"
},
"shipping_lines": {
"delivery_id": "DP5252954538512632866",
"express_type_source": "system",
"price": "5.0",
"title": "马来"
},
"status": "400",
"stock_reserved": false,
"total_line_items_price": "1.0",
"total_tax": "0.0",
"update_at": 1673161388870
}
}
Was this article helpful to you?

Error loading component.

Error loading component.