Creates a new customer if the customerCode provided does not exist,
else updates the existing customer.
Rate limit range : Standard
Body
Required
-
Customer name.
Minimum length is
1, maximum length is10000. -
Parent customer code. Case insensitive.
Maximum length is
10000. -
Office code. Case insensitive. If the property is not filled in
- if the parent customer code is filled in, the parent customer office will be applied
- if the parent customer code is not filled in, the office of the OAuth2.0 application will be applied
Minimum length is
1, maximum length is10000. -
Customer contact details.
-
Customer address details.
-
Customer description of any.
Maximum length is
10000. -
Map of custom fields of a customer.
PUT
/eTech/rest/ws/referentials/v1/customers/code:{customerCode}
curl \
--request PUT 'https://ws-eu1.praxedo.com/eTech/rest/ws/referentials/v1/customers/code:customer-123456' \
--header "Authorization: Bearer $ACCESS_TOKEN" \
--header "Content-Type: application/json" \
--data '{
"name": "New Customer",
"addressDetails": {
"address": "28 Rue de Mogador",
"zipCode": "75009",
"city": "Paris",
"country": "FR"
},
"contact": {
"name": "Jean Du Jardin",
"details": [
{
"type": "Mobile",
"description": "Personal mobile number",
"value": "+608012601"
},
{
"type": "Email",
"description": "Work email",
"value": "john.doe@company.com"
},
{
"type": "Phone",
"description": "",
"value": "987654321"
},
{
"type": "Fax",
"description": "Office fax",
"value": "+1122334455"
}
]
},
"description": "New Customer Description",
"officeCode": "ac81fde",
"customFields": {
"textCustomFieldCode": {
"textValue": "I am a text field"
},
"checkBoxCustomFieldCode": {
"booleanValue": true
},
"dateCustomFieldCode": {
"dateValue": "2024-12-25"
},
"dateTimeCustomFieldCode": {
"dateTimeValue": "2024-12-25T12:15"
},
"timeCustomFieldCode": {
"timeValue": 44100
},
"dropDownCustomFieldCode": {
"dropDownValue": "I am a drop down text"
},
"urlCustomFieldCode": {
"urlValue": "https://www.praxedo.fr/"
},
"gpsCustomFieldCode": {
"gpsValue": {
"longitude": 48.8567,
"latitude": 2.3508
}
}
}
}'
Request examples
New customer with all fields
{
"name": "New Customer",
"addressDetails": {
"address": "28 Rue de Mogador",
"zipCode": "75009",
"city": "Paris",
"country": "FR"
},
"contact": {
"name": "Jean Du Jardin",
"details": [
{
"type": "Mobile",
"description": "Personal mobile number",
"value": "+608012601"
},
{
"type": "Email",
"description": "Work email",
"value": "john.doe@company.com"
},
{
"type": "Phone",
"description": "",
"value": "987654321"
},
{
"type": "Fax",
"description": "Office fax",
"value": "+1122334455"
}
]
},
"description": "New Customer Description",
"officeCode": "ac81fde",
"customFields": {
"textCustomFieldCode": {
"textValue": "I am a text field"
},
"checkBoxCustomFieldCode": {
"booleanValue": true
},
"dateCustomFieldCode": {
"dateValue": "2024-12-25"
},
"dateTimeCustomFieldCode": {
"dateTimeValue": "2024-12-25T12:15"
},
"timeCustomFieldCode": {
"timeValue": 44100
},
"dropDownCustomFieldCode": {
"dropDownValue": "I am a drop down text"
},
"urlCustomFieldCode": {
"urlValue": "https://www.praxedo.fr/"
},
"gpsCustomFieldCode": {
"gpsValue": {
"longitude": 48.8567,
"latitude": 2.3508
}
}
}
}
{
"name": "New Customer",
"addressDetails": {
"city": "Paris"
},
"officeCode": "ac81fde",
"customFields": {
"mandatoryTextCustomFieldCode": {
"textValue": "I am a text field"
}
}
}
{
"name": "Customer to update",
"addressDetails": {
"address": "1 Rue d'Aubervilliers",
"zipCode": "75019",
"city": "Paris",
"country": "FR"
},
"contact": {
"name": "Jean Du Jardin",
"details": [
{
"type": "Mobile",
"description": "Personal mobile number",
"value": "+7234567890"
},
{
"type": "Email",
"description": "Work email",
"value": "john.doe@company.com"
},
{
"type": "Phone",
"description": "",
"value": "987654321"
},
{
"type": "Fax",
"description": "Office fax",
"value": "+1122334455"
}
]
},
"description": "Update customer description",
"officeCode": "ac81fde",
"customFields": {
"textCustomFieldCode": {
"textValue": "I am a text field"
},
"checkBoxCustomFieldCode": {
"booleanValue": true
},
"dateCustomFieldCode": {
"dateValue": "2024-12-25"
},
"dateTimeCustomFieldCode": {
"dateTimeValue": "2024-12-25T12:15"
},
"timeCustomFieldCode": {
"timeValue": 44100
},
"dropDownCustomFieldCode": {
"dropDownValue": "I am a drop down text"
},
"urlCustomFieldCode": {
"urlValue": "https://www.praxedo.fr/"
},
"gpsCustomFieldCode": {
"gpsValue": {
"longitude": 48.8567,
"latitude": 2.3508
}
}
}
}
{
"name": "Customer name to update",
"addressDetails": {
"city": "Paris"
},
"officeCode": "ac81fde",
"customFields": {
"mandatoryTextCustomFieldCode": {
"textValue": "I am a text field"
}
}
}
{
"name": "New sub customer",
"parentCustomerCode": "a56tgj89",
"addressDetails": {
"address": "87 rue Assas",
"zipCode": "75006",
"city": "Paris",
"country": "FR"
},
"contact": {
"name": "Louis Julien",
"details": [
{
"type": "Mobile",
"description": "Personal mobile number",
"value": "+7234567890"
},
{
"type": "Email",
"description": "Work email",
"value": "louis.julien@company.com"
},
{
"type": "Phone",
"description": "",
"value": "0143263361"
},
{
"type": "Fax",
"description": "Office fax",
"value": "+1122334455"
}
]
},
"description": "New sub customer description",
"officeCode": "df89edd",
"customFields": {
"textCustomFieldCode": {
"textValue": "I am a text field"
},
"checkBoxCustomFieldCode": {
"booleanValue": true
},
"dateCustomFieldCode": {
"dateValue": "2024-12-25"
},
"dateTimeCustomFieldCode": {
"dateTimeValue": "2024-12-25T12:15"
},
"timeCustomFieldCode": {
"timeValue": 44100
},
"dropDownCustomFieldCode": {
"dropDownValue": "I am a drop down text"
},
"urlCustomFieldCode": {
"urlValue": "https://www.praxedo.fr/"
},
"gpsCustomFieldCode": {
"gpsValue": {
"longitude": 48.8567,
"latitude": 2.3508
}
}
}
}
Response examples (201)
Response examples (204)
Response examples (400)
Missing address details property
{
"errors": [
{
"code": "referentials.customer.addressdetails.mandatory",
"message": "Property addressDetails is required."
}
],
"errorReference": "88Hb11d0ae8145aa9b106b049091b371"
}
{
"errors": [
{
"code": "referentials.customer.city.mandatory",
"message": "Property city is required."
}
],
"errorReference": "d3c79ddca4f9413cad99dc934cc7d0aa"
}
{
"errors": [
{
"code": "referentials.customer.code.mandatory",
"message": "Missing code in path."
}
],
"errorReference": "669b11d0ae8145aa9b106b049091b371"
}
{
"errors": [
{
"code": "referentials.customer.name.mandatory",
"message": "Property name is required."
}
],
"errorReference": "d3c79ddca4f9413cad99dc934cc7d0aa"
}
{
"errors": [
{
"code": "referentials.customer.custom.field.mandatory",
"message": "Custom field 'custom_foo_bar' is required."
}
],
"errorReference": "d3c79ddca4f9413cad99dc934cc7d0aa"
}
{
"errors": [
{
"code": "referentials.customer.invalid.json",
"message": "Invalid Json format."
}
],
"errorReference": "d3c79ddca4f9413cad99dc934cc7d0aa"
}
{
"errors": [
{
"code": "referentials.customer.invalid.json",
"message": "Duplicate field 'name'."
}
],
"errorReference": "d3c79ddca4f9413cad99dc934cc7d0aa"
}
{
"errors": [
{
"code": "referentials.customer.field.unknown",
"message": "The field 'foo_bar' is unknown. Please correct your JSON request."
}
],
"errorReference": "d3c79ddca4f9413cad99dc934cc7d0aa"
}
{
"errors": [
{
"code": "referentials.customer.office.unknown",
"message": "The organizational unit 'DUMMY' is unknown."
}
],
"errorReference": "669b11d0ae8145aa9b106b049091b371"
}
{
"errors": [
{
"code": "referentials.customer.parent.unknown",
"message": "The parent customer 'DUMMY' is unknown."
}
],
"errorReference": "669b11d0ae8145aa9b106b049091b371"
}
{
"errors": [
{
"code": "referentials.customer.parent.identical",
"message": "The customer cannot be its own parent."
}
],
"errorReference": "669b11d0ae8145aa9b106b049091b371"
}
{
"errors": [
{
"code": "referentials.customer.office.hierarchy.error",
"message": "The customer parent is also a child of the customer."
}
],
"errorReference": "669b11d0ae8145aa9b106b049091b371"
}
{
"errors": [
{
"code": "referentials.customer.office.hierarchy.error",
"message": "Hierarchy contains 10 or more levels."
}
],
"errorReference": "669b11d0ae8145aa9b106b049091b371"
}
Response examples (401)
401 unauthorized
{
"errors": [
{
"code": "unauthorized.nocredentials",
"message": "No credentials."
}
],
"errorReference": "f939c6b8c15045c9a70f500fdb570555"
}
{
"errors": [
{
"code": "unauthorized.badcredentials",
"message": "Bad Credentials."
}
],
"errorReference": "f1028f99811b422eb21f5ff176664069"
}
Response examples (403)
{
"errors": [
{
"code": "access.forbiden",
"message": "You don't have the rights to access this resource."
}
],
"errorReference": "a745dc4c5a2b473aaf8ce94c9260aa8f"
}
Response examples (429)
{
"errors": [
{
"code": "ratelimiter.toomanyrequest",
"message": "Rejected because of the rate limit definition."
}
],
"errorReference": "973326230a3f44daba6cc34a5939b4fb"
}
Response examples (500)
{
"errors": [
{
"code": "internal.server.error",
"message": "Something went wrong."
}
],
"errorReference": "6377010431314bf6b0b95ec4d32ddae0"
}