Funds Transfers

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.


GET/api/topups/{topupId}

This endpoint allows you to retrieve a Top Up by id.

Request
GET/api/topups/WRhAxxWpTKb5U7pXyxQjjY
curl -X GET \
 https://service.centrapay.com/api/topups/WRhAxxWpTKb5U7pXyxQjjY \
 -H 'x-api-key: <TOKEN>'
Response
{
  "id": "WRhAxxWpTKb5U7pXyxQjjY",
  "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/api/topups

This endpoint allows you to list the Top Ups for authorized accounts.

Request
GET/api/topups
curl -X GET \
 https://service.centrapay.com/api/topups \
 -H 'x-api-key: <TOKEN>'
Response
[
  {
    "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"
  }
]

GET/api/accounts/{accountId}/topups

This endpoint allows you to list the Top Ups for an account.

Request
GET/api/accounts/aBc932S9182qwCDqwer/topups
curl -X GET \
 https://service.centrapay.com/api/accounts/aBc932S9182qwCDqwer/topups \
 -H 'x-api-key: <TOKEN>'
Response
[
  {
    "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"
  }
]

POST/api/withdrawals

This endpoint allows you to create a withdrawal.

Attributes

  • amount

    bignumberrequired

    Total amount of the transaction in cents

  • assetId

    stringrequired

    The id of the asset

  • bankAccountId

    stringrequired

    The id of the bank account

Errors

  • BANK_AUTHORITY_WALLET_MISMATCH

    403

    The wallet and the bank account for the withdrawal request do not belong to the same account.

  • INSUFFICIENT_WALLET_BALANCE

    403

    The wallet balance is less than the required amount.

  • INVALID_WALLET_TYPE

    403

    The wallet type does not support withdrawals. See settlement wallets  API .

  • BANK_ACCOUNT_TYPE_NOT_CONFIGURED_FOR_WITHDRAWAL

    403

    The bank account type is not configured for withdrawals. Only centrapay type bank accounts are configured.

Request
POST/api/withdrawals
curl -X POST \
 https://service.centrapay.com/api/withdrawals \
 -H 'content-type: application/json' \
 -H 'x-api-key: <TOKEN>' \
 -d '
{
 "amount": "10000",
 "assetId": "Te2uDM7xhDLWGVJU3nzwnh",
 "bankAccountId": "FRhAzzWpTKb5U7pZygQjjY"
}
'
Response
{
  "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/api/withdrawals/{withdrawalId}

This endpoint allows you to retrieve a Withdrawal by id.

Errors

  • BANK_AUTHORITY_WALLET_MISMATCH

    403

    The wallet and the bank account for the withdrawal request do not belong to the same account.

  • INSUFFICIENT_WALLET_BALANCE

    403

    The wallet balance is less than the required amount.

  • INVALID_WALLET_TYPE

    403

    The wallet type does not support withdrawals. See settlement wallets  API .

  • BANK_ACCOUNT_TYPE_NOT_CONFIGURED_FOR_WITHDRAWAL

    403

    The bank account type is not configured for withdrawals. Only centrapay type bank accounts are configured.

Request
GET/api/withdrawals/WRhAxxWpTKb5U7pXyxQjjY
curl -X GET \
 https://service.centrapay.com/api/withdrawals/WRhAxxWpTKb5U7pXyxQjjY \
 -H 'x-api-key: <TOKEN>'
Response
{
  "id": "WRhAxxWpTKb5U7pXyxQjjY",
  "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/api/accounts/{accountId}/withdrawals

This endpoint allows you to list the withdrawals for an Account.

Request
GET/api/accounts/aBc932S9182qwCDqwer/withdrawals
curl -X GET \
 https://service.centrapay.com/api/accounts/aBc932S9182qwCDqwer/withdrawals \
 -H 'x-api-key: <TOKEN>'
Response
{
  "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"
    }
  ]
}

POST/api/funds-transfers/{fundsTransferId}/abort

This endpoint allows you to abort a Funds Transfer.

Errors

  • ABORT_WITHDRAWAL_NOT_SUPPORTED

    403

    Aborting funds transfers of type withdrawal is not supported.

  • FUNDS_TRANSFER_ALREADY_COMPLETE

    403

    The funds transfer is already complete.

Request
POST/api/funds-transfers/5thg2RPBZEfYTPJdQ63Cre/abort
curl -X POST \
 https://service.centrapay.com/api/funds-transfers/5thg2RPBZEfYTPJdQ63Cre/abort \
 -H 'x-api-key: <TOKEN>'
Response
{}