Skip to main content
OCLC Wise Support EN

Patron management

Learn about the endpoints used for patron management with the Wise Rest-API.

Cardnumber validation

GET /patron/cardnumber/{cardno}/library/{libraryid}

This endpoint only validates the membership (subscription) of a given patron library card. For security reasons, this endpoint does not return a patronSystemId.

Cardnumber lookup

GET /library/{libraryid}/patron?offset=0&limit=10&search={cardno}

To search for a patron by card number, this endpoint will return a patronSystemId. To use this endpoint, the API user needs to have permissions for patron administration. The endpoint returns a patronSystemId that can be used in other requests to get patron information.

Patron information

GET /patron/{patronid}/library/{libraryid}/patroninformation

This endpoint returns the basic patron information such as name, address, and membership information. The patron must be logged in to get this information.

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 role XTRN in Wise. The application can retrieve and update this information at a later time. When the customer also has a library 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 Edit on the organization (instance) level.

Storing external customers

Before storing a customer, the application must check whether the customer already exists.

POST /patron/external/library/{libraryid}

Registering patrons

Wise supports the registration of patrons via an endpoint. The following endpoints are available to complete the subscription process:

  • /subscription/{subscriptionType}/instance/{instanceId}/field
  • /library/{libraryId}/subscription?branchId=branchId&patronSystemId=patronSystemId &dateOfBirth=yyyy-mm-dd&gender=gender&zipCode=zipcode
  • /patron/authentication/library/{instanceId}
  • /patron/authentication/
  • /library/{libraryId}/patron
  • /library/{libraryId}/patron/{patronSystemId}
  • /payment/{paymentId}/status/{paymentStatus}

The registration process needs to follow the following steps:

  1. Get the possible subscriptions (memberships) for the new patron. The offered subscriptions can be age-dependent, and the fees can differ from library to library.
  2. If the patron is already known, see if a login with the patron’s credentials leads to a success or failure. The outcome determines whether the subscription needs to be done with a POST or a PUT with a given patron system id.
  3. Depending on the system option VWIZBET, the subscription is activated with a status ‘invoiced’ or added to the shopping basket that needs to be paid before activating the new subscription. If the subscription product is in the shopping basket, the basket can be paid via the /payment-endpoint.

Get required fields

This is an optional endpoint that can be called to get information about which fields are mandatory in the subscription process. This can be used to inform the new patron about the fields that need to be provided before the membership registration can be completed.

Type: GET

Request: subscription/R/instance/{libraryId}/field

Parameters:

  • LibraryId: this is the id (instantie_id) from the library the patron wants to (re)subscribe to

Response:

  • Id: ID that identifies the field, like "PML" stands for "Email address"
  • Type: C(haracter), N(umeric), D(ate)
  • Label: field name, and how it can be presented for the patron
  • Required: Boolean, is this field required to provide
  • Desired: Boolean, not required but nice to store
  • Visible: Boolean, should this field be presented to the patron
  • Description: not applicable, always empty
  • Format: how should the patron enter the data
  • Group: an indicator that can group fields together
  • GroupLabel: a description of the group. Can be used to bind fields in a group together on the screen.
  • Order: in what order should fields be presented on the screen

Example:

[

{'id': 'PML', 'validationErrors': [], 'type': 'C', 'label': 'Emailaddress', 'required': True, 'desired': False, 'visible': True, 'description': '', 'format': 'email', 'group': 'A', 'groupLabel': 'APP-FORMS__LABEL-AUTHENTICATION', 'order': '12-1'},

{'id': 'PGN', 'validationErrors': [], 'type': 'C', 'label': 'Username', 'required': True, 'desired': False, 'visible': True, 'description': '', 'format': '', 'group': 'A', 'groupLabel': 'APP-FORMS__LABEL-AUTHENTICATION', 'order': '13-1'},

]

 The following fields are checked by the subscription endpoint and need to be provided:

  • STREET
  • CITY
  • LAST_NAME
  • DATE_OF_BIRTH
  • HOUSE_NUMBER
  • HOME_BRANCH
  • USERNAME
  • PASSWORD
  • ZIPCODE
  • GENDER
  • EMAIL_ADDRESS

Get possible subscriptions

To get the possible subscriptions (memberships) for the new or re-subscribing patron, Wise offers the subscription endpoint. The endpoint responds only with subscriptions that are available via web registration.

