PUT /companies

PUT /companies

client = InvisibleCollector::API.new(api_token: '4a415cc660e67d8f4d26d5a7f390183a86fc3a4524ded78dc2448e86c48b2739') company = client.company.get() # update company information client.company.update(company)

IcApiFacade apiFacade = new IcApiFacade("56a73507b66cd761caae7547ef2a66fc3a393746ba4bb9a91e303fcb3ceefb98");

// optional, get company info for validation fields Company companyToSend = apiFacade.requestCompanyInfo(); // set new info //update company Company updatedCompany = apiFacade.updateCompanyInfo(companyToSend);

var ic = new InvisibleCollector("56a73507b66cd761caae7547ef2a66fc3a393746ba4bb9a91e303fcb3ceefb98");

// optional, get company info for validation fields Company company = await ic.GetCompanyInfoAsync(); // set new information company.City = "new city"; var updatedCompany = await ic.SetCompanyInfoAsync(company);

iC, err := ic.NewInvisibleCollector("56a73507b66cd761caae7547ef2a66fc3a393746ba4bb9a91e303fcb3ceefb98", ic.InvisibleCollectorUri)

updateCompany := ic.MakeCompany() // set new company info, while setting the mandatory fields
var channel = make(chan ic.CompanyPair) go iC.SetCompany(channel, updateCompany) p := <-channel

fmt.Println(p.Company)

This request can receive, for example, the following JSON data:

{
  "name": "Johny's Company",
  "vatNumber": "PT543219876",
  "address": "Invisible Avenue, 456",
  "zipCode": "1234-543",
  "city": "Lisbon",
  "country": "PT"
}

This request will return, for example, the following JSON response:

{
  "name": "Johny's Company",
  "vatNumber": "PT543219876",
  "address": "Invisible Avenue, 456",
  "zipCode": "1234-543",
  "city": "Lisbon",
  "country": "PT",
  "gid": "061d2feb-81c2-4694-a74a-13cecbe7d2ce",
  "notificationsEnabled": true
}

Partially updates the current authorized company’s information.

null attributes will be ignored.

This request is idempotent.

Endpoint

PUT https://api.invisiblecollector.com/companies

Request body

Attribute Type Mandatory Default Description
name string true N/A The name of the company. Cannot be changed but needed for consistency check
vatNumber string true N/A The company’s unique identification number. Cannot be changed but needed for consistency check
address string false N/A The company’s address
zipCode string false N/A The company’s zip code
city string false N/A The company’s city

Response body

Attribute Type Description
name string The name of the company
vatNumber string The company’s unique identification number for tax purposes
address string The company’s address
zipCode string The company’s zip code
city string The company’s city
country string The company’s ISO 3166-1 country code
gid string An unique identifier of this company within Invisible Collector’s system
notificationsEnabled boolean Flag that indicates if Invisible Collector is sending notifications to customers

Errors

This endpoint may return the following errors

HTTP Code Description
401 Unauthorized Invalid credentials were supplied