Updates

The following items are the latest updates and changes from the previous versions:

1.0.2

  • - Updated example cURL requests from using --form option to --data
  • - Add OTHERS option for occupation field. See in Models section

1.0.1

  • - Clarified the process on how to authenticate requests using Basic Authentication header
  • - Moved options for the fields: housing_type, marital_status, occupation to the Models section
  • - Added description for the values of nationality field directing to the Countries in Models section
  • - Added field validation, e.g. regex, length, in Description column on the Send Lead method in the Endpoints section
  • - Changed address[flat_number] field from required to optional
  • - Updated description for the following fields: loan_period, employed_since
  • - Updated field validations for the following fields: car_plate_number
  • - Updated data types for the following fields: loan_sum, loan_period, agreements
  • - Added asnef-membership field as an optional field and default value is NO
  • - Legal consents fields, i.e. data_processing_policy and terms_of_services are merged into one field (legal_consent)
  • - Additional consent field is added for email/electronic subscription for receiving up-to-date Casheddy news and offers

Get Started

This is the full documentation of Casheddy API. This documentation provides integration for sending lead data to partners via Casheddy services.

The Content-Type header for each requests should be set to 'application/json'. Furthermore, responses for each request are in the form of JSON.

Responses may contain the following properties: data, message, errors, success.
  -  The data properties contains the data returned by the request as either array or object.
  -  The message is a string explaining the output of the request.
  -  The errors contain an array of any errors and may contain field names and their corresponding errors.
  -  The success properties is a boolean flag whether the request succeeded or not.

Authorization

For requests to be accepted, each request needs to be authenticated using HTTP Basic Authentication in the form of a header with username and password. You can contact the administrator to get the credentials (username and password).

The credentials may be in the form of 'username:password' and encoded in base64 format. You may talk a look at the Authorization header in the sample cURL requests below.

This kind of authentication have no expiration since the credentials are registered as an Application Passwords (same as an API key).

Endpoint

Use the following base URL for each request:

development :   https://dev.casheddy.es/wp-json/api

Endpoints

ValidatePOST

This validates username and password for authentication
URL: /v1/validate

                
            curl -X POST 'https://dev.casheddy.es/wp-json/api/v1/validate' \
            -H 'Content-Type: application/json' \
            -d '{
                "username": "username",
                "password": "password",
            }'
        
            

Body Parameters

Field Type Required Description
username string YES Your username
password string YES Your password

                
Success:
{ "data": { "message": "User is valid!" }, "message": "OK", "success": true }
Error:
{ "message": "Invalid/incorrect username or password", "success": false }

Send leadPOST

This tries to send lead to partners in the order specified in Casheddy.
URL: /v1/lead/send

                
            curl -X POST 'https://dev.casheddy.es/wp-json/api/v1/lead/send' \
            -H 'Content-Type: application/json' \
            -H 'Authorization: Basic Y2FzaVGk2AHktXYBpOk241SmogT1J3NyBhUNHaIDBNdk8gJFV5aCBRMz1M' \
            -d '{
                "loan_sum": 200,
                "loan_period": 91,
                "first_name": "Kyle",
                "last_name": "Trazo",
                "second_last_name": "Pogi",
                "personal_id": "60604016M",
                "email": "kyle@blendit.eu",
                "phone": "608 819 736",
                "agreements": {
                    "legal_consent": true,
                    "subscription": true
                },
                "address": {
                    "postal_code": "33560",
                    "city": "Ribadesella",
                    "street": "Maestro Puig Valera",
                    "house_number": "35",
                    "flat_number": "13"
                },
                "housing_type": "RENTED_ROOM",
                "gender": "MALE",
                "birth_date": "1985-06-18",
                "nationality": "España",
                "marital_status": "MARRIED",
                "phone_plan": "CONTRACT",
                "occupation": "EMPLOYED_INDEFINITE_PERIOD",
                "neto_income": "10000",
                "monthly_expenses": "1000",
                "employed_since": "2021-03-02",
                "remuneration_deadline": "2023-05-02",
                "dependant_count": "1",
                "car_owner": "YES",
                "car_plate_number": "1234 RST",
                "bank_account": "ES5020803294338752239563",
                "ip_address": "180.190.166.143"
            }'
        
            

Body Parameters

