Update contact

Requires authentication

HTTP Request

PUT connector/api/contact/{contact}

PATCH connector/api/contact/{contact}

URL Parameters

Parameter Status Description
contact required id of the contact to be updated

Body Parameters

Parameter Type Status Description
type string optional Type of contact (supplier, customer, both)
supplier_business_name string optional 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 PUT \
"http://erp.dstadvertising.com/connector/api/contact/17" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer {token}" \
-d '{"type":"customer","supplier_business_name":"modi","prefix":"quaerat","first_name":"sint","middle_name":"exercitationem","last_name":"dolore","tax_number":"488744dwd","pay_term_number":3,"pay_term_type":"months","mobile":"8795461009","landline":"65484-848-848","alternate_number":"9898795220","address_line_1":"at","address_line_2":"quasi","city":"ut","state":"deserunt","country":"et","zip_code":"voluptatem","customer_group_id":"eligendi","contact_id":"repudiandae","dob":"2000-06-13","custom_field1":"culpa","custom_field2":"veniam","custom_field3":"nobis","custom_field4":"consequatur","email":"omnis","shipping_address":"asperiores","position":"quaerat","opening_balance":10.3}'

Example response (200):

{
"data": {
"id": 21,
"business_id": 1,
"type": "customer",
"supplier_business_name": null,
"name": "created from api",
"prefix": null,
"first_name": "created from api",
"middle_name": null,
"last_name": null,
"email": null,
"contact_id": "CO0009",
"contact_status": "active",
"tax_number": null,
"city": null,
"state": null,
"country": null,
"address_line_1": "test address",
"address_line_2": null,
"zip_code": "54878787",
"dob": "2000-06-13",
"mobile": "8754154872154",
"landline": null,
"alternate_number": null,
"pay_term_number": null,
"pay_term_type": null,
"credit_limit": null,
"created_by": 1,
"balance": "0.0000",
"total_rp": 0,
"total_rp_used": 0,
"total_rp_expired": 0,
"is_default": 0,
"shipping_address": null,
"position": null,
"customer_group_id": null,
"crm_source": null,
"crm_life_stage": null,
"custom_field1": null,
"custom_field2": null,
"custom_field3": null,
"custom_field4": null,
"deleted_at": null,
"created_at": "2020-08-10 10:41:42",
"updated_at": "2020-08-10 10:41:42",
"remember_token": null,
"password": null
}
}

javascript

const url = new URL(
"http://erp.dstadvertising.com/connector/api/contact/17"
);
let headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer {token}",
};
let body = {
"type": "customer",
"supplier_business_name": "modi",
"prefix": "quaerat",
"first_name": "sint",
"middle_name": "exercitationem",
"last_name": "dolore",
"tax_number": "488744dwd",
"pay_term_number": 3,
"pay_term_type": "months",
"mobile": "8795461009",
"landline": "65484-848-848",
"alternate_number": "9898795220",
"address_line_1": "at",
"address_line_2": "quasi",
"city": "ut",
"state": "deserunt",
"country": "et",
"zip_code": "voluptatem",
"customer_group_id": "eligendi",
"contact_id": "repudiandae",
"dob": "2000-06-13",
"custom_field1": "culpa",
"custom_field2": "veniam",
"custom_field3": "nobis",
"custom_field4": "consequatur",
"email": "omnis",
"shipping_address": "asperiores",
"position": "quaerat",
"opening_balance": 10.3
}
fetch(url, {
method: "PUT",
headers: headers,
body: body
})
.then(response => response.json())
.then(json => console.log(json));