---
title: "启动编辑"
description: >
  订单编辑-开始编辑接口，编辑订单为一组组合接口(开始编辑，修改商品数量，增加普通商品行，增加自定义商品行，增加商品行折扣，移除商品行折扣，订单编辑提交)，需要调用编辑订单-开始接口，开启一次编辑，如果该接口调用有错误，会在返回值user_errors字段中拿到错误，调用方可以根据是否有错误进行编辑重试（注意：重试需要从order_edit_begin.json订单编辑开始接口开始进行整套编辑订单接口重新调用,重试需要控制次数）
doc_type: openapi
doc_category: openapi
doc_version: v20270301
source_url:
  html: 'https://developer.shopline.com/zh-hans-cn/docs/admin-rest-api/order/edit-order-combination-interface/start-editing'
  md: 'https://developer.shopline.com/zh-hans-cn/docs/admin-rest-api/order/edit-order-combination-interface/start-editing.md'
---
# 启动编辑

订单编辑-开始编辑接口，编辑订单为一组组合接口(开始编辑，修改商品数量，增加普通商品行，增加自定义商品行，增加商品行折扣，移除商品行折扣，订单编辑提交)，需要调用编辑订单-开始接口，开启一次编辑，如果该接口调用有错误，会在返回值user_errors字段中拿到错误，调用方可以根据是否有错误进行编辑重试（注意：重试需要从order_edit_begin.json订单编辑开始接口开始进行整套编辑订单接口重新调用,重试需要控制次数）

- **Base URL:** `https://{handle}.myshopline.com/admin/openapi`
- **Required Scopes:** `write_orders`
- **API Version:** v20270301
- **API Type:** Admin
- **API Protocol:** RESTful

## Endpoint

```http
POST /orders/:id/order_edit_begin.json
```

## Base URL

* `https://{handle}.myshopline.com/admin/openapi`

  * `{handle}`: `handle` ：店铺的唯一标识符，值为店铺域名的前缀。例如，域名为 `open001.myshopline.com` 的店铺，其 `handle` 是 `open001` 。

## Required Permissions

* `write_orders`

## Request

### Path Parameters

* `id`

  string (required)

  订单id

### Request Headers

* `Content-Type`

  string (required)

  字段值固定为 `application/json; charset=utf-8`。

