| Requires any of the roles: | Client, Admin, Partner |
| POST | /currency_rates |
|---|
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 CurrencyRatesAddResponse:
tenants_id: int = 0
from_currencies_id: int = 0
to_currencies_id: int = 0
exchange_rate: float = 0.0
effective_date: datetime.datetime = datetime.datetime(1, 1, 1)
response_status: Optional[ResponseStatus] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CurrencyRatesAdd:
# @Validate(Validator="NotNull")
tenants_id: int = 0
# @Validate(Validator="NotNull")
from_currencies_id: int = 0
# @Validate(Validator="NotNull")
to_currencies_id: int = 0
# @Validate(Validator="NotNull")
exchange_rate: float = 0.0
# @Validate(Validator="NotNull")
effective_date: datetime.datetime = datetime.datetime(1, 1, 1)
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 /currency_rates HTTP/1.1
Host: duengageapi.uat.scadsoftware.com
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
TenantsId: 0,
FromCurrenciesId: 0,
ToCurrenciesId: 0,
ExchangeRate: 0,
EffectiveDate: 0001-01-01
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
TenantsId: 0,
FromCurrenciesId: 0,
ToCurrenciesId: 0,
ExchangeRate: 0,
EffectiveDate: 0001-01-01,
ResponseStatus:
{
ErrorCode: String,
Message: String,
StackTrace: String,
Errors:
[
{
ErrorCode: String,
FieldName: String,
Message: String,
Meta:
{
String: String
}
}
],
Meta:
{
String: String
}
}
}