NAV Navbar
LoanMaster v2.8
Documentatie API-uri
shell live testing

Introducere

Această secțiune vă oferă acces la documentația completă pentru API-urile noastre publice, concepute pentru gestionarea eficientă a informațiilor asociate cu membrii (inclusiv detaliile conturilor de membru, creditele disponibile, istoricul plăților și inițierea de noi tranzacții).

Inregistrare cont nou

Inregistrarea unui client se face prin acest API. Daca toate datele sunt OK, atunci serverul returneaza un token (X-Authorization) care trebuie trimis in toate cererile prin intermediul unui header HTTP. De asemenea clientul primeste un cod de access pe email, care impreuna cu headerul X-Authorization trebuie utilizate in metoda PUT din API-ul de Autentificare.

# POST /api/external/v1/customers/register
curl  -X POST "https://casedeajutorreciproc.ro/api/external/v1/customers/register" \ 
      -H "X-Authorization: XXXXXXX" \ 
      -d "company_token=some_string" \ 
      -d "first_name=some_string" \ 
      -d "last_name=some_string" \ 
      -d "cnp=some_string" \ 
      -d "mobile=some_string" \ 
      -d "email=john.doe@example.com" \ 
      -d "email_confirm=john.doe@example.com" \ 
      -d "password=random_gOoD_p@ssword!" \ 
      -d "password_confirm=random_gOoD_p@ssword!" \ 
      -d "accept_terms_and_conditions=some_string" \ 
      -d "accept_marketing=some_string"

# outputs following data types: 
{
    "code": 200,
    "message": "Success",
    "data": {
        "X-Authorization": "string. Used as X-Authorization HTTP header. Requires step-2 (via PUT method) to be activated."
    }
}

POST /api/external/v1/customers/register

Parameter Required? Type Description
company_token Yes string Se poate genera din Dashboard pe pagina /dashboard/software/api
first_name Yes string Prenumele clientului.
last_name Yes string Numele de familie al clientului.
cnp Yes cnp CNP-ul clientului.
mobile Yes phone Nr. de mobil al clientului.
email Yes email Adresa de email
email_confirm Yes email Repetare adresa de email pentru a evita greselile.
password Yes password Noua parola a contului.
password_confirm Yes password Repetati noua parola a contului.
accept_terms_and_conditions Yes boolean Acordul clientului asupra termenilor si conditiilor CAR-ului dumneavoastra.
accept_marketing Yes boolean Acordul clientului pentru abonare la newsletter.

Autentificare

Autentificarea unui client se face in doua etape.

Prima etapa: obtinerea tokenului clientului prin metoda POST. Pentru acest pas este necesar un token de companie, obtinut din Dashboard, pagina API, precum si credentialele clientului.

A doua etapa: activarea tokenului clientului se va face prin metoda PUT, utilizand tokenul generat la pasul anterior, precum si codul trimis prin EMAIL catre client.

# POST /api/external/v1/customers/auth
curl  -X POST "https://casedeajutorreciproc.ro/api/external/v1/customers/auth" \ 
      -d "company_token=some_string" \ 
      -d "email=john.doe@example.com" \ 
      -d "password=random_gOoD_p@ssword!"

# outputs following data types: 
{
    "code": 200,
    "message": "Success",
    "data": {
        "X-Authorization": "string. Used as X-Authorization HTTP header. Requires step-2 (via PUT method) to be activated."
    }
}

POST /api/external/v1/customers/auth

Parameter Required? Type Description
company_token Yes string Se poate genera din Dashboard pe pagina /dashboard/software/api
email Yes email Este adresa de email a clientului, atunci cand i s-a creat contul in aplicatie de catre personalul CAR-ului.
password Yes password Parola initiala este alcatuita din ultimele 6 cifre ale CNP-ului. Dupa prima autentificare utilizatorul trebuie sa isi schimbe parola.
# PUT /api/external/v1/customers/auth
curl  -X PUT "https://casedeajutorreciproc.ro/api/external/v1/customers/auth" \ 
      -H "X-Authorization: XXXXXXX" \ 
      -d "2fa_code=some_string"

# outputs following data types: 
{
    "code": 200,
    "message": "Token activated"
}

PUT /api/external/v1/customers/auth

