从订单中删除项目或减少其数量

方法适用于模式DBS.

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

如果你按照模型工作 FBS

如果商店无法全部交付,则从订单中删除一个或多个项目。

订单必须具有状态 "status": "PROCESSING" 处理阶段 "substatus": "STARTED". 状态转移后无法更改组成 "substatus": "READY_TO_SHIP".

减少相同产品的数量

在参数中传递更新的值 count.

从订单中删除项目

传递值 0 在参数中 count 或者不要传递它 item.

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

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

在这种情况下,取消订单。 — 在方法 PUT v2/campaigns/{campaignId}/orders/{orderId}/status 发送订单状态 CANCELLED 与取消的原因 SHOP_FAILED.

这笔钱将如何退还

如果客户在结账时支付了产品,市场将在两天内退还从订单中移除的物品的钱:

  • 使用银行卡付款时 — 从商店将订单转移到状态的那一刻起 SHIPPED;

  • 通过支付时 Apple Pay 或 Google Pay — 从商店从订单中删除产品的那一刻起。

⚙️ 限制: 每小时100,000次请求

Request

PUT

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

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
{
  "items": [
    {
      "id": 0,
      "count": 0,
      "instances": [
        {
          "cis": "example",
          "uin": "example",
          "rnpt": "example",
          "gtd": "example",
          "countryCode": "RU"
        }
      ]
    }
  ],
  "reason": "PARTNER_REQUESTED_REMOVE"
}

Name

Description

items

Type: object[]

count

Type: integer

品的新数量。

Min value: 0

id

Type: integer

订单内产品的标识符。

您可以使用该方法获取ID:

所需参数。

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

品单元的标签的信息。

在请求中,指定要标记的所有项目。

如果来自企业的订单包含在系统中需要贴标签的产品,则该参数是必需的。 «Честный ЗНАК»«ASL BELGISI» (对于卖家 Market Yandex Go).

Min items: 1

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

订单中的产品列表。

如果商店在输入数据中没有提供有关产品的信息,它将从订单中删除。

所需参数。

Min items: 1

Example
[
  {
    "id": 0,
    "count": 0,
    "instances": [
      {
        "cis": "example",
        "uin": "example",
        "rnpt": "example",
        "gtd": "example",
        "countryCode": "RU"
      }
    ]
  }
]

reason

Type: string

订单组成已更新的原因:

  • PARTNER_REQUESTED_REMOVE — 商店已删除该产品。
  • USER_REQUESTED_REMOVE — 买方要求删除该产品。

Enum: PARTNER_REQUESTED_REMOVE, USER_REQUESTED_REMOVE

Responses

200 OK

燕基科斯. 市场已成功处理您的要求. 预计没有输出。

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}))$.