Type: GET

Request: /library/{libraryId}/subscription?branchId=branchId&patronSystemId=patronSystemId &dateOfBirth=yyyy-mm-dd&gender=gender&zipCode=zipcode

Parameters:

  • LibraryId: this is the id (instantie_id) from the library the patron wants to (re)subscribe to
  • BranchId: this is the actual branch of the library the patron wants to (re)subscribe to. Because every branch can have its own fees for subscriptions, this branch-id is important to provide
  • Date of birth: In Wise, subscriptions can be configured for specific age-groups. Only the subscriptions applicable for the (new) patron are offered.
  • Gender: FEMALE or MALE. Only natural patrons can subscribe via the rest-endpoint. Organizations cannot subscribe.
  • Zipcode: within the branch-id some zipcodes can offer subscriptions for a reduced or increased price

Response:

{

"subscriptionId": 0,

"subscriptionDescription": "string",

"cost": "string",

"renewalType": "string",

"subscriptionCost": 0,

"subscriptionType": "string",

"subscriptionLength": 0,

"internetFee": 0,

"additionalInformation": "string",

"requiresCAPTCHA": true

}

  • SubscriptionId: the id of the subscription that should be used when the subscription endpoint is called
  • SubscriptionDescription: a general description like ‘Youth 10-15’ or ‘Standard 18-99’ etc.
  • Cost: the cost of the subscription in text, for example: "$ 21.00 /12 months”
  • renewalType: not applicable for Rest-API subscription
  • SubscriptionCost: the cost of the subscription in cents, like “2100”
  • SubscriptionType: more information about the subscription-group, like “18-99”
  • SubscriptionLength: number of months for this subscription (12 = a year subscription)
  • InternetFee: minimal amount to be paid when subscribing via the internet
  • AdditonalInformation: can contain more information about the subscription
  • RequiresCAPTCHA: if a captcha is required, this can be set to ‘true’ in the Customer type table

Example:

[{"subscriptionId":45,"subscriptionDescription":"Standaardsubscription","cost":"€ 43.50 /12 mnd","renewalType":"0","subscriptionCost":4350,"subscriptionType":"18-64","subscriptionLength":12,"internetFee":0,"additionalInformation":"Subscription: Default subscription. incl. Ebooks","requiresCAPTCHA":false},

{"subscriptionId":200,"subscriptionDescription":"Digital Standard (Ebooks)","cost":"€ 42.00 /12 mnd","renewalType":"0","subscriptionCost":4200,"subscriptionType":"18-99","subscriptionLength":12,"internetFee":0,"additionalInformation":"Abonnement: Digital Standard (Ebooks)","requiresCAPTCHA":false}]

Authenticate patron

There are two endpoints that can be used to authenticate a patron:

  • /patron/authentication/library/{instanceId}
  • /patron/authentication/

The first endpoint will check whether the patron has an active subscription in the given library-id.

Type: POST

Request: patron/authentication/library/{libraryId}

Data:

"username": username,
"password": password

Username can be the patron’s username or a barcode

The same call can be done without a specific library:

Request: patron/authentication/

Response:

  • LibraryId: the id of the library where the patron is logged in
  • PatronSystemId: a unique id for this patron. This patronSystemId is needed to resubscribe the patron
  • MembershipexpiryDate: the date the current active subscription ends. YYYY-MM-DD
  • Token: this token is needed to resubscribe the patron and should be used in the header of the resubscribe endpoint
  • Username: contains the username or barcode

Sample:

{"id":"","validationErrors":[],"libraryId":"I018","patronSystemId":"1328ebb152edc752328b79d37b553bea","membershipExpiryDate":"2022-05-31","token":"<token>","username":" 2X545052607120"}

Subscribe patron

There are two endpoints for subscribing a patron. The first one is used for new patrons and the second one for subscribing patrons in a new library or re-subscribing patrons in libraries where they previously had a membership.

The outcome of the login endpoint determines which one should be used.

If the ‘authenticate’ patron does not return a patronSystemId then the first one (/library/{libraryId}/patron) should be used, otherwise the second one should be used (/library/{libraryId}/patron/{patronSystemId}).

Re-subscription of patrons can only be done if the patron has no active subscription in the given library, or when the subscription is ending at the end of the current month.


Method 1: new patrons

Type: POST

Request: /library/{libraryId}/patron

