Creates a new customer or updates an existing one based on email address.
POST/api/customer/createorupdate
This endpoint provides upsert functionality using email as the unique identifier.
- If a customer with the provided email exists, it will be updated and returned.
- If no customer exists with that email, a new customer will be created after validating uniqueness of email and document type+number.
Validation rules:
- Email is required and used as the primary lookup key
- If Id or GlobalId are provided (non-zero/non-empty), the request will be rejected with 400 - use UpdateCustomer endpoint instead
- For new customers: validates that email and document type+number combination don't already exist
- For updates: if document type or number changed, validates the new combination isn't used by another customer (requires permissions)
Request
Responses
- 200
- 400
- 403
Customer created or updated successfully
Invalid customer data or ID/GlobalID provided or Api Error
Unauthenticated user