Create a lead
In the examples, {{auto_financing_base_url}} is the Auto Financing base URL for the selected environment.
Start the integration by calling the create lead endpoint:
Request information
Section titled “Request information”| HTTP method | URL | Example |
|---|---|---|
| POST | {{auto_financing_base_url}}/api/leads |
Request body
Section titled “Request body”| Field | Type | Description |
|---|---|---|
| phone | String | The applicant’s 10-digit phone number. Only Mexican numbers are accepted. Ex: “9512138126” |
| | String | The applicant’s email address Ex: pq-approved@creditas.com |
| downPayment | number | The down payment in MXN. A value greater than 20% of the vehicle price is recommended. Ex: 30000 |
| term | number | The number of monthly installments. Allowed values: 24, 36, 48, or 60. Ex: 24 |
| externalAutoId | String | Optional. Send the vehicle identifier when your catalog is integrated with Creditas. Ex: “MLM1496685003” |
To avoid checking real credit history in staging, use one of these test email addresses:
Section titled “To avoid checking real credit history in staging, use one of these test email addresses:”| Prequalification outcome | |
|---|---|
| APPROVED | |
| REJECTED |
Request response status
Section titled “Request response status”The service returns 201 Created with the following response:
Request response body
Section titled “Request response body”| Field | Type | Description |
|---|---|---|
| id | UUID (String) | The lead identifier. Use it in subsequent requests as {{leadId}}. Ex: “2341b2c8-8e84-4a5a-aac6-9dda4410e999” |
cURL example
Section titled “cURL example”curl --location --request POST '{{auto_financing_base_url}}/api/leads' \--header 'Authorization: Bearer {{access_token}}' \--header 'Content-Type: application/json' \--data-raw '{ "phone": "9128463859", "email" : "pq-approved@creditas.com", "downPayment" : 30000, "term" : 24, "externalAutoId": "MLM1496685003"}'Possible errors
Section titled “Possible errors”Review the possible error responses.
Save personal information
Section titled “Save personal information”After creating the lead, provide the applicant’s personal information.
Request information
Section titled “Request information”| HTTP method | URL | Example |
|---|---|---|
| POST | {{auto_financing_base_url}}/api/leads/{{leadId}}/person | https://stg-api.creditas.io/mx/b2b/autofin/api/leads/2341b2c8-8e84-4a5a-aac6-9dda4410e999/person |
Request body
Section titled “Request body”| Field | Type | Description |
|---|---|---|
| firstName | String | The applicant’s first name. Ex: “Javier” |
| secondName | String | The applicant’s middle name. Omit this field when it does not apply. Ex: “Jair” |
| lastName | String | The applicant’s first surname. Ex: “Gonzalez” |
| secondLastName | String | The applicant’s second surname. Ex: “Gonzales” |
| birthDate | String | The applicant’s date of birth in |
| rfc | String | The applicant’s RFC. Ex: “GOGJ931128C83” |
Request response status
Section titled “Request response status”The service returns 204 No Content with an empty response body.
cURL example
Section titled “cURL example”curl --location --request POST '{{auto_financing_base_url}}/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
Section titled “Possible errors”Review the possible error responses.