Parameters

  • LibraryId: this is the id (instantie_id) from the library the patron wants to subscribe

Data:

{

"initials": "",

"firstName": "",

"lastName": "",

"dateOfBirth": "",

"addresses": [

{

"street": "",

"houseNumber": "",

"addition": "",

"zipCode": "",

"city": "",

"region": "",

"country": "",

"type": "H",

"typeLabel": "",

"method": ""

}

],

"phoneNumber": "",

"emailAddress": "",

"homeBranch": “”,

"identificationNumber": {

"identificationType": "EID",

"identificationNumber": ""

},

"preferredLanguage": "",

"patronSystemId":””,

"password": "",

"username": "”

"gender": "",

"smsNumber": "",

"futureSubscriptionId": “”,

"acceptedTermsAndAgreement": "true"

}

The bold lines are mandatory, and if they are not supplied this will lead to an error.

The field “homeBranch” is the branch in which the patron wants a new subscription. If this branch is not one of the libraries from the library-id in the parameter a 500-error will be thrown.

Response:

  • PatronId: contains the new generated actor_id.
  • PatronSystemId: contains the new generated unique id for this patron.
  • SubscriptionStatus: the current subscription status for this new patron.
  • PaymentId: a unique identifier that can be used to pay the subscription via Ideal/Rest if the status is not ‘INVOICE’.

Sample:

{"id":"","validationErrors":[],"patronId":1516143,"patronSystemId":"9d6d1e8ae0a47b43988971ffa4834126","initials":"T.","firstName":"Test","lastName":"Testuser","prefix":"","suffix":"","dateOfBirth":"1980-01-01","addresses":[{"id":"","links":[{"rel":"self","href":"/restapi/country/nl/address"}],"validationErrors":[],"street":"Machlaan","houseNumber":"5","addition":"","zipCode":"9765 TK","city":"Eelde","region":"","country":"Nederland","type":"H","typeLabel":"Hoofdadres"}],"phoneNumber":"0612345678","emailAddress":"test@testdomain.org","membershipExpirationDate":"2022-05-31","homeBranch":"9042","language":"nl_NL","updatedPassword":false,"username":"test.tester123","gender":"MALE","libraryCards":[{"id":"","validationErrors":[],"cardNumber":"2X748933357884","type":"H","mainCard":true}],"showResetPinEditLink":false,"selfPayAllowed":false,"smsNumber":"0612345678","subscriptionId":45,"subscriptionStatus":"INVOICE","preferredName":"","paymentId":"cd4f288bbb23897050884b6171d2f326","displayName":"Tester, T,","title":"","membershipDescription":"Default subscription","middleName":"","customerTag":"","registrationDate":"2021-05-12T00:00:00","homeBranchName":"Raalte","showLoanHistory":"B"}


Method 2: re-subscribe patrons

Type: PUT

Request: /library/{libraryId}/patron/{patronSystemId}

Parameters

  • LibraryId: this is the id (instantie_id) from the library the patron wants to subscribe
  • PatronSystemId: this is the id that was obtained by the ‘authorization’ request (patron/authentication/library/{libraryId})

Data:

{

"initials": "",

"firstName": "",

"lastName": "",

"dateOfBirth": "",

"addresses": [

{

"street": "",

"houseNumber": "",

"addition": "",

"zipCode": "",

"city": "",

"region": "",

"country": "",

"type": "H",

"typeLabel": "",

"method": ""

}

],

"phoneNumber": "",

"emailAddress": "",

"homeBranch": “”,

"identificationNumber": {

"identificationType": "EID",

"identificationNumber": ""

},

"preferredLanguage": "",

"patronSystemId":””,

"password": "",

"username": "”

"gender": "",

"smsNumber": "",

"subscriptionId": “”,

"acceptedTermsAndAgreement": "true"

}

The bold lines are mandatory and will lead to an error if not supplied.

 Note:  patronSystemId is also mandatory.

One of the requirements to subscribe a patron is that in the subscriptions table in Wise for every library, a definition for customer-type ‘N’ (anonymous) is available. Without this definition, a subscription cannot be completed.

Pay subscription fees

If the option VWIZBET is not set in Wise, a subscription will not be activated and will remain in the shopping basket until the payment is completed. The payment ID from the subscription endpoint should be used to complete the subscription.

Type: POST

Request: /payment/{paymentId}/status/{paymentStatus}

