需要 write_draft_orders 权限点。
更多权限点使用信息,请参考:
PUT https://{handle}.myshopline.com/admin/openapi/v20210901/orders/draft_orders.json
handle :店铺的唯一标识符,值为店铺域名的前缀。例如,域名为 open001.myshopline.com 的店铺,其 handleopen001
更新草稿单
请求头
  • Content-Type required
    字段值固定为application/json; charset=utf-8
  • Authorization string required
    资源的访问令牌。请参考 应用授权 获取访问令牌,然后将获取到的访问令牌以 Bearer 格式传入
    Example:
    Bearer eyJhbGciOiJIUzUxMiJ9.eyJhcHBLZXkiOiJmMjM3OWQyMTYyOGMzM2QxMWRiMWZkYjY5N2EzZjdjMjZlNGMwYTA5Iiwic2VsbGVySWQiOiIyMDAwMjM0ODgwIiwic3RvcmVJZCI6IjE2NzIzNjk3Mjk2MDYiLCJ2ZXJzaW9uIjoiVjIiLCJkb21haW4iOiJodHRwczovL3NsLW9wZW4tc2cubXlzaG9wbGluZS5jb20iLCJ0aW1lc3RhbXAiOjE2NzUzMTk0OTI0MzksImlzcyI6Inlzb3VsIiwiZXhwIjoxNzY5OTI3NDkyfQ.UwQzomM2veGCUaOZ0paUxq5dpc7DXuhHYFvsQ_uIAKduzWcb_j2E4q_36El83sp145D4cKbpcE5KCeeIz-JNQw
请求体
  • draft_orderobject
    草稿单对象
  • billing_addressobject
    支付账单地址
  • address1 string
    详细地址信息1,用作补充信息(最大255个字符)
    Example: 8899 Garfield Street
  • address2 string
    详细地址信息2,用作补充信息(最大255个字符)
    Example: Apartment 5
  • area string
    行政区名称(最大64个字符)
  • area_code string
    行政区编码,自定义编号
    Example: 4200006
  • city string
    城市名称(最大64个字符)
  • city_code string
    城市编码,自定义编号
  • company string
    公司名称
    Example: SHOPLINE
  • country string
    国家或是地区名称(最大64个字符)
    Example: 美国
  • country_code string
    国家或是地区编码,两位的编码缩写(ISO-3166-1)
    Example: US
  • email string
    用户邮箱
    Example: test@shoplineapp.com
  • first_name string
    用户 名(最大64个字符)
    Example: Tom
  • last_name string
    用户 姓(最大64个字符)
    Example: Washington
  • phone string
    联系电话(最大32个字符)
    Example: 13100000000
  • province string
    州或是省编码,自定义编号(最大64个字符)
    Example: 加利福尼亚州
  • province_code string
    支付账单收件人省编码
    Example: 4200006
  • same_as_receiver boolean
    是否与收货信息相同(相同下面参数可以不传)
  • zip string
    收货地址邮政编号
    Example: 92503
  • calc_sku_stock_mode string required
    计算库存模式:not_limit,无限库存;real,真实库存;reserve_real:预留库存+真实库存
    Example: not_limit
  • customerobject
    买家信息
  • area_code string
    联系方式 区号
  • email string
    用户邮箱
  • id string required
    用户id
  • phone string
    用户手机号
  • discount_amount_ext string
    订单优惠金额,精度2的double类型的字符串,eg:"12.41"
    Example: 2.00
  • discount_amount_ext_name string
    订单优惠名称(最大64个字符)
    Example: 满减
  • id string required
    草稿单号
    Example: 2505659131831930856670
  • language_infoobject
    语言信息
  • customer_language string
    买家侧下单语种(优先使用此语种)
  • merchant_language string
    卖家侧下单语种(优先使用买家侧语种)
  • line_itemsobject[] required
    商品信息列表
  • applied_discountobject
    商品折扣信息
  • description string
    折扣描述
  • title string
    折扣名称
  • value long
    折扣数额,折扣值,当折扣类型为DISCOUNT_AMOUNT_PERCENTAGE时,此值最大默认100,最小为0
  • value_type string
    折扣类型:fixed_amount(固定金额)、percentage(百分比)
  • gift_card boolean
    是否为礼品卡商品
  • id string
    订单商品行id, 唯一确认一个商品行
  • price string
    商品售价,精度2的double类型的字符串,eg:"12.41"
  • product_id string required
    商品id
  • product_source string required
    商品来源 main_site主站商品、customize自定义商品
  • quantity integer required
    商品数量
  • title string
    商品名称
  • variant_id string required
    商品skuId
  • note string
    草稿单备注
    Example: 客户想要尽快发货
  • note_attributesobject[]
    附加信息
  • name string
    名称
  • value string
  • outer_id string
    操作唯一标识,同一个id只能执行一次操作
  • payment_termsobject
    付款信息
  • pay_channel_id string required
    支付方式id
  • pay_status string required
    付款状态
  • payment_channel_name string
    支付渠道名称
  • shipping_addressobject
    收货人地址信息
  • address1 string
    详细地址信息1,用作补充信息(最大255个字符)
    Example: 8899 Garfield Street
  • address2 string
    详细地址信息2,用作补充信息(最大255个字符)
    Example: Apartment 5
  • city string
    城市名称(最大64个字符)
    Example: Riverside
  • company string
    公司名称
    Example: SHOPLINE
  • country string
    国家或是地区名称(最大64个字符)
    Example: 美国
  • country_code string
    国家或是地区编码,两位的编码缩写(ISO-3166-1)
    Example: US
  • district string
    行政区名称(最大64个字符)
  • district_code string
    行政区编码,自定义编号
    Example: 4200006
  • first_name string
    名(最大64个字符)
    Example: Tom
  • last_name string
    姓(最大64个字符)
    Example: Washington
  • phone string
    联系电话(最大32个字符)
    Example: 13100000000
  • province string
    州或是省名称(最大64个字符)
    Example: 加利福尼亚州
  • province_code string
    州或是省编码,自定义编号
    Example: 4200006
  • zip string
    收货地址邮政编号
    Example: 92503
  • shipping_linesobject
    物流信息
  • delivery_id string
    送货方式ID、运费模板ID
  • price string
    自定义运费,精度2的double类型的字符串,eg:"12.41"
  • shipping_type string required
    物流类型 system-系统物流;custom-自定义物流。当物流为系统物流时只需要传delivery_id,当物流类型伟自定义物流时传title和price字段
  • title string
    自定义配送名称
  • stock_reserved boolean required
    订单维度库存预留标识:true、flase
    Example: true
  • stock_reserved_time long
    订单维度库存预预留时间
    Example: 1669280400000
  • tags array
    草稿单标签,多个标签间用逗号分隔,店铺维度最大支持99个标签
    Example: shine,bili