Parameter Required? Type Description
2fa_code Yes string Codul primit de catre client prin SMS si/sau EMAIL. Este necesar pentru activarea tokenului de client, X-Authorization.

Resetare parola

Prin acest API un client isi poate reseta parola in cazul in care a uitat-o. Precum si in API-ul de autentificare resetarea parolei se face in doi pasi.

# POST /api/external/v1/customers/reset-password
curl  -X POST "https://casedeajutorreciproc.ro/api/external/v1/customers/reset-password" \ 
      -H "X-Authorization: XXXXXXX" \ 
      -d "company_token=some_string" \ 
      -d "email=john.doe@example.com" \ 
      -d "cnp=some_string"

# outputs following data types: 
{
    "code": 200,
    "message": "Reset code sent to email!"
}

POST /api/external/v1/customers/reset-password

Parameter Required? Type Description
company_token Yes string Se poate genera din Dashboard pe pagina /dashboard/software/api
email Yes email Adresa de email
cnp Yes cnp CNP-ul clientului.
# PUT /api/external/v1/customers/reset-password
curl  -X PUT "https://casedeajutorreciproc.ro/api/external/v1/customers/reset-password" \ 
      -H "X-Authorization: XXXXXXX" \ 
      -d "company_token=some_string" \ 
      -d "email=john.doe@example.com" \ 
      -d "cnp=some_string" \ 
      -d "mail_code=12" \ 
      -d "password=random_gOoD_p@ssword!" \ 
      -d "password_confirm=random_gOoD_p@ssword!"

# outputs following data types: 
{
    "code": 200,
    "message": "Password changed!"
}

PUT /api/external/v1/customers/reset-password

In formularul de resetare a parolei este recomandata ascunderea campurilor de la metoda POST, si afisarea doar a campurilor noi: mail_code, password si password_confirm.

Parameter Required? Type Description
company_token Yes string Se poate genera din Dashboard pe pagina /dashboard/software/api
email Yes email Adresa de email
cnp Yes cnp CNP-ul clientului.
mail_code Yes integer Codul necesar pentru resetarea parolei.
password Yes password Noua parola a contului.
password_confirm Yes password Repetati noua parola a contului.

Setari utilizator

Prin acest API puteti modifica adresa de email/telefon asociate contului. Atentie! Daca schimbati un nr de telefon validat sau adresa de email validata, aceasta va necesita reverificarea campului modificat.

# GET /api/external/v1/customers/settings
curl  -X GET "https://casedeajutorreciproc.ro/api/external/v1/customers/settings" \ 
      -H "X-Authorization: XXXXXXX" \ 

# outputs following data types: 
{
    "code": 200,
    "message": "Success",
    "data": {
        "first_name": "string",
        "last_name": "string",
        "email": "email",
        "phone": "phone",
        "address": "string",
        "cnp": "cnp",
        "company_public_name": "string",
        "company_legal_name": "string",
        "company_bank_iban": "string",
        "company_logo": "string",
        "company_allow_card_payment": "integer",
        "company_testing_card_pay": "integer",
        "company_address": "string",
        "company_email": "string",
        "company_phone": "string",
        "company_cui": "string"
    }
}

GET /api/external/v1/customers/settings

Aceasta metoda utilizeaza doar headerul HTTP X-Authorization ca input.

# PUT /api/external/v1/customers/settings
curl  -X PUT "https://casedeajutorreciproc.ro/api/external/v1/customers/settings" \ 
      -H "X-Authorization: XXXXXXX" \ 
      -d "email=john.doe@example.com" \ 
      -d "phone=some_string" \ 
      -d "address=some_string"

# outputs following data types: 
{
    "code": 200,
    "message": "Success",
    "data": []
}

PUT /api/external/v1/customers/settings

Parameter Required? Type Description
email Yes email Adresa de email
phone Yes phone Numarul de telefon/mobil.
address No string Este necesara doar daca faceti plati online sau aplicati pentru credit online.

Schimbare parola

Prin acest API puteti schimba parola contului.

# POST /api/external/v1/customers/settings/change-pass
curl  -X POST "https://casedeajutorreciproc.ro/api/external/v1/customers/settings/change-pass" \ 
      -H "X-Authorization: XXXXXXX" \ 
      -d "password=random_gOoD_p@ssword!" \ 
      -d "password_confirm=random_gOoD_p@ssword!" \ 
      -d "current_password=some_string"