Parameters:

  • PaymentId: the ID that came in the response from the subscription endpoint
  • PaymentStatus: SUCCESS. For other statuses, see the Swagger documentation.

Response:

A default message code 200 is given if the payment is handled successfully.

Before a client can call this endpoint, the client first needs to authorize itself with a special account (username and password) provided by the library organization. It is required that the IP address of the client is added to the safe list.

The token in the response is needed to complete the payment and should be used in the header of the payment endpoint.

Retrieve blocks for a specific patron

With this endpoint, the current blocks for a patron can be retrieved.

Type: GET

Request:     /patronmanagement/patron/{patronSystemId}/library/{libraryId}/property/blocking

Parameters

  • PatronSystemId: this is the id that was obtained by the ‘authorization’ request (patron/authentication/library/{libraryId})
  • LibraryId: this is the id (instantie_id) from the library where the block is active.

Response:

{

 "id":"",

 "validationErrors":[],

 "addressBlock":false,

 "generalBlock":false,

 "onlineBlock":false,

 "customerAtTerminalBlock":false,

 "webPortalSelfServiceBlock":false,

 "collectionAgencyBlock":false,

 "patronCardBlock":false,

 "blockMessage":"",

 "blockDetails":""

}

Set or remove one or more blocks for a patron

With this endpoint it is made possible to set or remove a few blocks on a specific patron.

Type: PUT

Request:     /patronmanagement/patron/{patronSystemId}/library/{libraryId}/property/blocking

  • PatronSystemId: this is the ID that was obtained by the ‘authorization’ request (patron/authentication/library/{libraryId})
  • LibraryId: this is the id (instantie_id) from the library where the block should be activated or deactivated

Data:

{

 "id":"",

 "validationErrors":[],

 "addressBlock":false,

 "generalBlock":false,

 "onlineBlock":false,

 "customerAtTerminalBlock":false,

 "webPortalSelfServiceBlock":false,

 "collectionAgencyBlock":false,

 "patronCardBlock":false,

 "blockMessage":"",

 "blockDetails":""

}

Set the required type of block on ‘true’ to activate the block. Set it to "false" to deactivate it.

In the response, the current situation is returned.

Response:

{

 "id":"",

 "validationErrors":[],

 "addressBlock":false,

 "generalBlock":false,

 "onlineBlock":false,

 "customerAtTerminalBlock":false,

 "webPortalSelfServiceBlock":false,

 "collectionAgencyBlock":false,

 "patronCardBlock":false,

 "blockMessage":"",

 "blockDetails":""

}

Before this call can be done, the client needs to be logged in. The client needs at least Read permissions on the ‘actor’, on the library level.

Getting a list of updated patrons

For synchronizing patrons with other systems you need a list of patrons which are recently updated. Using the endpoint

Request : GET /patronmanagement/patron/library/{libraryid}/updatedpatron?date=yyyy-mm-dd

Response: 

{
"patronSystemIDs" : [
        "45jherg678934434 krhf9w876r....",
        "59wef8fewj45yulk9yul6yl6946..."
    ]
}

The response of this endpoint contains a list of uuids of the patrons. Now it is possible to get patron information from every patron to update the information stored in the other system

Getting a list of deleted patrons

For synchronizing patrons with other systems you need a list of patrons which are recently updated. Using the endpoint

Request : GET /patronmanagement/patron/library/{libraryid}/deletedpatron?date=yyyy-mm-dd

Response: 

{
"patronSystemIDs" : [
        "45jherg678934434 krhf9w876r....",
        "59wef8fewj45yulk9yul6yl6946..."
    ]
}

The response of this endpoint contains a list of uuids of the patrons. Now it is possible to delete the patron information in the other system based on this uuid.

Get a list of active subscriptions by searching email or EID

For checking whether a patron already has an active subscription when filling out an online subscription form. 

Type: POST

Request: /patronmanagement/duplicate

Parameters:

  • searchValue: "email address" or "EID number"
  • searchType: "EMAIL" or "EID"

Response:

    {

        "patronSystemId": "6fc35db94ef7565ebbea34643575f729",

        "subscriptionData": [

            {

                "libraryId": "I304",

                "subscriptionEndDate": "2024-10-30",

                "status": "5"

      }

The response of this endpoint contains a list of active subscriptions for this patron based on their email address or EID.

 

  • Was this article helpful?