API flow

Index

Diagram

This is the flow that you need to follow in order to create a request for a credit.

Lead status

statusdescription
INCOMPLETEMissing information
COMPLETEHas all the information
PQ_PENDINGThe lead is processing by consultants
DOCUMENTS_PENDINGThe client has to send documents
DOCUMENTS_ANALYSISThe consultants are reviewing documents
CREDIT_APPROVEDThe credit has been approved
CREDIT_SIGNEDThe client has to sign the credit
REJECTEDThe offer is rejected

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 URLExample

POST

{{api_base_url}}/autoequity/api/leads

Request body

Field TypeDescription

phone

String

Client's phone number of 10 characters, only mexican numbers are allowed. Ex: "9512138126"

email

String

The client email Ex: pq-approved@creditas.com

loanAmount

Number

The amount in MXN to request. Ex: 120000

term

Number

The Number of monthly payments to settle the credit, possible values: 24, 36, 48 or 60. Ex: 24

In Staging environment, the following emails should be used so as not to actually consult the credit history:

Email Prequalification result

pq-approved@creditas.com

APPROVED

pq-manual-review@creditas.com

MANUAL_REVIEW

pq-direct-rejected@creditas.com

REJECTED

Request response status

The service will return a 201 status code with the next response:

Request response body

Field TypeDescription

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}}/autoequity/api/leads' \
--header 'Authorization: Bearer {{access_token}}
--header 'Content-Type: application/json' \
--data-raw '{
"phone": "9128463859",
"email" : "pq-approved@creditas.com",
"loanAmount" : 120000,
"term" : 24
}'

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 URLExample

POST

{{api_base_url}}/autoequity/api/leads/{{leadId}}/person

Request body

Field TypeDescription

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 body

Curl example

curl --location --request POST '{{api_base_url}}/autoequity/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 URLExample

PUT

{{api_base_url}}/autoequity/api/leads{{leadId}}/address

Request body

Field TypeDescription

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 body

Curl example

curl --location --request PUT '{{api_base_url}}/autoequity/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 URLExample

PUT

{{api_base_url}}/autoequity/api/leads{{leadId}}/financial

Request body

Field TypeDescription

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

Request response status

The service will return a 204 status with a empty response body.

Curl example

curl --location --request PUT '{{api_base_url}}/autoequity/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"
}'

Possible errors

Consult possible error returns, click here.

Auto information

We this endpoint you send the auto that is property of the lead. This endpoint works with the auto catalog.

Request information

HTTP method URLExample

PUT

{{api_base_url}}/autoequity/api/leads{{leadId}}/auto

Request body

Field TypeDescription

id

String

Is the auto version id, check auto catalog Ex: "2020910528260"

Request response status

The service will return a 204 status with a empty response body

Curl example

curl --location --request PUT '{{api_base_url}}/autoequity/api/leads/{{leadId}}/auto' \
--header 'Authorization: Bearer {{access_token}}' \--header 'Content-Type: application/json' \
--data-raw '{
"id" : "2020910528260"
}'

Possible errors

Consult possible error returns, click here.

Send 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 for this cases the default PIN is 123456

Request information

HTTP method URLExample

POST

{{api_base_url}}/autoequity/api/leads/{{leadId}}/pin

Request body

Field TypeDescription

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 body

Curl example

curl --location --request POST '{{api_base_url}}/autoequity/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:

Email Prequalification result

pq-approved@creditas.com

APPROVED

pq-direct-rejected@creditas.com

MANUAL_REVIEW

pq-manual-review@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 URLExample

POST

{{api_base_url}}/autoequity/api/leads/{{leadId}}/offer

Request body

Field TypeDescription

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}}/autoequity/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 body

Request response body

Field TypeDescription

prequalification

Boolean

It determines if the lead has a pre-approved offer

result

String Enum ["APPROVED", "MANUAL_REVIEW", "REJECTED"]

  • APPROVED - Generates a preaproved offer.
  • MANUAL_REVIEW - The operative team will review the information and will send a counter offer if available.
  • REJECTED - We don't send any offer.

offer

Object Nullable.

The pre-approved offer or counter offer. If the lead is not automatically prequalified this object will be null

offer.id

UUID (String)

Generated offer identifier

offer.annualInterestRate

Number

Annual interest to apply

offer.monthlyPayment

Number

Monthly payments to be made

offer.term

Integer

Number of months to pay back the loan

offer.loanAmount

Number

Amount to lend

offer.auto

Object

Data of the selected car, this auto can be changed later

offer.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.

offer.amountFinanced

Number

Total amount financing includes GPS cost and aperture commission

Response example

{
"prequalification": true,
"result": "APPROVED",
"offer": {
"id": "973f5181-68f1-447b-bf21-326a51e84ab1",
"annualInterestRate": 31.08,
"monthlyPayment": 7652.9,
"term": 24,
"loanAmount": 120000,
"auto": {
"make": "Acura",
"model": "ILX",
"year": 2020,
"price": null,
"officialPrice": 282100
},
"loanType": "REQUESTED",
"amountFinanced": 123850.26
}
}

Possible errors

Consult possible error returns, click here.

Update contact information

Update the email or phone contact.

Request information

HTTP method URLExample

PUT

{{api_base_url}}/autoequity/api/leads/{{leadId}}/contact

Request body

Field TypeDescription

phone

String

Client's phone number of 10 characters, only mexican numbers are allowed. Ex: "9512138126"

email

String

The client email Ex: pq-approved@creditas.com

