创建订单

方法适用于模式拉斯.

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

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

如果所需数量的货物在市场仓库中,则创建新订单。

指定 courierDelivery 速递派递或 pickupDelivery 送到收件点。 不要在同一时间传递这两个参数。

参数值 draft:

  • true — 燕基科斯.市场将创建一个具有状态的订单 RESERVED 它将等待商店的确认。 准备好后,发送状态 PROCESSING 具有子状态 STARTED 在方法 PUT v2/campaigns/{campaignId}/orders/{orderId}/status. 如果您在创建订单后一小时内不这样做,yandex。市场将取消它。
  • false — 燕基科斯.市场将创建一个具有状态的订单 PROCESSING 具有子状态 STARTED 不需要确认。

在调用方法之前

获取可用的运输选项 — POST v2/campaigns/{campaignId}/delivery-options.

⚙️ 限额: 10 000 请求 每小时

Request

POST

https://api.partner.market.yandex.ru/v1/campaigns/{campaignId}/orders/create

Path parameters

Name

Description

campaignId

Type: integer

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

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

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

⚠️ 不要把它与:

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

Min value: 1

Body

application/json
{
  "order": {
    "externalOrderId": "example",
    "itemsDelivery": [
      {
        "warehouseId": 1,
        "items": [
          {}
        ],
        "deliveryDateInterval": {
          "fromDate": "2025-01-01",
          "toDate": "2025-01-01"
        },
        "deliveryTimeInterval": {
          "fromTime": "example",
          "toTime": "example"
        }
      }
    ],
    "destination": {
      "pickupDelivery": {
        "logisticPointId": 1
      },
      "courierDelivery": {
        "address": {},
        "notes": "example"
      }
    },
    "customer": {
      "firstName": "example",
      "lastName": "example",
      "middleName": "example",
      "phone": "example"
    },
    "packaging": {
      "packageType": "WHITELABEL"
    },
    "paymentType": "PREPAID",
    "draft": false
  }
}

Name

Description

order

Type: object

customer

Type: object

firstName

Type: string

姓名。

Min length: 1

Max length: 512

Example: example

lastName

Type: string

姓。

Min length: 1

Max length: 512

Example: example

phone

Type: string

电话号码。

格式: +<国家代码><region_code><电话号码>.

Min length: 5

Max length: 16

Pattern: ^\+[0-9]+$

Example: example

middleName

Type: string

中间名。

Min length: 1

Max length: 512

Example: example

订单收件人或退款发件人的详细信息。

Example
{
  "firstName": "example",
  "lastName": "example",
  "middleName": "example",
  "phone": "example"
}

destination

Type: object

courierDelivery

Type: object

address

Type: object

All of 2 types
  • Type: object

    fullAddress

    Type: string

    完整的地址,直到门牌号码。

    Min length: 1

    Max length: 512

    Example: example

    送货地址。

    Example
    {
      "fullAddress": "example"
    }
    
  • Type: object

    apartment

    Type: string

    公寓或办公室号码。

    Min length: 1

    Max length: 16

    Example: example

    entrance

    Type: string

    入口号码。

    Min length: 1

    Max length: 16

    Example: example

    floor

    Type: integer

    地板。

    Example
    {
      "entrance": "example",
      "floor": 0,
      "apartment": "example"
    }
    

送货地址。

Example
{
  "fullAddress": "example",
  "entrance": "example",
  "floor": 0,
  "apartment": "example"
}

notes

Type: string

对订单进行评论。

Min length: 1

Max length: 3000

Example: example

关于快递的信息。

不要与 pickupDelivery.

Example
{
  "address": {
    "fullAddress": "example",
    "entrance": "example",
    "floor": 0,
    "apartment": "example"
  },
  "notes": "example"
}

pickupDelivery

Type: object

logisticPointId

Type: integer

取件点的ID。

使用该方法可以找到 POST v1/businesses/{businessId}/logistics-points.

Min value: 1

送到取件点的信息。

不要与 courierDelivery.

Example
{
  "logisticPointId": 1
}

交付信息。

不要在同一时间传送 courierDeliverypickupDelivery.

Example
{
  "pickupDelivery": {
    "logisticPointId": 1
  },
  "courierDelivery": {
    "address": {
      "fullAddress": "example",
      "entrance": "example",
      "floor": 0,
      "apartment": "example"
    },
    "notes": "example"
  }
}

externalOrderId

Type: string

商店系统中的外部订单ID。

Min length: 1

Example: example

itemsDelivery

Type: object[]

deliveryDateInterval

Type: object

fromDate

