> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.venda.rw/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.venda.rw/_mcp/server.

# Create batch

POST https://auth/inventory-batches
Content-Type: application/json

Reference: https://docs.venda.rw/venda-api-production/inventory-batches/create-batch

## Servers

- `https://auth` (https://auth, default)
- `https://profile` (https://profile)
- `https://media` (https://media)
- `https://health` (https://health)
- `https://organizations` (https://organizations)
- `https://products` (https://products)
- `https://categories` (https://categories)
- `https://inventory` (https://inventory)
- `https://inventory-batches` (https://inventory-batches)
- `https://suppliers` (https://suppliers)
- `https://purchase-orders` (https://purchase-orders)
- `https://supplier-payments` (https://supplier-payments)
- `https://goods-received` (https://goods-received)
- `https://supplier-returns` (https://supplier-returns)
- `https://customers` (https://customers)
- `https://customer-payments` (https://customer-payments)
- `https://sales` (https://sales)
- `https://returns` (https://returns)
- `https://orders` (https://orders)
- `https://expenses` (https://expenses)
- `https://recurring-expenses` (https://recurring-expenses)
- `https://cashier-shifts` (https://cashier-shifts)
- `https://cashier-activities` (https://cashier-activities)
- `https://stock-transfers` (https://stock-transfers)
- `https://invitations` (https://invitations)
- `https://permissions` (https://permissions)
- `https://reports` (https://reports)
- `https://api` (https://api)

## Request

### Headers

- `X-Organization-Id` (string, optional)

### Body (application/json)

This endpoint expects an object.

- `storeId` (string, required)
- `quantity` (string, required)
- `unitCost` (string, required)
- `productId` (string, required)
- `batchNumber` (string, required)
- `productVariantId` (string, required)

## Response

### 200

Successful response

## Examples

**Request**

```json
{
  "storeId": "{{storeId}}",
  "quantity": "50",
  "unitCost": "6000",
  "productId": "{{productId}}",
  "batchNumber": "B-2608-01",
  "productVariantId": "{{variantId}}"
}
```

**Response**

```json
{}
```

**SDK Code**

```python Inventory Batches_Create batch_example
import requests

url = "https://auth/inventory-batches"

payload = {
    "storeId": "{{storeId}}",
    "quantity": "50",
    "unitCost": "6000",
    "productId": "{{productId}}",
    "batchNumber": "B-2608-01",
    "productVariantId": "{{variantId}}"
}
headers = {
    "X-Organization-Id": "{{orgId}}",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Inventory Batches_Create batch_example
const url = 'https://auth/inventory-batches';
const options = {
  method: 'POST',
  headers: {'X-Organization-Id': '{{orgId}}', 'Content-Type': 'application/json'},
  body: '{"storeId":"{{storeId}}","quantity":"50","unitCost":"6000","productId":"{{productId}}","batchNumber":"B-2608-01","productVariantId":"{{variantId}}"}'
};

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

```go Inventory Batches_Create batch_example
package main

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

func main() {

	url := "https://auth/inventory-batches"

	payload := strings.NewReader("{\n  \"storeId\": \"{{storeId}}\",\n  \"quantity\": \"50\",\n  \"unitCost\": \"6000\",\n  \"productId\": \"{{productId}}\",\n  \"batchNumber\": \"B-2608-01\",\n  \"productVariantId\": \"{{variantId}}\"\n}")

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

	req.Header.Add("X-Organization-Id", "{{orgId}}")
	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 Inventory Batches_Create batch_example
require 'uri'
require 'net/http'

url = URI("https://auth/inventory-batches")

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

request = Net::HTTP::Post.new(url)
request["X-Organization-Id"] = '{{orgId}}'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"storeId\": \"{{storeId}}\",\n  \"quantity\": \"50\",\n  \"unitCost\": \"6000\",\n  \"productId\": \"{{productId}}\",\n  \"batchNumber\": \"B-2608-01\",\n  \"productVariantId\": \"{{variantId}}\"\n}"

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

```java Inventory Batches_Create batch_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://auth/inventory-batches")
  .header("X-Organization-Id", "{{orgId}}")
  .header("Content-Type", "application/json")
  .body("{\n  \"storeId\": \"{{storeId}}\",\n  \"quantity\": \"50\",\n  \"unitCost\": \"6000\",\n  \"productId\": \"{{productId}}\",\n  \"batchNumber\": \"B-2608-01\",\n  \"productVariantId\": \"{{variantId}}\"\n}")
  .asString();
```

```php Inventory Batches_Create batch_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://auth/inventory-batches', [
  'body' => '{
  "storeId": "{{storeId}}",
  "quantity": "50",
  "unitCost": "6000",
  "productId": "{{productId}}",
  "batchNumber": "B-2608-01",
  "productVariantId": "{{variantId}}"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'X-Organization-Id' => '{{orgId}}',
  ],
]);

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

```csharp Inventory Batches_Create batch_example
using RestSharp;

var client = new RestClient("https://auth/inventory-batches");
var request = new RestRequest(Method.POST);
request.AddHeader("X-Organization-Id", "{{orgId}}");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"storeId\": \"{{storeId}}\",\n  \"quantity\": \"50\",\n  \"unitCost\": \"6000\",\n  \"productId\": \"{{productId}}\",\n  \"batchNumber\": \"B-2608-01\",\n  \"productVariantId\": \"{{variantId}}\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Inventory Batches_Create batch_example
import Foundation

let headers = [
  "X-Organization-Id": "{{orgId}}",
  "Content-Type": "application/json"
]
let parameters = [
  "storeId": "{{storeId}}",
  "quantity": "50",
  "unitCost": "6000",
  "productId": "{{productId}}",
  "batchNumber": "B-2608-01",
  "productVariantId": "{{variantId}}"
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://auth/inventory-batches")! 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()
```