# Create Client Creates a new client. Endpoint: POST /clients.json Version: 2.0.0 Security: apiKeyAuth ## Query parameters: - `api_key` (string, required) Your API Key. Example: "YOUR_API_KEY" ## Request fields (application/json): - `client` (object, required) - `client.name` (string, required) Example: "Client Name" - `client.code` (string, required) Maximum length is the database default, not an enforced business rule. Example: "12345" - `client.email` (string) Example: "foo@bar.com" - `client.language` (string) Enum: "en", "pt", "es" - `client.address` (string) No enforced character limit (text column). Example: "Avenida da República, Lisboa" - `client.city` (string) Maximum length is the database default, not an enforced business rule. Example: "Lisboa" - `client.postal_code` (string) Maximum length is the database default, not an enforced business rule. Example: "1050-555" - `client.country` (string) Maximum length is the database default, not an enforced business rule. Example: "Portugal" - `client.fiscal_id` (string) Maximum length is the database default, not an enforced business rule. Example: "508025338" - `client.website` (string) Example: "www.invoicexpress.com" - `client.phone` (string) Example: "213456789" - `client.fax` (string) Example: "213456788" - `client.preferred_contact` (object) The preferred contact details. - `client.preferred_contact.name` (string) Contact-level name has no length validation, unlike the client-level name (max 100); the limit shown is the database default. Example: "Bruce Norris" - `client.preferred_contact.email` (string) Contact-level email allows one character more than the client-level email (max 254). Example: "email@invoicexpress.com" - `client.preferred_contact.phone` (string) Contact-level phone has no length validation, unlike the client-level phone (max 20); the limit shown is the database default. Example: "213456789" - `client.observations` (string) No enforced character limit (text column). Example: "Observations" - `client.send_options` (string) Enum: "1", "2", "3" ## Response 201 fields (application/json): - `client` (object) - `client.id` (integer) Example: 196601767 - `client.name` (string) Example: "Ricardo Pereira" - `client.code` (string,null) Maximum length is the database default, not an enforced business rule. - `client.language` (string,null) Maximum length is the database default, not an enforced business rule. Example: "pt" - `client.email` (string,null) Example: "someone@example.com" - `client.address` (string,null) No enforced character limit (text column). Example: "Lisbon" - `client.city` (string,null) Maximum length is the database default, not an enforced business rule. Example: "Lisbon" - `client.postal_code` (string,null) Maximum length is the database default, not an enforced business rule. Example: "1750-455" - `client.fiscal_id` (string,null) Maximum length is the database default, not an enforced business rule. Example: "508025338" - `client.website` (string,null) Example: "www.invoicexpress.com" - `client.country` (string,null) Maximum length is the database default, not an enforced business rule. Example: "Portugal" - `client.phone` (string,null) Example: "2313423424" - `client.fax` (string,null) Example: "2313423425" - `client.preferred_contact` (object) May be an empty object when no preferred contact is set. - `client.preferred_contact.name` (string,null) Contact-level name has no length validation, unlike the client-level name (max 100); the limit shown is the database default. Example: "Ricardo Pereira" - `client.preferred_contact.email` (string,null) Contact-level email allows one character more than the client-level email (max 254). Example: "someone@example.com" - `client.preferred_contact.phone` (string,null) Contact-level phone has no length validation, unlike the client-level phone (max 20); the limit shown is the database default. Example: "2233442233" - `client.preferred_contact.mobile` (string,null) Digits only (4-14). Validated against /\A\d{4,14}\z/. - `client.observations` (string,null) No enforced character limit (text column). - `client.open_account_link` (string) Example: "https://www.app.invoicexpress.com/suppliers/1f7bba947948c50e04af20d329db5bc67c38cf89" - `client.send_options` (integer,null) Example: 1 - `client.payment_days` (integer,null) - `client.tax_exemption_code` (string,null) Maximum length is the database default, not an enforced business rule. Example: "M00" ## Response 401 fields (application/json): - `errors` (array) - `errors.error` (string) Example: "Authentication Error" ## Response 422 fields (application/json): - `errors` (array) - `errors.error` (string) Example: "Nome não pode ficar em branco"