# outputs following data types: 
{
    "code": 200,
    "message": "Data updated"
}

POST /api/external/v1/customers/settings/change-pass

Parameter Required? Type Description
password Yes password Noua parola a contului.
password_confirm Yes password Repetati noua parola a contului.
current_password Yes string Parola actuala a contului.

Verificare nr. telefon

Prin acest API puteti verifica nr. de telefon asociat contului.

# POST /api/external/v1/customers/settings/validate-phone
curl  -X POST "https://casedeajutorreciproc.ro/api/external/v1/customers/settings/validate-phone" \ 
      -H "X-Authorization: XXXXXXX" \ 
      -d "phone=some_string"

# outputs following data types: 
{
    "code": 200,
    "message": "SMS code sent!"
}

POST /api/external/v1/customers/settings/validate-phone

Parameter Required? Type Description
phone Yes phone
# PUT /api/external/v1/customers/settings/validate-phone
curl  -X PUT "https://casedeajutorreciproc.ro/api/external/v1/customers/settings/validate-phone" \ 
      -H "X-Authorization: XXXXXXX" \ 
      -d "phone=some_string" \ 
      -d "phone_code=some_string"

# outputs following data types: 
{
    "code": 200,
    "message": "SMS code sent!"
}

PUT /api/external/v1/customers/settings/validate-phone

Parameter Required? Type Description
phone Yes phone
phone_code Yes string

Dashboard

Apeland acest API, veți obtine informatii generice (un sumar al creditelor/fondurilor/etc) utile de afisat in dashboard/homepage al aplicatiei construite.

# GET /api/external/v1/customers/dashboard
curl  -X GET "https://casedeajutorreciproc.ro/api/external/v1/customers/dashboard" \ 
      -H "X-Authorization: XXXXXXX" \ 

# outputs following data types: 
{
    "code": 200,
    "message": "Success",
    "data": {
        "fond_social_depus": "decimal",
        "fond_social_blocat": "decimal",
        "credite": [
            {
                "cont_membru": "string",
                "cont_credit": "string",
                "valoare_credit": "number",
                "nr_luni": "integer",
                "urmatoarea_data_scadenta": "date",
                "total_de_achitat_scadenta": "number"
            }
        ],
        "tranzactii": [
            {
                "id_tranzactie": "string",
                "tip_dispozitie": "string",
                "tip_tranzactie": "string",
                "suma_totala": "number",
                "data_operare": "date"
            }
        ]
    }
}

GET /api/external/v1/customers/dashboard

Aceasta metoda utilizeaza doar headerul HTTP X-Authorization ca input.

Conturi membru

Apeland acest API, veți vizualiza toate conturile de membru asociate persoanei autentificate.

# GET /api/external/v1/customers/accounts
curl  -X GET "https://casedeajutorreciproc.ro/api/external/v1/customers/accounts" \ 
      -H "X-Authorization: XXXXXXX" \ 

# outputs following data types: 
{
    "code": 200,
    "message": "Success",
    "data": [
        {
            "cont_membru": "string",
            "nr_cerere_inscriere": "integer",
            "data_inscriere": "date",
            "data_retragere": "date",
            "este_activ": "boolean"
        }
    ]
}

GET /api/external/v1/customers/accounts

Aceasta metoda utilizeaza doar headerul HTTP X-Authorization ca input.

Bonificatii

Apeland acest API, veți vizualiza toate bonificatiile asociate unui cont de membru.

# GET /api/external/v1/customers/accounts/bonifications
curl  -X GET "https://casedeajutorreciproc.ro/api/external/v1/customers/accounts/bonifications" \ 
      -H "X-Authorization: XXXXXXX" \ 
      -d "cont_membru=some_string"

# outputs following data types: 
{
    "code": 200,
    "message": "Success",
    "data": [
        {
            "an_bonificatie": "integer",
            "suma_bonificatie": "number",
            "suma_totala_retrasa": "number"
        }
    ]
}

GET /api/external/v1/customers/accounts/bonifications