Field Type Required Description
ip_address string YES IP address of the device you're using
regex:/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\z/
loan_sum integer YES Amount of the loan request
loan_period integer YES Period of the requested load in days
first_name string YES Customer's first name
min:3
last_name string YES Customer's last name
min:3
second_last_name string NO Customer's middle name
personal_id string YES Customer's personal ID. Can be DNI, NIE or CIF type.
DNI - regex:/^(([KLM]\d{7})|(\d{8}))([A-Z])$/ , NIE - regex:/^([ABCDEFGHJNPQRSUVW])(\d{7})([0-9A-J])$/ , CIF - regex:/^([XYZ])(\d{7,8})([A-Z])$/
email string YES Customer's email address
phone string YES Customer's phone number
length:11, regex:/^[67][0-9]{2}\s[0-9]{3}\s[0-9]{3}$/
agreements[legal_consent] boolean YES This value should be 1.
DETAIL: I confirm that I have read and accept the Terms and Conditions and the Data Processing Policy.

DETALLE: Confirmo que he leído y acepto los Términos y condiciones y la Política de procesamiento de datos.

agreements[subscription] boolean YES This value should be 1. You may opt out any time and unsubscribe.
DETAIL: I consent to be up to date with the latest news and receive special offers and discounts by any means, including electronic communications or the equivalent from CashEddy.

