Conventions
Naming conventions
-
we use
camelCase
for all object and attribute names -
we use
CAPITAL_UNDERSCORE
for enum values -
we use plural in resource names
Paging
Some resources, as stated in the documentation, return a collection of objects that support pagination. We use a technique known as cursor-based pagination
.
To make a request:
- The query parameter
limit
specifies the maximum number of objects in the returned collection. - The query parameter
after
specifies the last object retrieved in the previous request. Its value is usually the ID of the last object retrieved in the previous call, but this will be stated in the documentation. The 'after' parameter is used when traversing the collection forward. - The query parameter
before
specifies the first object retrieved in the previous request (analogous to theafter
parameter), and is used when traversing the collection backwards. - If
before
andafter
are omitted, the beginning of the collection is returned, using the specified sort order. - Items in the collection are always sorted according to the attribute which could be passed in the
after
/before
parameters. Even if you specify a different sorting order, this attribute will be the last sorting criterion. If you do not specify a sorting order, the resulting collection will be sorted according to this attribute.
on response:
The pagingInfo
object is returned as part of the response body with the following attributes:
nextPage
- a request to retrieve the next page. EithernextPage
orpreviousPage
is returned, depending on whether you specify theafter
orbefore
parameter. If you don't specify eitherbefore
orafter
parameters, these attributes will be omitted from the response.prevPage
- a request to retrieve the previous page (seenextPage
attribute description above).itemsPerPage
- the number of items per page.
Example request
curl -X GET https://api.partner.skippay.cz/financing/v1/examples?sort=category&limit=10&after=15
Example response pagingInfo
"pagingInfo": { "nextPage": "/examples?sort=category&limit=10&after=15" "itemsPerPage": 10, }
Sorting
Some resources (as stated in documentation) support result sorting. You can specify sorting attributes and order using the sort
request parameter. For ascending order, specify just the attribute name; for descending order, add the unary -
in front of the attribute name. You can specify multiple attributes for sorting, separated by a comma. Each resource that supports sorting specifies a list of attributes that can be used for sorting.
Examples
-
/public/fxrates?sort=currencyCode
- get list of FX rates sorted by attribute currencyCode -
/public/branches?sort=-name
- get list of branches, sorted by attribute name in descending order -
/banking/accounts?sort=accountType,-accountCurrency,accountName
- get list of accounts, sorted by type (ascending), then by currency descending and then by account name (ascending)
Filtering
Some resources (as stated in the documentation) support result filtering. These resources have a list of filters specified, including possible operations and values. You can specify filtering by passing the filter attribute. The general pattern for specifying a filter is:
<filterName>|<operator>|<values>
-
filterName
- filter name from documentation -
operator
- operator, specified in resource documentation -
values
- one or more values for filter. Multiple values are separated by comma
Multiple filters can be specified on each request, separated by semi-colon. They are joined by "AND", so each result item must satisfy all conditions.
Filtering examples
-
get a list of partners with category in (1, 5, 10)
GET /general/partners?filter=category|in|1,5,10
-
get a list of contracts with contractDate in (2016-02-10, 2016-04-28>
GET /general/contracts?filter=contractDate|gt|2016-02-10;contractDate|lteq|2016-04-28
List of operators
Operator | Meaning |
---|---|
lt | less than |
lteq | less than or equals |
eq | equals |
gteq | greater than or equals |
gt | greater than |
in | value in list |
Request restrictions
Please, keep in mind following restrictions regarding requests:
-
Maximum request size is 10 MB.
-
Maximum size of accepted single file is 500 kB.
-
Here is the list of suppported files:
MIME type | Example(s) |
---|---|
application/pdf | *.pdf |
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet | *.xlsx |
application/vnd.openxmlformats-officedocument.wordprocessingml.document | *.docx |
application/vnd.openxmlformats-officedocument.presentationml.presentation | *.pptx |
application/vnd.ms-excel | *.xls, *.xlt, *.xla |
application/msword | *.doc, *.dot |
application/vnd.ms-powerpoint | *.ppt, *.pot, *.pps, *.ppa |
plain/text | *.csv, *.txt |
image/jpeg | *.jpg, *.jpeg |
image/png | *.png |
image/gif | *.gif |
API calls limits
When you exceed the API call limit (by calling our API more times than your quota allows), you will receive an HTTP error 429. To inform you about your limits, we use the following response headers:
X-Rate-Limit-Limit
- the number of allowed requests in the current periodX-Rate-Limit-Remaining
- the number of remaining requests in the current periodX-Rate-Limit-Reset
- the number of seconds left in the current period
Formats
Date and time are represented using ISO 8601 formatting, for example:
- Date is represented as
YYYY-mm-dd
, and timezone (local) is added when necessary. - Week number 1 is the week with the year's first Thursday in it.
- Day of the week is represented as a number
1..7
, with 1 being Monday. - Time is represented as
Thh:mm:ss
, and timezone is added when necessary. Time with an arbitrary number of digits representing milliseconds is also accepted (when the ISO 8601 format criteria is met), but the time without milliseconds is always returned. - Phone numbers use international format starting with
+
and including the country code. An example of a valid number is+420739111222
. - Number format is defined by the JSON standard, for example, decimals are separated by a
'
. - The money format follows the ISO 4217 standard, where the value is represented in minor units. For example, the amount 125,90 CZK would be represented as
12590
.