Update a representative
client.embed.representatives.update(stringrepresentativeID, RepresentativeUpdateParams { dob, email, first_name, 9 more } params, RequestOptionsoptions?): Representative { data, meta, response_type }
/v1/representatives/{representative_id}
Updates an existing representative's information. This can be used to update personal details, contact information, or the relationship to the account or organization.
Parameters
representativeID: string
Returns
Update a representative
import Straddle from '@straddlecom/straddle';
const client = new Straddle({
apiKey: 'My API Key',
});
const representative = await client.embed.representatives.update('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {
dob: '1980-01-01',
email: 'ron.swanson@pawnee.com',
first_name: 'Ron',
last_name: 'Swanson',
mobile_number: '+12128675309',
relationship: { control: true, owner: true, primary: true },
ssn_last4: '1234',
});
console.log(representative.data);
{
"data": {
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"account_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"created_at": "2019-12-27T18:11:19.117Z",
"dob": "1980-01-01",
"email": "ron.swanson@pawnee.com",
"first_name": "Ron",
"last_name": "Swanson",
"mobile_number": "+12128675309",
"name": "name",
"relationship": {
"control": true,
"owner": true,
"primary": true,
"percent_ownership": 0,
"title": "title"
},
"ssn_last4": "1234",
"status": "created",
"status_detail": {
"code": "code",
"message": "message",
"reason": "unverified",
"source": "watchtower"
},
"updated_at": "2019-12-27T18:11:19.117Z",
"external_id": "external_id",
"metadata": {
"foo": "string"
},
"phone": "phone",
"user_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
},
"meta": {
"api_request_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"api_request_timestamp": "2019-12-27T18:11:19.117Z"
},
"response_type": "object"
}Returns Examples
{
"data": {
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"account_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"created_at": "2019-12-27T18:11:19.117Z",
"dob": "1980-01-01",
"email": "ron.swanson@pawnee.com",
"first_name": "Ron",
"last_name": "Swanson",
"mobile_number": "+12128675309",
"name": "name",
"relationship": {
"control": true,
"owner": true,
"primary": true,
"percent_ownership": 0,
"title": "title"
},
"ssn_last4": "1234",
"status": "created",
"status_detail": {
"code": "code",
"message": "message",
"reason": "unverified",
"source": "watchtower"
},
"updated_at": "2019-12-27T18:11:19.117Z",
"external_id": "external_id",
"metadata": {
"foo": "string"
},
"phone": "phone",
"user_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
},
"meta": {
"api_request_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"api_request_timestamp": "2019-12-27T18:11:19.117Z"
},
"response_type": "object"
}