More exhaustive API documentation can be found in openapi.yaml
Fetches all accounts in the system. Returns only account IDs
GET /accounts
Returns an array of strings
Creates new account with specified ID, currency and balance
POST /accounts
JSON object:
Field | Type | Description | Optional |
---|---|---|---|
id |
string | Account ID, must be unique | no |
currency |
string | Account's currency | no |
balance |
number | Account's initial balance. Can't be negative | no |
Returns created Account
Fetches existing account data.
GET /accounts/:id
Path parameter:
Field | Description | Optional |
---|---|---|
id |
Account ID | no |
Returns found Account
Fetches payments related to specified account.
GET /accounts/:id/payments
Path parameter:
Field | Description | Optional |
---|---|---|
id |
Account ID | no |
Returns an array of Payments
Makes new payment from one account to another.
POST /accounts/:id/payments
Path parameter:
Field | Description | Optional |
---|---|---|
id |
ID of account who will be the source of payment | no |
JSON object:
Field | Type | Description | Optional |
---|---|---|---|
id |
string (guid) | Unique ID of payment that must be generated by client. Helps to avoid payment duplication. | no |
to_account |
string | ID of recipient's account | no |
amount |
number | Amount of money to transfer | no |
Returns created Payment
Attribute | Description | Nullable |
---|---|---|
id |
Unique string ID of Account | no |
currency |
Account's currency | no |
balance |
Balance of Account | no |
Attribute | Description | Nullable |
---|---|---|
account |
Account ID to which this payment relates to | no |
amount |
Transferred funds | no |
direction |
Direction of payment: "outgoing" or "incoming" |
no |
from_account |
Source account ID of the payment if direction is "incoming" |
yes |
to_account |
Destination account ID of the payment if direction is "outgoing" |
yes |