> For the complete documentation index, see [llms.txt](https://panaceamobile.gitbook.io/panacea-mobile-help-centre/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://panaceamobile.gitbook.io/panacea-mobile-help-centre/developers/https-api/examples/php/batch-create.md).

# Batch Create

```php
<?php
require_once("panacea_api.php");
$api = new PanaceaApi();
$api->setUsername("demouser");
$api->setPassword("demouser");

$file = "../generic/mybatch.csv";

$result = $api->batch_create("My batch name", $file);

if($api->ok($result)) {
	/* Batch created ! */
	
	$batch_id = $result['details'];
	
	echo "Batch created with ID {$batch_id}\n";
	
	/* Let's create another one from XLS */
	
	$file = "../generic/mybatch.xls";
	
	$result = $api->batch_create("My second batch", $file, 0, false, 'xls');
	
	if($api->ok($result)) {
		echo "XLS Batch created!\n";
		
		/* Give it a moment to parse */
		sleep(1);
		
		$status = $api->batch_check_status($result['details']);
		
		
		
		
		

		if($status['details']['status'] == 32) { // Is it currently paused and waiting?
			$api->batch_start($result['details']);
			
			/* Let's wait a while and see if it's done */
			
			sleep(2);
			
			$status = $api->batch_check_status($result['details']);
			
		}
		
	}
	
	
}

?>
```
