Update
Request URL
POST /customer/update
Description
This endpoint can be used to update the following customer properties: email, addresses, phones, businessAddresses, and/or businessPhones.
The email, addresses, and phones properties are specific to individual customers, while the businessAddresses and businessPhones properties are specific to business customers. For business customers, it is also possible to update the email, addresses, and/or phones of the businessRepresentatives, if the businessRepresentative object property is included in the request body.
If the customer type is "individual", then fields other than email, addresses, and/or phones will cause an error indicating that an invalid field is present for the current customer type. Similarly, if an individual customer property (email, addresses, or phones) is present in an update request for a business customer, it will cause an invalid field error for the current customer type.
customerUpdate object
Fields allowed for Individual Customers
Optional Properties | Description | Schema | Example Values |
---|---|---|---|
Individual customer email | string, regex pattern "^(.+)@(.+)$" | "aaaaa@someemail.aa" | |
addresses | Array of address objects for individual customers, at least one required. (See address object in the customer initialization section here) | array | [{ //address object 1 }, { //address object 2 }, ...] |
phones | Array of phone objects for individual customers, at least one is required. (See phone object in the customer initialization section here) | array | [{ //phone object 1 }, { //phone object 2 }, ...] |
Fields allowed for Business Customers
Optional Properties | Description | Schema | Example Values |
---|---|---|---|
businessAddresses | An array of address objects representing a business customer's addresses (See address object in the customer initialization section here) | array | [ { //businessAddress 1 }, { //businessAddress 2 }, ... ] |
businessPhones | An array of phone objects representing a business customer's phone numbers (See phone object in the customer initialization section here) | array | [ { //businessPhone 1 }, { //businessPhone 2 }, ... ] |
Schema
Property table for customer/update
Property | Description | Required | Schema |
---|---|---|---|
customerId | Customer ID in connectFi | Yes | { "type": "string", "pattern": "^[0-9a-zA-Z_]+$", "minLength": 1, "maxLength": 36, "$id": "common-id" } |
customer | Details of the customer | Yes | customer customerUpdate object |
businessRepresentatives | Details of the authorized businessRepresentative(s) | No | array of businessRepresentatives item objects |
Property table for businessRepresentatives array item object
Property | Description | Required | Schema |
---|---|---|---|
id | id | Yes | { "type": "string", "pattern": "^[0-9a-zA-Z_]+$", "minLength": 1, "maxLength": 36, "$id": "common-id" } |
Email address | No | { "type": "string", "format": "email", "$id": "customer-email" } |
|
addresses | Array of address objects | No | array of addresses item objects |
phones | Array of phone objects | No | array of phones item objects |
Property table for customer customerUpdate object
Property | Description | Required | Schema |
---|---|---|---|
Email address | No | { "type": "string", "format": "email", "$id": "customer-email" } |
|
addresses | Array of address objects | No | array of addresses item objects |
phones | Array of phone objects | No | array of phones item objects |
businessAddresses | Array of address objects | No | array of businessAddresses item objects |
businessPhones | Array of phone objects | No | array of businessPhones item objects |
Property table for businessPhones array item object
Property | Description | Required | Schema |
---|---|---|---|
type | type | Yes | { "type": "string", "enum": [ "MOBILE", "LANDLINE", "PRIMARY" ] } |
phoneNumber | phoneNumber | Yes | { "type": "string", "pattern": "^\d+$", "minLength": 6, "maxLength": 12, "$id": "customer-phoneNumber" } |
countryDialingCode | Country dialing code prefix | No | { "type": "string", "pattern": "^\d+$", "minLength": 1, "maxLength": 4, "$id": "customer-countryDialingCode" } |
Property table for businessAddresses array item object
Property | Description | Required | Schema |
---|---|---|---|
type | type | Yes | { "type": "string", "enum": [ "PRIMARY", "SECONDARY" ] } |
addressLine1 | Line 1 of the address | Yes | { "type": "string", "pattern": "^((?![<>]).)*$", "minLength": 1, "maxLength": 50, "isNotOnlyWhitespace": true, "$id": "common-commonStr50Req" } |
addressLine2 | Line 2 of the address | No | { "type": "string", "pattern": "^((?![<>]).)*$", "minLength": 0, "maxLength": 50, "nullable": true, "$id": "common-commonStr50" } |
city | City | Yes | { "type": "string", "pattern": "^((?![<>]).)*$", "minLength": 1, "maxLength": 50, "isNotOnlyWhitespace": true, "$id": "common-commonStr50Req" } |
postalCode | Postal code | Yes | { "type": "string", "pattern": "^[0-9a-zA-Z-]+$", "minLength": 5, "maxLength": 10, "$id": "customer-postalCode" } |
stateCode | State abbreviation code | Yes | { "type": "string", "enum": [ "AL", "AK", "AS", "AZ", "AR", "CA", "CO", "CT", "DE", "DC", "FM", "FL", "GA", "GU", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MH", "MD", "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ", "NM", "NY", "NC", "ND", "MP", "OH", "OK", "OR", "PW", "PA", "PR", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "VI", "VA", "WA", "WV", "WI", "WY" ], "$id": "customer-stateCode" } |
countryCodeA3 | 3-letter country code, ISO 3166-1 alpha-3 format | Yes | { "type": "string", "pattern": "^[A-Z]{3}$", "$id": "customer-countryCodeA3" } |
Property table for phones array item object
Property | Description | Required | Schema |
---|---|---|---|
type | type | Yes | { "type": "string", "enum": [ "MOBILE", "LANDLINE", "PRIMARY" ] } |
phoneNumber | phoneNumber | Yes | { "type": "string", "pattern": "^\d+$", "minLength": 6, "maxLength": 12, "$id": "customer-phoneNumber" } |
countryDialingCode | Country dialing code prefix | No | { "type": "string", "pattern": "^\d+$", "minLength": 1, "maxLength": 4, "$id": "customer-countryDialingCode" } |
Property table for addresses array item object
Property | Description | Required | Schema |
---|---|---|---|
type | type | Yes | { "type": "string", "enum": [ "PRIMARY", "SECONDARY" ] } |
addressLine1 | Line 1 of the address | Yes | { "type": "string", "pattern": "^((?![<>]).)*$", "minLength": 1, "maxLength": 50, "isNotOnlyWhitespace": true, "$id": "common-commonStr50Req" } |
addressLine2 | Line 2 of the address | No | { "type": "string", "pattern": "^((?![<>]).)*$", "minLength": 0, "maxLength": 50, "nullable": true, "$id": "common-commonStr50" } |
city | City | Yes | { "type": "string", "pattern": "^((?![<>]).)*$", "minLength": 1, "maxLength": 50, "isNotOnlyWhitespace": true, "$id": "common-commonStr50Req" } |
postalCode | Postal code | Yes | { "type": "string", "pattern": "^[0-9a-zA-Z-]+$", "minLength": 5, "maxLength": 10, "$id": "customer-postalCode" } |
stateCode | State abbreviation code | Yes | { "type": "string", "enum": [ "AL", "AK", "AS", "AZ", "AR", "CA", "CO", "CT", "DE", "DC", "FM", "FL", "GA", "GU", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MH", "MD", "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ", "NM", "NY", "NC", "ND", "MP", "OH", "OK", "OR", "PW", "PA", "PR", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "VI", "VA", "WA", "WV", "WI", "WY" ], "$id": "customer-stateCode" } |
countryCodeA3 | 3-letter country code, ISO 3166-1 alpha-3 format | Yes | { "type": "string", "pattern": "^[A-Z]{3}$", "$id": "customer-countryCodeA3" } |
Request Body
{
"customerId": "cstap_6reGTr3k8vpAu8uFV7EdiN",
"customer": {
"email": "abc123def4@test.test",
"phones": [
{
"type": "MOBILE",
"countryDialingCode": "01",
"phoneNumber": "1234567890"
},
{
"type": "PRIMARY",
"countryDialingCode": "01",
"phoneNumber": "1234567891"
}
],
"addresses": [
{
"type": "PRIMARY",
"addressLine1": "123 Main Str.",
"addressLine2": "apt 8",
"city": "Harrisburg",
"stateCode": "PA",
"postalCode": "12345",
"countryCodeA3": "USA"
}
]
}
}
Snippet Examples
javascript
const axios = require('axios');
const data = {
"customerId": "cstap_6reGTr3k8vpAu8uFV7EdiN",
"customer": {
"email": "abc123def4@test.test",
"phones": [
{
"type": "MOBILE",
"countryDialingCode": "01",
"phoneNumber": "1234567890"
},
{
"type": "PRIMARY",
"countryDialingCode": "01",
"phoneNumber": "1234567891"
}
],
"addresses": [
{
"type": "PRIMARY",
"addressLine1": "123 Main Str.",
"addressLine2": "apt 8",
"city": "Harrisburg",
"stateCode": "PA",
"postalCode": "12345",
"countryCodeA3": "USA"
}
]
}
};
const config = {
method: 'POST',
url: '${CONNECTFI_BASE_URL}/customer/update',
headers: {
'Content-Type': "application/json",
'x-connectfi-token': "A long random string token received from /auth/get-token request"
},
data
};
let result;
try {
result = await axios.request(config);
if (result.status === 200) {
console.log(JSON.stringify(result.data));
}
} catch (err) {
console.log({
errCode: err.code,
responseStatus: err.response && err.response.status,
data: err.response && JSON.stringify(err.response.data)
});
}
cURL
curl --location "CONNECTFI_BASE_URL/customer/update" --data "{\"customerId\":\"cstap_6reGTr3k8vpAu8uFV7EdiN\",\"customer\":{\"email\":\"abc123def4@test.test\", \"phones\":[{\"type\":\"MOBILE\",\"countryDialingCode\":\"01\",\"phoneNumber\":\"1234567890\"}, {\"type\":\"PRIMARY\",\"countryDialingCode\":\"01\",\"phoneNumber\":\"1234567891\"}],\"addresses\":[{\"type\":\"PRIMARY\",\"addressLine1\":\"123 Main Str.\",\"addressLine2\":\"apt 8\",\"city\":\"Harrisburg\",\"stateCode\":\"PA\",\"postalCode\":\"12345\",\"countryCodeA3\":\"USA\"}]}}" --header "Content-Type: application/json" --header "x-connectfi-token: A long random string token received from /auth/get-token request"
Successful Response Examples
200 SUCCESSFUL RESPONSE FOR INDIVIDUAL CUSTOMER
HEADERS
Header | Value |
---|---|
Content-Type | application/json |
x-connectfi-token | A long random string token received from /auth/get-token request |
REQUEST BODY
{
"customerId": "cstap_6reGTr3k8vpAu8uFV7EdiN",
"customer": {
"email": "abc123def4@test.test",
"phones": [
{
"type": "MOBILE",
"countryDialingCode": "01",
"phoneNumber": "1234567890"
},
{
"type": "PRIMARY",
"countryDialingCode": "01",
"phoneNumber": "1234567891"
}
],
"addresses": [
{
"type": "PRIMARY",
"addressLine1": "123 Main Str.",
"addressLine2": "apt 8",
"city": "Harrisburg",
"stateCode": "PA",
"postalCode": "12345",
"countryCodeA3": "USA"
}
]
}
}
RESPONSE BODY
{
"code": "0",
"data": {
"reference": "ExtRefICust101",
"customerId": "cstap_6reGTr3k8vpAu8uFV7EdiN",
"customerType": "individual",
"customer": {
"firstName": "Janice",
"lastName": "Sample",
"gender": "M",
"dateOfBirth": "1969-08-04",
"email": "abc123def4@test.test",
"citizenshipCountryCodeA3": "USA",
"addresses": [
{
"type": "PRIMARY",
"addressLine1": "123 Main Str.",
"addressLine2": "apt 8",
"city": "Harrisburg",
"countryCodeA3": "USA",
"postalCode": "12345",
"stateCode": "PA"
}
],
"phones": [
{
"type": "MOBILE",
"phoneNumber": "1234567890",
"countryDialingCode": "01"
},
{
"type": "PRIMARY",
"phoneNumber": "1234567891",
"countryDialingCode": "01"
}
],
"identificationDocuments": [
{
"type": "SSN",
"issuanceCountryCodeA3": "USA",
"last4": "7000"
},
{
"type": "DRIVING LICENSE",
"value": "PA99999999",
"issuanceCountryCodeA3": "USA",
"issuanceRegion": "PA",
"expiryDate": "2029-12-28"
}
]
},
"boises": [],
"dtsCreatedAt": "2023-11-01T16:07:59.332Z"
},
"requestId": "d1ea112078d111eeb5658f28ab5fe311"
}
200 SUCCESSFUL RESPONSE FOR BUSINESS CUSTOMER
HEADERS
Header | Value |
---|---|
Content-Type | application/json |
x-connectfi-token | A long random string token received from /auth/get-token request |
REQUEST BODY
{
"customerId": "cstab_7BX5DO49J48VeWKsJ6gWNb",
"customer": {
"businessPhones": [
{
"type": "PRIMARY",
"countryDialingCode": "01",
"phoneNumber": "5556667777"
}
],
"businessAddresses": [
{
"type": "PRIMARY",
"addressLine1": "789 Main Str.",
"addressLine2": "Suite 10",
"city": "Harrisburg",
"stateCode": "PA",
"postalCode": "12345",
"countryCodeA3": "USA"
}
]
}
}
RESPONSE BODY
{
"code": "0",
"data": {
"reference": "ExtRefBCust100",
"customerId": "cstab_7BX5DO49J48VeWKsJ6gWNb",
"customerType": "business",
"customer": {
"businessName": "AWSM BRAND MANAGEMENT INC",
"businessFederalEin": "123456800",
"businessAddresses": [
{
"type": "PRIMARY",
"addressLine1": "789 Main Str.",
"addressLine2": "Suite 10",
"city": "Harrisburg",
"countryCodeA3": "USA",
"postalCode": "12345",
"stateCode": "PA"
}
],
"businessPhones": [
{
"type": "PRIMARY",
"phoneNumber": "5556667777",
"countryDialingCode": "01"
}
]
},
"boises": [],
"dtsCreatedAt": "2023-11-01T17:13:29.457Z",
"businessRepresentatives": [
{
"id": "cstab_7BX5DPJcbmipymiokecA6d",
"firstName": "JOLEEN",
"lastName": "KAPSCH",
"gender": "F",
"dateOfBirth": "1978-10-15T00:00:00.000Z",
"businessRepresentativeType": "principal_owner",
"email": "aa@aa.aa",
"citizenshipCountryCodeA3": "USA",
"addresses": [
{
"type": "PRIMARY",
"addressLine1": "123 Main Str.",
"addressLine2": "apt 7",
"city": "Harrisburg",
"countryCodeA3": "USA",
"postalCode": "12345",
"stateCode": "PA"
}
],
"phones": [
{
"type": "MOBILE",
"phoneNumber": "1234567890",
"countryDialingCode": "01"
}
],
"identificationDocuments": [
{
"type": "SSN",
"value": "666989698",
"issuanceCountryCodeA3": "USA"
},
{
"type": "DRIVING LICENSE",
"value": "PA1234567890123456",
"issuanceCountryCodeA3": "USA",
"issuanceRegion": "PA",
"expiryDate": "2029-12-28"
}
]
}
]
},
"requestId": "cca4302078da11eeb5658f28ab5fe311"
}