diff --git a/src/content/api/bank-accounts.mdx b/src/content/api/bank-accounts.mdx index 6011641ac..eb0acb86b 100644 --- a/src/content/api/bank-accounts.mdx +++ b/src/content/api/bank-accounts.mdx @@ -158,7 +158,7 @@ The Bank Account balance, retrieved using Open Banking flows. The supported Bank `directDebitAuthority`, the user accepts our [Direct Debit terms](https://centrapay.com/directdebit-termsandconditions/) and has authority to operate this account. - `phone`,`fullName` and `emailAddress` are all required to create a direct-debit authority. This is required to be able to Top Up a Bank Account. + `phone`, `fullName` and `emailAddress` are all required to create a direct-debit authority. This is required to be able to Top Up a Bank Account. ### Attributes diff --git a/src/content/api/funds-transfers.mdx b/src/content/api/funds-transfers.mdx new file mode 100644 index 000000000..b1388624a --- /dev/null +++ b/src/content/api/funds-transfers.mdx @@ -0,0 +1,457 @@ +--- +title: Funds Transfers +description: Endpoints for managing Funds Transfers +draft: true +nav: + path: API + order: 19 +--- + +import Properties from '../../components/Properties.astro'; +import Property from '../../components/Property.astro'; +import Endpoint from '../../components/Endpoint.astro'; +import CodePanel from '../../components/CodePanel.astro'; +import Badge from '../../components/Badge.astro'; + +A funds transfer represents either a top up to or a withdrawal from a Centrapay wallet. Topping up a wallet consists of making a bank transfer from the user's bank account to Centrapay. Once Centrapay has verified the transfer was successful a user will be given credit on their Centrapay wallet equal to the amount of the bank transfer. + +--- + + + ## Create a Top Up + + This endpoint allows you to create a topup. + + ### Attributes + + + Total amount of the transaction in cents + + + + The id of the asset + + + + The id of the bank account + + + + ### Errors + + + The wallet and the bank account for the top up request do not belong to the same account. + + + + The bank account already has ten pending top ups, which is the maximum a bank authority can have at any one time. + + + + The top up can not be created because it is above the max amount of funds a bank account can have pending at any one time. The max amount is $1000.00 for verified bank accounts and $100.00 for non-verified bank accounts. + + + + The topup exceeds one or more top up quota limits. See [Quota Error Response](https://docs.centrapay.com/api/quotas#quota-error-response). + + + + Bank account requires authorization for top up. See bank accounts [direct debit endpoint](https://docs.centrapay.com/api/bank-accounts#direct-debit-authority). + + + + The wallet type does not support top ups. See [settlement wallets](https://docs.centrapay.com/api/wallets#settlement-wallets). + + + + The bank account type is not configured for topups. Only `centrapay` type bank accounts are configured. + + + + + ```bash + curl -X POST https://service.centrapay.com/api/topups \ + -H "X-Api-Key: $api_key" \ + -H "Content-Type: application/json" \ + -d '{ + "amount": "10000", + "assetId": "Te2uDM7xhDLWGVJU3nzwnh", + "bankAccountId": "FRhAzzWpTKb5U7pZygQjjY" + }' + ``` + + + + ```json + { + "id": "hg2RfYTQ635tPBZEPJdCre", + "assetId": "Te2uDM7xhDLWGVJU3nzwnh", + "bankAccountId": "FRhAzzWpTKb5U7pZygQjjY", + "accountId": "aBc932S9182qwCDqwer", + "type": "topup", + "amount": "10000", + "status": "created", + "createdAt": "2020-05-01T12:30:00.000Z", + "updatedAt": "2020-05-01T12:30:00.000Z" + } + ``` + + + +--- + + + ## Get Top Up + + This endpoint allows you to retrieve a Top Up by id. + + ### Attributes + No attributes. + + + ```bash + curl https://service.centrapay.com/api/topups/WRhAxxWpTKb5U7pXyxQjjY \ + -H "X-Api-Key: $api_key" + ``` + + + + ```json + { + "id": "hg2RfYTQ635tPBZEPJdCre", + "assetId": "Te2uDM7xhDLWGVJU3nzwnh", + "bankAccountId": "FRhAzzWpTKb5U7pZygQjjY", + "accountId": "aBc932S9182qwCDqwer", + "type": "topup", + "amount": "10000", + "status": "created", + "createdAt": "2020-05-01T12:30:00.000Z", + "updatedAt": "2020-05-01T12:30:00.000Z" + } + ``` + + + +--- + + + ## List Top Ups For Authorized Accounts + + ### Attributes + No attributes. + + + ```bash + curl https://service.centrapay.com/api/topups \ + -H "X-Api-Key: $api_key" + ``` + + + + ```json + [ + { + "id": "5thg2RPBZEfYTPJdQ63Cre", + "assetId": "Te2uDM7xhDLWGVJU3nzwnh", + "bankAccountId": "FRhAzzWpTKb5U7pZygQjjY", + "accountId": "aBc932S9182qwCDqwer", + "type": "topup", + "amount": "10000", + "status": "created", + "createdAt": "2020-05-01T12:30:00.000Z", + "updatedAt": "2020-05-01T12:30:00.000Z" + }, + { + "id": "hg2RfYTQ635tPBZEPJdCre", + "assetId": "Te2uDM7xhDLWGVJU3nzwnh", + "bankAccountId": "FRhAzzWpTKb5U7pZygQjjY", + "accountId": "aBc932S9182qwCDqwer", + "type": "topup", + "amount": "10000", + "status": "created", + "createdAt": "2020-05-01T12:30:00.000Z", + "updatedAt": "2020-05-01T12:30:00.000Z" + } + ] + ``` + + + +--- + + + ## List Top Ups For an Account + + ### Attributes + No attributes. + + + ```bash + curl https://service.centrapay.com/api/accounts/aBc932S9182qwCDqwer/topups \ + -H "X-Api-Key: $api_key" + ``` + + + + ```json + [ + { + "id": "5thg2RPBZEfYTPJdQ63Cre", + "assetId": "Te2uDM7xhDLWGVJU3nzwnh", + "bankAccountId": "FRhAzzWpTKb5U7pZygQjjY", + "accountId": "aBc932S9182qwCDqwer", + "type": "topup", + "amount": "10000", + "status": "created", + "createdAt": "2020-05-01T12:30:00.000Z", + "updatedAt": "2020-05-01T12:30:00.000Z" + }, + { + "id": "hg2RfYTQ635tPBZEPJdCre", + "assetId": "Te2uDM7xhDLWGVJU3nzwnh", + "bankAccountId": "FRhAzzWpTKb5U7pZygQjjY", + "accountId": "aBc932S9182qwCDqwer", + "type": "topup", + "amount": "10000", + "status": "created", + "createdAt": "2020-05-01T12:30:00.000Z", + "updatedAt": "2020-05-01T12:30:00.000Z" + } + ] + ``` + + + + +--- + + + ## Create Withdrawal + + ### Attributes + + + Total amount of the transaction in cents + + + + The id of the asset + + + + The id of the bank account + + + + ### Errors + + + The wallet and the bank account for the withdrawal request do not belong to the same account. + + + + The wallet balance is less than the required amount. + + + + The wallet type does not support withdrawals. See [settlement wallets](https://docs.centrapay.com/api/wallets#settlement-wallets). + + + + The bank account type is not configured for withdrawals. Only `centrapay` type bank accounts are configured. + + + + + ```bash + curl -X POST https://service.centrapay.com/api/withdrawals \ + -H "X-Api-Key: $api_key" \ + -H "Content-Type: application/json" \ + -d '{ + "amount": "10000", + "assetId": "Te2uDM7xhDLWGVJU3nzwnh", + "bankAccountId": "FRhAzzWpTKb5U7pZygQjjY" + }' + ``` + + + + ```json + { + "id": "hg2RfYTQ635tPBZEPJdCre", + "assetId": "Te2uDM7xhDLWGVJU3nzwnh", + "bankAccountId": "FRhAzzWpTKb5U7pZygQjjY", + "accountId": "aBc932S9182qwCDqwer", + "type": "withdrawal", + "amount": "10000", + "status": "created", + "createdAt": "2020-05-01T12:30:00.000Z", + "updatedAt": "2020-05-01T12:30:00.000Z" + } + ``` + + + + +--- + + + ## Get Withdrawal + + This endpoint allows you to retrieve a Withdrawal by id. + + ### Attributes + No attributes. + + ### Errors + + + The wallet and the bank account for the withdrawal request do not belong to the same account. + + + + The wallet balance is less than the required amount. + + + + The wallet type does not support withdrawals. See [settlement wallets](https://docs.centrapay.com/api/wallets#settlement-wallets). + + + + The bank account type is not configured for withdrawals. Only `centrapay` type bank accounts are configured. + + + + + ```bash + curl https://service.centrapay.com/api/withdrawals/WRhAxxWpTKb5U7pXyxQjjY \ + -H "X-Api-Key: $api_key" + ``` + + + + ```json + { + "id": "hg2RfYTQ635tPBZEPJdCre", + "assetId": "Te2uDM7xhDLWGVJU3nzwnh", + "bankAccountId": "FRhAzzWpTKb5U7pZygQjjY", + "accountId": "aBc932S9182qwCDqwer", + "type": "withdrawal", + "amount": "10000", + "status": "created", + "createdAt": "2020-05-01T12:30:00.000Z", + "updatedAt": "2020-05-01T12:30:00.000Z" + } + ``` + + + + +--- + + + ## List Withdrawals for an Account + + This endpoint allows you to list the withdrawals for an Account. + + ### Attributes + No attributes. + + + ```bash + curl https://service.centrapay.com/api/accounts/aBc932S9182qwCDqwer/withdrawals \ + -H "X-Api-Key: $api_key" + ``` + + + + + ```json + { + "items": [ + { + "id": "5thg2RPBZEfYTPJdQ63Cre", + "assetId": "Te2uDM7xhDLWGVJU3nzwnh", + "bankAccountId": "FRhAzzWpTKb5U7pZygQjjY", + "accountId": "aBc932S9182qwCDqwer", + "type": "withdrawal", + "amount": "10000", + "status": "created", + "createdAt": "2020-05-01T12:30:00.000Z", + "updatedAt": "2020-05-01T12:30:00.000Z" + }, + { + "id": "hg2RfYTQ635tPBZEPJdCre", + "assetId": "Te2uDM7xhDLWGVJU3nzwnh", + "bankAccountId": "FRhAzzWpTKb5U7pZygQjjY", + "accountId": "aBc932S9182qwCDqwer", + "type": "withdrawal", + "amount": "10000", + "status": "done", + "createdAt": "2020-05-01T12:30:00.000Z", + "updatedAt": "2020-05-01T12:30:00.000Z" + } + ] + } + ``` + + + +--- + + + ## Abort Funds Transfer + + This endpoint allows you to aboert a Funds Transfer. + + ### Attributes + No attributes. + + ### Errors + + + Aborting funds transfers of type `withdrawal` is not supported. + + + + The funds transfer is already complete. + + + + + ```bash + curl -X POST https://service.centrapay.com/api/funds-transfers/5thg2RPBZEfYTPJdQ63Cre/abort \ + -H "X-Api-Key: $api_key" + ``` + + + + ```json + {} + ``` + +