Parameter Required? Type Description
cont_membru Yes string Contul de membru care identifica in mod unic un membru asociat la aceasta institutie.

Fonduri sociale

Apeland acest API, veți vizualiza toate fondurile sociale si de deces asociate unui cont de membru.

# GET /api/external/v1/customers/accounts/funds
curl  -X GET "https://casedeajutorreciproc.ro/api/external/v1/customers/accounts/funds" \ 
      -H "X-Authorization: XXXXXXX" \ 
      -d "cont_membru=some_string"

# outputs following data types: 
{
    "code": 200,
    "message": "Success",
    "data": [
        {
            "id_inregistrare": "string",
            "cont_credit": "string",
            "fond_social": "number",
            "fond_deces": "number",
            "cotizatie_car": "number",
            "data_operare": "date",
            "descriere": "string"
        }
    ]
}

GET /api/external/v1/customers/accounts/funds

Parameter Required? Type Description
cont_membru Yes string Contul de membru care identifica in mod unic un membru asociat la aceasta institutie.

Conturi de credite

Apeland acest API, veți vizualiza toate credite asociate unui cont de membru.

# GET /api/external/v1/customers/accounts/loans
curl  -X GET "https://casedeajutorreciproc.ro/api/external/v1/customers/accounts/loans" \ 
      -H "X-Authorization: XXXXXXX" \ 
      -d "cont_membru=some_string"

# outputs following data types: 
{
    "code": 200,
    "message": "Success",
    "data": [
        {
            "cont_membru": "string",
            "cont_credit": "string",
            "data_contract": "date",
            "dae": "number",
            "valoare_credit": "number",
            "status_credit": "string"
        }
    ]
}

GET /api/external/v1/customers/accounts/loans

Parameter Required? Type Description
cont_membru Yes string Contul de membru care identifica in mod unic un membru asociat la aceasta institutie.

Detalii credite

Apeland acest API, veți vizualiza scadentarul creditului, precum si totalurile de plata.

# GET /api/external/v1/customers/accounts/loans/details
curl  -X GET "https://casedeajutorreciproc.ro/api/external/v1/customers/accounts/loans/details" \ 
      -H "X-Authorization: XXXXXXX" \ 
      -d "cont_membru=some_string" \ 
      -d "cont_credit=some_string"

# outputs following data types: 
{
    "code": 200,
    "message": "Success",
    "data": {
        "summary": {
            "cont_credit": "string",
            "data_contract": "date",
            "dae": "number",
            "valoare_credit": "number",
            "nr_luni": "integer",
            "tip_rate": "string",
            "status_credit": "string",
            "total_rata_si_dobanda": "number",
            "total_penalitati": "number",
            "total_achitat_rd": "number",
            "total_rest_de_plata": "number"
        },
        "details": [
            {
                "nr_rata": "integer",
                "data_scadenta": "date",
                "rata": "number",
                "dobanda": "number",
                "total_lunar": "number",
                "penalitati": "number",
                "suma_achitata": "number",
                "rest_de_plata": "number"
            }
        ]
    }
}

GET /api/external/v1/customers/accounts/loans/details

Parameter Required? Type Description
cont_membru Yes string Contul de membru care identifica in mod unic un membru asociat la aceasta institutie.
cont_credit Yes string Contul de credit care identifica in mod unic un credit la aceasta institutie.

Tranzactii

Acest API vă permite să consultați întregul istoric de tranzacții asociat cu acest cont de membru.

# GET /api/external/v1/customers/accounts/transactions
curl  -X GET "https://casedeajutorreciproc.ro/api/external/v1/customers/accounts/transactions" \ 
      -H "X-Authorization: XXXXXXX" \ 
      -d "cont_membru=some_string"

# outputs following data types: 
{
    "code": 200,
    "message": "Success",
    "data": [
        {
            "id_tranzactie": "string",
            "cont_credit": "string",
            "tip_tranzactie": "string",
            "tip_dispozitie": {
                "I": "incasare",
                "P": "plata"
            },
            "suma_totala": "number",
            "data_operare": "date",
            "suma_reprezinta": "string",
            "nr_chitanta": "integer",
            "nr_dispozitie": "integer"
        }
    ]
}

GET /api/external/v1/customers/accounts/transactions

