Update your organization
Route
PUT
/api/v1/organizations
Usage
- Curl
- Python
- Ruby
- Node.js
- Go
LAGO_URL="https://api.getlago.com"
API_KEY="__YOUR_API_KEY__"
curl --location --request PUT "$LAGO_URL/api/v1/organizations" \
--header "Authorization: Bearer $API_KEY" \
--header 'Content-Type: application/json' \
--data-raw '{
"organization": {
"name": "Name1",
"webhook_url": "https://test-example.example",
"country": "CZ",
"address_line1": "address1",
"address_line2": null,
"state": "state1",
"zipcode": "10000",
"email": "org@email.com",
"city": "city125",
"legal_name": null,
"legal_number": null,
"timezone": "Europe/Paris",
"billing_configuration": {
"invoice_footer": "footer custom",
"invoice_grace_period": 3,
"vat_rate": 15.0
}
}
}'
from lago_python_client import Client
from lago_python_client.models import Organization, OrganizationBillingConfiguration
client = Client(api_key='__YOUR_API_KEY__')
params = Organization(
timezone="Europe/Paris",
webhook_url="https://new.url",
billing_configuration=OrganizationBillingConfiguration(
invoice_footer="footer custom",
invoice_grace_period=3,
vat_rate=12.5
)
)
client.organizations().update(params)
require 'lago-ruby-client'
client = Lago::Api::Client.new({api_key: '__YOUR_API_KEY__'})
update_params = {
timezone: 'Europe/Paris',
webhook_url: 'https://webhook_url.com',
billing_configuration: {
invoice_footer="footer custom",
invoice_grace_period=3,
vat_rate: 10
}
}
client.organizations.update(update_params)
import Organization from 'lago-nodejs-client/organization'
import OrganizationBillingConfiguration from 'lago-nodejs-client/organization_billing_configuration'
let client = new Client('__API_KEY__')
await client.updateOrganization(new Organization({
timezone: "Europe/Paris",
webhookUrl: "https://newwebhookurl.com",
billingConfiguration: new OrganizationBillingConfiguration({
invoiceFooter: "footer custom",
invoiceGracePeriod: 3,
vatRate: 15.5
})
}))
import "fmt"
import "github.com/getlago/lago-go-client"
func main() {
lagoClient := lago.New().
SetApiKey("__YOUR_API_KEY__")
organizationInput := &lago.OrganizationInput{
LegalName: "Legal Name",
Timezone: "Europe/Paris",
BillingConfiguration: &OrganizationBillingConfigurationInput{
InvoiceFooter: "footer custom",
InvoiceGracePeriod: 3,
VatRate: 20.0,
}
}
organization, err := lagoClient.Organization().Update(organizationInput)
if err != nil {
// Error is *lago.Error
panic(err)
}
// organization is *lago.Organization
fmt.Println(organization)
}
Arguments
{
"organization": {
"webhook_url": "https://test-example.example",
"country": "CZ",
"address_line1": "address1",
"address_line2": null,
"state": "state1",
"zipcode": "10000",
"email": "org@email.com",
"city": "city125",
"legal_name": null,
"legal_number": null,
"timezone": "Europe/Paris",
"billing_configuration": {
"invoice_footer": "footer custom",
"invoice_grace_period": 3,
"vat_rate": 15.0
}
}
}
Attributes | Type | Description |
---|---|---|
webhook_url | String Optional | Webhook URL |
country | String Optional ISO 3166 (alpha-2) | Country where the organization is located |
address_line1 | String Optional | Address (first line) |
address_line2 | String Optional | Address (second line) |
state | String Optional | State where the organization is located |
zipcode | String Optional | Zip code associated with the organization's address |
String Optional | Business email address | |
city | String Optional | City where the organization is located |
legal_name | String Optional | Legal name of the organization |
legal_number | String Optional | Legal number of the organization |
timezone | String Optional TZ database | Timezone of the organization - learn more UTC by default |
billing_configuration | Object Optional | Custom billing settings |
Billing configuration
Attributes | Type | Description |
---|---|---|
invoice_footer | String Optional | Custom invoice footer |
invoice_grace_period | Integer Optional | Grace period (in days) |
vat_rate | Float Optional | Custom VAT rate |
Responses
- HTTP 200
- HTTP 400
- HTTP 401
- HTTP 422
The organization was successfully updated
Returns an organization object.
{
"status": 400,
"error": "Bad Request"
}
The organization
json root is not present in the request body.
{
"status": 401,
"error": "Unauthorized"
}
Access to the API endpoint is unhautorized.
Possible reasons are:
- The
Authorization
header is missing - The
Authorization
header does not contain the API key - The Api key is invalid or expired
{
"status": 422,
"error": "Unprocessable entity",
"code": "validation_errors",
"error_details": {
"field": ["error"]
}
}
Possible errors:
field | error | description |
---|---|---|
webhook_url | url_is_invalid | bebhook_url format is invalid |
vat_rate | value_is_out_of_range | vat_rate is not between 0 and 100 |
country | not_a_valid_country_code | Provided country is invalid |
invoice_footer | value_is_too_long | Footer length is too long |
invoice_grace_period | value_is_out_of_range | Provided invoice grace period is invalid. It must be a positive integer |
email | invalid_email_format | Email format is invalid |
logo | invalid_size | File size is too big |
logo | invalid_content_type | Content type is invalid |
timezone | timezone_invalid | Provided timezone is invalid |