For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://developer.shipbob.com/v1.0/api/products/llms.txt. For full documentation content, see https://developer.shipbob.com/v1.0/api/products/llms-full.txt.

# Add multiple products to the store


POST https://api.shipbob.com/1.0/product/batch
Content-Type: application/json

Reference: https://developer.shipbob.com/v1.0/api/products/add-multiple-products-to-the-store

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: api-1.0
  version: 1.0.0
paths:
  /1.0/product/batch:
    post:
      operationId: add-multiple-products-to-the-store
      summary: |
        Add multiple products to the store
      tags:
        - subpackage_products
      parameters:
        - name: Authorization
          in: header
          description: Authentication using Personal Access Token (PAT) token
          required: true
          schema:
            type: string
        - name: shipbob_channel_id
          in: header
          description: Channel Id for Operation
          required: true
          schema:
            type: string
            format: int32
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Products.ProductViewModelArray'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Products.Post.Api.Product.Batch.Bad.Request.Object
        '401':
          description: No access right at this time
          content:
            application/json:
              schema:
                description: Any type
        '403':
          description: No access
          content:
            application/json:
              schema:
                description: Any type
        '422':
          description: Client Error
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Products.Post.Api.Product.Batch.Unprocessable.Entity.Object
      requestBody:
        description: List of up to 50 products to add
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Products.CreateProductModelArray'
servers:
  - url: https://api.shipbob.com
  - url: https://sandbox-api.shipbob.com
components:
  schemas:
    Products.CreateProductModel:
      type: object
      properties:
        barcode:
          type:
            - string
            - 'null'
          description: Barcode for the product
        gtin:
          type:
            - string
            - 'null'
          description: >-
            Global Trade Item Number - unique and internationally recognized
            identifier assigned to item by company GS1.
        name:
          type: string
          description: The name of the product
        reference_id:
          type: string
          description: >-
            Unique reference identifier for the product. Any linked or generated
            inventory will also be uniquely identified by this value
        sku:
          type:
            - string
            - 'null'
          description: Stock keeping unit for the product
        unit_price:
          type:
            - number
            - 'null'
          format: double
          description: The price of one unit
        upc:
          type:
            - string
            - 'null'
          description: Universal Product Code - Unique external identifier
      required:
        - name
        - reference_id
      description: The product to create
      title: Products.CreateProductModel
    Products.CreateProductModelArray:
      type: array
      items:
        $ref: '#/components/schemas/Products.CreateProductModel'
      title: Products.CreateProductModelArray
    Products.BundleRootInformationViewModel:
      type: object
      properties:
        id:
          type: integer
          description: Id of the bundle root product
        name:
          type:
            - string
            - 'null'
          description: Name of the bundle root product
      title: Products.BundleRootInformationViewModel
    Products.ChannelViewModel:
      type: object
      properties:
        id:
          type: integer
          description: Unique id of the store channel
        name:
          type:
            - string
            - 'null'
          description: Name of the store channel
      description: Information about a store channel
      title: Products.ChannelViewModel
    Products.InventoryItemViewModel:
      type: object
      properties:
        id:
          type: integer
          description: Unique id of the inventory item
        name:
          type:
            - string
            - 'null'
          description: Name of the inventory item
        quantity:
          type: integer
          description: Quantity of the inventory item included in a store product
      description: The inventory that store products can resolve to when packing a shipment
      title: Products.InventoryItemViewModel
    Products.FulfillmentCenterQuantityViewModel:
      type: object
      properties:
        committed_quantity:
          type: integer
          description: Amount of committed quantity at this fulfillment center
        fulfillable_quantity:
          type: integer
          description: Amount of fulfillable quantity at this fulfillment center
        id:
          type: integer
          description: Unique id of the fulfillment center
        name:
          type:
            - string
            - 'null'
          description: Name of the fulfillment center
        onhand_quantity:
          type: integer
          description: Amount of onhand quantity at this fulfillment center
      description: Break down of quantities by fulfillment center
      title: Products.FulfillmentCenterQuantityViewModel
    Products.ProductViewModel:
      type: object
      properties:
        barcode:
          type:
            - string
            - 'null'
          description: Barcode for the product
        bundle_root_information:
          $ref: '#/components/schemas/Products.BundleRootInformationViewModel'
        channel:
          $ref: '#/components/schemas/Products.ChannelViewModel'
        created_date:
          type: string
          format: date-time
          description: Date the product was created
        fulfillable_inventory_items:
          type:
            - array
            - 'null'
          items:
            $ref: '#/components/schemas/Products.InventoryItemViewModel'
          description: >-
            The inventory that this product will resolve to when packing a
            shipment
        fulfillable_quantity_by_fulfillment_center:
          type:
            - array
            - 'null'
          items:
            $ref: '#/components/schemas/Products.FulfillmentCenterQuantityViewModel'
          description: >-
            Fulfillable quantity of this product broken down by fulfillment
            center location
        gtin:
          type:
            - string
            - 'null'
          description: >-
            Global Trade Item Number - unique and internationally recognized
            identifier assigned to item by company GS1.
        id:
          type: integer
          description: Unique identifier of the product
        name:
          type:
            - string
            - 'null'
          description: The name of the product
        reference_id:
          type:
            - string
            - 'null'
          description: Unique reference identifier of the product
        sku:
          type:
            - string
            - 'null'
          description: Stock keeping unit for the product
        total_committed_quantity:
          type: integer
          description: Total committed quantity of this product
        total_fulfillable_quantity:
          type: integer
          description: Total fulfillable quantity of this product
        total_onhand_quantity:
          type: integer
          description: Total on hand quantity of this product
        unit_price:
          type:
            - number
            - 'null'
          format: double
          description: The price of one unit
        upc:
          type:
            - string
            - 'null'
          description: Universal Product Code - Unique external identifier
      title: Products.ProductViewModel
    Products.ProductViewModelArray:
      type: array
      items:
        $ref: '#/components/schemas/Products.ProductViewModel'
      title: Products.ProductViewModelArray
    Products.Post.Api.Product.Batch.Bad.Request.Object:
      type: object
      additionalProperties:
        type: array
        items:
          type: string
      title: Products.Post.Api.Product.Batch.Bad.Request.Object
    Products.Post.Api.Product.Batch.Unprocessable.Entity.Object:
      type: object
      additionalProperties:
        type: array
        items:
          type: string
      title: Products.Post.Api.Product.Batch.Unprocessable.Entity.Object
  securitySchemes:
    PAT:
      type: http
      scheme: bearer
      description: Authentication using Personal Access Token (PAT) token
    OAuth2:
      type: http
      scheme: bearer
      description: OAuth2 authentication using JWT tokens