Parameter Required? Type Description
cont_membru Yes string Contul de membru care identifica in mod unic un membru asociat la aceasta institutie.

Plati online

Acest API vă permite să efectuați plăți către instituție folosind serviciul NETOPIA. După apelarea API-ului, veți primi un formular HTML, care trebuie trimis automat folosind JavaScript.

Este important să știți că instituția trebuie să aibă configurat un cont NETOPIA în panoul de control al platformei CaseDeAjutorReciproc.ro pentru a putea folosi acest API.

Payment ID - reprezinta ID-ul platii (comun cu procesatorul de plati)

Tranzaction ID - reprezinta ID-ul platii in aplicatia interna LoanMaster

# GET /api/external/v1/customers/online-payments
curl  -X GET "https://casedeajutorreciproc.ro/api/external/v1/customers/online-payments" \ 
      -H "X-Authorization: XXXXXXX" \ 

# outputs following data types: 
{
    "code": 200,
    "message": "Success",
    "data": [
        {
            "payment_id": "integer",
            "payment_error": "string",
            "cont_membru": "string",
            "cont_credit": "string",
            "suma_achitata": "number",
            "currency_iso": "string",
            "status_plata": "enum. with following values: unpaid | paid | canceled | credited | error | processing | unknown",
            "descriere_status": "string",
            "este_depunere_fs": "boolean",
            "created_on": "datetime",
            "tranzaction_id": "string, Apare doar dupa ce plata este procesata in graficul de credit",
            "tranzaction_processed_on": "datetime",
            "tranzaction_error": "string"
        }
    ]
}

GET /api/external/v1/customers/online-payments

Aceasta metoda utilizeaza doar headerul HTTP X-Authorization ca input.

# POST /api/external/v1/customers/online-payments
curl  -X POST "https://casedeajutorreciproc.ro/api/external/v1/customers/online-payments" \ 
      -H "X-Authorization: XXXXXXX" \ 
      -d "cont_membru=some_string" \ 
      -d "cont_credit=some_string" \ 
      -d "suma_achitata=some_string" \ 
      -d "este_depunere_fs=some_string"

# outputs following data types: 
{
    "code": 200,
    "message": "Success",
    "data": {
        "html_form": "string, which is a fully functional HTML form. It must be auto-submited using JavaScript in order to redirect user to payment page"
    }
}

POST /api/external/v1/customers/online-payments

Parameter Required? Type Description
cont_membru Yes string Contul de membru care identifica in mod unic un membru asociat la aceasta institutie.
cont_credit Yes string Contul de credit care identifica in mod unic un credit la aceasta institutie.
suma_achitata Yes number Suma care se doreste a fi achitata.
este_depunere_fs No predefined_value In functie de alegerea clientului, acesta poate fie depune bani la Fondul Social, fie sa isi achite rata la credit.

Status plati online

Acest API este public (nu necesita autorizare prin token) insa necesita token-ul platii pentru a-i putea vedea statusul. El este util pentru pagina in care este intors utilizatorul dupa efectuarea unei tranzactii.

# POST /api/external/v1/customers/online-payments/status
curl  -X POST "https://casedeajutorreciproc.ro/api/external/v1/customers/online-payments/status" \ 
      -H "X-Authorization: XXXXXXX" \ 
      -d "payment_id=12" \ 
      -d "payment_hash=some_string"

# outputs following data types: 
{
    "code": 200,
    "message": "Success",
    "data": {
        "payment_id": "integer",
        "status": "enum. with following values: unpaid | paid | canceled | credited | error | processing | unknown"
    }
}

POST /api/external/v1/customers/online-payments/status

Parameter Required? Type Description
payment_id Yes integer ID-ul tranzactiei.
payment_hash Yes string Token unic asociat acestei tranzactii.

Credite online (nefunctional)

Acest API nu functioneaza inca. Prin acest API un membru poate sa aplice la un credit online.

# GET /api/external/v1/customers/online-loans
curl  -X GET "https://casedeajutorreciproc.ro/api/external/v1/customers/online-loans" \ 
      -H "X-Authorization: XXXXXXX" \ 

