API general data types
Content:
Primitive types:
Structured types:
Primitive types:
Date
Must be string in format Y-m-d.
DateTime
Must be string in format Y-m-d H:i:s.
Structured types:
FieldError
Only output.
| Property | Type | Description |
|---|---|---|
field | string | Name of the input field. |
message | string | Human-readable description of the problem. Can be localized. |
Translation
Object where key is Language identifier and value is translation for this language or null.
Input behaviour
- When input field is required, must contain translations for all languages.
- Can contain translations only for languages.
- When translations for some languages are missing, they are considered as null value.
Output behaviour
- Contains translations for all languages - by default.
- When translation for language is not available,
valueis null for this language.
Example:
{
"ces": "český překlad",
"eng": "english translation"
}
Amount
This data type is used for representing amount for specific Currency.
Key of this object must always be Currency identifier.
Input behaviour
- When input field is required, must contain values for all currencies.
- Can contain values only for currencies.
- When values for some currencies are missing, they are considered as null value.
Example:
{
"CZK": 25899.99,
"EUR": null
}
Output behaviour
- Contains values for all currencies - by default.
- Always contains formatted value for the currency.
- When value for currency is not available, value is
nullfor this currency.
Example:
{
"CZK": {
"value": 25899.99,
"formatted": "25 899,99 Kč"
},
"EUR": null
}
DateTimeRange
| Property | Type | Description | Input Requirements |
|---|---|---|---|
from | DateTime | Date and time where range starts | Required. |
to | DateTime | Date and time where range ends | Required. |
NullableDateTimeRange
| Property | Type | Description | Input Requirements |
|---|---|---|---|
from | DateTime or null | Date and time where range starts | Nullable. |
to | DateTime or null | Date and time where range ends | Nullable. |
Length
This data type object with following properties:
| Property | Type | Description | Input Requirements |
|---|---|---|---|
unit | string | metric / imperial unit | Required. Must be value of enumerator "length_unit". |
value | float | decimal value | Required. Must be valid decimal value. |
Weight
This data type object with following properties:
| Property | Type | Description | Input Requirements |
|---|---|---|---|
unit | string | IS / imperial / US unit | Required. Must be value of enumerator "weight_unit". |
value | float | decimal value | Required. Must be valid decimal value. |