New user registration without activation in CloudSuite
Use case
When a new user (e-commerce ->users) registers to become a customer, all user information is stored in the CloudSuite database and the user is marked as “inactive user”. The customer (party) and address are NOT created with this method, only the data is saved with the user data.
If the request has been reviewed and approved, the user needs to be activated and linked to a newly created OR and existing customer (party).
The key for the created user is:
Data | Key |
---|---|
user | generated UUID ( e.g. b3ea7d82-d1e1-420c-bd41-cabc1d9d20c9 ) by CloudSuite |
There is no trigger or outgoing API call that pushes customer/address/user data to an external system like ERP. It always must be fetched from CloudSuite.
How to retrieve users and related user profile data (company/address)
To GET the customer data for a user, use the following two API calls and parameters:
GET /api/origin/{origin_code}/user/?create_date__gte={date from last_update}&inactive=true
GET /api/origin/{origin_code}/user/?registration=new&inactive=true
This API vs; returns ALL user data (CloudSuite registered and ERP registered).
The integration partner should check if the user data is already present in the ERP and add or update new or changed information.
Other criteria for fetching user data can also be used. This depends on the functionality needed.
The next step is to GET the so-called user-profile data, meaning all data entered during registration besides name and email.
{
"count": 1,
"next": null,
"previous": null,
"results": [
{
...
"user_profiles": [
1
],
...
}
]
}
You need the user-profile id from the previous call to fetch the correct data.
GET /api/userprofile/{id}
{
"id": 2109,
"user": 15038,
"name": "Cloudsuite",
"attention": "",
"street1": "Elzenkade",
"house_number": "1",
"addition": "a",
"street2": "",
"zip": "3992AD",
"city": "Houten",
"country": "NL",
"subdivision": null,
"company_telephone_number": "",
"delivery": true,
"delivery_name": "",
"delivery_attention": "",
"delivery_street1": "",
"delivery_house_number": "",
"delivery_addition": "",
"delivery_street2": "",
"delivery_zip": "",
"delivery_city": "",
"delivery_country": "NL",
"delivery_subdivision": null,
"delivery_telephone_number": "",
"department": "",
"vat": "NL822898044B01",
"coc": "",
"web": "",
"account_code": "",
"industry": null,
"create_date": "2023-01-18T09:23:02.507764",
"modified_date": null
}
With the provided information:
You can create a customer (e.g. in your ERP system) and send it to CloudSuite (POST/PUT)
Activate the new user and link it to the created customer.
2) Customer/Address create - update from ERP
You can create a new customer and link the user and address.
Link user to customer
PATCH /API/origin/SOMEORIGIN/user/key
{
"authorised_customers": ["customerkey"]
}
Set the trigger for sending the activation emails
PATCH /API/origin/SOMEORIGIN/user/key
{
"registration": "new",
"active" : false
}
These two calls can also be used in one call.
This action can also be performed manually by using the E-commerce → Activate Users functionality in the CloudSuite client.
Related content
© 2024 CloudSuite BV, All rights reserved