---
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/localizations/add-store-languages'
  md: 'https://developer.shopline.com/zh-hans-cn/docs/admin-rest-api/localizations/add-store-languages.md'
---
# 添加店铺语言

你可以通过该接口对店铺中的语言进行添加。

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

## Endpoint

```http
POST /store/languages.json
```

## Base URL

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

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

## Required Permissions

* `write_store_information`

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

* `languages`

  array<string>

  待添加的语种列表。添加后可以在 SHOPLINE 商家后台 <strong>设置 -> 语言</strong> 查看。

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

* `data`

  object

  响应数据体。

  * `default_language`

    string

    店铺的默认语言。

  * `supported_languages`

    array<string>

    正在被使用的语言清单。


#### 401

* `errors`

  string

  错误描述。


#### 429

* `errors`

  string

  错误描述。


## OpenAPI Definition

```json
{
  "description": "你可以通过该接口对店铺中的语言进行添加。",
  "externalDocs": {
    "description": "接口使用的权限点: `write_store_information` ，更多权限点使用信息，请参考:",
    "url": "ec20/3cv5d7wpfgr6a8z5/xabczf5442284vkq?lang=zh-hans-cn",
    "errorTableDescription": ""
  },
  "operationId": "WLWKpUMh",
  "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": {
            "languages": {
              "name": "languages",
              "description": "待添加的语种列表。添加后可以在 SHOPLINE 商家后台 <strong>设置 -> 语言</strong> 查看。",
              "type": "array",
              "items": {
                "name": "languages",
                "description": "待添加的语种列表。添加后可以在 SHOPLINE 商家后台 <strong>设置 -> 语言</strong> 查看。",
                "type": "string",
                "example": "vi"
              },
              "example": [
                "vi"
              ]
            }
          },
          "required": [
            "languages"
          ],
          "example": {
            "languages": [
              "vi"
            ]
          }
        },
        "examples": {
          "店铺设置中添加语言": {
            "description": "店铺设置中添加语言。",
            "value": {
              "languages": [
                "vi",
                "th"
              ]
            }
          }
        }
      }
    },
    "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": {
          "schema": {
            "type": "object",
            "properties": {
              "data": {
                "name": "data",
                "description": "响应数据体。",
                "type": "object",
                "properties": {
                  "default_language": {
                    "name": "default_language",
                    "description": "店铺的默认语言。",
                    "type": "string",
                    "example": "en"
                  },
                  "supported_languages": {
                    "name": "supported_languages",
                    "description": "正在被使用的语言清单。",
                    "type": "array",
                    "items": {
                      "name": "supported_languages",
                      "description": "正在被使用的语言清单。",
                      "type": "string",
                      "example": "vi"
                    },
                    "example": [
                      "vi"
                    ]
                  }
                },
                "example": {
                  "default_language": "en",
                  "supported_languages": [
                    "vi"
                  ]
                }
              }
            },
            "example": {
              "data": {
                "default_language": "en",
                "supported_languages": [
                  "vi"
                ]
              }
            }
          },
          "examples": {
            "店铺设置中添加语言": {
              "description": "店铺设置中添加语言。",
              "value": {
                "data": {
                  "default_language": "en",
                  "supported_languages": [
                    "en",
                    "vi",
                    "th"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "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": "post",
  "path": "/store/languages.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_store_information"
  ]
}
```