Type: string<date>

间隔的开始。

日期格式: YYYY-MM-DD.

Example: 2025-01-01

toDate

Type: string<date>

间隔的结束。

日期格式: YYYY-MM-DD.

Example: 2025-01-01

交货日期的范围。

Example
{
  "fromDate": "2025-01-01",
  "toDate": "2025-01-01"
}

items

Type: object[]

订单中的产品列表。

在单个查询中,所有值都是 offerId 它们必须是独一无二的。 不允许传输具有相同名称的两个对象。 offerId.

Min items: 1

Max items: 1000

Example
[
  {
    "offerId": "example",
    "count": 1,
    "price": {
      "value": 0,
      "currencyId": "RUR"
    }
  }
]

warehouseId

Type: integer

市场的履行仓库的ID。

使用方法获取它 POST v2/campaigns/{campaignId}/delivery-options.

Min value: 1

deliveryTimeInterval

Type: object

fromTime

Type: string

间隔的开始。

格式: HH:MM.

Pattern: ^([0-1][0-9]&#124;2[0-3]):[0-5][0-9]$

Example: example

toTime

Type: string

间隔的结束。

格式: HH:MM.

Pattern: ^([0-1][0-9]&#124;2[0-3]):[0-5][0-9]$

Example: example

的递送时间间隔。

Example
{
  "fromTime": "example",
  "toTime": "example"
}

订单中的产品列表。

Min items: 1

Max items: 1000

Example
[
  {
    "warehouseId": 1,
    "items": [
      {
        "offerId": "example",
        "count": 1,
        "price": {}
      }
    ],
    "deliveryDateInterval": {
      "fromDate": "2025-01-01",
      "toDate": "2025-01-01"
    },
    "deliveryTimeInterval": {
      "fromTime": "example",
      "toTime": "example"
    }
  }
]

packaging

Type: object

packageType

Type: string

包装要求:

  • WHITELABEL — 盒子。

  • BRAND — [品牌包装](*brand-package) 那家商店。

如果你不通过它 packageType,订单将在一个盒子或没有包装到达。

Enum: WHITELABEL, BRAND

在订单中包装货物的规则。

Example
{
  "packageType": "WHITELABEL"
}

paymentType

Type: string

订购付款类别:

  • PREPAID — 结账时付款。

Const: PREPAID

Example: example

draft

Type: boolean

指示是否已创建订单草稿。

  • true — 燕基科斯.市场将创建一个具有状态的订单 RESERVED 它将等待商店的确认。
  • false — 燕基科斯.市场将创建一个具有状态的订单 PROCESSING 具有子状态 STARTED 它将开始处理它,不需要额外的确认。

Default: false

订单信息。

从方法响应传输所选传递选项 POST v1/campaigns/{campaignId}/delivery-options.

Example
{
  "externalOrderId": "example",
  "itemsDelivery": [
    {
      "warehouseId": 1,
      "items": [
        {}
      ],
      "deliveryDateInterval": {
        "fromDate": "2025-01-01",
        "toDate": "2025-01-01"
      },
      "deliveryTimeInterval": {
        "fromTime": "example",
        "toTime": "example"
      }
    }
  ],
  "destination": {
    "pickupDelivery": {
      "logisticPointId": 1
    },
    "courierDelivery": {
      "address": {
        "fullAddress": "example",
        "entrance": "example",
        "floor": 0,
        "apartment": "example"
      },
      "notes": "example"
    }
  },
  "customer": {
    "firstName": "example",
    "lastName": "example",
    "middleName": "example",
    "phone": "example"
  },
  "packaging": {
    "packageType": "WHITELABEL"
  },
  "paymentType": "PREPAID",
  "draft": false
}

Responses

200 OK

有关已创建订单的信息。

Body

application/json
{
  "status": "OK",
  "result": {
    "orders": [
      {
        "id": 0
      }
    ]
  }
}

Type: object

All of 2 types
  • Type: object

    status

    Type: string

    响应的类型。 可能的值:

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

    Enum: OK, ERROR

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

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

    result

    Type: object

    orders

    Type: object[]

    id

    Type: integer

    的订单ID。

    订单创建。

    Min items: 1

    Example
    [
      {
        "id": 0
      }
    ]
    

    有关已创建订单的信息。

    每个仓库一个订单。

    Example
    {
      "orders": [
        {
          "id": 0
        }
      ]
    }
    
    Example
    {
      "result": {
        "orders": [
          {
            "id": 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"
        }
      ]
    }
    

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.

[*brand-package]:提前带到存放货物的市场仓库。