---
title: Adding custom config to Printus job data
description: "It's possible to filter and change the data that Printus sends to the PrintNode API for a print job. In the example below we're adding some custom print options to the printjob before sending it to PrintNode. You can learn…"
url: "https://printus.cloud/docs/adding-custom-config-to-printus-job-data/"
updated: "2024-09-10"
category: Custom Code Samples
---

# Adding custom config to Printus job data

It's possible to filter and change the data that Printus sends to the PrintNode API for a print job. In the example below we're adding some custom print options to the printjob before sending it to PrintNode.

You can learn more about the printjob configuration [here](https://www.printnode.com/en/docs/api/curl#printjobs).

```
function sl_cc_printus_add_custom_print_config($job_data){
	$job_data['options'] = array(
		'fit_to_page' => 'false',
		'rotate'      => 0,
	);
	return $job_data;
}
add_filter('printus__printnode_job_data', 'sl_cc_printus_add_custom_print_config', 10, 1);
```

In the above example we're adding a key called `options` and then further adding some array items to that `options` key. The `$job_data` variable itself is an array with the following structure:

```
$job_data = array(
			'order_id'    => $order_id,
			'printerId'   => $printer_id,
			'contentType' => 'pdf_base64',
			'content'     => $content,
			'title'       => __( 'Order', 'printus-cloud-printing-for-woocommerce' ) . ' #' . $order_id . ' - Printus.cloud',
			'source'      => 'printus',
		);
```

This means to change the Printer ID that the print would be sent to, you can add the following snippet to your website:

```
function sl_cc_printus_change_printer_id($job_data){
  // ...
  // ...
  // You can add logic that would determine the Printer ID to use here.
  // ...
  // ...

	$job_data['printerId'] = 1234567 // Printer ID
	return $job_data;
}
add_filter('printus__printnode_job_data', 'sl_cc_printus_change_printer_id', 10, 1);
```