address[postal_code] string YES Postal code of the customer's address
regex:/^(0[1-9]|[1-4][0-9]|5[0-2])[-]{0,1}\d{3}$/
address[city] string YES City name of the customer's address
regex:/^[a-záéèíñóúüç\s'-]+$/ui
address[street] string YES Street name of the customer's address
regex:/^[a-záéèíñóúüç\s'-]+$/ui
address[house_number] string YES House number of the customer's address
regex:/^\d+[a-záéèíñóúüç]?$/ui
address[flat_number] string NO Flat number of the customer's address
regex:/^[a-zA-ZÀ-ÖØ-öø-ÿ0-9 ]+$/i
housing_type string YES Housing type. See 'Housing Types' in Models section for possible values
gender string YES Customer's gender. Value should be either MALE or FEMALE
birth_date string YES Customer's birthdate in yyyy-mm-dd format. Note that the corresponding age should be between 18 to 80 years
nationality string YES Customer's nationality. See 'Countries' in Models section for possible values
marital_status string YES Customer's marital status. See 'Marital Status' in Models section for possible values
phone_plan string NO (Default: PREPAID) Customer's phone plan. May be one of the following: PREPAID, CONTRACT
occupation string YES Customer's type of occupation. See 'Employments' in Models section for possible values
neto_income string YES Customer's income
minVal:1
monthly_expenses string YES Customer's monthly expenses
minVal:1
employed_since string YES Customer's current employment date or retirement started. Should be before today's date in yyyy-mm-dd format
remuneration_deadline string YES Customer's next salary date. Should be after today's date in yyyy-mm-dd format
dependant_count string NO Customer's number of dependants
minVal:0
car_owner string NO (Default: NO) Does the customer owns a car? Should be either YES or NO
car_plate_number string NO Plate number of customer's car. Required only if car_owner is YES
regex:/^\d{4}\s*[BCDFGHJKLMNPRSTVWXYZ]{3}|[A-Z]{2,3}\s*\d{4}\s*[A-Z]{2}$/
bank_account string YES IBAN number or customer's bank account
regex:/^ES[0-9]*/
asnef-membership string NO (Default: NO) ASNEF registered

                
Success:
{ "data": { "lead_id": "1af30231-ad0d-4e9e-a0ab-b28ceedcf983", "message": "accepted", "redirect_url": "https://dev.casheddy.es/redirect?lead_id=1af30231-ad0d-4e9e-a0ab-b28ceedcf983", "responses": [ { "status": 200, "error_message": null } ] }, "message": "OK", "success": true }
Error:
{ "data": { "status": "failed", "responses": [ { "status": 422, "results": [ { "field": "phone_plan", "message": "Tipo de contrato no puede estar vacío." } ], "error_message": null } ], }, "message": "Error", "success": false }

Models

The following listed models are possible value for certain fields.

Employments

Value Description
EMPLOYED_INDEFINITE_PERIOD Employed without a time limit or with an indefinite period
ECONOMIC_ACTIVITY Runs own company or business
STUDENT Student or a job trainee
MATERNITY_LEAVE Currently on a period of absence due to maternity/pregnancy
PENSIONER1 Retired and/or receiving pension
UNEMPLOYED Not having any type of employment
OTHERS When type of employment is not mentioned above

Housing Types

Value Description
RENTED_ROOM Rents a single room
RENTED_APARTMENT_OR_HOUSE Rents an entire house or an apartment
OWN_HOUSE_OR_APARTMENT Owns a house or an apartment
WITH_PARENTS Living with parents or relatives

Marital Status

Value Description
SINGLE Living alone
MARRIED Legally married (on paper)
DIVORCED Living alone and recently divorced
WITH_PARTNER Living with someone on the same address
WIDOW Partner has died and has not married again

Countries

España Estados Unidos Mexicanos United States
Colombia Afghanestan Al Arabiyah as Suudiyah
Al Bahrayn Al Imarat al Arabiyah al Muttahidah Al Kuwayt
Al Maghrib Al Yaman Al-Urdunn
American Samoa Andorra Angola
Anguilla Antarctica Antigua and Barbuda
Aomen Aotearoa Argentina
Aruba As-Sudan Australia
Azarbaycan Bahamas Bangladesh
Barbados Belau Belgie
Belize Benin Bermuda
Bhutan Bod Bolivia
Bosna i Hercegovina Botswana Brasil
Bulgaria Burkina Faso Burundi
Byelarus Cabo Verde Cameroon
Canada Cayman Islands Ceska Republika
Chile Christmas Island Cocos (Keeling) Islands
Cook Islands Costa Rica Cote d'Ivoire
Cote d'Ivoire Crna Gora Cuba
Danmark Dawlat Qatar Deutschland
Dhivehi Raajje Dominica (Ouaitocoubouli) Ecuador
Eesti Vabariik Éire El Salvador
Ellas or Ellada Eswatini Filastin
Føroyar France Gabon
Ghana Gibraltar Grenada
Guadeloupe (Gwadloup) Guåhan Guatemala
Guiné-Bissau Guinea Ecuatorial Guinée
Guyana Guyane Hagärä Ertra, Tigrinya
Haiti Hanguk Hayastan
Honduras Hrvatska Ile de la Réunion
India Indonesia Iran
Iraq Ísland Islas Malvinas
Italia Ityop'iya Jabuuti, Gabuuti
Jamaica Jamhuri ya Muungano wa Tanzania Jisra'el
Kalaallit Nunaat Kampuchea Kenya
Kibris, Kypros Komori Kosovo
Kyrgysstan Lao Latvija
Lesotho Liberia Libiyah
Liechtenstein Lietuva Lubnan
Luxembourg Madagasikara Magyarorszag
Malawi Malaysia Mali
Malta Marshall Islands Martinique
Matanitu ko Viti Mauritius Mayotte
Micronesia Misr Mocambique
Moldova Monaco Mongol Uls
Montserrat Muritaniyah Myanmar, Burma
Namibia Nauru Nederland
Nederlandse Antillen Negara Brunei Darussalam Nepal
Nicaragua Niger Nigeria
Nihon or Nippon Niue Norge, Noreg
North Korea Northern Mariana Islands Nouvelle-Calédonie
Österreich Pakistan Panama
Papua Niu Gini Paraguay Peru
Pilipinas Pitcairn Island Polska
Polynésie Française Portugal Prathet Thai
Puerto Rico Qazaqstan República Dominicana
Republica Oriental del Uruguay Republique Centrafricaine République Démocratique du Congo
République du Congo Republique Togolaise Ribaberiki Kiribati
Romania Rossiya Rwanda
Saint Kitts and Nevis Saint Lucia Saint Vincent and the Grenadines
Sakartvelo Saltanat Uman Samoa
San Marino São Tomé e Príncipe Schweiz
Senegal Severna Makedonija Seychelles
Shqiperia Shqiperia Sierra Leone
Singapore Slovenija Slovensko
Solomon Islands Soomaaliya South Africa
South Sudan Srbija Sri Lanka
Status Civitatis Vaticanæ Status Civitatis Vaticanæ Suomi
Suriname Suriyah Sverige
T'ai-wan Tchad Terres Australes et Antarctiques Françaises
The Gambia Timór Loro Sa’e Tojikiston
Tokelau Tonga Trinidad, Tobago
Tunis Turkiye Turkmenistan
Turks and Caicos Islands Tuvalu Uganda
Ukrayina United Kingdom Uzbekiston Respublikasi
Vanuatu Venezuela Vietnam
Virgin Islands Wallis et Futuna Western Sahara
Xianggang Zambia Zhong Guo
Zimbabwe

Partners

horacredit flexcredit credityes
oceancredit cashtero creditprime
axicard crezu horacredit
credipuffin lunare cashtero
lunare credityes horacredit
cashtero credityes lunare
wall of offers

Errors

Casheddy API uses the following errors and some sample messages:

Code Error Description Sample message
400 Not found This error appears when certain field or option is not found. Invalid field or field not found.
400 Empty request This error appears when no request data is set or defined. Parameter must be defined or valid.
400 Invalid argument This error appears when input field is invalid such as invalid date format. Invalid request. Please specify valid data.
401 Unauthorized This error appears when request is unauthorized. Unauthorized.
500 Server error This error appears when unexpected error occurs in server-side. Server error. Please contact administrator.