需要 write_orders 权限点。
更多权限点使用信息,请参考:
POST https://{handle}.myshopline.com/admin/openapi/v20220601/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
请求体
  • orderobject required
    订单信息
  • billing_addressobject required
    账单地址
  • address1 string
    账单收件人详细地址(最大255个字符)
  • address2 string
    账单收件人详细地址附加(最大255个字符)
  • area string
    账单收件人区县(最大64个字符)
  • area_code string
    账单收件人区县编码
  • city string
    账单收件人城市(最大64个字符)
  • city_code string
    账单收件人城市编码
  • company string
    公司名称
  • country string
    账单收件人国家(最大64个字符)
  • country_code string
    账单收件人国家编码
  • email string
    账单收件人邮箱
  • first_name string
    账单收件人名
  • last_name string
    账单收件人姓
  • phone string
    账单收件人名手机号
  • province string
    账单收件人名省份
  • province_code string
    账单收件人名省份编码
  • same_as_receiver boolean
    是否与收货信息相同(相同其他参数可以不传)
  • zip string
    账单收件人名邮编
  • customerobject
    买家信息
  • email string
    用户邮箱
  • first_name string
  • id string
    用户id
  • last_name string
  • phone string
    用户手机号
  • line_itemsobject[] required
    订单商品快照信息
  • price string
    商品售价,精度2
  • product_id string
    spu序列号
  • quantity long
    订单中的商品数量
  • rate string
    税费比例,字符串类型的小数
  • title string
    商品标题
  • variant_id string
    商品sku序列号
  • note string
    订单备注,最大50个字符
  • note_attributesobject[]
    附加信息
  • name string
    名称
  • value string
  • price_infoobject required
    价格信息
  • current_extra_total_discounts string
    订单优惠金额,非优惠code金额
  • taxes_included boolean
    是否为含税订单,默认为false
  • total_shipping_price string
    运费,精度为2的dubbo字符串
  • shipping_addressobject required
    收货人地址信息
  • address1 string
    收货人详细地址(最大255个字符)
  • address2 string
    收货人详细地址附加(最大255个字符)
  • area string
    收货人区县名称(最大64个字符)
  • area_code string
    收货人区县编码
  • city string
    收货人城市名称(最大64个字符)
  • city_code string
    收货人城市编码
  • company string
    公司名称
  • country string
    收货人国家名称(最大64个字符)
  • country_code string
    国家或地区,请参考国家代码
  • email string
    收货人联系邮箱
  • first_name string
    收货人名(最大64个字符)
  • last_name string
    收货人姓(最大64个字符)
  • latitude string
    纬度
  • longitude string
    经度
  • phone string
    收货人联系方式(最大32个字符)
  • province string
    收货人省(最大64个字符)
  • province_code string
    收货人省编码
  • zip string
    邮编
  • transactionsobject required
    支付单信息
  • channel_code string
    废弃字段,请勿使用
  • id string
    支付方式id
响应
更多状态码信息请参考 HTTP 状态码

响应头
  • traceId
    traceId
