Customer Service (Tenant Managed) Tutorial
How to manage a customer's profile
1
Get an employee access token
API Referencecurl -L
--request POST
--url 'https://api.emporix.io/oauth/token'
--header 'Content-Type: application/x-www-form-urlencoded'
--data 'grant_type=client_credentials&client_id={CLIENT_ID}&client_secret={CLIENT_SECRET}&scope=customer.customer_manage customer.customer_manage_own'2
Create a customer account
API Referencecurl -X POST "https://api.emporix.io/customer/{tenant}/customers?sendPasswordResetNotifications=true"
-H "Authorization: Bearer YOUR_OAUTH2_TOKEN"
-H "Content-Type: application/json"
-d '{
"contactEmail": "[email protected]",
"title": "MR",
"firstName": "John",
"lastName": "Doe",
"contactPhone": "123456789",
"company": "Emporix",
"preferredLanguage": "en_US",
"preferredCurrency": "EUR",
"preferredSite": "main",
"b2b": {
"companyRegistrationId": "123-456-789"
}
}'{
"id": "47718865"
}3
Update the customer account
curl -X PUT "https://api.emporix.io/customer/mytenant/customers/{customerNumber}"
-H "Authorization: Bearer YOUR_OAUTH2_TOKEN"
-H "Content-Type: application/json"
-d '{
"contactEmail": "[email protected]",
"firstName": "John",
"lastName": "Doe",
"preferredLanguage": "de_DE"
}'4
Add addresses to the profile
curl -X POST "https://api.emporix.io/customer/{tenant}/customers/{customerNumber}/addresses"
-H "Authorization: Bearer YOUR_OAUTH2_TOKEN"
-H "Content-Type: application/json"
-d '{
"contactName": "John Doe",
"companyName": "Emporix",
"street": "Platz der Republik",
"streetNumber": "1",
"zipCode": "11011",
"city": "Berlin",
"country": "DE",
"state": "Berlin",
"contactPhone": "123456789",
"tags": ["BILLING", "SHIPPING"],
"isDefault": true
}'{
"id": "e6eae2c789"
}5
6
7
Retrieve the customer's profile
curl -X GET "https://api.emporix.io/customer/{tenant}/customers/{customerNimber}?expand=addresses,accounts"
-H "Authorization: Bearer YOUR_OAUTH2_TOKEN"{
"title": "MR",
"firstName": "John",
"lastName": "Doe",
"contactPhone": "123456789",
"company": "Emporix",
"preferredLanguage": "de_DE",
"preferredCurrency": "EUR",
"preferredSite": "main",
"metadata": {
"version": 6
},
"customerNumber": "13869000",
"id": "13869000",
"contactEmail": "[email protected]",
"active": true,
"onHold": false,
"businessModel": "B2B",
"b2b": {
"companyRegistrationId": "123-456-789",
"legalEntities": [
{
"id": "D165356",
"name": "Emporix",
"contactAssignmentId": "D436432"
}
]
},
"addresses": [
{
"id": "e6eae2c789",
"contactName": "John Doe",
"street": "Platz der Republik",
"streetNumber": "1",
"zipCode": "11011",
"city": "Berlin",
"country": "DE",
"state": "Berlin",
"contactPhone": "123456789",
"tags": ["BILLING", "SHIPPING", "PRIMARY_CONTACT"],
"isDefault": true
}
]
}Last updated
Was this helpful?

