### Make a GET Request to Rappi API (Java) Source: https://dev-portal.rappi.com/en/api-reference/rests-api This Java code snippet demonstrates how to make a GET request to the Rappi API to retrieve store payment information. It requires the `x-authorization` header with a Bearer token. The output includes the response body and the HTTP response code. ```Java URL url = new URL("https://api.dev.rappi.com/restaurants/finance/v1/stores/1234/payments"); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setRequestMethod("GET"); connection.setRequestProperty("User-Agent", "Mozilla/5.0"); connection.setRequestProperty("Content-Type", "application/json"); connection.setRequestProperty("Accept", "application/json"); connection.setRequestProperty("x-authorization", "Bearer YOUR_TOKEN"); 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()); ``` -------------------------------- ### GET Orders Request in Java Source: https://dev-portal.rappi.com/en/api-reference/orders Example of making a GET request to retrieve new orders using Java. This code demonstrates setting up the URL, HttpURLConnection, request headers, and processing the response. It requires a valid token for authentication. ```java URL url = new URL("https://microservices.dev.rappi.com/api/v2/restaurants-integrations-public-api/orders"); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setRequestMethod("GET"); connection.setRequestProperty("User-Agent", "Mozilla/5.0"); connection.setRequestProperty("Content-Type", "application/json"); connection.setRequestProperty("Accept", "application/json"); connection.setRequestProperty("x-authorization", "Bearer YOUR_TOKEN"); 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()); ``` -------------------------------- ### Sample GET Request for Store Agreements (Java) Source: https://dev-portal.rappi.com/en/api-reference/financial Provides a Java code example for making a GET request to the Rappi API to fetch store agreement details. This snippet utilizes HttpURLConnection for network communication and requires an authorization token. It demonstrates setting request headers and processing the response. ```Java URL url = new URL("https://api.dev.rappi.com/restaurants/finance/v1/stores/1234/agreements"); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setRequestMethod("GET"); connection.setRequestProperty("User-Agent", "Mozilla/5.0"); connection.setRequestProperty("Content-Type", "application/json"); connection.setRequestProperty("Accept", "application/json"); connection.setRequestProperty("x-authorization", "Bearer YOUR_TOKEN"); 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()); ``` -------------------------------- ### GET /restaurants/finance/v1/stores/{storeId}/payments Source: https://dev-portal.rappi.com/en/api-reference/rests-api Retrieves a list of payments for a specific store. This endpoint requires an authenticated user with appropriate permissions. ```APIDOC ## GET /restaurants/finance/v1/stores/{storeId}/payments ### Description Retrieves a list of payments for a specific store. This endpoint requires an authenticated user with appropriate permissions. ### Method GET ### Endpoint `/restaurants/finance/v1/stores/{storeId}/payments` ### Parameters #### Path Parameters - **storeId** (string) - Required - The ID of the store for which to retrieve payments. #### Query Parameters - **page_number** (integer) - Optional - The page number for pagination. - **page_size** (integer) - Optional - The number of entries per page. - **order_by** (string) - Optional - The field to order the results by. - **order_type** (string) - Optional - The type of order (e.g., ASC, DESC). ### Request Example ```java URL url = new URL("https://api.dev.rappi.com/restaurants/finance/v1/stores/1234/payments"); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setRequestMethod("GET"); connection.setRequestProperty("User-Agent", "Mozilla/5.0"); connection.setRequestProperty("Content-Type", "application/json"); connection.setRequestProperty("Accept", "application/json"); connection.setRequestProperty("x-authorization", "Bearer YOUR_TOKEN"); 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()); ``` ### Response #### Success Response (200) - **page_number** (integer) - The current page number. - **page_size** (integer) - The number of entries per page. - **order_by** (string) - The field by which the results are ordered. - **order_type** (string) - The type of order. - **total_pages** (integer) - The total number of pages. - **total_entries** (integer) - The total number of entries. - **entries** (array) - A list of payment entries. - **id** (integer) - The unique identifier for the payment. - **status** (string) - The status of the payment. - **period_date_start** (string) - The start date of the payment period. - **period_date_end** (string) - The end date of the payment period. - **expected_execution_date** (string) - The expected execution date of the payment. - **confirmed_payment_date** (string) - The confirmed payment date. - **total_amount** (integer) - The total amount of the payment. - **payment_reference** (string) - The reference number for the payment. - **frequecy_type** (string) - The frequency type of the payment. - **frequecy_type_descripcion** (string) - Description of the frequency type. - **balance_request_id** (string) - The ID for the balance request. - **bank_account** (object) - Details of the bank account associated with the payment. - **bank_name** (string) - The name of the bank. - **account_number** (string) - The bank account number. - **bank_code** (string) - The bank code. - **account_type** (string) - The type of bank account. - **ispb** (string) - The ISPB code. - **document** (object) - Document details of the account holder. - **identification_type** (string) - The type of identification. - **identification_number** (string) - The identification number. - **holder_name** (string) - The name of the account holder. - **consolidated_stores** (array) - A list of consolidated store IDs. #### Response Example ```json { "page_number": 1, "page_size": 10, "order_by": "string", "order_type": "string", "total_pages": 0, "total_entries": 0, "entries": [ { "id": 1000, "status": "string", "period_date_start": "2023-11-07T22:02:47.009Z", "period_date_end": "2023-11-07T22:02:47.009Z", "expected_execution_date": "2023-11-07T22:02:47.009Z", "confirmed_payment_date": "2023-11-07T22:02:47.009Z", "total_amount": 0, "payment_reference": "string", "frequecy_type": "string", "frequecy_type_descripcion": "string", "balance_request_id": "string", "bank_account": { "bank_name": "string", "account_number": "string", "bank_code": "string", "account_type": "string", "ispb": "string", "document": { "identification_type": "string", "identification_number": "string", "holder_name": "string" } }, "consolidated_stores": [1000] } ] } ``` ``` -------------------------------- ### Sample API Request for Loans (Java) Source: https://dev-portal.rappi.com/en/api-reference/financial Illustrates how to perform a GET request to retrieve loan installments by store and payment period using Java. The code sets up the HttpURLConnection, includes necessary headers like authorization, and processes the response. ```Java URL url = new URL("https://api.dev.rappi.com/restaurants/finance/v1/stores/1234/loans"); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setRequestMethod("GET"); connection.setRequestProperty("User-Agent", "Mozilla/5.0"); connection.setRequestProperty("Content-Type", "application/json"); connection.setRequestProperty("Accept", "application/json"); connection.setRequestProperty("x-authorization", "Bearer YOUR_TOKEN"); 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()); ``` -------------------------------- ### GET Debts Request Example (Java) Source: https://dev-portal.rappi.com/en/api-reference/financial This Java code snippet demonstrates how to make a GET request to the Rappi API to retrieve outstanding debts for a store. It includes setting up the URL, HTTP connection, request headers (including authorization token), and reading the response. ```Java URL url = new URL("https://api.dev.rappi.com/restaurants/finance/v1/stores/1234/debts"); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setRequestMethod("GET"); connection.setRequestProperty("User-Agent", "Mozilla/5.0"); connection.setRequestProperty("Content-Type", "application/json"); connection.setRequestProperty("Accept", "application/json"); connection.setRequestProperty("x-authorization", "Bearer YOUR_TOKEN"); 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()); ``` -------------------------------- ### Schedule Store Time Slot (Java) Source: https://dev-portal.rappi.com/en/api-reference/utils Example of how to schedule a special time slot for a store using the Rappi API. This code demonstrates making a POST request with a JSON payload containing start and end times. It includes setting request headers and handling the response. ```java import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.OutputStream; import java.net.HttpURLConnection; import java.net.URL; import java.nio.charset.StandardCharsets; // ... other imports try { URL url = new URL("https://microservices.dev.rappi.com/api/rest-ops-utils/store/schedule/{storeId}/special/{specialDayId}"); 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.setRequestProperty("x-authorization", "Bearer YOUR_TOKEN"); connection.setDoOutput(true); String jsonInputString = "[" + " {\"starts_time\": \"08:00:00\"," + " \"ends_time\": \"20:00:00\"" + " }" + "]"; 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()); } catch (Exception e) { e.printStackTrace(); } ``` -------------------------------- ### GET Menu Integration Request - Java Source: https://dev-portal.rappi.com/en/api-reference/utils Example of an API request to retrieve menu integration details using Java's HttpURLConnection. It configures the request method, headers, and handles the response. This code requires standard Java libraries for network operations. ```java URL url = new URL("https://microservices.dev.rappi.com/api/rest-ops-utils/menu/integration/910001"); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setRequestMethod("GET"); connection.setRequestProperty("User-Agent", "Mozilla/5.0"); connection.setRequestProperty("Content-Type", "application/json"); connection.setRequestProperty("Accept", "application/json"); connection.setRequestProperty("x-authorization", "Bearer YOUR_TOKEN"); 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()); ``` -------------------------------- ### Get Product Schedules by Corridor - JSON Response Example Source: https://dev-portal.rappi.com/en/utils Example JSON response for the 'Get Product Schedules by Corridor' API endpoint. This structure includes the product ID, corridor ID, store ID, and a list of schedule details, specifying days, start time, and end time for availability. ```json { "product_id": 789, "corridor_id": 123, "store_id": 999, "schedule_details": [ { "id": 4, "days": "mon,tue,wed,thu,fri,sat,sun,hol", "starts_time": "08:00:00", "ends_time": "23:00:00" } ] } ``` -------------------------------- ### Sample API Request - Java/Node.js Source: https://dev-portal.rappi.com/en/api-reference/orders This snippet demonstrates how to make a GET request to the Rappi API to fetch order statuses. It includes setting up the HttpURLConnection, defining headers like 'User-Agent', 'Content-Type', 'Accept', and 'x-authorization', and processing the response. Ensure you replace 'YOUR_TOKEN' with your actual authorization token. ```java URL url = new URL("https://microservices.dev.rappi.com/api/v2/restaurants-integrations-public-api/orders/status/sent"); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setRequestMethod("GET"); connection.setRequestProperty("User-Agent", "Mozilla/5.0"); connection.setRequestProperty("Content-Type", "application/json"); connection.setRequestProperty("Accept", "application/json"); connection.setRequestProperty("x-authorization", "Bearer YOUR_TOKEN"); 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()); ``` -------------------------------- ### Get Products by Corridor - JSON Response Example Source: https://dev-portal.rappi.com/en/utils Example JSON response for the 'Get Products by Corridor' API endpoint. This structure details product information including product ID, name, description, corridor ID, and store ID. ```json [ { "product_id": 789, "name": "Americano Caliente 16 oz", "description": "16 oz. Espresso con agua caliente.", "corridor_id": 123, "store_id": 999 }, { "product_id": 987, "name": "Americano Caliente 20 oz", "description": "20 oz. Espresso con agua caliente.", "corridor_id": 123, "store_id": 999 } ] ``` -------------------------------- ### Manage Product Stock Availability (PATCH) - Java Source: https://dev-portal.rappi.com/en/api-reference/menu-rests-api Java code example for making a PATCH request to manage product stock availability. It demonstrates setting up the URL, HTTP connection, request method, headers, and request body. It also shows how to read the response stream. ```java URL url = new URL("https://api.dev.rappi.com/restaurants/menu/v1/stores/11111/products/RAPPI/stock"); HttpURLConnection httpConn = (HttpURLConnection) url.openConnection(); httpConn.setRequestMethod("PATCH"); httpConn.setRequestProperty("x-authorization", "Bearer "); httpConn.setRequestProperty("Content-Type", "application/json"); httpConn.setDoOutput(true); OutputStreamWriter writer = new OutputStreamWriter(httpConn.getOutputStream()); writer.write("{\n \"available\": [\n \"123123\"\n ],\n \"unavailable\": [\n ]\n}"); writer.flush(); writer.close(); httpConn.getOutputStream().close(); InputStream responseStream = httpConn.getResponseCode() / 100 == 2 ? httpConn.getInputStream() : httpConn.getErrorStream(); Scanner s = new Scanner(responseStream).useDelimiter("\\A"); String response = s.hasNext() ? s.next() : ""; System.out.println(response); ``` -------------------------------- ### Get Corridor Schedule - Java Example Source: https://dev-portal.rappi.com/en/api-reference/corridor-schedules-by-integration Demonstrates how to make a GET request to retrieve corridor schedule details using Java's HttpURLConnection. It sends necessary headers like User-Agent, Content-Type, Accept, and Authorization. The response body and status code are printed to the console. This example requires a valid API token. ```java URL url = new URL("https://microservices.dev.rappi.com/api/rest-ops-utils/corridor/schedule/321/integration/888"); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setRequestMethod("GET"); connection.setRequestProperty("User-Agent", "Mozilla/5.0"); connection.setRequestProperty("Content-Type", "application/json"); connection.setRequestProperty("Accept", "application/json"); connection.setRequestProperty("x-authorization", "Bearer YOUR_TOKEN"); 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()); ``` -------------------------------- ### GET /v1/stores/{store_id}/loans Source: https://dev-portal.rappi.com/en/financial Returns a list of loans installments by payment or by store and a payment period. ```APIDOC ## GET /v1/stores/{store_id}/loans ### Description Returns a list of loan installments, filterable by store and payment period, or by a specific payment ID. ### Method GET ### Endpoint /v1/stores/{store_id}/loans ### Parameters #### Path Parameters - **store_id** (string) - Required - The ID of the store. #### Query Parameters - **payment_id** (string) - Optional - Filters loan installments by a specific payment ID. - **payment_period** (string) - Optional - Filters loan installments by a specific payment period. ### Request Example ```json { "example": "GET /v1/stores/12345/loans?payment_period=monthly" } ``` ### Response #### Success Response (200) - **loans** (array) - An array of loan installment objects. - **loan_id** (string) - The unique identifier for the loan installment. - **loan_details** (object) - Details of the loan installment. #### Response Example ```json { "example": { "loans": [ { "loan_id": "loan_303", "loan_details": { "installment_amount": 75.00, "due_date": "2023-02-15" } } ] } } ``` ``` -------------------------------- ### Create Product Schedule (Java) Source: https://dev-portal.rappi.com/en/api-reference/product-schedules This Java code demonstrates how to send a POST request to create a product schedule. It configures the HTTP connection, sets request headers including authentication, and sends a JSON payload containing schedule details. The response code and body are then printed. ```java URL url = new URL("https://microservices.dev.rappi.com/api/rest-ops-utils/product/schedule/789/corridor/123/store/999"); 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.setRequestProperty("x-authorization", "Bearer YOUR_TOKEN"); connection.setDoOutput(true); String jsonInputString = "{\n" + " \"schedule_details\": [\n" + " {\n" + " \"days\": \"mon,tue,wed,thu,fri,sat,sun\",\n" + " \"starts_time\": \"08:00:00\",\n" + " \"ends_time\": \"20:00:00\"\n" + " },\n" + " {\n" + " \"days\": \"hol\",\n" + " \"starts_time\": \"13:00:00\",\n" + " \"ends_time\": \"22:00:00\"\n" + " }\n" + " ]\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()); ``` -------------------------------- ### Java - GET Request for Store Orders Source: https://dev-portal.rappi.com/en/api-reference/orders-rests-api Example of making a GET request to the Rappi API to fetch orders for a specific store using Java. This code handles URL construction, setting request headers, and processing the response. ```java final Integer storeId = 205634; URL url = new URL("https://api.dev.rappi.com/restaurants/orders/v1/stores/%s/orders", storeId); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setRequestMethod("GET"); connection.setRequestProperty("User-Agent", "Mozilla/5.0"); connection.setRequestProperty("Content-Type", "application/json"); connection.setRequestProperty("Accept", "application/json"); connection.setRequestProperty("x-authorization", "Bearer YOUR_TOKEN"); 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()); ``` -------------------------------- ### Sample Response Source: https://dev-portal.rappi.com/en/api-reference/financial This section provides an example of a successful API response, detailing the structure and data fields for retrieved information. ```APIDOC ## Sample Response ### Description This is an example of the response, detailing the structure of the data returned by an API call. ### Response Example (200 OK) ```json { "page_number": 1, "page_size": 10, "order_by": "string", "order_type": "string", "total_pages": 0, "total_entries": 0, "entries": [ { "contracted_plan": "string", "application_fnfo": { "name": "string", "document_number": "string", "corporate_name": "string", "state_registration": "string", "municipal_registration": "string", "address": { "country": "string", "state": "string", "city": "string", "district": "string", "street": "string", "number": "string", "zipCode": "string", "complement": "string", "reference": "string" }, "contact_fnfo": { "contact_email": "user@example.com", "contact_phone": "string", "contact_name": "string" } }, "store_info": { "store_id": "string", "type": "string", "document": "string", "name": "string", "corporate_name": "string", "is_marketplace": true, "address": { "city": "string" } }, "contract_info": { "frequency_type": "string", "contract_term": { "start_date": "2023-11-07", "end_date": "2023-11-07" } }, "conditions": [ { "name": "string", "commision": "string" } ] } ] } ``` ``` -------------------------------- ### Mark Order Ready for Pickup API Request (Java) Source: https://dev-portal.rappi.com/en/api-reference/orders This Java code snippet demonstrates how to send a POST request to the Rappi API to mark an order as ready for pickup. It constructs the URL, sets request properties like content type and authorization token, and prints the response code. Ensure you replace 'YOUR_TOKEN' with a valid authorization token. ```java final Integer orderId = 392625; URL url = new URL(String.format("https://microservices.dev.rappi.com/api/v2/restaurants-integrations-public-api/orders/%s/ready-for-pickup", orderId)); 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.setRequestProperty("x-authorization", "Bearer YOUR_TOKEN"); System.out.println("Response Code : " + connection.getResponseCode()); ``` -------------------------------- ### Python GET Request for Corridor Integration Source: https://dev-portal.rappi.com/en/api-reference/utils Provides a Python example for making a GET request to the corridor integration endpoint. This snippet utilizes the `requests` library to manage the HTTP request and response handling, including authentication headers. It's designed to fetch corridor data. ```python import requests url = "https://microservices.dev.rappi.com/api/rest-ops-utils/corridor/integration/888" headers = { "User-Agent": "Mozilla/5.0", "Content-Type": "application/json", "Accept": "application/json", "Authorization": "Bearer YOUR_TOKEN" } response = requests.get(url, headers=headers) if response.status_code == 200: print("Response body:", response.json()) else: print("Response Code:", response.status_code) ``` -------------------------------- ### Retrieve Store Orders - Node.js Source: https://dev-portal.rappi.com/en/api-reference/rests-api-orders This Node.js example shows how to call the Rappi API endpoint to get store orders. It uses the 'https' module to make the GET request, sets necessary headers including the authorization token, and logs the response. ```javascript const https = require('https'); const storeId = 205634; const options = { hostname: 'api.dev.rappi.com', port: 443, path: `/restaurants/orders/v1/stores/${storeId}/orders`, method: 'GET', headers: { 'User-Agent': 'Mozilla/5.0', 'Content-Type': 'application/json', 'Accept': 'application/json', 'x-authorization': 'Bearer YOUR_TOKEN' } }; const req = https.request(options, (res) => { let data = ''; res.on('data', (chunk) => { data += chunk; }); res.on('end', () => { console.log('Response body: ' + data); console.log('Response Code: ' + res.statusCode); }); }); req.on('error', (error) => { console.error(error); }); req.end(); ``` -------------------------------- ### PUT /restaurants/orders/v1/stores/{storeId}/orders/{orderId}/take Source: https://dev-portal.rappi.com/en/api-reference/orders-rests-api Takes an order to commence preparation. ```APIDOC ## PUT /restaurants/orders/v1/stores/{storeId}/orders/{orderId}/take ### Description Takes an order to commence preparation. ### Method PUT ### Endpoint `/restaurants/orders/v1/stores/{storeId}/orders/{orderId}/take` ### Parameters #### Path Parameters - **storeId** (string) - Required - The ID of the store. - **orderId** (string) - Required - The ID of the order. ### Response #### Success Response (200) - **message** (string) - Confirmation message. #### Response Example ```json { "message": "Order taken successfully." } ``` ``` -------------------------------- ### Validate Product Stock Availability (POST) - Response Example Source: https://dev-portal.rappi.com/en/api-reference/menu-rests-api Example of a successful response from the POST endpoint to validate product availability. It confirms that the request has been accepted. ```json { "message": "Your request has been accepted" } ``` -------------------------------- ### GET /restaurants/finance/v1/stores/{store_id}/loans Source: https://dev-portal.rappi.com/en/api-reference/financial-rests-api Returns a list of loan installments by payment or by store and a payment period. This endpoint is used to retrieve information about loan installments associated with a store, including details like balance, currency, and disbursement information. ```APIDOC ## GET /restaurants/finance/v1/stores/{store_id}/loans ### Description Returns a list of loan installments by payment or by store and a payment period. This endpoint is used to retrieve information about loan installments associated with a store, including details like balance, currency, and disbursement information. ### Method GET ### Endpoint `https://{COUNTRY_DOMAIN}/restaurants/finance/v1/stores/{store_id}/loans` ### Parameters #### Path Parameters - **store_id** (string) - Required - The unique identifier of store in request #### Query Parameters - **page_number** (integer) - Optional - Number of pages that you want to get - **page_size** (integer) - Optional - The maximum size of entries in paginated responses - **payment_id:eq** (integer) - Optional - The `payment_id` must equal its value - **created_at:gte** (string) - Optional - The `created_at` must be greather than or equal its value (YYYY-MM-DD) - **created_at:lte** (string) - Optional - The `created_at` must be less than or equal its value (YYYY-MM-DD) ### Request Example ```java URL url = new URL("https://api.dev.rappi.com/restaurants/finance/v1/stores/1234/loans"); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setRequestMethod("GET"); connection.setRequestProperty("User-Agent", "Mozilla/5.0"); connection.setRequestProperty("Content-Type", "application/json"); connection.setRequestProperty("Accept", "application/json"); connection.setRequestProperty("x-authorization", "Bearer YOUR_TOKEN"); 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()); ``` ### Response #### Success Response (200) - **page_number** (integer) - The current page number. - **page_size** (integer) - The number of entries per page. - **order_by** (string) - The field by which the results are ordered. - **order_type** (string) - The type of ordering (e.g., ASC, DESC). - **total_pages** (integer) - The total number of available pages. - **total_entries** (integer) - The total number of entries. - **entries** (array) - A list of loan installment objects. - **id** (integer) - The unique identifier of the loan installment. - **description_type** (string) - The type of description for the loan. - **balance** (number) - The remaining balance of the loan. - **frequency** (integer) - The frequency of payments. - **created_at** (string) - The date and time when the loan was created. - **currency** (string) - The currency of the loan amount. - **disbursement_date** (string) - The date when the loan amount was disbursed. - **disbursement_amount** (number) - The total amount disbursed for the loan. - **deadline** (string) - The deadline for loan repayment. - **reason** (string) - The reason for the loan. - **stores** (array) - A list of store identifiers associated with the loan. - **type** (string) - The type of loan. - **installment_amount** (number) - The amount of each installment. - **installment_percentage** (number) - The percentage of each installment. - **lastCollection_date** (string) - The date of the last collection. - **amortization** (string) - Amortization details. - **installments** (object) - Details about specific installments. - **installment_amount** (number) - The amount of a specific installment. - **installment_created_at** (string) - The creation date of a specific installment. - **store_id** (integer) - The store ID for the installment. - **payment_id** (integer) - The payment ID for the installment. #### Response Example ```json { "page_number": 1, "page_size": 10, "order_by": "string", "order_type": "string", "total_pages": 0, "total_entries": 0, "entries": [ { "id": 0, "description_type": "string", "balance": 0, "frequency": 0, "created_at": "2023-11-07", "currency": "string", "disbursement_date": "2023-11-07", "disbursement_amount": 0, "deadline": "2023-11-07", "reason": "string", "stores": ["string"], "type": "string", "installment_amount": 0, "installment_percentage": 0, "lastCollection_date": "2023-11-07", "amortization": "string", "installments": { "installment_amount": 0, "installment_created_at": "2023-11-07", "store_id": 0, "payment_id": 0 } } ] } ``` ``` -------------------------------- ### GET /restaurants/finance/v1/stores/{store_id}/loans Source: https://dev-portal.rappi.com/en/api-reference/rests-api-financial Retrieves loan installments for a store, optionally filtered by payment or date range. ```APIDOC ## GET /restaurants/finance/v1/stores/{store_id}/loans ### Description Returns a list of loan installments by payment or by store and a payment period. ### Endpoint URL `https://{COUNTRY_DOMAIN}/restaurants/finance/v1/stores/{store_id}/loans` ### Endpoint Properties - Response formats: `JSON` - Authentication requirements: Token ### Parameters #### Path Parameters - **store_id** (string) - Required - The unique identifier of store in request #### Query Parameters - **page_number** (integer) - Optional - Number of pages that you want to get - **page_size** (integer) - Optional - The maximum size of entries in paginated responses - **payment_id:eq** (integer) - Optional - The `payment_id` must equal its value - **created_at:gte** (string) - Optional - The `created_at` must be greather than or equal its value (YYYY-MM-DD). - **created_at:lte** (string) - Optional - The `created_at` must be less than or equal its value (YYYY-MM-DD). ### Status Codes - `200` Success - `400` When some param have a invalid value, is missing, etc - `401` When access token sent is invalid or expired - `403` When the access token is valid but don't have permissions ### Request Example ```json { "example": "GET https://api.dev.rappi.com/restaurants/finance/v1/stores/1234/loans" } ``` ### Response #### Success Response (200) - **page_number** (integer) - The current page number. - **page_size** (integer) - The number of entries per page. - **order_by** (string) - The field used for ordering. - **order_type** (string) - The order type. - **total_pages** (integer) - The total number of pages. - **total_entries** (integer) - The total number of entries. - **entries** (array) - A list of loan installment objects. - **id** (integer) - The unique identifier of the loan installment. - **description_type** (string) - The type of description for the loan. - **balance** (number) - The remaining balance of the loan. - **frequency** (integer) - The frequency of installments. - **created_at** (string) - The date the loan was created (YYYY-MM-DD). - **currency** (string) - The currency of the loan. - **disbursement_date** (string) - The date the loan was disbursed (YYYY-MM-DD). - **disbursement_amount** (number) - The amount disbursed for the loan. - **deadline** (string) - The deadline for the loan repayment (YYYY-MM-DD). - **reason** (string) - The reason for the loan. - **stores** (array of strings) - List of store IDs associated with the loan. - **type** (string) - The type of loan. - **installment_amount** (number) - The amount of each installment. - **installment_percentage** (number) - The percentage of each installment. - **lastCollection_date** (string) - The date of the last collection (YYYY-MM-DD). - **amortization** (string) - The amortization schedule of the loan. - **installments** (object) - Details about the loan installments. - **installment_amount** (number) - The amount of the installment. - **installment_created_at** (string) - The date the installment was created (YYYY-MM-DD). - **store_id** (integer) - The ID of the store for this installment. - **payment_id** (integer) - The ID of the payment associated with the installment. #### Response Example ```json { "page_number": 1, "page_size": 10, "order_by": "string", "order_type": "string", "total_pages": 0, "total_entries": 0, "entries": [ { "id": 0, "description_type": "string", "balance": 0, "frequency": 0, "created_at": "2023-11-07", "currency": "string", "disbursement_date": "2023-11-07", "disbursement_amount": 0, "deadline": "2023-11-07", "reason": "string", "stores": ["string"], "type": "string", "installment_amount": 0, "installment_percentage": 0, "lastCollection_date": "2023-11-07", "amortization": "string", "installments": { "installment_amount": 0, "installment_created_at": "2023-11-07", "store_id": 0, "payment_id": 0 } } ] } ``` ``` -------------------------------- ### Store Availability Sync Response Example Source: https://dev-portal.rappi.com/en/managing-availability Example JSON response for a synchronous store availability update request. It details the outcome for each store, including whether it was enabled/disabled, and provides reasons for failure like suspension. ```json { "results": [ { "store_id": 90774, "is_enabled": false, "operation_result": false, "operation_result_type": "suspended", "suspended_reason": "suspended due cancelled orders", "suspended_at": "2022-04-11T20:23:00.00Z", "suspended_time": 60 } ] } ``` -------------------------------- ### GET /restaurants/finance/v1/stores/{store_id}/loans Source: https://dev-portal.rappi.com/en/api-reference/financial Retrieves a list of loan installments by payment or by store and a payment period. ```APIDOC ## GET /restaurants/finance/v1/stores/{store_id}/loans ### Description Returns a list of loans installments by payment or by store and a payment period. ### Method GET ### Endpoint `https://{COUNTRY_DOMAIN}/restaurants/finance/v1/stores/{store_id}/loans` #### Path Parameters - **store_id** (string) - Required - The unique identifier of store in request. #### Query Parameters - **page_number** (integer) - Optional - Number of pages that you want to get. - **page_size** (integer) - Optional - The maximum size of entries in paginated responses. - **payment_id:eq** (integer) - Optional - The `payment_id` must equal its value. - **created_at:gte** (string) - Optional - The `created_at` must be greater than or equal its value (YYYY-MM-DD). - **created_at:lte** (string) - Optional - The `created_at` must be less than or equal its value (YYYY-MM-DD). ### Request Example ```json { "example": "GET https://api.dev.rappi.com/restaurants/finance/v1/stores/1234/loans" } ``` ### Response #### Success Response (200) - **page_number** (integer) - The current page number. - **page_size** (integer) - The number of entries per page. - **order_by** (string) - The field by which the results are ordered. - **order_type** (string) - The order type (e.g., ASC, DESC). - **total_pages** (integer) - The total number of pages. - **total_entries** (integer) - The total number of entries. - **entries** (array) - A list of loan objects. - **id** (integer) - The unique identifier of the loan. - **description_type** (string) - The type of loan description. - **balance** (number) - The outstanding balance of the loan. - **frequency** (integer) - The frequency of installments. - **created_at** (string) - The date and time the loan was created (YYYY-MM-DD). - **currency** (string) - The currency of the loan. - **disbursement_date** (string) - The date the loan was disbursed (YYYY-MM-DD). - **disbursement_amount** (number) - The amount disbursed for the loan. - **deadline** (string) - The deadline for the loan repayment (YYYY-MM-DD). - **reason** (string) - The reason for the loan. - **stores** (array of strings) - List of store IDs associated with the loan. - **type** (string) - The type of loan. - **installment_amount** (number) - The amount of each installment. - **installment_percentage** (number) - The percentage of each installment. - **lastCollection_date** (string) - The date of the last collection (YYYY-MM-DD). - **amortization** (string) - The amortization details of the loan. - **installments** (object) - Details about the loan installments. - **installment_amount** (number) - The amount of the installment. - **installment_created_at** (string) - The date the installment was created (YYYY-MM-DD). - **store_id** (integer) - The ID of the store associated with the installment. - **payment_id** (integer) - The ID of the payment for the installment. #### Response Example ```json { "page_number": 1, "page_size": 10, "order_by": "string", "order_type": "string", "total_pages": 0, "total_entries": 0, "entries": [ { "id": 0, "description_type": "string", "balance": 0, "frequency": 0, "created_at": "2023-11-07", "currency": "string", "disbursement_date": "2023-11-07", "disbursement_amount": 0, "deadline": "2023-11-07", "reason": "string", "stores": ["string"], "type": "string", "installment_amount": 0, "installment_percentage": 0, "lastCollection_date": "2023-11-07", "amortization": "string", "installments": { "installment_amount": 0, "installment_created_at": "2023-11-07", "store_id": 0, "payment_id": 0 } } ] } ``` ```