Withdraw Money

Withdraw funds from a wallet or VBA (Virtual Bank Account)

This endpoint is used to create a withdrawal to another funding method owned by the same account (self-payments). The endpoint is as follows:

POST https://sandbox-api.veem.com/veem/v1.2/payments/withdraw

📘

Headers

There are 2 headers necessary for the use of this endpoint:

  • X-request-id: This is a number unique to the current API request, and follows the UUID format. Reusing this header without changing the value will result in a 409 (Conflict) status. An example X-request-id is as follows:

48855846-628d-4177-b071-80332a116f0a

  • Authorization: This header holds the bearer token required to use Veem's public API, and belongs to the owner account. Failure to use a valid bearer token will result in a 404 (Not Found) status. An example of a valid token is as follows:

Bearer c047594b-082c-4da1-be89-08fe3770f4b3

See Get Access Token section to generate your bearerToken

Request Payload

When sending a withdraw request using Veem's Withdraw Payment API to another funding method, follow the format as shown in the following examples:

{
    "amount": {
        "currency": "USD",
        "number": 50
    },
    "fromFundingMethodType": "VirtualBank",
    "fromFundingMethodId": 1,
    "toFundingMethodType": "Wallet",
    "toFundingMethodId": 135323,
}
{
    "amount": {
        "currency": "USD",
        "number": 50
    },
    "fromFundingMethodType": "VirtualBank",
    "fromFundingMethodId": 1,
    "sweepToWalletId":11808
}

Request Parameters

The following table contains detailed information on the payload's parameters, such as the parameter name, whether it is mandatory or not, formatting (if applicable), and size of the parameter. You can retrieve various fields such as countryCode, bankName, bankCode, swiftCode, and purposeOfPayment from the Country-Currency-Map endpoint. Please refer to the following link: country-currency-map

Parameter

Mandatory?

Format/Values

Size (in chars)

amount.currency

Yes

Amount currency to withdraw
Currency Code (ISO 4217)

amount.number

Yes

Amount number to withdraw Number

fromFundingMethodType

Yes

"Wallet"
"VirtualBank"

fromFundingMethodId

Yes

Number
Note: Make sure the ID is the one associated with the requesting account

toFundingMethodType

Yes
(if sweepToWalletId is not provided)

For wallet withdrawal the supported funding methods:
"Bank"
"Card" (debit cards only)
"VirtualCard"
"VirtualBank"

For Virtual Bank withdrawal the supported funding methods:
"Bank"
"Card" (debit cards only)
"VirtualCard"
"VirtualBank"
"Wallet"

toFundingMethodId

Yes
(if sweepToWalletId is not provided)

Number
Note: Make sure the ID is the one associated with the requesting account

sweepToWalletId

Not supported for wallet withdrawals Yes
(if toFundingMethodType and toFundingMethodId are not provided)

Number
Note: Make sure the ID is the one associated with the requesting account

Response Payload

Once a valid request has been sent, a response payload of this format should be expected:

{
    "requestId": "18eb345d-2425-42f6-9b77-dbec8803cb75",
    "ccEmails": [],
    "status": "Sent",
    "goodFundsPayment": false,
    "realTimePayment": false,
    "extraInfo": {},
    "id": 468711,
    "exchangeRate": {},
    "feeInformation": {
        "payerInfo": {
            "originalAmount": 50.00,
            "feeAmount": 0.00,
            "totalAmount": 50.00,
            "currency": "USD"
        },
        "payeeInfo": {
            "originalAmount": 50.00,
            "feeAmount": 0.00,
            "totalAmount": 50.00,
            "currency": "USD"
        }
    },
    "fastTransfer": false,
    "cancelable": false,
    "payerFundingMethodType": "VirtualBank",
    "receiverFundingMethodType": "Wallet"
}

Possible Errors

If any mandatory field is missing, one will get a Status 400 (Bad Request) error in the following format:

{
   "validationErrorMessage": [
       "From Funding Method Type is required.",
       "Sweep to Wallet is not supported for wallet withdrawals.",
       "Amount number <> is not acceptable",
       "To funding method type and id are required",
       "Funding method of type <> is not acceptable",
       "Partner <> is not allowed to sweep to wallet."
   ]
}

Here are some extra examples of specific errors that can pop up during the use of the Withdraw Money API:

Unauthorized

Status Code: 401 (Unauthorized)

Example:

{
    "error": "unauthorized",
    "error_description": "Full authentication is required to access this resource"
}

Incorrect Funding Method ID

Status Code: 404 (Not Found)

Example:

{
    "code": 10001004,
    "message": "Could not find funding method: VIRTUALBANK for payer accountId: 441628 and fundingMethodId: 163",
    "logTag": "6642a1b3-9b67-4bf5-a9ba-ca34138f1b4c",
    "timestamp": "2025-01-03T21:34:04.464",
    "fileName": "CreatePayment.java",
    "lineNumber": 406
}