GET /v1/customers/:id

Returns the information Invisible Collector knows regarding a specific customer with a specific id.

The provided id can be either:

uri = URI.parse("https://api.invisiblecollector.com/v1/customers/2314234") http = Net::HTTP.new(uri.host, uri.port) http.use_ssl = true

request = Net::HTTP::Get.new(uri.request_uri) request['Content-Type'] = 'application/json' request['Authorization'] = 'Bearer 4a415cc660e67d8f4d26d5a7f390183a86fc3a4524ded78dc2448e86c48b2739'

response = http.request(request)

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

String customerId = "1"; Customer upToDateCustomer = apiFacade.requestCustomerInfo(customerId);

//or Customer customer = //must containd an id or externalId Customer upToDateCustomer = apiFacade.requestCustomerInfo(customer);

var ic = new InvisibleCollector("56a73507b66cd761caae7547ef2a66fc3a393746ba4bb9a91e303fcb3ceefb98"); string customerId = … ; Customer customer = await ic.GetCustomerInfoAsync(customerId);

customerId := aCustomerModel.Id() // or customerId := aCustomerModel.RoutableId()

var channel = make(chan ic.CustomerPair) go iC.GetCustomer(channel, customerId) p := <-channel

fmt.Println(p.Customer)

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

{
  "name": "John Doe Inc.",
  "vatNumber": "PT543219876",
  "address": "Invisible Avenue, 456",
  "zipCode": "1234-543",
  "city": "Lisbon",
  "country": "PT",
  "email": "[email protected]",
  "phone": "555-555-555",
  "mobile": "444-444-444",
  "externalId": "345",
  "gid": "061d2feb-81c2-4694-a74a-13cecbe7d2ce",
  "locale": "pt",
  "contacts": [
    {
      "name": "John Doe",
      "email": "[email protected]",
      "phone": "555-555-555",
      "mobile": "444-444-444"
    }
  ]
}

Endpoint

GET https://api.invisiblecollector.com/v1/customers/:id

Response body

Customer

<tr>
  <td>externalId</td>
  <td>string</td>
  <td>An external identification of this customer. Mainly used to facilitate integration with external systems.</td>
</tr>

<tr>
  <td>vatNumber</td>
  <td>string</td>
  <td>The customer’s unique identification number for tax purposes.</td>
</tr>

<tr>
  <td>address</td>
  <td>string</td>
  <td>The customer’s address.</td>
</tr>

<tr>
  <td>zipCode</td>
  <td>string</td>
  <td>The customer’s zip code.</td>
</tr>

<tr>
  <td>city</td>
  <td>string</td>
  <td>The customer’s city.</td>
</tr>

<tr>
  <td>country</td>
  <td>string</td>
  <td>The customer’s <a href="https://en.wikipedia.org/wiki/ISO_3166-1" class="highlight">ISO 3166-1</a> country code.</td>
</tr>

<tr>
  <td>email</td>
  <td>string</td>
  <td>The customer’s email address. Will be used as the destination for email notifications.</td>
</tr>

<tr>
  <td>phone</td>
  <td>string</td>
  <td>The customer’s phone number</td>
</tr>

<tr>
  <td>mobile</td>
  <td>string</td>
  <td>The customer’s mobile number</td>
</tr>

<tr>
  <td>gid</td>
  <td>string</td>
  <td>An unique identifier of this customer which can be used to retrive it.</td>
</tr>

<tr>
  <td>locale</td>
  <td>string</td>
  <td>The customer’s <a href="https://en.wikipedia.org/wiki/Locale_(computer_software)" class="highlight">locale</a>. Will be used to set the language of notifications sent to the customer.</td>
</tr>

<tr>
  <td>contacts</td>
  <td>array</td>
  <td>A list of registered secondary contacts linked to this customer.</td>
</tr>

Contact

<tr>
  <td>email</td>
  <td>string</td>
  <td>The contact's email address.</td>
</tr>

<tr>
  <td>phone</td>
  <td>string</td>
  <td>The contact phone number</td>
</tr>

<tr>
  <td>mobile</td>
  <td>string</td>
  <td>The contact mobile number</td>
</tr>

Errors

This endpoint may return the following errors

HTTP Code Description
401 Unauthorized Invalid credentials were supplied
404 Not found The user doesn’t have any customer registered with that specific id.