# outputs following data types: 
{
    "code": 200,
    "message": "Success",
    "data": {
        "loan_request_id ": "integer",
        "loan_name": "string",
        "loan_value": "number",
        "loan_period": "integer",
        "loan_dae": "number",
        "application_step": "integer",
        "application_status": "string",
        "currency_iso": "string",
        "created_on": "datetime",
        "modified_on": "datetime"
    }
}

GET /api/external/v1/customers/online-loans

Aceasta metoda utilizeaza doar headerul HTTP X-Authorization ca input.

Step-1-loan-data

No description yet...

# POST /api/external/v1/customers/online-loans/step-1-loan-data
curl  -X POST "https://casedeajutorreciproc.ro/api/external/v1/customers/online-loans/step-1-loan-data" \ 
      -H "X-Authorization: XXXXXXX" \ 

POST /api/external/v1/customers/online-loans/step-1-loan-data

Aceasta metoda utilizeaza doar headerul HTTP X-Authorization ca input.

Step-2-personal-data

No description yet...

# POST /api/external/v1/customers/online-loans/step-2-personal-data
curl  -X POST "https://casedeajutorreciproc.ro/api/external/v1/customers/online-loans/step-2-personal-data" \ 
      -H "X-Authorization: XXXXXXX" \ 

POST /api/external/v1/customers/online-loans/step-2-personal-data

Aceasta metoda utilizeaza doar headerul HTTP X-Authorization ca input.

Step-3-documents

No description yet...

# POST /api/external/v1/customers/online-loans/step-3-documents
curl  -X POST "https://casedeajutorreciproc.ro/api/external/v1/customers/online-loans/step-3-documents" \ 
      -H "X-Authorization: XXXXXXX" \ 

POST /api/external/v1/customers/online-loans/step-3-documents

Aceasta metoda utilizeaza doar headerul HTTP X-Authorization ca input.

Step-4-credit-score

No description yet...

# POST /api/external/v1/customers/online-loans/step-4-credit-score
curl  -X POST "https://casedeajutorreciproc.ro/api/external/v1/customers/online-loans/step-4-credit-score" \ 
      -H "X-Authorization: XXXXXXX" \ 

POST /api/external/v1/customers/online-loans/step-4-credit-score

Aceasta metoda utilizeaza doar headerul HTTP X-Authorization ca input.

Step-5-payment-test

No description yet...

# POST /api/external/v1/customers/online-loans/step-5-payment-test
curl  -X POST "https://casedeajutorreciproc.ro/api/external/v1/customers/online-loans/step-5-payment-test" \ 
      -H "X-Authorization: XXXXXXX" \ 

POST /api/external/v1/customers/online-loans/step-5-payment-test

Aceasta metoda utilizeaza doar headerul HTTP X-Authorization ca input.

Step-6-credit-approval

No description yet...

# POST /api/external/v1/customers/online-loans/step-6-credit-approval
curl  -X POST "https://casedeajutorreciproc.ro/api/external/v1/customers/online-loans/step-6-credit-approval" \ 
      -H "X-Authorization: XXXXXXX" \ 

POST /api/external/v1/customers/online-loans/step-6-credit-approval

Aceasta metoda utilizeaza doar headerul HTTP X-Authorization ca input.

Step-7-final-sign

No description yet...

# POST /api/external/v1/customers/online-loans/step-7-final-sign
curl  -X POST "https://casedeajutorreciproc.ro/api/external/v1/customers/online-loans/step-7-final-sign" \ 
      -H "X-Authorization: XXXXXXX" \ 

POST /api/external/v1/customers/online-loans/step-7-final-sign

Aceasta metoda utilizeaza doar headerul HTTP X-Authorization ca input.

Tratarea erorilor

# A few examples of errors
                
# PUT /api/external/customers/auth may return following error
{
    "code": 403,
    "error_code": "token_missing",
    "message": "Missing token"
}
# or the next one, but not limited to
{
    "code": "403",
    "error_code": "token_banned",
    "message": "Token is banned due to more than three failed attempts"
}
# POST /api/external/customers/change-pass may return following error
{
    "code": "412",
    "data": {
        "current_password": "Parola este gresita"
    }
}

Toate codurile de raspuns primite inapoi de la API respecta standardul API RESTfull si pot fi tratate generic.

Codurile returnate de aplicatie sunt: