Create contact

Requires authentication

HTTP Request

POST connector/api/contact

Body Parameters

Parameter Type Status Description
type string required Type of contact (supplier, customer, both)
supplier_business_name string required Required if type is supplier
prefix string optional Prefix for the name of the contact
first_name string required Name of the contact
middle_name string optional
last_name string optional
tax_number string optional
pay_term_number float optional
pay_term_type string optional (months ,days)
mobile string required
landline string optional
alternate_number string optional
address_line_1 string optional
address_line_2 string optional
city string optional
state string optional
country string optional
zip_code string optional
customer_group_id string optional
contact_id string optional
dob string optional Fromat: Y-m-d
custom_field1 string optional
custom_field2 string optional
custom_field3 string optional
custom_field4 string optional
email string optional
shipping_address string optional
position string optional
opening_balance float optional

Example request:

curl -X POST \
"http://erp.dstadvertising.com/connector/api/contact" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}" \
-d '{"type":"customer","supplier_business_name":"et","prefix":"aut","first_name":"cum","middle_name":"aperiam","last_name":"voluptates","tax_number":"8787fefef","pay_term_number":3,"pay_term_type":"months","mobile":"4578691009","landline":"5487-8454-4145","alternate_number":"841847541222","address_line_1":"quam","address_line_2":"ea","city":"voluptas","state":"qui","country":"id","zip_code":"omnis","customer_group_id":"quis","contact_id":"ut","dob":"2000-06-13","custom_field1":"possimus","custom_field2":"voluptatem","custom_field3":"dolores","custom_field4":"soluta","email":"et","shipping_address":"quia","position":"consequatur","opening_balance":0}'

Example response (200):

{
"data": {
"type": "customer",
"name": "test customer",
"tax_number": "75879BHF",
"mobile": "7878825008",
"business_id": 1,
"created_by": 9,
"credit_limit": null,
"contact_id": "CO0007",
"updated_at": "2020-06-04 21:59:21",
"created_at": "2020-06-04 21:59:21",
"id": 17
}
}

javascript

const url = new URL(
"http://erp.dstadvertising.com/connector/api/contact"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {token}",
};
let body = {
"type": "customer",
"supplier_business_name": "et",
"prefix": "aut",
"first_name": "cum",
"middle_name": "aperiam",
"last_name": "voluptates",
"tax_number": "8787fefef",
"pay_term_number": 3,
"pay_term_type": "months",
"mobile": "4578691009",
"landline": "5487-8454-4145",
"alternate_number": "841847541222",
"address_line_1": "quam",
"address_line_2": "ea",
"city": "voluptas",
"state": "qui",
"country": "id",
"zip_code": "omnis",
"customer_group_id": "quis",
"contact_id": "ut",
"dob": "2000-06-13",
"custom_field1": "possimus",
"custom_field2": "voluptatem",
"custom_field3": "dolores",
"custom_field4": "soluta",
"email": "et",
"shipping_address": "quia",
"position": "consequatur",
"opening_balance": 0
}
fetch(url, {
method: "POST",
headers: headers,
body: body
})
.then(response => response.json())
.then(json => console.log(json));