Store and retrieve external customers
External customers (CRM)
Wise can act as database for customers from external applications. For example, a ticketing application can register customer information in Wise. The customer is stored with the role XTRN in Wise. The application can retrieve and update this information at a later time. When the customer also has a library membership (subscription), then the existing patron will be used and the XTRN role will be added to their record.
The API user must have the permission: ACTOREN update on the organization (instance) level.
Every external system must supply an application name for storing customers in Wise. An email address and customer number are mandatory for every customer. A customer number is a unique number for that customer in the external system.
Customers stored in Wise that do not have a library membership can be found in the Wise staff application (Wise Client) and are "promoted" to a library member by subscribing to a membership.
Retrieve an external customer
GET /patron/external/library/{libraryId}
payload : {'emailAddress': <EMAIL>, 'applicationName': <APPNAME> 'externalNo': <EXTERNALNO>}
Response
status 200: Customer exists. The patronSystemId is returned and can be used in endpoints to get patron/customer information.
status 404: Customer not found.
Store an external customer
Before storing a customer, the application must check whether the customer already exists by calling the endpoint mentioned above.
POST /patron/external/library/{libraryid}
body = {"email": <EMAIL>, "applicationName": <APPNAME>, "externalNo": <EXTERNALNO>,
"firstName": <firstName>, "middleName": <middleName>, "lastName": <lastName>}
After successfully saving the customer, a patronSystemId is returned. This can be used in other endpoints for saving more customer information like address, phone number, and even financial records.