Curl example

curl --location --request PUT '{{api_base_url}}/autoequity/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 204

Possible errors

Consult possible error returns, click here.

Consult lead's information

With this endpoint you can consult the information of an specific lead.

Request information

HTTP method URLExample

GET

{{api_base_url}}/autoequity/api/leads/{{leadId}}

Request response status

The service will return a 200 status with the next response body

Request response body

Field TypeDescription

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 and loanAmmount

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 and monthlyIncome. 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.

status

String

INCOMPLETE, COMPLETE, PQ_PENDING, DOCUMENTS_PENDING, DOCUMENTS_ANALYSIS, CREDIT_APPROVED, CREDIT_SIGNED, REJECTED

preApprovingResult String Nullable. Allow filter by pre approving result can be more than one: APPROVED, MANUAL_REVIEW, REJECTED

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": "c8a66afe-640d-4492-b327-90e02d2b012d",
"contact": {
"email": "pq-approved@creditas.com",
"phone": "9128463859"
},
"createdAt": "2023-10-19T15:08:36.211789",
"updatedAt": "2023-10-19T15:10:29.797814",
"loanInformation": {
"term": 24,
"loanAmount": 120000
},
"personalInformation": {
"firstName": "Javier",
"secondName": "",
"lastName": "Solis",
"secondLastName": "Guzman",
"birthDate": "1993-04-26",
"rfc": "TEUR9010199I4"
},
"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
},
"financialInformation": {
"employmentType": "RETIRED",
"monthlyIncome": 5000
},
"nipConfirmationDate": null,
"isComplete": false,
"isPq": false
}

Possible errors

Consult possible error returns, click here.

Consult all leads

With this endpoint you can consult the information about your leads.

Request information

HTTP methodURL

GET

{{api_base_url}}/autoequity/api/leads

Query params

NameExampleDescription
name username Search leads with contains
rfc SOGJ930426EKA Search by exactly rfc
status COMPLETE Allow filter by status can be more than one: INCOMPLETE, COMPLETE, PQ_PENDING, DOCUMENTS_PENDING, DOCUMENTS_ANALYSIS, CREDIT_APPROVED, CREDIT_SIGNED, REJECTED
preApprovingResult MANUAL_REVIEW Allow filter by pre approving result can be more than one: APPROVED, MANUAL_REVIEW, REJECTED
email email@gmail.com Search by exactly email
createdFrom 2023-11-01T09:30:00 Search leads with creationDate greater than a date in format yyyy-MM-dd'T'HH:mm:ss
createdTo 2023-11-01T09:30:00 Search leads with creationDate less than a date in format yyyy-MM-dd'T'HH:mm:ss
sort updatedAt,desc Allow sort by createdAt and updatedAt fields separated by a coma the order
page number The result page. Default 1
size number The result size page. Default 20

Curl example

curl --location '{{api_base_url}}/autoequity/api/leads?sort=updatedAt%2Cdesc&size=3&page=4' \
--header 'Authorization: Bearer {{access_token}}' \

Request response status

The service will return a 200 status with the next response body

Request response body

FieldTypeDescription

content.id

String UUID

Identifier of the lead.

content.fullName

String

Full name

content.rfc

String Nullable.

RFC

content.status

String

INCOMPLETE, COMPLETE, PQ_PENDING, DOCUMENTS_PENDING, DOCUMENTS_ANALYSIS, CREDIT_APPROVED, CREDIT_SIGNED, REJECTED

content.email

String

Email

content.phone

String

Phone

content.loanAmount

number Nullable.

Loan amount

content.preApprovingResult

String Nullable.

APPROVED, MANUAL_REVIEW, REJECTED

content.createdAt

String

Date time of creation lead

content.updatedAt

String

Date time of the last update to the lead information.

content.isComplete

Boolean

If the lead has personal information, address, auto and has nip confirmed

content.isPq

Boolean

If the lead has a pre qualification successful

Response example

{
"content": [
{
"id": "86b7fd6a-1d6d-4a81-b474-8b0dab435adb",
"fullName": "Javier Solis Guzman",
"rfc": "BUWY900905XO5",
"status": "COMPLETE",
"email": "pq-approved@creditas.com",
"phone": "9128463859",
"loanAmount": 120000.0,
"preApprovingResult": "APPROVED",
"createdAt": "2023-12-20T22:04:17.722156",
"updatedAt": "2023-12-21T18:26:23.601086",
"isComplete": true,
"isPq": false
}
],
"empty": false,
"first": true,
"last": true,
"number": 0,
"numberOfElements": 1,
"size": 20,
"sorted": true,
"totalElements": 1,
"totalPages": 1
}

Possible errors

Consult possible error returns, click here.

Catalogs

Zip code information

Request information

HTTP method URLExample

GET

{{api_base_url}}/autoequity/api/catalogs/zip-code/{{zip-code}}

{{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 TypeDescription

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}}/autoequity/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 URLExample

GET

{{api_base_url}}/autoequity/api/catalogs/years/{{year}}/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 TypeDescription

[]

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}}/autoequity/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 URLExample

GET

{{api_base_url}}/autoequity/api/catalogs/years/{{year}}/brands/{{brandId}}/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 TypeDescription

[]

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}}/autoequity/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 URLExample

GET

{{api_base_url}}/autoequity/api/catalogs/years/{{year}}/brands/{{brandId}}/models{{modelId}}/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 TypeDescription

[]

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}}/autoequity/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"
}
]