订单准备

方法适用于模式:FBS, ExpressDBS.

如果您使用API-Key令牌,调用该方法时需要具备列表中可用权限之一

它也适用于 DBS

该请求旨在与 FBS-订单,但您可以使用它进行处理 DBS-订单,如果方便的话。

允许您执行三个操作:

  • 向市场发送有关按箱配送货物的信息;
  • 将产品的标签代码发送到市场;
  • 从订单中删除一个项目,如果它没有库存.

如果您需要修复传输数据中的某些内容,只需重复请求即可。 — 在订单状态更改之前,您可以根据需要多次执行此操作。 准备装运. ⚠️ 如果您在打印和粘贴标签后更改布局,请不要忘记重新打印并再次粘贴。

如何发送有关货物分发的信息

在此请求中,您需要向市场发送一个盒子列表,并指定每个盒子中的产品。 有两种类型的盒子:

  • 含整个产品。 这样的盒子可以包含任何种类的任何数量的物品。

  • **含有产品的一部分。**此类盒子包含一种产品的一部分。 例如,一个包含外部空调单元,另一个 — 的室内机。

⚠️ 一个盒子不能同时包含整个货物和部分货物。

如何传输标记代码并获取其验证状态

系统中货物的标签 «Честный ЗНАК» 个人订单可选

对于业务订单,您仍然需要发送标签代码。

如果订单中包含有标签的产品,则必须在请求中提供相应的唯一代码。 什么是标签?

接受以下类型的代码:

对于需要标注的顺序中的每个项目,您需要提供代码列表。 — 每个项目一个。 例如,如果订单中有两双拖鞋和一双鞋子,您将获得第一个位置的两个代码列表和第二个位置的一个代码列表。

如果产品在多个盒子中旅行,则必须为每个盒子传输标签代码。

如果你按照模型工作 FBS,快递

对于包含系统中标记的珠宝或产品的订单 «Честный ЗНАК»,转换为状态 READY_TO_SHIP 只有在以下情况下才可用:

  1. 您将其转移到Yandex。街市 УИНы 对于订单中的每件珠宝和系统中的代码 «Честный ЗНАК» 对于订单中需要此标记的所有产品。
  2. 所有标记代码将被成功验证。 如何获取验证状态
如何从订单中删除商品

从订单中删除商品:

  1. 添加到请求中 allowRemove: true.
  2. 将分发转移到没有要删除的项目的框中.

删除无法撤消

此操作不可逆转:买方将立即收到通知,订单组成将发生变化。

要删除整个位置,请不要传递相应的 OrderBoxLayoutItemDTO. 要减少产品的数量,请在字段中传递减少的值 fullCount.

您不能删除或减少项目的数量,如果它:

  • 特别优惠增加;
  • 相当于订单价值的99%;
  • 订单中唯一的产品。

如果您无法运送此类物品,请取消订单。 为此,请使用以下方法发送请求 PUT v2/campaigns/{campaignId}/orders/{orderId}/status 并发送订单状态 CANCELLED 与取消的原因 SHOP_FAILED.

你不能增加订单

您不能使用查询来增加相同物料的数量、向订单添加新物料或将一个物料替换为另一个物料。

例子:

产品放在盒子里

如果他们在同一个盒子里旅行,这就是请求的样子:

  • 需要贴标签的同一产品的三个单元;
  • 不需要标签的另一个产品的一个单元。
{
    "boxes": [
        {
            "items": [
                {
                    "id": 123456,
                    "fullCount": 3,
                    "instances": [
                        {
                            "cis": "01030410947874432155Qbag!\u001d93Zjqw"
                        },
                        {
                            "cis": "010304109478gftJ14545762!\u001dhGt264"
                        },
                        {
                            "cis": "010304109478fRs28323ks23!\u001dhet201"
                        }
                    ]
                },
                {
                    "id": 654321,
                    "fullCount": 1
                }
            ]
        }
    ]
}
货物在不同的箱子里旅行

如果产品有两个盒子,这就是请求的样子:

{
    "boxes": [
        {
            "items": [
                {
                    "id": 123456,
                    "partialCount": {
                        "current": 1,
                        "total": 2
                    },
                    "instances": [
                        {
                            "cis": "01030410947874432155Qbag!\u001d93Zjqw"
                        }
                    ]
                }
            ]
        },
        {
            "items": [
                {
                    "id": 123456,
                    "partialCount": {
                        "current": 2,
                        "total": 2
                    },
                    "instances": [
                        {
                            "cis": "01030410947874432155Qbag!\u001d93Zjqw"
                        }
                    ]
                }
            ]
        }
    ]
}
相同的商品,每个人都在几个盒子里旅行

