GET /v1/customers/:id
Returns the information Invisible Collector knows regarding a specific customer with a specific id.
The provided id
can be either:
- The global id Invisible Collector assigned to the customer when it was first registered;
- The external id provided by the client upon registration.
curl -XGET \
--header "Content-Type: application/json" \
--header "Authorization: Bearer 4a415cc660e67d8f4d26d5a7f390183a86fc3a4524ded78dc2448e86c48b2739" \
https://api.invisiblecollector.com/v1/customers/2314234
require "net/https"
require "uri"
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)
import com.ic.invisiblecollector.IcApiFacade;
import com.ic.invisiblecollector.model.Customer;
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);
using InvisibleCollectorLib;
using InvisibleCollectorLib.Model;
var ic = new InvisibleCollector("56a73507b66cd761caae7547ef2a66fc3a393746ba4bb9a91e303fcb3ceefb98");
string customerId = ... ;
Customer customer = await ic.GetCustomerInfoAsync(customerId);
iC, err := ic.NewInvisibleCollector("56a73507b66cd761caae7547ef2a66fc3a393746ba4bb9a91e303fcb3ceefb98", ic.InvisibleCollectorUri)
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
Attribute | Type | Description |
---|---|---|
name | string | The name of this debtor. |
externalId | string | An external identification of this debtor. Mainly used to facilitate integration with external systems. |
vatNumber | string | The debtor’s unique identification number for tax purposes. |
address | string | The debtor’s address. |
zipCode | string | The debtor’s zip code. |
city | string | The debtor’s city. |
country | string | The debtor’s ISO 3166-1 country code. |
string | The debtor’s email address. Will be used as the destination for email notifications. | |
phone | string | The debtor’s phone number |
mobile | string | The debtor’s mobile number |
gid | string | An unique identifier of this debtor which can be used to retrive it. |
locale | string | The debtor’s locale. Will be used to set the language of notifications sent to the debtor. |
contacts | array | A list of registered secondary contacts linked to this debtor. |
Contact
Attribute | Type | Description |
---|---|---|
name | string | The name of this contact. |
string | The contact's email address. | |
phone | string | The contact phone number |
mobile | string | The contact mobile number |
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. |