响应体
  • orderobject
    订单信息
  • adjust_price string
    调整金额
  • adjust_price_setobject
    调整金额
  • presentment_moneyobject
    买家侧金额信息
  • amount string
    金额
  • currency_code string
    币种
  • shop_moneyobject
    卖家侧金额信息
  • amount string
    金额
  • currency_code string
    币种
  • billing_addressobject
    账单地址信息
  • address1 string
    详细地址1
  • address2 string
    详细地址2,备选
  • city string
    城市
  • company string
    公司名称
  • country string
    国家
  • country_code string
    国家码
  • first_name string
  • last_name string
  • phone string
    电话
  • province string
    省份
  • province_code string
    省份码
  • zip string
    邮编
  • created_at string
    订单创建时间(格式见IOS8601)
  • currency string
    交易币种
  • current_subtotal_price string
    当前商品总和,商品总价*数量
  • current_subtotal_price_setobject
    当前商品总和多币种信息, 买卖家币种和金额一致
  • presentment_moneyobject
    买家侧币种
  • amount string
    金额
  • currency_code string
    币种
  • shop_moneyobject
    卖家侧币种
  • amount string
    金额
  • currency_code string
    币种
  • current_total_discounts string
    折扣总和,精度2,营销优惠+人工折扣
  • current_total_discounts_setobject
  • presentment_moneyobject
    买家侧金额
  • amount string
    金额
  • currency_code string
    币种信息
  • shop_moneyobject
    卖家侧金额
  • amount string
    金额
  • currency_code string
    币种信息
  • current_total_price string
    当前订单总额,取值逻辑:商品总额 - 优惠总额 + 运费 + 税费
  • current_total_price_setobject
    当前订单总额多币种信息,买卖家币种和金额一致
  • presentment_moneyobject
    买家侧金额
  • amount string
    金额
  • currency_code string
    币种信息
  • shop_moneyobject
    卖家侧金额
  • amount string
    金额
  • currency_code string
    币种信息
  • current_total_tax string
    税费总和,商品税 + 运费税
  • current_total_tax_setobject
    税费总和多币种信息, 买卖家币种和金额一致
  • presentment_moneyobject
    买家侧金额
  • amount string
    币种信息
  • currency_code string
    币种信息
  • shop_moneyobject
    卖家侧金额
  • amount string
    币种信息
  • currency_code string
    币种信息
  • customerobject
    买家信息
  • area_code string
    手机区号
  • currency string
    币种
  • email string
    用户邮箱
  • first_name string
  • id string
    用户id
  • last_name string
  • phone string
    用户手机号
  • deduct_member_point_amount string
    当前订单会员积分抵扣金额
  • discount_codesobject
    优惠码信息
  • amount string
    优惠金额,精度2
  • code string
    优惠码
  • type string
    优惠类型,减金额;打折;免运费;固定售价;最低价商品免费;打包价;第N件打折;
  • email string
    买家邮箱
  • financial_status string
    支付状态,unpaid,authorized, pending,partially_paid,paid,partially_refunded,refunded
  • id string
    系统订单号
  • line_itemsobject[]
    订单商品快照信息
  • attribute string
    商品属性:名称 - 属性值 多个以逗号", "分割 如:颜色 - 红色, 尺寸 - X
  • id string
    商品快照表的id, 系统生成,与订单号唯一确认一个商品
  • image_url string
    商品图片
  • name string
    sku标题,同title
  • price string
    商品售价,精度2
  • product_id string
    spu序列号
  • propertiesobject[]
    商品定制信息
  • name string
    自定义属性名称
  • type string
    属性类型, text-字符,展示格式为 name: value; picture-图片,展示类型为 name: 通过urls获取渲染出缩略图;link-超链,展示类型为 name: value,支持点击链接跳转 到urls第一个
  • urls string
    url资源列表
  • value string
    自定义属性值
  • quantity integer
    订单中的商品数量
  • requires_shipping boolean
    是否需要发货
  • sku string
    商品码,barCode
  • tags string
    商品标签(多个逗号隔开)
  • tax_linesobject[]
    税费信息
  • name string
    税费名称
  • price string
    税费,精度2
  • price_setobject
    税费多币种信息
  • presentment_moneyobject
    买家侧币种
  • amount string
    金额
  • currency_code string
    币种
  • shop_moneyobject
    卖家侧币种
  • amount string
    金额
  • currency_code string
    币种
  • rate double
    税率
  • title string
    税费描述
  • taxable boolean
    是否收税
  • title string
    商品标题
  • variant_id string
    商品sku序列号
  • variant_title string
    商品属性值, 多个以" / "分割, 如: “155 / 红色 / 大"
  • vendor string
    供应商
  • name string
    自定义订单号
  • note string
    商家备注内容
  • note_attributesobject[]
    附加信息
  • name string
    名称
  • value string
  • order_status_url string
    订单状态页url
  • payment_detailsobject[]
    支付单信息
  • pay_amount string
    支付金额
  • pay_channel string
    支付渠道
  • pay_channel_deal_id string
    外部渠道支付流水号
  • pay_seq string
    支付单号
  • pay_status string
    支付单状态
  • phone string
    买家联系方式
  • presentment_currency string
    买家侧币种
  • shipping_addressobject
    收货地址
  • address1 string
    详细地址1
  • address2 string
    详细地址2,备选
  • city string
    城市
  • company string
    公司名称
  • country string
    国家
  • country_code string
    国家码
  • district string
  • district_code string
    区编码
  • first_name string
  • last_name string
  • latitude string
    纬度
  • longitude string
    经度
  • phone string
    电话
  • province string
    省份
  • province_code string
    省份码
  • zip string
    邮编
  • status string
    订单状态 open=处理中,cancelled-已取消
  • subtotal_price string
    商品折后价总和, 商品总价 - 营销优惠 - 人工折扣
  • subtotal_price_setobject
    商品折后价总和多币种信息
  • presentment_moneyobject
    买家侧金额信息
  • amount string
    金额
  • currency_code string
    币种
  • shop_moneyobject
    卖家侧金额信息
  • amount string
    金额
  • currency_code string
    币种
  • tax_linesobject[]
    税费信息
  • name string
    税费名称
  • price string
    税费,精度2
  • price_setobject
    税费多币种信息
  • presentment_moneyobject
    买家侧金额信息
  • amount string
    金额
  • currency_code string
    币种
  • shop_moneyobject
    卖家侧金额信息
  • amount string
    金额
  • currency_code string
    币种
  • rate double
    税率
  • title string
    税费描述
  • tax_number string
    税号
  • tax_type string
    税号类型
  • taxes_included boolean
    总计额是否包含税额
  • total_discounts string
    折扣总额,营销优惠+人工折扣
  • total_discounts_setobject
    折扣总额多币种信息
  • presentment_moneyobject
    买家侧金额信息
  • amount string
    金额
  • currency_code string
    币种
  • shop_moneyobject
    卖家侧金额信息
  • amount string
    金额
  • currency_code string
    币种
  • total_line_items_price string
    商品原价总和,精度2
  • total_line_items_price_setobject
    商品原价总和,多币种信息
  • presentment_moneyobject
    卖家侧金额信息
  • amount string
    金额
  • currency_code string
    币种
  • shop_moneyobject
    卖家侧金额信息
  • amount string
    金额
  • currency_code string
    币种
  • total_outstanding string
    未付款金额总和,精度2
  • total_shipping_price_setobject
    订单运费总和,多币种信息
  • presentment_moneyobject
    买家侧金额信息
  • amount string
    金额
  • currency_code string
    币种
  • shop_moneyobject
    卖家侧金额信息
  • amount string
    金额
  • currency_code string
    币种
  • total_tax string
    税费总和,精度2, 商品税 + 运费税
  • total_tax_setobject
    税费总和,多币种信息
  • presentment_moneyobject
    买家侧金额信息
  • amount string
    金额
  • currency_code string
    币种
  • shop_moneyobject
    卖家侧金额信息
  • amount string
    金额
  • currency_code string
    币种
  • total_tip_received string
    小费,精度2
  • total_weight string
    商品总重量(g)