如果两个相同的产品中的每一个都装在两个盒子里,这就是请求的样子:

{
    "boxes": [
        {
            "items": [
                {
                    "id": 123456,
                    "partialCount": {
                        "current": 1,
                        "total": 2
                    },
                    "instances": [
                        {
                            "cis": "01030410947874432155Qbag!\u001d93Zjqw"
                        }
                    ]
                }
            ]
        },
        {
            "items": [
                {
                    "id": 123456,
                    "partialCount": {
                        "current": 2,
                        "total": 2
                    },
                    "instances": [
                        {
                            "cis": "01030410947874432155Qbag!\u001d93Zjqw"
                        }
                    ]
                }
            ]
        },
        {
            "items": [
                {
                    "id": 123456,
                    "partialCount": {
                        "current": 1,
                        "total": 2
                    },
                    "instances": [
                        {
                            "cis": "01030410947874432155Qbag!\u001d93Zjqw"
                        }
                    ]
                }
            ]
        },
        {
            "items": [
                {
                    "id": 123456,
                    "partialCount": {
                        "current": 2,
                        "total": 2
                    },
                    "instances": [
                        {
                            "cis": "01030410947874432155Qbag!\u001d93Zjqw"
                        }
                    ]
                }
            ]
        }
    ]
}
不同的产品在不同的盒子里

如果将两种不同的产品放在不同的盒子中,这就是请求的样子:

{
    "boxes": [
        {
            "items": [
                {
                    "id": 123456,
                    "fullCount": 1
                }
            ]
        },
        {
            "items": [
                {
                    "id": 654321,
                    "fullCount": 1
                }
            ]
        }
    ]
}
⚙️ 限制: 每小时100,000次请求

Request

PUT

https://api.partner.market.yandex.ru/v2/campaigns/{campaignId}/orders/{orderId}/boxes

Path parameters

Name

Description

campaignId

Type: integer

广告系列(商店)的ID — 通过API工作时,代表您在Yandex市场系统中的商店的技术标识符。 它与您的商店唯一链接,但仅用于自动交互。

您可以使用查询找到它 GET v2/campaigns 或者在市场上的卖家办公室找到它。 点击您的帐户图标→ 设置 在左边的菜单中,选择 Api和模块:

  • 运动ID;
  • 标签 查询日志 →块中的下拉列表 显示日志.

⚠️ 不要把它与:

  • 商店的标识符,显示在商家的个人帐户中。
  • 广告活动。

Min value: 1

orderId

Type: integer

的订单ID。

Body

application/json
{
  "boxes": [
    {
      "items": [
        {
          "id": 0,
          "fullCount": 1,
          "partialCount": {},
          "instances": [
            null
          ]
        }
      ]
    }
  ],
  "allowRemove": false
}

Name

Description

boxes

Type: object[]

items

Type: object[]

id

Type: integer

订单中的产品ID。

它来自方法的响应 POST v1/businesses/{businessId}/orders — 参数 iditems.

fullCount

Type: integer

一个盒子里的项目数量。

如果框中有未分成部分的整个项目,请使用此字段。 不要在同一时间使用此字段 partialCount.

Min value: 1

instances

Type: object[]

cis

Type: string

识别码 系统中的产品单元 "诚实的标志""ASL BELGISI" (对于Yandex Go市场的卖家)。

不要转义分隔符代码中的斜杠。 \u001d

01030410947874432155Qbag!\u001d93Zjqw

01030410947874432155Qbag!\\u001d93Zjqw

根据JSON规则在其他地方转义斜杠和引号。: \\\"

Example: example

countryCode

Type: string

生产国采用ISO3166-1alpha-2格式。 如何获得

Min length: 2

Max length: 2

Pattern: ^[A-Z]{2}$

Example: RU

gtd

Type: string

货物报关。

它是由斜杠分隔的三个数字组成的字符串:XXXXXXX/XXXXXXX/XXXXXXXXXXX。

第一部分 — 登记进口货物申报的海关代码。 进一步 — 声明的日期和编号。

Example: example

rnpt

Type: string

品批次的注册号。

它是由斜杠分隔的四个数字组成的字符串:XXXXXXX/XXXXXXX/XXXXXXX/XXX。

第一部分 — 登记货物申报的海关办公室的代码。 进一步 — 声明的日期、编号和声明中标记产品的编号。

Example: example

uin

Type: string

珠宝的唯一标识号。

这是一个16位数字。

Example: example

传输的标记代码。

Min items: 1

Example
[
  {
    "cis": "example",
    "uin": "example",
    "rnpt": "example",
    "gtd": "example",
    "countryCode": "RU"
  }
]

partialCount

Type: object

current

Type: integer

零件编号,从1开始。

