Pecuario.Backend

<back to all web services

RequestCredit

The following routes are available for this service:
POST/api/v1/credit/request
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class Status:
    message: Optional[str] = None
    status_code: int = 0


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class BaseResponse:
    status: Optional[Status] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class RequestCreditResponse(BaseResponse):
    id: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class RequestCredit(IPost):
    nombre: Optional[str] = None
    dpi: Optional[str] = None
    fecha_de_nacimiento: Optional[str] = None
    telefono: Optional[str] = None
    monto_a_financiar: Optional[Decimal] = None
    region_id: int = 0
    city_id: int = 0

Python RequestCredit DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv

HTTP + JSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /api/v1/credit/request HTTP/1.1 
Host: pecuario-backend.develsystems.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	nombre: String,
	dpi: String,
	fechaDeNacimiento: String,
	telefono: String,
	montoAFinanciar: 0,
	regionId: 0,
	cityId: 0
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	id: String
}