```

## SDK Code Examples

```python Products_addMultipleProductsToTheStore_example
import requests

url = "https://api.shipbob.com/1.0/product/batch"

payload = [
    {
        "name": "Medium Blue T-Shirt",
        "reference_id": "TShirtBlueM",
        "barcode": "123456789012",
        "gtin": "012345678905",
        "sku": "TShirtBlueM",
        "unit_price": 20.32,
        "upc": "012345678912"
    }
]
headers = {
    "shipbob_channel_id": "shipbob_channel_id",
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Products_addMultipleProductsToTheStore_example
const url = 'https://api.shipbob.com/1.0/product/batch';
const options = {
  method: 'POST',
  headers: {
    shipbob_channel_id: 'shipbob_channel_id',
    Authorization: 'Bearer <token>',
    'Content-Type': 'application/json'
  },
  body: '[{"name":"Medium Blue T-Shirt","reference_id":"TShirtBlueM","barcode":"123456789012","gtin":"012345678905","sku":"TShirtBlueM","unit_price":20.32,"upc":"012345678912"}]'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Products_addMultipleProductsToTheStore_example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.shipbob.com/1.0/product/batch"

	payload := strings.NewReader("[\n  {\n    \"name\": \"Medium Blue T-Shirt\",\n    \"reference_id\": \"TShirtBlueM\",\n    \"barcode\": \"123456789012\",\n    \"gtin\": \"012345678905\",\n    \"sku\": \"TShirtBlueM\",\n    \"unit_price\": 20.32,\n    \"upc\": \"012345678912\"\n  }\n]")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("shipbob_channel_id", "shipbob_channel_id")
	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Products_addMultipleProductsToTheStore_example
require 'uri'
require 'net/http'

url = URI("https://api.shipbob.com/1.0/product/batch")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["shipbob_channel_id"] = 'shipbob_channel_id'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "[\n  {\n    \"name\": \"Medium Blue T-Shirt\",\n    \"reference_id\": \"TShirtBlueM\",\n    \"barcode\": \"123456789012\",\n    \"gtin\": \"012345678905\",\n    \"sku\": \"TShirtBlueM\",\n    \"unit_price\": 20.32,\n    \"upc\": \"012345678912\"\n  }\n]"

response = http.request(request)
puts response.read_body
```

```java Products_addMultipleProductsToTheStore_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.shipbob.com/1.0/product/batch")
  .header("shipbob_channel_id", "shipbob_channel_id")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("[\n  {\n    \"name\": \"Medium Blue T-Shirt\",\n    \"reference_id\": \"TShirtBlueM\",\n    \"barcode\": \"123456789012\",\n    \"gtin\": \"012345678905\",\n    \"sku\": \"TShirtBlueM\",\n    \"unit_price\": 20.32,\n    \"upc\": \"012345678912\"\n  }\n]")
  .asString();
```

```php Products_addMultipleProductsToTheStore_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.shipbob.com/1.0/product/batch', [
  'body' => '[
  {
    "name": "Medium Blue T-Shirt",
    "reference_id": "TShirtBlueM",
    "barcode": "123456789012",
    "gtin": "012345678905",
    "sku": "TShirtBlueM",
    "unit_price": 20.32,
    "upc": "012345678912"
  }
]',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
    'shipbob_channel_id' => 'shipbob_channel_id',
  ],
]);

echo $response->getBody();
```

```csharp Products_addMultipleProductsToTheStore_example
using RestSharp;

var client = new RestClient("https://api.shipbob.com/1.0/product/batch");
var request = new RestRequest(Method.POST);
request.AddHeader("shipbob_channel_id", "shipbob_channel_id");
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "[\n  {\n    \"name\": \"Medium Blue T-Shirt\",\n    \"reference_id\": \"TShirtBlueM\",\n    \"barcode\": \"123456789012\",\n    \"gtin\": \"012345678905\",\n    \"sku\": \"TShirtBlueM\",\n    \"unit_price\": 20.32,\n    \"upc\": \"012345678912\"\n  }\n]", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Products_addMultipleProductsToTheStore_example
import Foundation

let headers = [
  "shipbob_channel_id": "shipbob_channel_id",
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  [
    "name": "Medium Blue T-Shirt",
    "reference_id": "TShirtBlueM",
    "barcode": "123456789012",
    "gtin": "012345678905",
    "sku": "TShirtBlueM",
    "unit_price": 20.32,
    "upc": "012345678912"
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.shipbob.com/1.0/product/batch")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```