Min value: 1

total

Type: integer

产品分成的总份数。

Min value: 2

盒中的产品的部分的信息。

Example
{
  "current": 1,
  "total": 2
}

箱中的产品列表。

如果盒子里有一个大的产品的一部分,列表中只能有一个项目。

Min items: 1

Example
[
  {
    "id": 0,
    "fullCount": 1,
    "partialCount": {
      "current": 1,
      "total": 2
    },
    "instances": [
      {
        "cis": "example",
        "uin": "example",
        "rnpt": "example",
        "gtd": "example",
        "countryCode": "RU"
      }
    ]
  }
]

框的列表。

Min items: 1

Example
[
  {
    "items": [
      {
        "id": 0,
        "fullCount": 1,
        "partialCount": {
          "current": 1,
          "total": 2
        },
        "instances": [
          {}
        ]
      }
    ]
  }
]

allowRemove

Type: boolean

传下去 true 如果您要从订单中删除一些项目。

Default: false

Responses

200 OK

作为响应,您将收到带有框Id的传输布局。 — 您将需要他们请求快捷方式。

Body

application/json
{
  "status": "OK",
  "result": {
    "boxes": [
      {}
    ]
  }
}

Type: object

All of 2 types
  • Type: object

    status

    Type: string

    响应的类型。 可能的值:

    • OK — 没有错误。
    • ERROR — 处理请求时出错。

    Enum: OK, ERROR

    服务器响应的标准包装器。

    Example
    {
      "status": "OK"
    }
    
  • Type: object

    result

    Type: object

    boxes

    Type: object[]

    框的列表。

    Example
    [
      {
        "items": [
          {
            "id": 0,
            "fullCount": 1,
            "partialCount": {},
            "instances": [
              null
            ]
          }
        ],
        "boxId": 0
      }
    ]
    

    分箱配送货物。

    Example
    {
      "boxes": [
        {
          "items": [
            {}
          ],
          "boxId": 0
        }
      ]
    }
    
    Example
    {
      "result": {
        "boxes": [
          {
            "items": [
              null
            ],
            "boxId": 0
          }
        ]
      }
    }
    

400 Bad Request

请求包含不正确的数据。 详细了解处理订单时的错误

Body

application/json
{
  "status": "OK",
  "errors": [
    {
      "code": "example",
      "message": "example"
    }
  ]
}

Type: object

All of 1 type
  • Type: object

    All of 2 types
    • Type: object

      status

      Type: string

      响应的类型。 可能的值:

      • OK — 没有错误。
      • ERROR — 处理请求时出错。

      Enum: OK, ERROR

      服务器响应的标准包装器。

      Example
      {
        "status": "OK"
      }
      
    • Type: object

      errors

      Type: object[]

      code

      Type: string

      的错误代码。

      Example: example

      message

      Type: string

      错误的描述。

      Example: example

      错误列表。

      Min items: 1

      Example
      [
        {
          "code": "example",
          "message": "example"
        }
      ]
      
      Example
      {
        "errors": [
          {
            "code": "example",
            "message": "example"
          }
        ]
      }
      

    服务器错误的标准包装器。

    Example
    {
      "status": "OK",
      "errors": [
        {
          "code": "example",
          "message": "example"
        }
      ]
    }
    

401 Unauthorized

请求中未指定授权数据。 有关错误的更多信息

Body

application/json
{
  "status": "OK",
  "errors": [
    {
      "code": "example",
      "message": "example"
    }
  ]
}

Type: object

All of 1 type
  • Type: object

    All of 2 types
    • Type: object

      status

      Type: string

      响应的类型。 可能的值:

      • OK — 没有错误。
      • ERROR — 处理请求时出错。

      Enum: OK, ERROR

      服务器响应的标准包装器。

      Example
      {
        "status": "OK"
      }
      
    • Type: object

      errors

      Type: object[]

      code

      Type: string

      的错误代码。

      Example: example

      message

      Type: string

      错误的描述。

      Example: example

      错误列表。

      Min items: 1

      Example
      [
        {
          "code": "example",
          "message": "example"
        }
      ]
      
      Example
      {
        "errors": [
          {
            "code": "example",
            "message": "example"
          }
        ]
      }
      

    服务器错误的标准包装器。

    Example
    {
      "status": "OK",
      "errors": [
        {
          "code": "example",
          "message": "example"
        }
      ]
    }
    

403 Forbidden

授权数据不正确或禁止访问资源。 有关错误的更多信息

Body

application/json
{
  "status": "OK",
  "errors": [
    {
      "code": "example",
      "message": "example"
    }
  ]
}

Type: object