* `Authorization`

  string (required)

  资源的访问令牌。参考 [应用授权](https://developer.shopline.com/zh-hans-cn/docs/apps/api-instructions-for-use/app-authorization.md?lang=zh-hans-cn) 获取访问令牌，然后将获取到的访问令牌以 Bearer 格式传入。

## Response

### Status Codes

* `200`

  更多状态码信息，参考 [HTTP 状态码](https://developer.shopline.com/zh-hans-cn/docs/apps/api-instructions-for-use/http-status-code.md?lang=zh-hans-cn)。

* `401`

  

* `429`

  

### Response Headers

* `traceId`

  请求的全局唯一标识符。用于追踪请求在系统中的流转，以便于问题发生时进行定位和调试。

### Response Body

#### 200

* `user_errors`

  array<object>

  编辑订单的错误提示信息, 如果该接口执行有错，执行结果错误码会在此字段上返回

  * `field`

    array<string>

    导致错误的输入字段的路径

  * `message`

    string

    错误提示信息

  * `code`

    string

    错误码，具体的执行结果码在此字段透出

* `calculated_order`

  object

  开始动作返回的编辑订单的草稿信息

  * `committed`

    boolean

    是否已经提交保存到订单

  * `id`

    string

    订单编辑草稿单id，用于后续订单编辑相关接口的入参(编辑设置商品数量，增加普通商品，增加自定义商品，增加商品行折扣，移除商品行折扣)


#### 401

* `errors`

  string

  错误描述。


#### 429

* `errors`

  string

  错误描述。


## OpenAPI Definition

```json
{
  "description": "订单编辑-开始编辑接口，编辑订单为一组组合接口(开始编辑，修改商品数量，增加普通商品行，增加自定义商品行，增加商品行折扣，移除商品行折扣，订单编辑提交)，需要调用编辑订单-开始接口，开启一次编辑，如果该接口调用有错误，会在返回值user_errors字段中拿到错误，调用方可以根据是否有错误进行编辑重试（注意：重试需要从order_edit_begin.json订单编辑开始接口开始进行整套编辑订单接口重新调用,重试需要控制次数）",
  "externalDocs": {
    "description": "接口使用的权限点: `write_orders` ，更多权限点使用信息，请参考:",
    "url": "ec20/3cv5d7wpfgr6a8z5/xabczf5442284vkq?lang=zh-hans-cn",
    "errorTableDescription": ""
  },
  "operationId": "H1IvSCFW",
  "parameters": [
    {
      "name": "id",
      "in": "path",
      "description": "订单id",
      "required": true,
      "style": "simple",
      "schema": {
        "name": "id",
        "description": "订单id",
        "type": "string",
        "example": "21060502039313593543444149"
      },
      "example": "21060502039313593543444149"
    },
    {
      "name": "Content-Type",
      "in": "header",
      "description": "字段值固定为 `application/json; charset=utf-8`。",
      "required": true,
      "style": "string",
      "schema": {
        "name": "Content-Type",
        "type": "string",
        "example": "application/json; charset=utf-8"
      }
    },
    {
      "name": "Authorization",
      "in": "header",
      "description": "资源的访问令牌。参考 [应用授权](https://developer.shopline.com/zh-hans-cn/docs/apps/api-instructions-for-use/app-authorization.md?lang=zh-hans-cn) 获取访问令牌，然后将获取到的访问令牌以 Bearer 格式传入。",
      "required": true,
      "style": "string",
      "schema": {
        "name": "Authorization",
        "description": "资源的访问令牌。请参考 [应用授权](https://developer.shopline.com/zh-hans-cn/docs/apps/api-instructions-for-use/app-authorization.md?lang=zh-hans-cn) 获取访问令牌，然后将获取到的访问令牌以 Bearer 格式传入",
        "type": "string",
        "example": "Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6MCwiYXBwS2V5IjoiNzU2ZjI1NWE2NjdlZTcwNTk1MzM0ZjVjYzk4NzU5MzBmN2E3NGZjMSIsImV4cCI6MTg3OTQ4MjA3NiwiaXNzIjoieXNvdWwiLCJzZWxsZXJJZCI6IjIwMDAyMzQ4ODAiLCJzdG9yZUlkIjoiMTY3MjM2OTcyOTYwNiIsInRpbWVzdGFtcCI6MTc4NDc4NzY3NjY2MSwidmVyc2lvbiI6IlYyIn0.3ZzbGAH4cLU1QR2VPEvMOQInUDvus-C4amkINSQIPuNVlXsFKj0sAt1c0KnUy9MWUOFV9cHlkf7J90r2y1FzpA"
      },
      "example": "Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6MCwiYXBwS2V5IjoiNzU2ZjI1NWE2NjdlZTcwNTk1MzM0ZjVjYzk4NzU5MzBmN2E3NGZjMSIsImV4cCI6MTg3OTQ4MjA3NiwiaXNzIjoieXNvdWwiLCJzZWxsZXJJZCI6IjIwMDAyMzQ4ODAiLCJzdG9yZUlkIjoiMTY3MjM2OTcyOTYwNiIsInRpbWVzdGFtcCI6MTc4NDc4NzY3NjY2MSwidmVyc2lvbiI6IlYyIn0.3ZzbGAH4cLU1QR2VPEvMOQInUDvus-C4amkINSQIPuNVlXsFKj0sAt1c0KnUy9MWUOFV9cHlkf7J90r2y1FzpA"
    }
  ],
  "responses": {
    "200": {
      "description": "更多状态码信息，参考 [HTTP 状态码](https://developer.shopline.com/zh-hans-cn/docs/apps/api-instructions-for-use/http-status-code.md?lang=zh-hans-cn)。",
      "headers": {
        "traceId": {
          "description": "请求的全局唯一标识符。用于追踪请求在系统中的流转，以便于问题发生时进行定位和调试。"
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "user_errors": {
                "name": "user_errors",
                "description": "编辑订单的错误提示信息, 如果该接口执行有错，执行结果错误码会在此字段上返回",
                "type": "array",
                "items": {
                  "name": "user_errors",
                  "description": "编辑订单的错误提示信息, 如果该接口执行有错，执行结果错误码会在此字段上返回",
                  "type": "object",
                  "properties": {
                    "field": {
                      "name": "field",
                      "description": "导致错误的输入字段的路径",
                      "type": "array",
                      "items": {
                        "name": "field",
                        "description": "导致错误的输入字段的路径",
                        "type": "string",
                        "example": ""
                      },
                      "example": [
                        ""
                      ]
                    },
                    "message": {
                      "name": "message",
                      "description": "错误提示信息",
                      "type": "string",
                      "example": "参数有误"
                    },
                    "code": {
                      "name": "code",
                      "description": "错误码，具体的执行结果码在此字段透出",
                      "type": "string",
                      "example": "PARAM_ILLEGAL"
                    }
                  },
                  "example": {
                    "code": "PARAM_ILLEGAL",
                    "field": [
                      ""
                    ],
                    "message": "参数有误"
                  }
                },
                "example": [
                  {
                    "field": [
                      ""
                    ],
                    "message": "参数有误",
                    "code": "PARAM_ILLEGAL"
                  }
                ]
              },
              "calculated_order": {
                "name": "calculated_order",
                "description": "开始动作返回的编辑订单的草稿信息",
                "type": "object",
                "properties": {
                  "committed": {
                    "name": "committed",
                    "description": "是否已经提交保存到订单",
                    "type": "boolean",
                    "example": false
                  },
                  "id": {
                    "name": "id",
                    "description": "订单编辑草稿单id，用于后续订单编辑相关接口的入参(编辑设置商品数量，增加普通商品，增加自定义商品，增加商品行折扣，移除商品行折扣)",
                    "type": "string",
                    "example": "2106050203931359354344414929098923"
                  }
                },
                "example": {
                  "committed": false,
                  "id": "2106050203931359354344414929098923"
                }
              }
            },
            "example": {
              "user_errors": [
                {
                  "message": "参数有误",
                  "code": "PARAM_ILLEGAL",
                  "field": [
                    ""
                  ]
                }
              ],
              "calculated_order": {
                "committed": false,
                "id": "2106050203931359354344414929098923"
              }
            }
          }
        }
      }
    },
    "401": {
      "headers": {
        "traceId": {
          "description": "请求的全局唯一标识符。用于追踪请求在系统中的流转，以便于问题发生时进行定位和调试。"
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "errors": {
                "description": "错误描述。",
                "type": "string"
              }
            },
            "required": [
              "errors"
            ]
          }
        }
      }
    },
    "429": {
      "headers": {
        "traceId": {
          "description": "请求的全局唯一标识符。用于追踪请求在系统中的流转，以便于问题发生时进行定位和调试。"
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "errors": {
                "description": "错误描述。",
                "type": "string"
              }
            },
            "required": [
              "errors"
            ]
          }
        }
      }
    }
  },
  "security": [
    {
      "oauth2": []
    }
  ],
  "method": "post",
  "path": "/orders/:id/order_edit_begin.json",
  "servers": [
    {
      "url": "https://{handle}.myshopline.com/admin/openapi",
      "variables": {
        "handle": {
          "default": "openapiceshidianpu",
          "description": "`handle` ：店铺的唯一标识符，值为店铺域名的前缀。例如，域名为 `open001.myshopline.com` 的店铺，其 `handle` 是 `open001` 。"
        }
      }
    }
  ],
  "info": {
    "title": "启动编辑",
    "version": "v20270301"
  },
  "authIndexes": [
    "write_orders"
  ]
}
```