| Required role: | Tartarus.Read |
| GET,POST | /api/citi-bank-statement |
|---|
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
class BankEntryType(IntEnum):
BALANCE = 1
TRANSACTION = 2
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CitiBankAccountEntry:
entry_type: Optional[BankEntryType] = None
description: Optional[str] = None
amount: Optional[Decimal] = None
currency_code: Optional[str] = None
credit_debit_indicator: Optional[str] = None
entry_date: Optional[datetime.datetime] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CitiBankEntriesResponse:
response_status: Optional[ResponseStatus] = None
statement_is_still_generating: bool = False
entries: List[CitiBankAccountEntry] = field(default_factory=list)
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class RetrieveCitiBankStatementRequest(IGet, IPost):
statement_id: Optional[str] = None
Python RetrieveCitiBankStatementRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /api/citi-bank-statement HTTP/1.1
Host: tartarus.nephila.com
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
statementId: String
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
responseStatus:
{
errorCode: String,
message: String,
stackTrace: String,
errors:
[
{
errorCode: String,
fieldName: String,
message: String,
meta:
{
String: String
}
}
],
meta:
{
String: String
}
},
statementIsStillGenerating: False,
entries:
[
{
entryType: Balance,
description: String,
amount: 0,
currencyCode: String,
creditDebitIndicator: String,
entryDate: 0001-01-01
}
]
}