All of 1 type
  • Type: object

    All of 2 types
    • Type: object

      status

      Type: string

      响应的类型。 可能的值:

      • OK — 没有错误。
      • ERROR — 处理请求时出错。

      Enum: OK, ERROR

      服务器响应的标准包装器。

      Example
      {
        "status": "OK"
      }
      
    • Type: object

      errors

      Type: object[]

      code

      Type: string

      的错误代码。

      Example: example

      message

      Type: string

      错误的描述。

      Example: example

      错误列表。

      Min items: 1

      Example
      [
        {
          "code": "example",
          "message": "example"
        }
      ]
      
      Example
      {
        "errors": [
          {
            "code": "example",
            "message": "example"
          }
        ]
      }
      

    服务器错误的标准包装器。

    Example
    {
      "status": "OK",
      "errors": [
        {
          "code": "example",
          "message": "example"
        }
      ]
    }
    

404 Not Found

找不到请求的资源。 有关错误的更多信息

Body

application/json
{
  "status": "OK",
  "errors": [
    {
      "code": "example",
      "message": "example"
    }
  ]
}

Type: object

All of 1 type
  • Type: object

    All of 2 types
    • Type: object

      status

      Type: string

      响应的类型。 可能的值:

      • OK — 没有错误。
      • ERROR — 处理请求时出错。

      Enum: OK, ERROR

      服务器响应的标准包装器。

      Example
      {
        "status": "OK"
      }
      
    • Type: object

      errors

      Type: object[]

      code

      Type: string

      的错误代码。

      Example: example

      message

      Type: string

      错误的描述。

      Example: example

      错误列表。

      Min items: 1

      Example
      [
        {
          "code": "example",
          "message": "example"
        }
      ]
      
      Example
      {
        "errors": [
          {
            "code": "example",
            "message": "example"
          }
        ]
      }
      

    服务器错误的标准包装器。

    Example
    {
      "status": "OK",
      "errors": [
        {
          "code": "example",
          "message": "example"
        }
      ]
    }
    

420 Method Failure

已超出资源访问限制。 有关错误的更多信息

Body

application/json
{
  "status": "OK",
  "errors": [
    {
      "code": "example",
      "message": "example"
    }
  ]
}

Type: object

All of 1 type
  • Type: object

    All of 2 types
    • Type: object

      status

      Type: string

      响应的类型。 可能的值:

      • OK — 没有错误。
      • ERROR — 处理请求时出错。

      Enum: OK, ERROR

      服务器响应的标准包装器。

      Example
      {
        "status": "OK"
      }
      
    • Type: object

      errors

      Type: object[]

      code

      Type: string

      的错误代码。

      Example: example

      message

      Type: string

      错误的描述。

      Example: example

      错误列表。

      Min items: 1

      Example
      [
        {
          "code": "example",
          "message": "example"
        }
      ]
      
      Example
      {
        "errors": [
          {
            "code": "example",
            "message": "example"
          }
        ]
      }
      

    服务器错误的标准包装器。

    Example
    {
      "status": "OK",
      "errors": [
        {
          "code": "example",
          "message": "example"
        }
      ]
    }
    

500 Internal Server Error

Yandex中的内部错误。 市场。 有关错误的更多信息

Body

application/json
{
  "status": "OK",
  "errors": [
    {
      "code": "example",
      "message": "example"
    }
  ]
}

Type: object

All of 1 type
  • Type: object

    All of 2 types
    • Type: object

      status

      Type: string

      响应的类型。 可能的值:

      • OK — 没有错误。
      • ERROR — 处理请求时出错。

      Enum: OK, ERROR

      服务器响应的标准包装器。

      Example
      {
        "status": "OK"
      }
      
    • Type: object

      errors

      Type: object[]

      code

      Type: string

      的错误代码。

      Example: example

      message

      Type: string

      错误的描述。

      Example: example

      错误列表。

      Min items: 1

      Example
      [
        {
          "code": "example",
          "message": "example"
        }
      ]
      
      Example
      {
        "errors": [
          {
            "code": "example",
            "message": "example"
          }
        ]
      }
      

    服务器错误的标准包装器。

    Example
    {
      "status": "OK",
      "errors": [
        {
          "code": "example",
          "message": "example"
        }
      ]
    }
    

No longer supported, please use an alternative and newer version.

意义 cis 必须匹配正则表达式 ^(?=.{1,256}$)\u001D?(\(?01\)?\d{14}\(?21\)?([!-~]{6,8}|[!-~]{13}|[!-~]{20})(\u001D\(?240\)?.{1,30})?\u001D\(?9[1,3]\)?.+)$.

没有密码 — ^(?=[!-~]{1,256}$)(\(?01\)?\d{14}\(?21\)?(.{6,8}|.{13}|.{20}))$.