Customer

This page includes all the endpoints for the Customer endpoints.

[ Base URL: customers:8080/ ]

https://apicb.test.aazzur.com/docs/services/customers

customers-controller

The createCustomer request creates the customer for the application. The whole process of creating a customer is already mentioned on the Authentication Workflow page.

The getBundles request sends the active bundles to the registered customer. For the request to work, you must send the oauth token as the Bearer token as the authentication process.

The getCurrentCustomer request sends the customer information that is associated with the token that is sent with the request. A sample successful response is added after the request.

{
    "id": "123123123",
    "email": "sample@mail.com",
    "phoneNumber": "+123123123",
    "firstName": "John",
    "lastName": "Doe",
    "dateOfBirth": "1900-01-01",
    "language": "en-US",
    "address": {
        "addressLine1": "100",
        "city": "CITY",
        "country": "US",
        "postalCode": "1234"
    },
    "shippingAddress": {
        "addressLine1": "100",
        "city": "CITY",
        "country": "US",
        "postalCode": "1234"
    },
    "nationality": "US",
    "numberOfTokens": 500,
    "applicationState": "ACCEPTED",
    "unsatisfiedRequirements": [],
    "title": "Mr",
    "gender": "MALE",
    "consents": {
        "privacyPolicy": true,
        "termsAndConditions": true
    },
    "programme": "AAZZUR",
    "bundles": [
        "123-123-123"
    ]
}

The updateCustomer request is used to update any data of the customer that is associated with the token. For example, if you want to change the address or maybe the title of the customer or add extra information such as the shipping address, you will have to use this request to update the existing customer's information.

The getUserBundles request sends the Feature Configuration and Limit Configuration data. The Feature Configuration Object has the data for the features like if the Split Bill feature is enabled or not. On the other hand, the Limit Configuration object has the data for the physical card limit number, virtual card limit number, etc.

To verify the user email, the requestEmailVerification request comes in. The request does not require the email address but the oauth token only. After a successful request, the user will get an email to confirm the email.

If you want to change the user's password then you will have to use the changePassword request. The request requires a body with the new and the old password.

Users require PIN to do some tasks like transfering money or check card details, etc. Using the changePin request, you can change the User PIN, keeping in mind that the password is required to change the PIN for the user.

device-controller

image-controller

You will have to use the addImage POST request to upload images on the server. The request will need the image in the body of the request. After a successful POST request, the response will contain the image id by which you can make a GET request getImage to get the image. A sample response for this request is added below the POST request.

{
    "uri": "v1/images/123123123a-123-123123-123123-123123123"
}

When you want to get an image that you have uploaded to the server already, just use the image id from the previous request's response. From the previous POST request's response, the id should be the one after the images/ for example 123123123a-123-123123-123123-123123123

onboarding-controller

password-recovery-controller

The initiate request starts the flow of password recovery. After you have sent a request with the email in the body, you will get a response object that has the status object "OK". If the entered email is not found within the system, the status will be "NOT_FOUND".

If the status is "OK", you will get an email containing information to reset your account password.

After initiating the password recovery flow, you will have to check if the user can reset the password. To get the questions or the reset status, use the getChallenges request. A sample response body is shown for understanding.

You will have to click on the reset password button link on the same device that you are logged in to.

{
    "questions": [
        {
            "id": "SAMPLE ID 1",
            "securityQuestion": "BIRTH_DATE"
        },
        {
            "id": "SAMPLE ID 2",
            "securityQuestion": "ADDRESS_CITY"
        }
    ],
    "resetAllowed": false
}

The above sample response has two questions and these two separate questions have different ids. To solve challenges, you will have to use the below request with the password recovery id and the challengeid. For example the request body to solve the first question should be like this:

{
    "solution": "1900-01-01"
}

If the solution is correct then you will get a 200 response status with an "OK" value.

If you send another request to the getChallenges, you will see that the first question is not there anymore because it is solved. After solving two of the challenges, the request questions array will be empty, and the value of resetAllowed will be true. A sample response is added after the request for your convenience.

{
    "questions": [],
    "resetAllowed": true
}

After knowing that you are allowed to reset the password from the previous request, go ahead and request for the password reset using the below request. You will have to put the id for the password request in the path and in the body, put the new password in the password JSON.

Last updated