Skip to main content

Store New Customer

Create the Azotte-side projection of a customer using identity data sourced from your system. Returns the canonical AzotteCustomer record (including CustomerUrn).

Endpoint

POST/api/c2a/customer/store

Request Parameters

Body: StoreCustomerRequest.

customerCustomerDto
required

Customer payload.

claimedRegionClaimedRegion
required

Country / language context claimed by the caller. Scopes storefront, currency, tax.

CustomerDto

externalIdentifierstring
required

Tenant-side identifier. Must be unique per tenant.

emailstring

Customer email.

phoneNumberstring

E.164 phone number.

salutationstring

Salutation prefix.

firstNamestring

Given name.

lastNamestring

Family name.

genderEnGender

Gender code.

Values:FemaleMaleOtherUnspecified
legalTypeEnPersonLegalType

Legal classification of the customer.

Values:IndividualCorporate
primaryBillingAddressPostalAddress

Billing address.

corporationInfoCorporationInfo

Conditional. Required when legalType = Corporate.

privacyAzotteCustomerPrivacySettings

Communication consents.

statusstring

Caller-asserted status.

ClaimedRegion

countryCodestring
required

ISO 3166-1 alpha-2 country code.

languageCodestring
required

ISO 639-1 language code.

Request Example

{
"customer": {
"externalIdentifier": "crm-9981273",
"email": "jane.doe@example.com",
"phoneNumber": "+49 170 1234567",
"salutation": "Ms.",
"firstName": "Jane",
"lastName": "Doe",
"gender": "Female",
"legalType": "Individual",
"primaryBillingAddress": {
"street": "Hauptstr. 1",
"city": "Berlin",
"postalCode": "10115",
"countryCode": "DE"
}
},
"claimedRegion": {
"countryCode": "DE",
"languageCode": "de"
}
}

Response Parameters

StoreCustomerResponse.

resultAzotteCustomer

Canonical customer record.

result.customerUrnstring

Azotte-assigned URN. Use this in every downstream call.

result.externalIdentifierstring

Echo of supplied ExternalId.

result.emailstring

Echoed email.

result.statusstring

Operational status (Active, etc.).

statusAzotteStatus

Operation status envelope.

status.messageCodestring

SUCCESS on hit.

Sample Response

{
"result": {
"customerUrn": "cu.00.482",
"externalIdentifier": "crm-9981273",
"email": "jane.doe@example.com",
"status": "Active"
},
"status": { "messageCode": "SUCCESS" }
}

Bad Request (HTTP 400)

messageCodeTrigger
BAD_REQUESTrequest.Customer is null.
INVALID_REQUESTFluentValidation rule failed on payload.

Conflict (HTTP 409)

Duplicate identity collision.

messageCodeTrigger
USER_WITH_SAME_PHONE_NUMBER_EXISTSPhone number already attached to another customer.
USER_WITH_SAME_EMAIL_EXISTSEmail already attached to another customer.
CUSTOMER_ALREADY_STOREDexternalIdentifier already projected (call /info or /update instead).

Server Error (HTTP 500)

messageCodeTrigger
SQL_DATABASE_FAILUREInsert returned null (DB layer rejected the row).
INTERNAL_SERVER_ERRORUnhandled exception caught by the controller.

Behaviour

  • ExternalId uniqueness is enforced per tenant. Colliding ExternalId returns CUSTOMER_ALREADY_STORED (409).
  • Email and phone uniqueness enforced per tenant — return USER_WITH_SAME_EMAIL_EXISTS / USER_WITH_SAME_PHONE_NUMBER_EXISTS (409).
  • Validation of mandatory tenant-side fields runs via TenantCustomerInfoStorageValidatorINVALID_REQUEST (400).
  • Privacy / consent flags are stored verbatim; you remain responsible for the legal basis.

Sample Codes

curl --location 'https://acme.sandbox.azotte.com/api/v1/c2a/customer/store' \
--header 'Content-Type: application/json' \
--header 'x-tn: e2a1c7b2-4f3a-4b8e-9c2d-1a2b3c4d5e6f' \
--header 'x-api-key: sk_dev_acme_sample_123456789' \
--data '{
"customer": {
"externalIdentifier": "crm-9981273",
"email": "jane.doe@example.com",
"firstName": "Jane",
"lastName": "Doe",
"legalType": "Individual"
},
"claimedRegion": { "countryCode": "DE", "languageCode": "de" }
}'