I am sure i have seen it somewhere in the docs, but cannot find it any longer
What are the requirements for create > client country_id
if i dont include it, it sets the country to India
Can anyone point me in the right direction, as i have searched google for country codes, but they do not seem to match single numbers, etc.
If i try adding GBP, i just get an error, as it needs to be an number
Surely i dont need to add a php library to look up all countries ID’s?
Or if i do, can anyone make suggestions please?
It is the ISO 3166 that they require.
I was hoping there was something that was within the ninja code that would help select this.
Most my customers are from the same country, so i could hard code it, but the odd few may want a different country.
I feel it would be better if a string could be used for the displayed country on invoice, as appose to needing to enter the ISO numbers.
When I did a little additional searching after responding to your question, I did find a random PHP script on GitHub, that supposedly finds the code associated with country names. But I think it’s only run from the CLI, so wouldn’t really help.
This gets a list of all countries data, if this is of use to others. I was using a 3rd party .sql list to do this, but i feel it better to use the InvoiceNinja list (now i had time to work out how to get this), just in case there are any differences, the invoiceNinja list should be 100% reliable
require_once DIR . ‘/vendor/autoload.php’;
use InvoiceNinja\Sdk\InvoiceNinja;
$ninja = new InvoiceNinja(YOUR_TOKEN);
$ninja->setUrl(YOUR_URL); // if self hosted
$countries = $ninja->statics->countries();
print_r($countries); // will give you a list of all countries and codes