Command 08 — Client registrationrework
Creates a client. In V2 it is POST /client, and most fields keep their names. What changes is what the call checks: duplicate detection, required fields and several defaults work differently — see What changes compared with V1 below the mapping.
Permissions
Section titled “Permissions”V2 checks an app permission on every call — V1 checked none — and a call whose permission is missing answers 400 with errorCode 15, the same status as an invalid payload (see 4.4). Grant these to the API user before porting the command; the names are the ones of the permission tree in flowww.
| Call | Permission |
|---|---|
POST /client | Clients → Fast registration - Create |
PATCH /client/{clientID} | Clients → Clients - Save |
GET /system/countries | General → Settings - Load |
GET /client/{clientID} | Clients → Clients - Edit |
GET /client | Clients → Clients - Search |
Before and after
Section titled “Before and after”curl --location 'https://euapi.flowww.net/v1/fwa_external_get.asp?cmd=08&doctor=USER_LOGIN&pass=USER_PASS&country=ES&key=SYSTEM_KEY&ClinicID=1' \ --data-urlencode 'ClientName=Benito' \ --data-urlencode 'ClientSurname1=Perez' \ --data-urlencode 'ClientPhone1=610000000' \ --data-urlencode 'ClientSex=M' \ --data-urlencode 'ClientEmail=benito@perez.com' \ --data-urlencode 'ClientCountryISO3166_1_alfa2=ES' \ --data-urlencode 'ClientProvinceISO3166_2=ES-M' \ --data-urlencode 'ClientRefererID=1'<Cmd08> <Result>1</Result> <ResultClientID>93271</ResultClientID></Cmd08>curl --location 'https://api.flowww.net/v2/client?clinicID=1' \ --header 'Authorization: Bearer <api_key>' \ --header 'Content-Type: application/json' \ --data '{ "ClientName": "Benito", "ClientSurname1": "Perez", "ClientPhone1": "610000000", "ClientSex": "M", "ClientEmail": "benito@perez.com", "ClientCountryID": 201, "ClientProvinceID": 32, "ClientRefererID": 1 }'{ "ClientID": 93271 }Field mapping
Section titled “Field mapping”Most fields keep the name they had in V1, and POST /client and PATCH /client/{clientID} take the same ones. What follows is only what a V1 payload has to change; the complete list of fields, with types and limits, is in the API reference (Create Client, createClient).
| API V1 | API V2 | What to do |
|---|---|---|
ClientProvinceISO3166_2 (ES-M) | ClientProvinceID (28) | The numeric id, not the ISO code. Resolve it once with GET /system/provinces?countryID=… — see 4.11. |
ClientCountryISO3166_1_alfa2 (ES) | ClientCountryID (201) | Same change. GET /system/countries carries the catalogue — see 4.11. |
ClientCityName | ClientCity | Renamed. |
ClientBirthDay | ClientBirthDate | Renamed. dd/MM/yyyy, as everywhere else in V2 — see 4.1. |
| Legal representative | ClientRepParenthood, ClientRepName, ClientRepSurnames, ClientRepNIF, ClientRepIDClass, ClientRepAddress, ClientRepPhone, ClientRepEmail | The prefix is ClientRep, not ClientLegalRep. Send them for a minor. |
ClientEnableRGPD | ClientConsentEmail, ClientConsentSMS, ClientConsentAPP, ClientConsentPhone, ClientConsentWhatsApp, ClientConsentPostal | Consent is per channel now. ClientEnableRGPD still works, but it overrides all six — read the warning below. |
ClientDisableEMailNotification | — | Gone. The welcome email is sent whenever the clinic has the client app enabled and the client has an email. |
ClientTemp, ClientAppDisabled | same names | True is -1, not 1 — see 4.2. A temporary client is created with this same POST /client by sending ClientTemp; there is no separate call. |
ClientFWA | same name | Still 1 to give the client the app, and it now works on an update too — see command 18. |
Worth sending although V1 had no equivalent: ClientPhonePrefix1…3 (the dial code, separate from the number), ClientExternalReference (your own id, which also resolves the referer), ClientSource, ClientCardNumber, ClientFWALogin / ClientFWAPassword, and ClientLNotes.
What changes compared with V1
Section titled “What changes compared with V1”| Topic | API V1 | API V2 |
|---|---|---|
| Clinic | With the clinic setting default clinic for online registrations, V1 ignored ClinicID and used that clinic. | The client is created in the clinicID you send (or the API user’s default clinic). That setting is ignored. |
| Required fields | V1 enforced the clinic’s list of fields mandatory for online registrations (100003 if one was missing). | The same fields the flowww interface requires. The clinic’s configuration applies exactly as it does when a client is created by hand in flowww; the separate online-registration list is no longer a case of its own. |
| Codes of country, province, referer | Checked. | Stored as sent. |
| Minors | Refused a birth date that needs a legal representative. | Accepted; send the ClientRep* fields to create the representative. |
Emails such as nomail…, nowant… | Blanked, and the text was moved to ClientCustom3. | Stored as sent. |
Consent when ClientEnableRGPD is omitted | The clinic’s default. | Withheld on every channel. |
| Welcome email | Could be suppressed with ClientDisableEMailNotification. | Always sent when the clinic has the client app enabled and the client has an email. |
Duplicates
Section titled “Duplicates”This is the change most likely to create duplicate clients after the switch.
- V1 always checked the email, and also the ID number and the phones when the clinic set them as unique.
- V2 only checks when you send
ClientForceEmail: 0. It then applies the clinic’s rules: same full name always, and email, ID number, phones and card number according to the clinic’s settings. If you omitClientForceEmail, no check is done at all.
Send ClientForceEmail: 0 so the check runs. A duplicate answers 409 {"message":"A client with those details already exists.","errorCode":"409"}.
Reach for ClientForceEmail: 1 only once you have established that you do want a second record — you looked the client up and it is a different person, or whoever handles the 409 decided to create it anyway. Retrying the same call with ClientForceEmail: 1 as an automatic reaction to the 409 turns the duplicate check into a no-op and is exactly how the duplicates get in.
Always check that the answer carries a numeric ClientID before storing it.
Errors
Section titled “Errors”| Answer | Meaning | What to do |
|---|---|---|
400 invalid-request-data + field | A field does not meet the rules in the mapping. | Fix the field. |
| 409 | Duplicate client (only with ClientForceEmail: 0). | Search the existing client and use it. Only send ClientForceEmail: 1 once someone has established it really is a different person — never as an automatic retry. |
400 381 / 340 | The system (or the test clinic) reached its maximum number of clients. | Contact flowww. |
400 403 / 706 / 707 / 708 | Clinic connected to the regional health registry: mandatory registry data missing, or birth date in the future / too old / invalid. | Complete the data. Note that 403 here is an errorCode inside a 400 answer. |
400 (errorCode 15) | The API user lacks Clients → Fast registration → Create. | Grant the permission. |