Authenticate customer

Here, you can learn how to make an API call to authenticate a customer. Once you execute the call successfully, you will receive a JSON web token that permits you to make authorised API calls to other Tuum API endpoints.

Sample API call

To authenticate a customer, make the following API call.

https://auth-api.sandbox.tuumplatform.com/api/v1/authorise

Learn more about the authenticate customer endpoint in the Tuum developer portal.

Sample request

Below is an example request body of the API call for authentication of a customer.

{
"username": "customer_username",
"password": "customer_password"
}

If your customer doesn't have login details, you can create them following the instructions provided in the Create customer credentials example.

Sample response

Below you find an example response body to the API call above.

Response
{
    "errors": null,
    "validationErrors": null,
    "data": {
        "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJuYW1lIjoiYWF0b21payIsInBlcnNvbklkIjoiSUQtMTAzOCIsInRlbmFudENvZGUiOiJNQiIsImV4cGlyeURUaW1lIjoiMjAyMy0wNy0yOFQxMjoyMDoyMSIsImV4cCI6MTY5MDU0NjgyMX0.wpNOfTan73vnqQNZo5cI99B2NWuVZ6wurW9JiO7z0x0"
    }
}

Result

An customer is authenticated, and a JSON Web Token is returned in the response.

In order to make authorised API calls, the JSON Web Token that was received must be used as a parameter value for the x-auth-token header parameter.

Last updated

Was this helpful?