创建文档

方法适用于所有模式.

目前不适用于卖家Market Yandex Go.

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

为货物的指定业务创建文档。 每个请求最多可以创建100个文档。

要将文档链接到产品,请在字段中输入其编号 certificates 的方法 POST v2/businesses/{businessId}/offer-mappings/update.

如果已存在具有此编号的文档,则该文档的结果包含错误。 DOCUMENT_ALREADY_EXISTS. 不返回现有文档。 一个文档错误 它不会干扰其余部分的处理。

⚙️ 没有订阅的限制: 5 请求 每分钟
⭐️ 使用中等订阅限制: 10 请求 每分钟

Request

POST

https://api.partner.market.yandex.ru/v1/businesses/{businessId}/offers/documents/create

Path parameters

Name

Description

businessId

Type: integer

内阁ID。

Min value: 1

Body

application/json
{
  "documents": [
    {
      "number": "example",
      "type": "CONFORMITY_DECLARATION",
      "activeFromDate": "2025-01-01",
      "activeToDate": "2025-01-01"
    }
  ]
}

Name

Description

documents

Type: object[]

number

Type: string

证书、声明或其他文档中指定的编号。

Min length: 1

Max length: 100

Pattern: ^\S(?:.*\S)?$

Example: example

type

Type: string

文件类别:

  • CONFORMITY_DECLARATION — 符合性声明。
  • CONFORMITY_CERTIFICATE — 合格证书。
  • STATE_REGISTRATION_CERTIFICATE — 产品的国家注册(卫生要求)。
  • MEDICINAL_PRODUCT_CERTIFICATE — 药房所需文件。
  • BIOLOGICALLY_ACTIVE_ADDITIVE_CERTIFICATE — 膳食补充剂国家注册证书。
  • MEDICAL_DEVICE_CERTIFICATE — 医疗器械注册证书。
  • AGROCHEMICAL_PESTICIDE_CERTIFICATE — 国家农药和农用化学品登记。

Enum: CONFORMITY_DECLARATION, CONFORMITY_CERTIFICATE, STATE_REGISTRATION_CERTIFICATE, MEDICINAL_PRODUCT_CERTIFICATE, BIOLOGICALLY_ACTIVE_ADDITIVE_CERTIFICATE, MEDICAL_DEVICE_CERTIFICATE, AGROCHEMICAL_PESTICIDE_CERTIFICATE

activeFromDate

Type: string<date>

文件的有效期.

Example: 2025-01-01

activeToDate

Type: string<date>

文件的有效期。

Example: 2025-01-01

要创建的文档。 文档编号不应在单个请求中重复。 如果数字重复,则不处理请求。

Min items: 1

Max items: 100

Example
[
  {
    "number": "example",
    "type": "CONFORMITY_DECLARATION",
    "activeFromDate": "2025-01-01",
    "activeToDate": "2025-01-01"
  }
]

Responses

200 OK

此请求和创建错误创建的文档。

如果无法创建至少一个文档,则该字段 status 取值 ERROR. 其他人 文件在同一时间进行处理。

Body

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

Type: object

All of 2 types
  • Type: object

    status

    Type: string

    响应的类型。 可能的值:

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

    Enum: OK, ERROR

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

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

    result

    Type: object

    documents

    Type: object[] | null

    此请求创建的文档。

    Min items: 1

    Max items: 100

    Example
    [
      {
        "number": "example",
        "type": "CONFORMITY_DECLARATION",
        "activeFromDate": "2025-01-01",
        "activeToDate": "2025-01-01",
        "id": 1,
        "status": "ACTIVE"
      }
    ]
    

    errors

    Type: object[]

    code

    Type: string

    文档错误代码:

    • DOCUMENT_VALIDATION_FAILED — 该文件未经证实。
    • DOCUMENT_ALREADY_EXISTS — 文档已经存在。
    • DOCUMENT_NOT_FOUND — 文件没有找到。
    • DOCUMENT_UPDATE_NOT_ALLOWED — 禁止文档修改。
    • DOCUMENT_CONCURRENT_MODIFICATION — 文档进行了并行修改。

    Enum: DOCUMENT_VALIDATION_FAILED, DOCUMENT_ALREADY_EXISTS, DOCUMENT_NOT_FOUND, DOCUMENT_UPDATE_NOT_ALLOWED, DOCUMENT_CONCURRENT_MODIFICATION

    number

    Type: string

    证书、声明或其他文档中指定的编号。

    Min length: 1

    Max length: 100

    Pattern: ^\S(?:.*\S)?$

    Example: example

    message

    Type: string

    人的错误描述。 要处理错误,请使用该字段 code.

    Example: example

    无法创建的文档中的错误。

    Min items: 1

    Max items: 100

    Example
    [
      {
        "number": "example",
        "code": "DOCUMENT_VALIDATION_FAILED",
        "message": "example"
      }
    ]
    

    创建的文档和处理错误。

    Example
    {
      "documents": [
        {
          "number": "example",
          "type": "CONFORMITY_DECLARATION",
          "activeFromDate": "2025-01-01",
          "activeToDate": "2025-01-01",
          "id": 1,
          "status": "ACTIVE"
        }
      ],
      "errors": [
        {
          "number": "example",
          "code": "DOCUMENT_VALIDATION_FAILED",
          "message": "example"
        }
      ]
    }
    
    Example
    {
      "result": {
        "documents": [
          {
            "number": "example",
            "type": "CONFORMITY_DECLARATION",
            "activeFromDate": "2025-01-01",
            "activeToDate": "2025-01-01",
            "id": 1,
            "status": "ACTIVE"
          }
        ],
        "errors": [
          {
            "number": "example",
            "code": "DOCUMENT_VALIDATION_FAILED",
            "message": "example"
          }
        ]
      }
    }
    

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"
        }
      ]
    }
    

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"
        }
      ]
    }