Impact migration of the route GET /v0/customers
- Obsolète
- 1 juin 2023
- 1 route liée
Context
Upgrade from GET - /v0/customers to GET - /v1/customers
⭐ Key benefits : Give the ability to specify the type of identity number
ℹ️ identity_number becomes an object that contains two keys and had a new name : identity
As a CxO dev I want to be able to enter an identity number for a customer and an associated typology In order to modify this number and specify its type
Impacts
Route to call :
- GET -
/v1/customers
❗ identity_number got a new name : identity
❗ identity is an object that contains two keys : number and type
❗ type Allows you to specify type of identity number in an enumeration
Model
id: identity
description : National identifier code
id: number
description : National identifier code attached to the identity document
type : String
example : E001241
key : type
type : ENUM
ENUM : [CPF, CUIL, TAX_NUMBER, SECURITY_NUMBER, ID_NUMBER, NATIONAL_REGISTER]
ENUM Spotlight
| ENUM API | Description |
|---|---|
| CPF | Cadastro de pessoas fisicas (mandatory for Brasil) |
| CUIL | Argentine Tax Identification Number |
| TAX_NUMBER | Italian Tax Code |
| SECURITY_NUMBER | French social security number |
| ID_NUMBER | Unique identifier (China) |
| NATIONAL_REGISTER | Belgian social security number |
Output - GET /v1/customers
Response : ⚠️ Evolved
[
{
"id": "123456789",
"blacklisted": false,
"gm_number": "123456789",
"civility": "MR",
"first_name": "John",
"unicode_first_name": "",
"last_name": "Smith",
"unicode_last_name": "",
"birthdate": "19800117",
"email": "john@h.fr",
"type": "CLIENT",
- "identity_number": "E001241"
+ "identity": {
+ "number": "E001241",
+ "type": "CUIL"
+ },
"birth_country_code": "FR",
"phones": [
{
"number": "0623456789",
"type": "MOBILE"
}
],
"health_pass_id": "1234567892",
"address": {
"number": "15",
"street": "AVENUE DES CHAMPS ELYSEES",
"add_on": "6A",
"town": "Luynes",
"city": "Aix-en-Provence",
"zip_code": "75000",
"state_or_district": "CA",
"country": "FRANCE",
"country_code": "FR",
"additional_information_1": "Chez M. Dupont",
"additional_information_2": "Entreprise Clubmed"
},
"passport": {
"first_name": "string",
"unicode_first_name": "string",
"last_name": "string",
"unicode_last_name": "string",
"birthdate": "string",
"document_number": "09PR5121E",
"authority": "prefecture de paris",
"birthplace": "Paris",
"nationality": "FR",
"issuing_date": "20150225",
"expiration_date": "20250224",
"serial_number": "123456789",
"birth_country": "FR",
"residence_city": "Paris",
"issuing_country": "FR"
},
"id_card": {
"first_name": "string",
"unicode_first_name": "string",
"last_name": "string",
"unicode_last_name": "string",
"birthdate": "string",
"document_number": "09PR5121E",
"authority": "prefecture de paris",
"birthplace": "Paris",
"nationality": "FR",
"issuing_date": "20150205",
"expiration_date": "20250204",
"birth_country": "FR",
"residence_city": "Paris",
"issuing_country": "FR"
},
"driving_licence": {
"first_name": "string",
"unicode_first_name": "string",
"last_name": "string",
"unicode_last_name": "string",
"birthdate": "string",
"document_number": "09PR5121E",
"authority": "prefecture de paris",
"birthplace": "Paris",
"issuing_date": "19590101",
"expiration_date": "20010101"
},
"_links": [
{
"method": "GET",
"href": "https://api.clubmed.com/v1/products/AGAC",
"rel": "product_detail"
}
]
}
]