Daftra API
DocsAll EndpointsDaftra Partners
DocsAll EndpointsDaftra Partners
  1. Clients
  • Welcome
  • Getting Started
  • Authorization
  • authorization
    • Authenticate
      POST
  • Invoices
    • GET Single Invoice
      GET
    • Edit Invoices
      PUT
    • Delete Invoices
      DELETE
    • GET All Invoices
      GET
    • Add New Invoice
      POST
  • Estimates
    • GET Single Estimate
      GET
    • Edit Estimates
      PUT
    • Delete Estimates
      DELETE
    • GET All Estimates
      GET
    • Add New Estimate
      POST
  • Credit Notes
    • GET Single Credit Note
      GET
    • Edit Credit Notes
      PUT
    • Delete Credit Notes
      DELETE
    • GET All Credit Notes
      GET
    • Add New Credit Note
      POST
  • Refund Receipts
    • GET Single Refund Receipt
      GET
    • Edit Refund Receipts
      PUT
    • Delete Refund Receipts
      DELETE
    • GET All Refund Receipts
      GET
    • Add New Refund Receipt
      POST
  • Clients
    • GET Single Client
      GET
    • Edit Clients
      PUT
    • Delete Clients
      DELETE
    • GET All Clients
      GET
    • Add New Client
      POST
  • Suppliers
    • GET Single Supplier
    • Edit Suppliers
    • Delete Suppliers
    • GET All Suppliers
    • Add New Supplier
  • Work Orders
    • GET Single Work Order
    • Edit Work Orders
    • Delete Work Orders
    • GET All Work Orders
    • Add New Work Order
  • Client Appointments
    • GET Single Client Appointment
    • Edit Client Appointments
    • Delete Client Appointments
    • GET All Client Appointments
    • Add New Client Appointment
  • Invoice Appointments
    • GET Single Invoice Appointment
    • Edit Invoice Appointments
    • Delete Invoice Appointments
    • GET All Invoice Appointments
    • Add New Invoice Appointment
  • Estimate Appointments
    • GET Single Estimate Appointment
    • Edit Estimate Appointments
    • Delete Estimate Appointments
    • GET All Estimate Appointments
    • Add New Estimate Appointment
  • Work Order Appointments
    • GET Single Work Order Appointment
    • Edit Work Order Appointments
    • Delete Work Order Appointments
    • GET All Work Order Appointments
    • Add New Work Order Appointment
  • Notes
    • GET Single Note
    • Edit Notes
    • Delete Notes
    • GET All Notes
    • Add New Note
  • Time Tracking
    • GET Single Time Tracking
    • Edit Time Tracking
    • Delete Time Tracking
    • GET All Time Tracking
    • Add New Time Tracking
  • Invoice Payments
    • GET Single Invoice Payment
    • Edit Invoice Payments
    • Delete Invoice Payments
    • GET All Invoice Payments
    • Add New Invoice Payment
  • Client Payments
    • GET Single Client Payment
    • Edit Client Payments
    • Delete Client Payments
    • GET All Client Payments
    • Add New Client Payment
  • Products
    • GET Single Product
    • Edit Products
    • Delete Products
    • GET All Products
    • Add New Product
  • Journals
    • GET Single Journal
    • Edit Journals
    • Delete Journals
    • GET All Journals
    • Add New Journal
  • Journal Accounts
    • GET Single Journal Account
    • Edit Journal Accounts
    • Delete Journal Accounts
    • GET All Journal Accounts
    • Add New Journal Account
  • Journal Cats
    • GET Single Journal Cat
    • Edit Journal Cats
    • Delete Journal Cats
    • GET All Journal Cats
    • Add New Journal Cat
  • Expenses
    • GET Single Expens
    • Edit Expenses
    • Delete Expenses
    • GET All Expenses
    • Add New Expens
  • Incomes
    • GET Single Income
    • Edit Incomes
    • Delete Incomes
    • GET All Incomes
    • Add New Income
  • Taxes
    • GET Single Taxe
    • Edit Taxes
    • Delete Taxes
    • GET All Taxes
    • Add New Taxe
  • Purchase Invoices
    • GET Single Purchase Invoice
    • Edit Purchase Invoices
    • Delete Purchase Invoices
    • GET All Purchase Invoices
    • Add New Purchase Invoice
  • Purchase Refunds
    • GET Single Purchase Refund
    • Edit Purchase Refunds
    • Delete Purchase Refunds
    • GET All Purchase Refunds
    • Add New Purchase Refund
  • Stock Transactions
    • GET Single Stock Transaction
    • Edit Stock Transactions
    • Delete Stock Transactions
    • GET All Stock Transactions
    • Add New Stock Transaction
  • Stores
    • GET Single Store
    • Edit Stores
    • Delete Stores
    • GET All Stores
    • Add New Store
  • Product Categories
    • GET Single Product Category
    • GET All Product Categories
  • Staff
    • GET Single Staff
    • GET All Staff
  • Client-attendance-log
    • Add New Client-attendance-log
  • Follow Up Actions
    • GET Single Follow Up Action
    • Delete Follow Up Action
    • GET All Follow Up Actions
  • Follow Up Statuses
    • GET Single Follow Up Status
    • Delete Follow Up Status
    • GET All Follow Up Statuses
  • General Listing
    • GET General Listing
  • Site
    • GET Site Info
  • Treasuries
    • GET Single Treasury
    • Edit Treasuries
    • Delete Treasuries
    • GET All Treasuries
    • Add New Treasury
  1. Clients

Add New Client