API Explorer
https://openapiceshidianpu.myshopline.com/admin/openapi/v20220601

ParamOptions

— header required

Body

required
{
  "order": {
    "billing_address": {
      "address1": "",
      "address2": "",
      "area": "",
      "area_code": "",
      "city": "",
      "city_code": "",
      "company": "",
      "country": "",
      "country_code": "",
      "email": "",
      "first_name": "",
      "last_name": "",
      "phone": "",
      "province": "",
      "province_code": "",
      "same_as_receiver": false,
      "zip": ""
    },
    "customer": {
      "email": "",
      "first_name": "",
      "id": "",
      "last_name": "",
      "phone": ""
    },
    "line_items": [
      {
        "price": "",
        "product_id": "",
        "quantity": 0,
        "rate": "",
        "title": "",
        "variant_id": ""
      }
    ],
    "note": "",
    "note_attributes": [
      {
        "name": "",
        "value": ""
      }
    ],
    "price_info": {
      "current_extra_total_discounts": "",
      "taxes_included": false,
      "total_shipping_price": ""
    },
    "shipping_address": {
      "address1": "",
      "address2": "",
      "area": "",
      "area_code": "",
      "city": "",
      "city_code": "",
      "company": "",
      "country": "",
      "country_code": "",
      "email": "",
      "first_name": "",
      "last_name": "",
      "latitude": "",
      "longitude": "",
      "phone": "",
      "province": "",
      "province_code": "",
      "zip": ""
    },
    "transactions": {
      "channel_code": "",
      "id": ""
    }
  }
}

Language

