---
title: "目录变体单独定价"
description: "支持批量移除公司地点目录中变体价格。批量修改公司地点目录中变体的阶梯价，覆盖更新。"
doc_type: openapi
doc_category: openapi
doc_version: v20270301
source_url:
  html: 'https://developer.shopline.com/zh-hans-cn/docs/admin-rest-api/product/catalog/separate-pricing-for-catalog-variants'
  md: 'https://developer.shopline.com/zh-hans-cn/docs/admin-rest-api/product/catalog/separate-pricing-for-catalog-variants.md'
---
# 目录变体单独定价

支持批量移除公司地点目录中变体价格。批量修改公司地点目录中变体的阶梯价，覆盖更新。

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

## Endpoint

```http
PUT /company_location_catalog/variants_pricing.json
```

## Base URL

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

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

## Required Permissions

* `write_products`

## Request

### 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 格式传入。

### Request Body

* `product_id`

  string

  目录中产品的id

* `variant_prices`

  array<object>

  变体定价列表。限制最大传500个变体。

  * `price`

    string

    商品固定价格

  * `price_adjustment_method`

    integer

    价格调整的类型，值为`1`表示按百分比调整，值为`2`表示固定价格。

  * `quantity_price_breaks`

    array<object>

    梯度价格列表

    * `minimum_qty`

      integer

      梯度最小购买数量

    * `percent`

      integer

      按`percent_type`进行调整的数值，格式为百分比
      - 调低价格时，值限制为0～100
      - 调高价格时，值限制为0～10000

    * `percent_type`

      integer

      按百分比进行调整的类型，值为`1`表示调低价格，值为`2`表示调高价格

    * `price`

      string

      固定价格，仅当`price_adjustment_method=2`时有值

  * `quantity_rules`

    object

    购买数量的规则

    * `increment`

      integer

      购买数量增量，每次增加的数量必须是增量的倍数

    * `maximum`

      integer

      最大值

    * `minimum`

      integer

      最小值

  * `variant_id`

    string

    目录中变体的id

  * `percent`

    integer

    按`percent_type`进行调整的数值，格式为百分比
    - 调低价格时，值限制为0～100
    - 调高价格时，值限制为0～10000

  * `percent_type`

    integer

    按百分比进行调整的类型，值为`1`表示调低价格，值为`2`表示调高价格

* `catalog_id`

  string

  目录id

* `prices_to_delete_by_variant_ids`

  array<string>

  标识需要删除价格规则和数量规则的变体列表。同时入参删除列表和新增列表，变体的价格将被清除。限制最大传500个变体。无效ID将被过滤。

## 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

_No response body_

#### 401

* `errors`

  string

  错误描述。


#### 429

* `errors`

  string

  错误描述。


## OpenAPI Definition

