Authentication

To authenticate when making API requests to the Rappi API, you require an Access Token.

The Rappi API uses a Bearer authentication scheme, as the HTTP authentication method for API requests.

To make API requests, send the token in a customer header to interact with protected resources.

Rappi uses the following scheme for the Bearer authentication:

KeyValue
x-authorizationBearer: <access_token>

The following table describes the different contents of the Authentication resource:

ResourceDescriptionObservations
POST v1/token/login/integrationsUse this endpoint to generate an access token for integrations services_New_
POST v1/token/login/utilsUse this endpoint to generate an access token for utils services_new_

POST integrations login

Use this endpoint to generate an access token. This token allows you to authenticate when making API requests for integrations.

Endpoint URL

Use the following URLs to make a request with this endpoint:

URL: https://{NEW_DOMAIN}/restaurants/auth/v1/token/login/integrations

Endpoint Properties

This resource has the following properties:

request bodyjson
response bodyjson

Parameters

This endpoint does not permit additional parameters.

Sample Request

This is an example of an API request using this endpoint:

POST https://api.dev.rappi.com/restaurants/auth/v1/token/login/integrations

This is an example of the request:

{ "client_id": "7iCfjZCO4bTns3OjqLK4de2GV3sp6Ymd", "client_secret": "40iFFYJV9A1LrVmJsaIeARW40iFFYJV9A1LrVmJsaIeARW40iFFYJV9A1LrVmJsaIeARW" }

This table describes the attributes that the JSON of your request requires:

AttributesRequestedDescription
client_idstringtrueClient Id of your Rappi Credentials.
client_secretstringtrueClient Secret of your Rappi Credentials.

URL url = new URL("https://api.dev.rappi.com/restaurants/auth/v1/token/login/integrations"); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setRequestMethod("POST"); connection.setRequestProperty("User-Agent", "Mozilla/5.0"); connection.setRequestProperty("Content-Type", "application/json"); connection.setRequestProperty("Accept", "application/json"); connection.setDoOutput(true); final String jsonInputString = "{\n" + " \"client_id\":\"7iCfjZCO4bTns3OjqLK4de2GV3sp6Ymd\",\n" + " \"client_secret\":\"40iFFYJV9A1LrVmJsaIeARW40iFFYJV9A1LrVmJsaIeARW40iFFYJV9A1LrVmJsaIeARW\"\n" + "}"; try (OutputStream os = connection.getOutputStream()) { byte[] input = jsonInputString.getBytes(StandardCharsets.UTF_8); os.write(input, 0, input.length); } try (BufferedReader br = new BufferedReader(new InputStreamReader(connection.getInputStream(), StandardCharsets.UTF_8))) { StringBuilder response = new StringBuilder(); String responseLine; while ((responseLine = br.readLine()) != null) { response.append(responseLine.trim()); } System.out.println("Response body: " + response.toString()); } System.out.println("Response Code : " + connection.getResponseCode());



Status Codes

These are the possible status codes of the response for this endpoint:

Sample Response

This is an example of the response:

{ "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpeyJhbGciOiJIUzI1NiIsInR5cCI6IkpeyJhbGciOiJIUzI1NiIsInR5cCI6Ikp", "token_type": "Bearer", "expires_in": 86400 }

This table describes the objects contained in the response example:

Response ObjectObject Description
access_tokenstringAccess token to access secure endpoints.
token_typestringToken type.
expires_inintegerToken expiration time in seconds.

POST utils login

Use this endpoint to generate an access token. This token allows you to authenticate when making API requests for utils.

Endpoint URL

Use the following URLs to make a request with this endpoint:

URL: https://{NEW_DOMAIN}/restaurants/auth/v1/token/login/utils

Endpoint Properties

This resource has the following properties:

request bodyjson
response bodyjson

Parameters

This endpoint does not permit additional parameters.

Sample Request

This is an example of an API request using this endpoint:

POST https://api.dev.rappi.com/restaurants/auth/v1/token/login/utils

This is an example of the request:

{ "client_id": "7iCfjZCO4bTns3OjqLK4de2GV3sp6Ymd", "client_secret": "40iFFYJV9A1LrVmJsaIeARW40iFFYJV9A1LrVmJsaIeARW40iFFYJV9A1LrVmJsaIeARW" }

This table describes the attributes that the JSON of your request requires:

AttributesRequirementDescription
client_idstringrequiredClient Id of your Rappi Credentials.
client_secretstringrequiredClient Secret of your Rappi Credentials.

URL url = new URL("https://api.dev.rappi.com/restaurants/auth/v1/token/login/utils"); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setRequestMethod("POST"); connection.setRequestProperty("User-Agent", "Mozilla/5.0"); connection.setRequestProperty("Content-Type", "application/json"); connection.setRequestProperty("Accept", "application/json"); connection.setDoOutput(true); final String jsonInputString = "{\n" + " \"client_id\":\"7iCfjZCO4bTns3OjqLK4de2GV3sp6Ymd\",\n" + " \"client_secret\":\"40iFFYJV9A1LrVmJsaIeARW40iFFYJV9A1LrVmJsaIeARW40iFFYJV9A1LrVmJsaIeARW\"\n" + "}"; try (OutputStream os = connection.getOutputStream()) { byte[] input = jsonInputString.getBytes(StandardCharsets.UTF_8); os.write(input, 0, input.length); } try (BufferedReader br = new BufferedReader(new InputStreamReader(connection.getInputStream(), StandardCharsets.UTF_8))) { StringBuilder response = new StringBuilder(); String responseLine; while ((responseLine = br.readLine()) != null) { response.append(responseLine.trim()); } System.out.println("Response body: " + response.toString()); } System.out.println("Response Code : " + connection.getResponseCode());



Status Codes

These are the possible status codes of the response for this endpoint:

Sample Response

This is an example of the response:

{ "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpeyJhbGciOiJIUzI1NiIsInR5cCI6IkpeyJhbGciOiJIUzI1NiIsInR5cCI6Ikp", "token_type": "Bearer", "expires_in": 604798 }

This table describes the objects contained in the response example:

Response ObjectObject Description
access_tokenstringAccess token to access secure endpoints.
token_typestringToken type.
expires_inintegerToken expiration time in seconds.