响应
更多状态码信息请参考 HTTP 状态码

响应头
  • traceId
    traceId
响应体
  • draft_orderobject
    草稿单
  • billing_addressobject
    支付账单地址
  • address1 string
    详细地址信息1,用作补充信息
    Example: 8899 Garfield Street
  • address2 string
    详细地址信息2,用作补充信息
    Example: Apartment 5
  • area string
    行政区名称
  • area_code string
    行政区编码,自定义编号
    Example: 4200006
  • city string
    城市名称
    Example: Riverside
  • city_code string
    城市编码,自定义编号
    Example: 4200006
  • company string
    公司名称
    Example: SHOPLINE
  • country string
    国家或是地区名称
    Example: 美国
  • country_code string
    国家或是地区编码,两位的编码缩写(ISO-3166-1)
    Example: US
  • email string
    用户邮箱
    Example: test@shoplineapp.com
  • first_name string
    用户 名
    Example: Tom
  • last_name string
    用户 姓
    Example: Washington
  • phone string
    联系电话
    Example: 13100000000
  • province string
    州或是省名称
    Example: 加利福尼亚州
  • province_code string
    州或是省编码,自定义编号
    Example: 4200006
  • same_as_receiver boolean
    是否与收货信息相同:true、false
    Example: true
  • zip string
    收货地址邮政编号
    Example: 92503
  • buyer_infoobject
    买家信息
  • area_code string
    联系方式 区号
  • email string
    用户邮箱
  • id string
    用户id
  • phone string
    用户手机号
  • create_time long
    创建时间,时间戳格式
    Example: 1667638652832
  • currency string
    店铺币种
    Example: USD
  • discount_amount_ext string
    订单优惠金额,精度2的double类型的字符串,eg:"12.41"
  • discount_amount_ext_name string
    订单优惠名称
  • id string
    草稿单号
    Example: 2505659131831930856670
  • invoice_url string
    invoice链接
  • line_itemsobject[]
    商品信息列表
  • applied_discountobject
    商品自定义折扣信息
  • amount string
    折扣金额,精度2的double类型的字符串,eg:"12.41"
    Example: 1.00
  • before_amount string
    商品售价,精度2的double类型的字符串,eg:"12.41"
    Example: 3.00
  • description string
    折扣描述
    Example: 满两件减5元
  • title string
    折扣名称
    Example: 满减
  • value long
    折扣数额,折扣值,当折扣类型为DISCOUNT_AMOUNT_PERCENTAGE时,此值最大默认100,最小为0
    Example: 1
  • value_type string
    折扣类型:fixed_amount(固定金额)、percentage(百分比)
    Example: fixed_amount
  • gift_card boolean
    是否为礼品卡商品:true、false
    Example: true
  • id string
    商品行id, 唯一确认一个商品行
  • price string
    商品参加自定义折扣后的金额
    Example: 2.00
  • product_id string
    商品spu序列号
    Example: 16056577393789045351043258
  • product_source string
    商品来源 main_site主站商品、customize自定义商品
    Example: main_site
  • quantity integer
    商品数量
    Example: 1
  • requires_shipping boolean
    是否需要实物运输发货:true、false
    Example: true
  • title string
    商品标题
  • variant_id string
    商品sku序列号
    Example: 18056577393793239655103258
  • variant_title string
    商sku标题
  • logistics_price string
    运费总金额
    Example: 2.00
  • logistics_tax string
    运费总税费
    Example: 2.00
  • note string
    草稿单备注
    Example: 客户想要尽快发货
  • note_attributesobject[]
    附加信息
  • name string
    名称
  • value string
  • payment_termsobject
    付款信息
  • pay_channel_id string
    支付渠道ID
  • pay_status string
    支付单状态:未支付unpaid、已支付paid 草稿单生成订单后,该状态不会同步订单的支付状态
    Example: unpaid
  • payment_channel_name string
    支付渠道名称
  • product_tax string
    商品总税费
    Example: 2.00
  • shipping_addressobject
    收货地址
  • address1 string
    详细地址信息1,用作补充信息
    Example: 8899 Garfield Street
  • address2 string
    详细地址信息2,用作补充信息
    Example: Apartment 5
  • city string
    城市名称
    Example: Riverside
  • company string
    公司名称
    Example: SHOPLINE
  • country string
    国家或是地区名称
    Example: 美国
  • country_code string
    国家或是地区编码,两位的编码缩写(ISO-3166-1)
    Example: US
  • district string
    行政区名称
  • district_code string
    行政区编码,自定义编号
  • first_name string
    Example: Tom
  • last_name string
    Example: Washington
  • phone string
    联系电话
    Example: 13100000000
  • province string
    州或是省名称
    Example: 加利福尼亚州
  • province_code string
    州或是省编码,自定义编号
    Example: 4200006
  • zip string
    收货地址邮政编号
    Example: 92503
  • shipping_linesobject
    物流信息
  • delivery_id string
    送货方式ID、运费模板ID
  • price long
    物流运费,精度2的double类型的字符串
  • shipping_type string
    物流类型 system-系统物流;custom-自定义物流
    Example: system
  • title string
    物流名称
  • status integer
    草稿单状态:open 、 complete
  • stock_reserved boolean
    订单维度库存预留标识:true、flase
    Example: true
  • stock_reserved_time long
    订单维度库存预预留时间
    Example: 1669280400000
  • store_id string
    店铺id
  • tags array
    草稿单标签,多个标签间用逗号分隔,店铺维度最大支持99个标签
    Example: shine,bili
  • total_line_items_price string
    当前草稿单商品总金额
    Example: 2.00
  • total_price string
    当前草稿单总金额,商品售价-折扣+税费+运费
    Example: 2.00
  • update_time long
    更新时间,时间戳格式
    Example: 1667638652832
API Explorer
https://openapiceshidianpu.myshopline.com/admin/openapi/v20210901

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": "美国",
      "country_code": "US",
      "email": "test@shoplineapp.com",
      "first_name": "Tom",
      "last_name": "Washington",
      "phone": "13100000000",
      "province": "加利福尼亚州",
      "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": "客户想要尽快发货",
    "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": "美国",
      "country_code": "US",
      "district": "",
      "district_code": "4200006",
      "first_name": "Tom",
      "last_name": "Washington",
      "phone": "13100000000",
      "province": "加利福尼亚州",
      "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/v20210901/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'
这篇文章对你有帮助吗?

Error loading component.

Error loading component.