```json
{
  "description": "支持批量移除公司地点目录中变体价格。批量修改公司地点目录中变体的阶梯价，覆盖更新。",
  "externalDocs": {
    "description": "接口使用的权限点: `write_products` ，更多权限点使用信息，请参考:",
    "url": "ec20/3cv5d7wpfgr6a8z5/xabczf5442284vkq?lang=zh-hans-cn",
    "errorTableDescription": ""
  },
  "operationId": "0Kw92hKe",
  "parameters": [
    {
      "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"
    }
  ],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "properties": {
            "product_id": {
              "name": "product_id",
              "description": "目录中产品的id",
              "type": "string",
              "example": "16064429954842188935480520"
            },
            "variant_prices": {
              "name": "variant_prices",
              "description": "变体定价列表。限制最大传500个变体。",
              "type": "array",
              "items": {
                "name": "variant_prices",
                "description": "变体定价列表。限制最大传500个变体。",
                "type": "object",
                "properties": {
                  "price": {
                    "name": "price",
                    "description": "商品固定价格",
                    "type": "string",
                    "example": "100"
                  },
                  "price_adjustment_method": {
                    "name": "price_adjustment_method",
                    "description": "价格调整的类型，值为`1`表示按百分比调整，值为`2`表示固定价格。",
                    "type": "integer",
                    "example": 1
                  },
                  "quantity_price_breaks": {
                    "name": "quantity_price_breaks",
                    "description": "梯度价格列表",
                    "type": "array",
                    "items": {
                      "name": "quantity_price_breaks",
                      "description": "梯度价格列表",
                      "type": "object",
                      "properties": {
                        "minimum_qty": {
                          "name": "minimum_qty",
                          "description": "梯度最小购买数量",
                          "type": "integer",
                          "example": 2
                        },
                        "percent": {
                          "name": "percent",
                          "description": "按`percent_type`进行调整的数值，格式为百分比\n- 调低价格时，值限制为0～100\n- 调高价格时，值限制为0～10000",
                          "type": "integer",
                          "example": 50
                        },
                        "percent_type": {
                          "name": "percent_type",
                          "description": "按百分比进行调整的类型，值为`1`表示调低价格，值为`2`表示调高价格",
                          "type": "integer",
                          "example": 1
                        },
                        "price": {
                          "name": "price",
                          "description": "固定价格，仅当`price_adjustment_method=2`时有值",
                          "type": "string",
                          "example": "100"
                        }
                      },
                      "example": {
                        "percent": 50,
                        "percent_type": 1,
                        "price": "100",
                        "minimum_qty": 2
                      }
                    },
                    "example": [
                      {
                        "minimum_qty": 2,
                        "percent": 50,
                        "percent_type": 1,
                        "price": "100"
                      }
                    ]
                  },
                  "quantity_rules": {
                    "name": "quantity_rules",
                    "description": "购买数量的规则",
                    "type": "object",
                    "properties": {
                      "increment": {
                        "name": "increment",
                        "description": "购买数量增量，每次增加的数量必须是增量的倍数",
                        "type": "integer",
                        "example": 2
                      },
                      "maximum": {
                        "name": "maximum",
                        "description": "最大值",
                        "type": "integer",
                        "example": 8
                      },
                      "minimum": {
                        "name": "minimum",
                        "description": "最小值",
                        "type": "integer",
                        "example": 2
                      }
                    },
                    "required": [
                      "increment",
                      "minimum"
                    ],
                    "example": {
                      "minimum": 2,
                      "increment": 2,
                      "maximum": 8
                    }
                  },
                  "variant_id": {
                    "name": "variant_id",
                    "description": "目录中变体的id",
                    "type": "string",
                    "example": "18064429954848899821990520"
                  },
                  "percent": {
                    "name": "percent",
                    "description": "按`percent_type`进行调整的数值，格式为百分比\n- 调低价格时，值限制为0～100\n- 调高价格时，值限制为0～10000",
                    "type": "integer",
                    "example": 50
                  },
                  "percent_type": {
                    "name": "percent_type",
                    "description": "按百分比进行调整的类型，值为`1`表示调低价格，值为`2`表示调高价格",
                    "type": "integer",
                    "example": 1
                  }
                },
                "required": [
                  "price_adjustment_method",
                  "quantity_rules",
                  "variant_id"
                ],
                "example": {
                  "percent": 50,
                  "percent_type": 1,
                  "price": "100",
                  "price_adjustment_method": 1,
                  "quantity_price_breaks": [
                    {
                      "minimum_qty": 2,
                      "percent": 50,
                      "percent_type": 1,
                      "price": "100"
                    }
                  ],
                  "quantity_rules": {
                    "minimum": 2,
                    "increment": 2,
                    "maximum": 8
                  },
                  "variant_id": "18064429954848899821990520"
                }
              },
              "example": [
                {
                  "percent_type": 1,
                  "price": "100",
                  "price_adjustment_method": 1,
                  "quantity_price_breaks": [
                    {
                      "price": "100",
                      "minimum_qty": 2,
                      "percent": 50,
                      "percent_type": 1
                    }
                  ],
                  "quantity_rules": {
                    "increment": 2,
                    "maximum": 8,
                    "minimum": 2
                  },
                  "variant_id": "18064429954848899821990520",
                  "percent": 50
                }
              ]
            },
            "catalog_id": {
              "name": "catalog_id",
              "description": "目录id",
              "type": "string",
              "example": "6598087148213149672"
            },
            "prices_to_delete_by_variant_ids": {
              "name": "prices_to_delete_by_variant_ids",
              "description": "标识需要删除价格规则和数量规则的变体列表。同时入参删除列表和新增列表，变体的价格将被清除。限制最大传500个变体。无效ID将被过滤。",
              "type": "array",
              "items": {
                "name": "prices_to_delete_by_variant_ids",
                "description": "标识需要删除价格规则和数量规则的变体列表。同时入参删除列表和新增列表，变体的价格将被清除。限制最大传500个变体。无效ID将被过滤。",
                "type": "string",
                "example": "18064429954848899821950520"
              },
              "example": [
                "18064429954848899821950520"
              ]
            }
          },
          "required": [
            "catalog_id",
            "product_id"
          ],
          "example": {
            "product_id": "16064429954842188935480520",
            "variant_prices": [
              {
                "quantity_rules": {
                  "increment": 2,
                  "maximum": 8,
                  "minimum": 2
                },
                "variant_id": "18064429954848899821990520",
                "percent": 50,
                "percent_type": 1,
                "price": "100",
                "price_adjustment_method": 1,
                "quantity_price_breaks": [
                  {
                    "minimum_qty": 2,
                    "percent": 50,
                    "percent_type": 1,
                    "price": "100"
                  }
                ]
              }
            ],
            "catalog_id": "6598087148213149672",
            "prices_to_delete_by_variant_ids": [
              "18064429954848899821950520"
            ]
          }
        }
      }
    },
    "required": true
  },
  "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": {}
      }
    },
    "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": "put",
  "path": "/company_location_catalog/variants_pricing.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_products"
  ]
}
```