Update Customer Contact Information
Overview
This guide shows you how to implement the Update Contact endpoint to update contact details.
Use case
- Cloudify customer receives an email following up on the purchase of the subscription. The email contains the option: Click here to update your contact details.
- The customer clicks the link and is redirected to the Manage my Details page on your website.
- The customer enters information for the billing contact and clicks Submit.
- The page uses the Update Contact endpoint to update the customer's billing information in the Cleverbridge platform.
Implement the Update Contact endpoint
Before you start
Make sure that:
- The subscription has the status
Active.
Parameters
Parameter | Type | Required | Example | Notes |
|---|---|---|---|---|
ContactType | str | Yes | BillingContact | Update billing contact. Possible values:
|
Contact | obj | Yes | "PostalCode": | The object containing the customer's details such as the email address, postal address, name and title. |
SubscriptionId | str | Yes | S67661151 | The unique identifier of the subscription. |
Request
curl --location 'https://rest.cleverbridge.com/subscription//subscription/updatecontact'
--header 'Content-Type: application/json'
--header 'Accept: application/json'
--header 'Authorization: Basic YOUR_BASE64_ENCODED_CREDENTIALS'
--data-raw '{
"ContactType": "BillingContact",
"Contact": {
"CountryId": "DE",
"LanguageId": "en",
"City": "Berlin",
"EMail": "[email protected]",
"Firstname": "Anna",
"Lastname": "Test",
"PostalCode": "50667",
"Street1": "Goethestr",
"Title": "Miss"
},
"SubscriptionId": "S67661151"
}'import http.client
import json
conn = http.client.HTTPSConnection("rest.cleverbridge.com")
payload = json.dumps({
"ContactType": "BillingContact",
"Contact": {
"CountryId": "DE",
"LanguageId": "en",
"City": "Berlin",
"EMail": "[email protected]",
"Firstname": "Anna",
"Lastname": "Test",
"PostalCode": "50667",
"Street1": "Goethestr",
"Title": "Miss"
},
"SubscriptionId": "S67661151"
})
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Basic YOUR_BASE64_ENCODED_CREDENTIALS'
}
conn.request("POST", "/subscription/updatecontact", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))var https = require('follow-redirects').https;
var fs = require('fs');
var options = {
'method': 'POST',
'hostname': 'rest.cleverbridge.com',
'path': '/subscription/updatecontact',
'headers': {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Basic YOUR_BASE64_ENCODED_CREDENTIALS'
},
'maxRedirects': 20
};
var req = https.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function (chunk) {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
res.on("error", function (error) {
console.error(error);
});
});
var postData = JSON.stringify({
"ContactType": "BillingContact",
"Contact": {
"CountryId": "DE",
"LanguageId": "en",
"City": "Berlin",
"EMail": "[email protected]",
"Firstname": "Anna",
"Lastname": "Test",
"PostalCode": "50667",
"Street1": "Goethestr",
"Title": "Miss"
},
"SubscriptionId": "S67661151"
});
req.write(postData);
req.end();Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.post("https://rest.cleverbridge.com/subscription/updatecontact?ContactType=1&Contact%0A=%0A&ContactType=1")
.header("Content-Type", "application/json")
.header("Accept", "application/json")
.header("Authorization", "Basic YOUR_BASE64_ENCODED_CREDENTIALS")
.body("{\n \"ContactType\": \"BillingContact\",\n \"Contact\": {\n \"CountryId\": \"DE\",\n \"LanguageId\": \"en\",\n \"City\": \"Berlin\",\n \"EMail\": \"[email protected]\",\n \"Firstname\": \"Anna\",\n \"Lastname\": \"Test\",\n \"PostalCode\": \"50667\",\n \"Street1\": \"Goethestr\",\n \"Title\": \"Miss\"\n },\n \"SubscriptionId\": \"S67661151\"\n}")
.asString();JSON Body
{
"ContactType": "BillingContact",
"Contact": {
"CountryId": "DE",
"LanguageId": "en",
"City": "Berlin",
"EMail": "[email protected]",
"Firstname": "Anna",
"Lastname": "Test",
"PostalCode": "50667",
"Street1": "Goethestr",
"Title": "Miss"
},
"SubscriptionId": "S67661151"
}Response
{
"ResultMessage": "OK"
}Diagram
flowchart LR
classDef mainColor fill:#ffffff,color:#555555,stroke:#96C34B,stroke-width:2px;
A([" <br/><b>Email sent to client</b><br/>The email contains the link <i>Update your contact details</i> <br/> "]):::mainColor
--> B([" <br/><b>Link</b><br/>The customer is redirected to <i>Manage my Details </i> <br/> "]):::mainColor
--> C([" <br/><b>Update page</b><br/><i>Update Contact</i> endpoint used <br/> "]):::mainColor
For more information, see the Update Customer Contact Information use case in the Integration guide.