---
title: "Add products to a market"
description: "Add products to a specific market in bulk."
doc_type: openapi
doc_category: openapi
doc_version: v20270301
source_url:
  html: 'https://developer.shopline.com/docs/admin-rest-api/market/add-products-to-the-market'
  md: 'https://developer.shopline.com/docs/admin-rest-api/market/add-products-to-the-market.md'
---
# Add products to a market

Add products to a specific market in bulk.

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

## Endpoint

```http
POST /markets/:markets_id/published_products.json
```

## Base URL

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

  * `{handle}`: `handle` : The store's unique identifier, which is the prefix of the store's domain name. For example, if a store's domain name is `open001.myshopline.com` , the store handle is `open001` .

## Required Permissions

* `write_products`

## Request

### Path Parameters

* `markets_id`

  string (required)

  The unique identifier for the market.  <br/>
  Maximum length：64

### Request Headers

* `Content-Type`

  string (required)

  The field must be set to the fixed value `application/json; charset=utf-8`.

* `Authorization`

  string (required)

   The access token for the API resource. Refer to [App authorization](https://developer.shopline.com/docs/apps/api-instructions-for-use/app-authorization.md?lang=en) to obtain the access token, and then pass the obtained token in the Bearer format. 

### Request Body

* `product_ids`

  array<string>

  The IDs of the products to be added.<br/> Maximum size: 50

## Response

### Status Codes

* `200`

  For the complete list of codes and messages, see [Http status code](https://developer.shopline.com/docs/apps/api-instructions-for-use/http-status-code.md?lang=en).

* `401`

  

* `429`

  

### Response Headers

* `traceId`

  A globally unique identifier for the request. It is used to track the request flow throughout the system, allowing for easy location and debugging when issues arise.

### Response Body

#### 200

* `product_ids`

  array<string>

  The list of product IDs successfully added and published to the current market.


#### 401

* `errors`

  string

  Error message. 


#### 429

* `errors`

  string

  Error message. 


## OpenAPI Definition

```json
{
  "tags": [
    "Add products to a market"
  ],
  "description": "Add products to a specific market in bulk.",
  "externalDocs": {
    "description": "Permission point used by the interface is `write_products` , For more information about the use of permission points, see",
    "url": "ec20/3cv5d7wpfgr6a8z5/xabczf5442284vkq?lang=en",
    "errorTableDescription": ""
  },
  "operationId": "zcerjI9z",
  "parameters": [
    {
      "name": "markets_id",
      "in": "path",
      "description": "The unique identifier for the market.  <br/>\nMaximum length：64",
      "required": true,
      "style": "simple",
      "schema": {
        "name": "markets_id",
        "description": "The unique identifier for the market.  <br/>\nMaximum length：64",
        "type": "string",
        "example": "2805879435494983497000"
      },
      "example": "2805879435494983497000",
      "examples": {
        "Add products to a market": {
          "value": "6608773158211162343"
        }
      }
    },
    {
      "name": "Content-Type",
      "in": "header",
      "description": "The field must be set to the fixed value `application/json; charset=utf-8`.",
      "required": true,
      "schema": {
        "name": "Content-Type",
        "type": "string",
        "example": "application/json; charset=utf-8"
      }
    },
    {
      "name": "Authorization",
      "in": "header",
      "description": " The access token for the API resource. Refer to [App authorization](https://developer.shopline.com/docs/apps/api-instructions-for-use/app-authorization.md?lang=en) to obtain the access token, and then pass the obtained token in the Bearer format. ",
      "required": true,
      "style": "string",
      "schema": {
        "name": "Authorization",
        "description": " The access token for the API resource. Refer to [App authorization](https://developer.shopline.com/docs/apps/api-instructions-for-use/app-authorization.md?lang=en) to obtain the access token, and then pass the obtained token in the Bearer format. ",
        "type": "string",
        "example": "Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6MCwiYXBwS2V5IjoiNzU2ZjI1NWE2NjdlZTcwNTk1MzM0ZjVjYzk4NzU5MzBmN2E3NGZjMSIsImV4cCI6MTg3OTQ4MjA3NiwiaXNzIjoieXNvdWwiLCJzZWxsZXJJZCI6IjIwMDAyMzQ4ODAiLCJzdG9yZUlkIjoiMTY3MjM2OTcyOTYwNiIsInRpbWVzdGFtcCI6MTc4NDc4NzY3NjY2MSwidmVyc2lvbiI6IlYyIn0.3ZzbGAH4cLU1QR2VPEvMOQInUDvus-C4amkINSQIPuNVlXsFKj0sAt1c0KnUy9MWUOFV9cHlkf7J90r2y1FzpA"
      },
      "example": "Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6MCwiYXBwS2V5IjoiNzU2ZjI1NWE2NjdlZTcwNTk1MzM0ZjVjYzk4NzU5MzBmN2E3NGZjMSIsImV4cCI6MTg3OTQ4MjA3NiwiaXNzIjoieXNvdWwiLCJzZWxsZXJJZCI6IjIwMDAyMzQ4ODAiLCJzdG9yZUlkIjoiMTY3MjM2OTcyOTYwNiIsInRpbWVzdGFtcCI6MTc4NDc4NzY3NjY2MSwidmVyc2lvbiI6IlYyIn0.3ZzbGAH4cLU1QR2VPEvMOQInUDvus-C4amkINSQIPuNVlXsFKj0sAt1c0KnUy9MWUOFV9cHlkf7J90r2y1FzpA"
    }
  ],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "name": "body",
          "description": "Body location parameters",
          "type": "object",
          "properties": {
            "product_ids": {
              "name": "product_ids",
              "description": "The IDs of the products to be added.<br/> Maximum size: 50",
              "type": "array",
              "items": {
                "type": "string"
              },
              "example": [
                "16057850264845250791280282",
                "16057850264845250333280282"
              ]
            }
          },
          "required": [
            "product_ids"
          ],
          "example": {
            "product_ids": [
              "16057850264845250791280282",
              "16057850264845250333280282"
            ]
          }
        },
        "examples": {
          "Add products to a market": {
            "description": "Add products to a market.",
            "value": {
              "market_id": "6608773158211162343",
              "product_ids": [
                "16058862795553170089862029",
                "16058910402019758566912029",
                "16058910656495731699282029",
                "16058980574022724890832029",
                "16059302701405621916822029",
                "16060418737484868223952029",
                "16060927716840157184432029",
                "16062026862565743752732925",
                "16062240622699840897282925",
                "16062313089907661290242925"
              ]
            }
          }
        }
      }
    },
    "required": true
  },
  "responses": {
    "200": {
      "description": "For the complete list of codes and messages, see [Http status code](https://developer.shopline.com/docs/apps/api-instructions-for-use/http-status-code.md?lang=en).",
      "headers": {
        "traceId": {
          "description": "A globally unique identifier for the request. It is used to track the request flow throughout the system, allowing for easy location and debugging when issues arise."
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "name": "body",
            "type": "object",
            "properties": {
              "product_ids": {
                "name": "product_ids",
                "description": "The list of product IDs successfully added and published to the current market.",
                "type": "array",
                "items": {
                  "type": "string"
                },
                "example": [
                  "16057850264845250791280282",
                  "16057850264845250333280282"
                ]
              }
            },
            "example": {
              "product_ids": [
                "16057850264845250791280282",
                "16057850264845250333280282"
              ]
            }
          },
          "examples": {
            "Add products to a market": {
              "description": "Add products to a market.",
              "value": {
                "product_ids": [
                  "16058862795553170089862029",
                  "16058910402019758566912029",
                  "16058910656495731699282029",
                  "16058980574022724890832029",
                  "16059302701405621916822029",
                  "16060418737484868223952029",
                  "16060927716840157184432029",
                  "16062026862565743752732925",
                  "16062240622699840897282925",
                  "16062313089907661290242925"
                ]
              }
            }
          }
        }
      }
    },
    "401": {
      "headers": {
        "traceId": {
          "description": "A globally unique identifier for the request. It is used to track the request flow throughout the system, allowing for easy location and debugging when issues arise."
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "errors": {
                "description": "Error message. ",
                "type": "string"
              }
            },
            "required": [
              "errors"
            ]
          }
        }
      }
    },
    "429": {
      "headers": {
        "traceId": {
          "description": "A globally unique identifier for the request. It is used to track the request flow throughout the system, allowing for easy location and debugging when issues arise."
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "errors": {
                "description": "Error message. ",
                "type": "string"
              }
            },
            "required": [
              "errors"
            ]
          }
        }
      }
    }
  },
  "security": [
    {
      "oauth2": []
    }
  ],
  "method": "post",
  "path": "/markets/:markets_id/published_products.json",
  "servers": [
    {
      "url": "https://{handle}.myshopline.com/admin/openapi",
      "variables": {
        "handle": {
          "default": "openapiceshidianpu",
          "description": "`handle` : The store's unique identifier, which is the prefix of the store's domain name. For example, if a store's domain name is `open001.myshopline.com` , the store handle is `open001` ."
        }
      }
    }
  ],
  "info": {
    "title": "Add products to a market",
    "version": "v20270301"
  },
  "authIndexes": [
    "write_products"
  ]
}
```