Bills and Stock

The API documentation for creating bills seems to be incomplete. There is
no explanation of how to add a stock item if the “Purchase of Stock”
category is selected when creating a bill. Does anyone know what the field
names are for the “Stock item” and “Quantity” fields?

Furthermore, there is no “Purchase of Stock” category in the API category
listing. I find that if I use the “Stock” category then I get the error
message “you must specify a stock item to use this category”, so it
certainly looks like the API is expecting a stock item for a bill with this
category, but giving a stock id in a field with the name “stock_item” (as
we do for an invoice) does not make the error message go away.

Below is the relevant code for the method that I have written in a php
class. I have highlighted relevant fields in red.

curl_setopt($curl, CURLOPT_SSLVERSION, 6);
curl_setopt($curl,CURLOPT_HTTPHEADER,array(“Authorization: Bearer
{$this->bearer}”,“Accept: application/json”,“Content-Type:
curl_setopt($curl,CURLOPT_USERAGENT,“Revision Tools {$this->version}”);
//Execute the cURL call.