Tiime
SDK TypeScript

Clients

Lister, créer et rechercher des clients

Accès via client.clients.

list

Lister les clients.

clients.ts
// Tous les clients actifs
const clients = await client.clients.list({ archived: false });

// Tous les clients (y compris archivés)
const all = await client.clients.list();

Paramètres (ClientsListParams) :

ChampTypeDescription
archivedbooleanFiltrer par statut d'archivage

Retour : Promise<Client[]>

get

Récupérer les détails d'un client.

clients.ts
const detail = await client.clients.get(100);
ParamètreTypeDescription
clientIdnumberID du client

Retour : Promise<Client>

create

Créer un nouveau client.

clients.ts
const newClient = await client.clients.create({
  name: "ACME Corp",
  email: "contact@acme.com",
  siren_or_siret: "12345678901234",
  city: "Paris",
  postal_code: "75001",
  address: "1 rue de Rivoli",
  professional: true,
});

Paramètres (ClientCreateParams) :

ChampTypeObligatoireDescription
namestringouiNom du client
emailstringEmail
phonestringTéléphone
addressstringAdresse
postal_codestringCode postal
citystringVille
country_idnumberID du pays
siren_or_siretstringSIREN ou SIRET
professionalbooleanClient professionnel

Retour : Promise<Client>

Rechercher des clients par nom.

clients.ts
const results = await client.clients.search("acme");
ParamètreTypeDescription
querystringTexte de recherche

Retour : Promise<Client[]>

Type Client

ChampTypeDescription
idnumberIdentifiant unique
namestringNom du client
slugstringSlug
addressstringAdresse
address_complementstring | nullComplément d'adresse
postal_codestringCode postal
citystringVille
countryCountryPays
country_codestringCode pays
emailstring | nullEmail
phonestring | nullTéléphone
siren_or_siretstringSIREN ou SIRET
siretstring | nullSIRET
sirenstring | nullSIREN
intracom_vat_numberstring | nullNuméro de TVA intracommunautaire
archivedbooleanArchivé
archived_atstring | nullDate d'archivage
professionalbooleanClient professionnel
colorstringCouleur
acronymstringAcronyme
notestring | nullNote
bicstring | nullBIC
ibanstring | nullIBAN

On this page