API flow
Index
- How to get access?
- Postman
- Environments
- General information
- Create a lead
- Save personal information
- Add additional info
- Address
- Financial information
- Auto information
- Get an offer
- Consult the information of the lead
- Update contact information
- Catalogs
- Zip code information
- Auto catalogs
Diagram
This is the flow that you need to follow in order to create a request for a credit.

Postman collection
Environments
Check the development environments section.
General information
Request headers
All the api request that you make, need the next headers.
| Header | Value |
|---|---|
| Content-Type | application/json |
| Authorization | Bearer {{access_token}} |
📘 Additional headers
In case that the endpoint needs an specific header, it will be specified in the specific request description.Create a lead
The first steep is calling the create lead endpoint:
Request information
| HTTP method | URL | Example |
|---|---|---|
| POST | {{api_base_url}}/autofin/api/leads | https://stg-api.creditas.io/mx/b2b/autofin/api/leads |
Request body
| Field | Type | Description |
|---|---|---|
| phone | String | Client's phone number of 10 characters, only mexican numbers are allowed. Ex: "9512138126" |
| | String | The client email Ex: pq-approved@creditas.com |
| downPayment | Number | The loan down payment in MXN, we recommend more than 20% of auto value. Ex: 30000 |
| term | Number | The Number of monthly payments to settle the credit, possible values: 24, 36, 48 or 60. Ex: 24 |
| externalAutoId | String | Optional Send this field if we have an integration to your auto catalog ex(Mercado libre) EX: "MLM1496685003" |
In Staging environment, the following emails should be used so as not to actually consult the credit history:
| Prequalification result | |
|---|---|
| pq-approved@creditas.com | APPROVED |
| pq-rejected@creditas.com | REJECTED |
Request response status
The service will return a 201 status code with the next response:Request response body
| Field | Type | Description |
|---|---|---|
| id | UUID (String) | The identifier of this lead, this will be used in the next requests as {{leadId}} Ex: "2341b2c8-8e84-4a5a-aac6-9dda4410e999" |
Curl example
curl --location --request POST '{{api_base_url}}/autofin/api/leads' \--header 'Authorization: Bearer {{access_token}}--header 'Content-Type: application/json' \--data-raw '{"phone": "9128463859","email" : "client@creditas.com","downPayment" : 30000,"term" : 24,"externalAutoId": "MLM1496685003"}'
Possible errors
Consult possible error returns, click here.Save personal information
After creation lead, you have to provide his personal information.Request information
| HTTP method | URL | Example |
|---|---|---|
| POST | {{api_base_url}}/autofin/api/leads/{{leadId}}/person | https://stg-api.creditas.io/mx/b2b/autofin/api/leads/2341b2c8-8e84-4a5a-aac6-9dda4410e999/person |
Request body
| Field | Type | Description |
|---|---|---|
| firstName | String | Client first name of the client Ex: "Javier" |
| secondName | String | Client second name, if a client only have one name you don't need to send this field Ex: "Jair" |
| lastName | String | Last name of the client Ex: "Gonzalez" |
| secondLastName | String | Second last name of the client Ex: "Gonzales" |
| birthDate | String | Birth date of the client in format "yyyy-mm-dd" Ex: "1993-11-28" |
| rfc | String | The RFC of the client Ex: "GOGJ931128C83" |
Request response status
The service will return a 204 status with a empty response bodyCurl example
curl --location --request POST '{{api_base_url}}/autofin/api/leads/{{leadId}}/person' \--header 'Authorization: Bearer {{access_token}}' \--header 'Content-Type: application/json' \--data-raw '{"firstName": "Javier","secondName": "Jair","lastName": "Gonzalez","secondLastName": "Gonzales","birthDate": "1993-11-28","rfc": "GOGJ931128C83"}'
Possible errors
Consult possible error returns, click here.Add additional info
Now, you have a lead with the personal information loaded, you can use the next endpoints in the order that you prefer.
Address
This is the information about the client address. You could complement this with out Zip code service.
Request information
| HTTP method | URL | Example |
|---|---|---|
| PUT | {{api_base_url}}/autofin/api/leads{{leadId}}/address | https://stg-api.creditas.io/mx/b2b/autofin/2341b2c8-8e84-4a5a-aac6-9dda4410e999/address |
Request body
| Field | Type | Description |
|---|---|---|
| zipCode | String | Zip code where live the person Ex: "09440" |
| neighborhood | String | Neighborhood where live the person Ex: "El Retoño" |
| street | String | Street where the person live Ex: "Margarita maza de juarez" |
| Number | String | Number of the house/ apartment/ etc where the person live Ex: "45" |
| interior | String | Optional. Interior number of the house/ apartment/ etc where the person live Ex: "A" |
Request response status
The service will return a 204 status with a empty response bodyCurl example
curl --location --request PUT '{{api_base_url}}/autofin/api/leads/{{leadId}}/address' \--header 'Authorization: Bearer {{access_token}}' \--header 'Content-Type: application/json' \--data-raw '{"street": "Margarita maza de juarez","number": 43,"interior": "A","zipCode": "09440","neighborhood": "El Retoño"}'
Possible errors
Consult possible error returns, click here.Financial information
This data help us to calculate the payment capacity of the lead.Request information
| HTTP method | URL | Example |
|---|---|---|
| PUT | {{api_base_url}}/autofin/api/leads{{leadId}}/financial | https://stg-api.creditas.io/mx/b2b/autofin/api/leads/2341b2c8-8e84-4a5a-aac6-9dda4410e999/financial |
Request body
| Field | Type | Description |
|---|---|---|
| employmentType | String enum ["RETIRED", "EMPLOYED", "SELF_EMPLOYED"] | Is the origin of the client's income Ex: "SELF_EMPLOYED" |
| income | Number | The monthly income of a person Ex: 20000 |
| jobPosition | String | Required when the employmentType is different of RETIRED. Ex: "Carpintero" |
| startDate | Object | Required when the employmentType is different of RETIRED. The date when the user start in that job. Below there are more details |
| startDate.year | Integer | The year when the user start to work Ex: 2020 |
| startDate.month | Integer | The month number when the user start to work, values 1 to 12 Ex: 1 for January |
Request response status
The service will return a 204 status with a empty response body.Curl example
curl --location --request PUT '{{api_base_url}}/autofin/api/leads/05d3ccd2-26e8-4a85-bde8-509d6888c12b/financial' \--header 'Authorization: Bearer {{access_token}}' \--header 'Content-Type: application/json' \--data-raw '{"income" : 20000,"employmentType" : "SELF_EMPLOYED","startDate" : {"year" : 2022,"month" : 1},"jobPosition" : "Carpintero"}'
Possible errors
Consult possible error returns, click here.Auto information
We this endpoint you send the auto that was chosen by the client. This endpoint works with the auto catalog.
📘 Endpoint optional
This endpoint is optional, additional this auto is only taken as a reference, the client could change the auto.Request information
| HTTP method | URL | Example |
|---|---|---|
| PUT | {{api_base_url}}/autofin/api/leads{{leadId}}/auto | https://stg-api.creditas.io/mx/b2b/2341b2c8-8e84-4a5a-aac6-9dda4410e999/auto |
Request body
| Field | Type | Description |
|---|---|---|
| id | String | Is the auto version id, check auto catalog Ex: "2020910528260" |
| price | Number | Is the price estimate of the auto Ex: 250000 |
Request response status
The service will return a 204 status with a empty response bodyCurl example
curl --location --request PUT '{{api_base_url}}/autofin/api/leads/{{leadId}}/auto' \--header 'Authorization: Bearer {{access_token}}' \--header 'Content-Type: application/json' \--data-raw '{"id" : "2020910528260","price" : 300000}'
Possible errors
Consult possible error returns, click here.Get an offer
In order to receive an offer, the client needs to accept a credit history consult. To allow this your have to call the send pin endpoint and after use the pin received in the request offer endpointSend pin to client
Endpoint used to send a pin of 6 digits to the client, this pin could be sent by SMS or email.If you need to update the contact client data use the update contact information endpoint.
In environments other than production, SMS are not sent. The default PIN is 123456
Request information
| HTTP method | URL | Example |
|---|---|---|
| POST | {{api_base_url}}/autofin/api/leads/{{leadId}}/pin | https://stg-api.creditas.io/mx/b2b/autofin/api/leads/2341b2c8-8e84-4a5a-aac6-9dda4410e999/pin |
Request body
| Field | Type | Description |
|---|---|---|
| channel | String enum ["SMS", "EMAIL"] | The channel to deliver the pin Ex: "SMS" |
Request response status
The service will return a 204 status with a empty response bodyCurl example
curl --location --request POST '{{api_base_url}}/autofin/api/leads/05d3ccd2-26e8-4a85-bde8-509d6888c12b/pin' \--header 'Authorization: Bearer {{access_token}}' \--header 'Content-Type: application/json' \--data-raw '{"channel": "EMAIL"}'
Possible errors
Endpoint information, click here.
Request Offer
When the client obtain a PIN, he could call this endpoint. With this action the client authorizes the consult to his credit history and get an offer.
In Staging environment, the following emails should be used so as not to actually consult the credit history:
| Prequalification result | |
|---|---|
| pq-approved@creditas.com | APPROVED |
| pq-rejected@creditas.com | REJECTED |
The fact that the prequalification result is APPROVED does not guarantee that the lead will be able to obtain an offer.
Request information
| HTTP method | URL | Example |
|---|---|---|
| POST | {{api_base_url}}/autofin/api/leads{{leadId}}/offer | https://stg-api.creditas.io/mx/b2b/2341b2c8-8e84-4a5a-aac6-9dda4410e999/offer |
Request body
| Field | Type | Description |
|---|---|---|
| pin | String | The PIN that the person received Ex: "123456" |
| pinConfirmation | String | The same PIN to make sure the user spelled it correctly Ex: "123456" |
Curl example
curl --location --request POST '{{api_base_url}}/autofin/api/leads/7809b67d-4dfb-47ff-a4df-ac033569f6e4/offer' \--header 'Authorization: Bearer {{access_token}}' \--header 'Content-Type: application/json' \--data '{"pin": "123456","pinConfirmation": "123456"}'
Request response status
The service will return a 200 status with the next response bodyRequest response body
| Field | Type | Description |
|---|---|---|
| prequalification | Boolean | It determines if the lead has a pre-approved offer |
| offer | Object Nullable. | The pre-approved offer or counter offer. If the lead is not automatically prequalified this object will be null |
| id | UUID (String) | Generated offer identifier |
| annualInterestRate | Number | Annual interest to apply |
| monthlyPayment | Number | Monthly payments to be made |
| term | Integer | Number of months to pay back the loan |
| loanAmount | Number | Amount to lend |
| downPayment | Number | Amount provided as a down payment |
| auto | Object Nullable. | Data of the selected car, this auto can be changed later |
| loanType | String Enum ["REQUESTED", "PROPOSED"] | It's the loan type. REQUESTED when it is the value that the lead requested and PROPOSED when the value requested cannot be provided and a counteroffer is provided with the maximum value that can be provided in the maxAutoPrice field. |
| maxAutoPrice | Number Nullable. | The maximum auto price that this lead can request. Only applies in case of counter offer where the loan type is PROPOSED |
Response example
{"prequalification": true,"offer": {"id": "0c3fe138-ef5d-4dbe-9b2d-568dd3045f89","annualInterestRate": 29.04,"monthlyPayment": 5524.52,"term": 60,"loanAmount": 152726.0,"downPayment": 100000.0,"auto": {"make": "Audi","model": "A3","year": 2020,"price": 250000.0,"officialPrice": 456480.0},"loanType": "REQUESTED","maxAutoPrice": null}}
Possible errors
Consult possible error returns, click here.Consult the information of the lead
With this endpoint you can consult the information of an specific lead.Request information
| HTTP method | URL | Example |
|---|---|---|
| GET | {{api_base_url}}/autofin/api/leads/{{leadId}} | https://stg-api.creditas.io/mx/b2b/autofin/api/leads/2341b2c8-8e84-4a5a-aac6-9dda4410e999 |
Request response status
The service will return a 200 status with the next response bodyRequest response body
| Field | Type | Description |
|---|---|---|
| id | String UUID | Identifier of the lead. |
| contact | Object | Contains the email and phone of the user |
| createdAt | String | Date time of creation lead |
| updatedAt | String | Date time of the last update to the lead information. |
| loanInformation | Object | Contains the term, downPayment and purchaseIntention |
| personalInformation | Object Nullable. | Contains the firstName, secondName, lastName, secondLastName, birthDate and rfc. For more details check save person. |
| address | Object Nullable. | It contains tha data about address, street, number, interior, zipCode, neighborhood. And additional data derived from zip code service like municipality, city and state. |
| auto | Object Nullable. | Contains the auto information, id, brandName, modelName, year and price |
| financialInformation | Object Nullable. | Contains the financial information, employmentType, monthlyIncome, jobPosition, startDate. For more details check financial information endpoint. |
| nipConfirmationDate | String Nullable. | It will have a valid date time String when the client has accepted the consult to their credit history. For more details check get an offer section. |
isComplete | Boolean | If the lead has personal information, address, auto and has nip confirmed |
isPq | Boolean | If the lead has a pre qualification successful |
Response example
{"id": "05d3ccd2-26e8-4a85-bde8-509d6888c12b","contact": {"email": "prueba@creditas.com","phone": "9128463859"},"createdAt": "2023-01-18T22:54:46.17806","updatedAt": "2023-01-19T23:01:48.540752","loanInformation": {"term": 12,"downPayment": 1000.0,"purchaseIntention": null},"personalInformation": {"firstName": "Javier","secondName": "Jair","lastName": "Gonzalez","secondLastName": "Gonzales","birthDate": "2007-11-28","rfc": "GOGJ071128C88"},"address": {"street": "Margarita maza de juarez","number": "43","interior": "A","zipCode": "09440","neighborhood": "El Retoño","municipality": "Iztapalapa","city": "Ciudad de México","state": {"id": "CDMX","name": "CIUDAD DE MÉXICO"}},"auto": {"id": "2020910528260","brandName": "Acura","modelName": "ILX","year": 2020,"price": 300000.0},"financialInformation": {"employmentType": "SELF_EMPLOYED","monthlyIncome": 20000.0,"jobPosition": "Carpintero","startDate": {"year": 2022,"month": 1}},"nipConfirmationDate": null,"isComplete": false,"isPq": false}
Curl example
curl --location --request GET '{{api_base_url}}/autofin/api/leads/{{leadId}}' \--header 'Authorization: Bearer {{access_token}}'
Update contact information
Update the email or phone contact.Request information
| HTTP method | URL | Example |
|---|---|---|
| PUT | {{api_base_url}}/autofin/api/leads/{{leadId}}/contact | https://stg-api.creditas.io/mx/b2b/autofin/api/leads/2341b2c8-8e84-4a5a-aac6-9dda4410e999/contact |
Request body
| Field | Type | Description |
|---|---|---|
| phone | String | Client's phone number of 10 characters, only mexican numbers are allowed. Ex: "9512138126" |
| | String | The client email Ex: pq-approved@creditas.com |
Curl example
curl --location --request PUT '{{api_base_url}}/autofin/api/leads/{{leadId}}/contact' \--header 'Authorization: Bearer {{access_token}}' \--header 'Content-Type: application/json' \--data-raw '{"phone" : 9511001687,"email" : "creaditas@creditas.com"}'
Request response status
The service will return a 204Possible errors
Consult possible error returns, click here.Catalogs
Zip code information
Request information
| HTTP method | URL | Example |
|---|---|---|
| GET | {{api_base_url}}/autofin/api/catalogs/zip-code/{{zip-code}} | https://stg-api.creditas.io/mx/b2b/autofin/api/catalogs/zip-code/09440 |
{{zip-code}} is an String former by 5 digits. For example "09440".
Request response status
The service will return a 200 status with the next response body.Request response body
| Field | Type | Description |
|---|---|---|
| zipCode | String | The zip code sent in the request |
| neighborhoods | String[] | A list the neighborhoods that are in the provided zip code Ex: ["El Retoño","San Andrés Tetepilco","Zacahuitzco"] |
| municipality | String | Municipality where is located the zip code provided |
| city | String | City where is located the zip code provided |
| state | Object | Mexican State where is located the zip code provided. |
Curl example
curl --location --request GET '{{api_base_url}}/autofin/api/catalogs/zip-code/{{zip-code}}' \--header 'Authorization: Bearer {{access_token}}'
Response example
{"zipCode": "09440","neighborhoods": ["El Retoño","San Andrés Tetepilco","Zacahuitzco"],"municipality": "Iztapalapa","city": "Ciudad de México","state": {"id": "CDMX","name": "Ciudad de México"}}
Possible errors
Consult possible error returns, click here.Auto catalogs
With these 3 endpoints you could select an auto. You just have to follow the next steps:
Obtain brands by year
Request information
| HTTP method | URL | Example |
|---|---|---|
| GET | {{api_base_url}}/autofin/api/catalogs/years/{{year}}/brands | https://stg-api.creditas.io/mx/b2b/autofin/api/catalogs/years/2020/brands |
{{year}}: Is the year of the auto.
Request response status
The service will return a 200 status the next response body.Request response body
| Field | Type | Description |
|---|---|---|
| [] | Object list | Is a list of brands available in that year |
| Object.id | String | Identifier of the brand. |
| Object.name | String | Commercial name of the brand. |
Curl example
curl --location --request GET '{{api_base_url}}/autofin/api/catalogs/years/{{year}}/brands' \--header 'Authorization: Bearer {{access_token}}'
Response example
[{"id": "910","name": "Acura"},{"id": "920","name": "Alfa Romeo"},{"id": "950","name": "Audi"},{"id": "930","name": "Baic"}]
Obtain brands by year and brand
Request information
| HTTP method | URL | Example |
|---|---|---|
| GET | {{api_base_url}}/autofin/api/catalogs/years/{{year}}/brands/{{brandId}}/models | https://stg-api.creditas.io/mx/b2b/autofin/api/catalogs/years/2020/brands/910/models |
{{year}}: Is the year of the auto.
{{brandId}}: Is the id of the brand obtained from auto brands
Request response status
The service will return a 200 status the next response body.Request response body
| Field | Type | Description |
|---|---|---|
| [] | Object list | Is a list of model available in that year by brand |
| Object.id | String | Identifier of the model. |
| Object.name | String | Commercial name of the model. |
Curl example
curl --location --request GET '{{api_base_url}}/autofin/api/catalogs/years/{{year}}/brands/{{brandId}}/models' \--header 'Authorization: Bearer {{access_token}}'
Response example
[{"id": "528","name": "ILX"},{"id": "801","name": "MDX"},{"id": "802","name": "RDX"}]
Obtain versions by year, brand and model
Request information
| HTTP method | URL | Example |
|---|---|---|
| GET | {{api_base_url}}/autofin/api/catalogs/years/{{year}}/brands/{{brandId}}/models{{modelId}}/versions | https://stg-api.creditas.io/mx/b2b/autofin/api/catalogs/years/2020/brands/910/models/528/versions |
{{year}}: Is the year of the auto.
{{brandId}}: Is the id of the brand obtained from auto brands
{{modelId}}: Is the id of the model obtained from auto models
Request response status
The service will return a 200 status the next response body.Request response body
| Field | Type | Description |
|---|---|---|
| [] | Object list | Is a list of versions available in that year by brand and model |
| Object.id | String | Identifier of the version. |
| Object.name | String | Commercial name of the version. |
Curl example
curl --location --request GET '{{api_base_url}}/autofin/api/catalogs/years/{{year}}/brands/{{brandId}}/models/{{modelId}}/versions' \--header 'Authorization: Bearer {{access_token}}'
Response example
[{"id": "2020910802280","name": "5p Tech L4/2.0/T Aut"},{"id": "2020910802290","name": "5p A Spech L4/2.0/T Aut"}]