curl --request POST \
--url https://openapiceshidianpu.myshopline.com/admin/openapi/v20220601/orders.json \
--header 'Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJhcHBLZXkiOiJmMjM3OWQyMTYyOGMzM2QxMWRiMWZkYjY5N2EzZjdjMjZlNGMwYTA5Iiwic2VsbGVySWQiOiIyMDAwMjM0ODgwIiwic3RvcmVJZCI6IjE2NzIzNjk3Mjk2MDYiLCJ2ZXJzaW9uIjoiVjIiLCJkb21haW4iOiJodHRwczovL3NsLW9wZW4tc2cubXlzaG9wbGluZS5jb20iLCJ0aW1lc3RhbXAiOjE2NzUzMTk0OTI0MzksImlzcyI6Inlzb3VsIiwiZXhwIjoxNzY5OTI3NDkyfQ.UwQzomM2veGCUaOZ0paUxq5dpc7DXuhHYFvsQ_uIAKduzWcb_j2E4q_36El83sp145D4cKbpcE5KCeeIz-JNQw' \
--header 'Content-Type: application/json; charset=utf-8' \
--header 'accept: application/json'
Examples
创建订单,包含自定义折扣
Request
{
"order": {
"billing_address": {
"address1": "8899GarfieldStreet",
"address2": "Apartment5",
"city": "Riverside",
"country": "UnitedStates",
"country_Code": "US",
"email": "test@test.com",
"first_name": "Tom",
"last_name": "Washington",
"phone": "13333333333",
"province": "California",
"province_Code": "4200006",
"same_as_receiver": true,
"zip": "45646"
},
"customer": {
"email": "test@test.com",
"first_name": "Tom",
"last_name": "Washington",
"phone": "13333333333"
},
"discount_codes": [
{
"amount": "2",
"code": "dgnhjmhm",
"type": "fixed_amount"
}
],
"line_items": [
{
"price": "135.56",
"quantity": 3,
"rate": "0.4",
"title": "商品标题"
},
{
"price": "105.56",
"quantity": 2,
"rate": "0.5",
"title": "商品标题2"
}
],
"note": "Thisisordernote",
"price_info": {
"current_extra_total_discounts": "0",
"taxes_included": false,
"total_shipping_price": "5.01"
},
"shipping_address": {
"address1": "8899GarfieldStreet",
"address2": "Apartment5",
"city": "Riverside",
"country": "UnitedStates",
"country_Code": "US",
"email": "test@test.com",
"first_name": "Tom",
"last_name": "Washington",
"phone": "13333333333",
"province": "California",
"province_Code": "4200006"
},
"transactions": {
"id": "5179248359731388421"
}
}
}
Response
{
"order": {
"adjust_price": "0.0",
"adjust_price_set": {
"presentment_money": {
"amount": "0.0",
"currency_code": "USD"
},
"shop_money": {
"amount": "0.0",
"currency_code": "USD"
}
},
"billing_address": {
"address1": "8899GarfieldStreet",
"address2": "Apartment5",
"city": "Riverside",
"country": "UnitedStates",
"first_name": "Tom",
"last_name": "Washington",
"phone": "13333333333",
"province": "California"
},
"currency": "USD",
"current_subtotal_price": "617.8",
"current_subtotal_price_set": {
"presentment_money": {
"amount": "617.8",
"currency_code": "USD"
},
"shop_money": {
"amount": "617.8",
"currency_code": "USD"
}
},
"current_total_price": "891.04",
"current_total_price_set": {
"presentment_money": {
"amount": "891.04",
"currency_code": "USD"
},
"shop_money": {
"amount": "891.04",
"currency_code": "USD"
}
},
"deduct_member_point_amount": "0.0",
"financial_status": "unpaid",
"id": "21057518700301669241486931",
"line_items": [
{
"name": "商品标题",
"price": "135.56",
"product_id": "1605751870021845425004",
"quantity": 3,
"requires_shipping": false,
"tax_lines": [
{
"price": "162.67",
"price_set": {
"presentment_money": {
"amount": "162.67",
"currency_code": "USD"
},
"shop_money": {
"amount": "162.67",
"currency_code": "USD"
}
},
"rate": 0.4,
"title": "Tax"
}
],
"taxable": true,
"title": "商品标题",
"variant_id": "1805751870021845425005"
},
{
"name": "商品标题2",
"price": "105.56",
"product_id": "1605751870021845425006",
"quantity": 2,
"requires_shipping": false,
"tax_lines": [
{
"price": "105.56",
"price_set": {
"presentment_money": {
"amount": "105.56",
"currency_code": "USD"
},
"shop_money": {
"amount": "105.56",
"currency_code": "USD"
}
},
"rate": 0.5,
"title": "Tax"
}
],
"taxable": true,
"title": "商品标题2",
"variant_id": "1805751870021845425007"
}
],
"name": "22224133",
"note_attributes": [
{
"name": "3400002118",
"value": "Thisisordernote"
}
],
"payment_details": [
{
"pay_amount": 891.04,
"pay_channel": "customPay",
"pay_seq": "23057518700305024684696931",
"pay_status": "unpaid"
}
],
"shipping_address": {
"address1": "8899GarfieldStreet",
"address2": "Apartment5",
"city": "Riverside",
"country": "UnitedStates",
"first_name": "Tom",
"last_name": "Washington",
"phone": "13333333333",
"province": "California"
}
}
}
这篇文章对你有帮助吗?

Error loading component.

Error loading component.