Production
https://{{subdomain}}.daftra.com/api2
Production
https://{{subdomain}}.daftra.com/api2
POST
https://{{subdomain}}.daftra.com/api2
/clients{format}
Clients
Request Request Example
Shell
JavaScript
Java
Swift
curl --location -g --request POST 'https://.daftra.com/api2/clients' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer ' \
--header 'apikey: ' \
--header 'Content-Type: application/json' \
--data-raw '{
    "Client": {
        "is_offline": true,
        "client_number": "0000715",
        "staff_id": 0,
        "business_name": "John Smith",
        "first_name": "",
        "last_name": "",
        "email": "user@example.com",
        "password": "string",
        "address1": "string",
        "address2": "string",
        "city": "string",
        "state": "string",
        "postal_code": "string",
        "phone1": "string",
        "phone2": "string",
        "country_code": "str",
        "notes": "string",
        "active_secondary_address": true,
        "secondary_name": "string",
        "secondary_address1": "string",
        "secondary_address2": "string",
        "secondary_city": "string",
        "secondary_state": "string",
        "secondary_postal_code": "string",
        "secondary_country_code": "string",
        "default_currency_code": "strin",
        "follow_up_status": null,
        "category": "string",
        "group_price_id": 0,
        "timezone": 0,
        "bn1": "string",
        "bn1_label": "string",
        "bn2_label": "string",
        "bn2": "string",
        "starting_balance": null,
        "type": null,
        "birth_date": "2018-05-10",
        "gender": null,
        "map_location": null,
        "credit_limit": 0,
        "credit_period": 0
    }
}'
Response Response Example
202 - Example 1
{
  "code": 202,
  "result": "successful",
  "id": "2415"
}

Request

Path Params
format
string 
required
Header Params
Accept
string 
optional
Default:
application/json
Content-Type
string 
optional
Default:
application/json
Authorization
string 
optional
You can generate the bearer token using the the authorization endpoint then use it here to be able to operate over your account's data
Default:
Bearer {{access_token}}
apikey
string 
deprecated
You can find/generate your apikey(s) from inside your Daftra Account
Default:
{{apikey}}
Body Params application/json
Client
object 
ClientBase
optional
is_offline
boolean 
optional
0 / 1 indicates if the Client is offline
client_number
string 
optional
Visual identifier for the Client
Example:
0000715
staff_id
integer <int64>
optional
Staff ID who created the invoice get it from GET STAFF API if it's 0 that means the site owner is the staff that created it
Default:
0
Example:
0
business_name
string 
required
Client's business name
<= 100 characters
Example:
John Smith
first_name
string 
required
Client's first name
<= 255 characters
Example:
last_name
string 
required
Client's last name
<= 255 characters
Example:
email
string <email>
required
Client's email
<= 255 characters
password
string 
write-onlyrequired
Client's password
<= 255 characters
address1
string 
optional
Client's Address line 1
<= 255 characters
address2
string 
optional
Client's Address line 2
<= 255 characters
city
string 
optional
Client's City
<= 100 characters
state
string 
optional
Client's State
<= 100 characters
postal_code
string 
optional
Client's postal code
<= 20 characters
phone1
string 
optional
Client's phone number
<= 50 characters
phone2
string 
optional
Client's mobile number
<= 50 characters
country_code
string 
optional
Client's country ISO "ALPHA-2 Code
<= 3 characters
notes
string 
optional
Notes for the Client
active_secondary_address
boolean 
optional
0/1 if the secondary data is active.
secondary_name
string 
optional
Client's name
<= 255 characters
secondary_address1
string 
optional
Client's address line 1
<= 255 characters
secondary_address2
string 
optional
Client's address line 2
<= 255 characters
secondary_city
string 
optional
Client's City
<= 100 characters
secondary_state
string 
optional
Client's State
<= 100 characters
secondary_postal_code
string 
optional
Client's postal code
<= 50 characters
secondary_country_code
string 
optional
Client's country ISO "ALPHA-2 Code
<= 10 characters
default_currency_code
string 
optional
3 Digit currency code following ISO 4217 standard
<= 5 characters
follow_up_status
integer  | null 
optional
Follow Up Status get it from GET Follow up statuses with model client
Default:
null
category
string 
optional
label for the client
group_price_id
integer <int32>
optional
Group price Ref get it from GET General Listing API with model GroupPrice
timezone
integer <int32>
optional
Timezone id get it from GET General Listing API with model Timezone
bn1
string 
optional
value for the bn1
bn1_label
string 
optional
label for the bn1 depends on the country like Tax ID number OR Business number
bn2_label
string 
optional
label for the bn2 depends on the country like Tax ID number OR Business number
bn2
string 
optional
value for the bn2
starting_balance
null 
optional
starting balance of the client
Default:
null
type
enum<integer>  | enum<null> 
required
client type
Allowed values:
2 => 'Individual'3 => 'Business'
Default:
null
Example:
2
birth_date
string <date>
optional
client's birth date
Example:
2018-05-10
gender
enum<integer>  | enum<null> 
optional
client gender
Allowed values:
null => 'Not selected'0 => 'Not selected'1 => 'Male'2 => 'Female'
Default:
null
Example:
2
map_location
string  | null 
optional
client's map location (latitude,longitude,zoom)
Default:
null
Example:
31.287550225000018,30.075630726558106,5
credit_limit
string 
optional
client's credit limit
Default:
0
credit_period
string 
optional
client's credit period in days
Default:
0
Examples

Responses

🟢202Accepted
application/json
Created
Body
code
integer 
optional
Example:
202
result
string 
optional
Example:
successful
id
integer 
optional
Example:
2415
🟠400Bad Request
🟠401Unauthorized
🟠403Forbidden
🟠404Record Not Found
Previous
GET All Clients
Next
GET Single Supplier