Skip to main content

Quickstart

This guide will help you get started with the banca.me API integration. Follow these steps to make your first API request.

Prerequisites​

Before you begin, make sure you have:

  • A banca.me account
  • Your API credentials (Bearer token)
  • A development environment set up

Making Your First Request​

You can now make requests to various endpoints. Here's an example of creating a pre-loan request:

import requests
from urllib.parse import urlencode

# Set up your authentication headers
headers = {
'Authorization': 'Bearer <token>',
'Content-Type': 'application/x-www-form-urlencoded'
}

# Create a pre-loan request
payload = {
'rut': '<RUT>',
'metadata': {}
}

# Encode the payload for x-www-form-urlencoded format
payload_encoded = urlencode(payload)

# Make the POST request
response = requests.post(
'https://api.banca.me/partner/pre-loan-request',
data=payload_encoded,
headers=headers
)

# Handle the response
if response.status_code == 200:
print("Success:", response.json())
else:
print("Error:", response.status_code, response.text)
Security Note

Never expose your Bearer token in client-side code. Always make API requests from your backend server.

Response Handling​

The API will return different responses based on the status of the pre-loan request. Please check our API documentation for more detail. Here are the possible responses:

For this section please check the data format response from the data section. When the product is ready for evaluation, you'll receive detailed information about the customer's financial status:

{
"step": "READY_FOR_LOAN",
"protestsAndDelinquencies": {
// See Protests And Delinquencies section in Data
},
"claveUnica": {
// See ClaveÚnica: AFC, SII, SUSESO and CMF section in Data
},
"preApproves": [
// See Risk Params and PreApproves section
]
}
Response Handling

Always check the step field in the response to determine the current state of the loan request and handle each case appropriately in your application.

Error Handling​

Always implement proper error handling in your code:

  • Check HTTP status codes
  • Parse error messages from the response
  • Implement retry logic for temporary failures
  • Log errors for debugging

Next Steps​