Withdraw-Fee-v6

From Barion Documentation
Jump to navigation Jump to search

Barion API: Calculate withdraw fee

POST /v6/withdraw/fee

The /v6/withdraw/fee API endpoint calculates the bank transfer withdrawal fee for a payout method and amount.

Prerequisites before use:

v6 This API endpoint is available in API v6.

Authentication

Barion Wallet Authentication

Input properties

The input properties should be defined in the request body.

The optional Accept-Language request header can be used to control the language of localized response text, for example estimatedArrival.message. Standard HTTP language priority values are accepted, for example en-US or hu-HU.

Property name Property type Limitations and constraints Description
PayoutMethodId string
  • Required
  • Format: pout_<ordered-base64-ulid>
Id of an existing payout method connected to the opened wallet.
Amount decimal
  • Required
  • Must be greater than 0
  • Precision depends on currency
Amount for which the withdrawal fee is calculated. Currency is not required here since the payout method specifies it.

Output properties

The response is an object of the following structure:

Property name Property type Description
<root> Object
fee Object Calculated withdrawal fee.
fee.value decimal Fee amount.
fee.currency string Fee currency. Possible values: HUF, EUR, USD, CZK, PLN, RON.
estimatedArrival Object Carries information about the estimated arrival of the withdrawal when an estimate is available.
estimatedArrival.code string The code for the expected arrival of funds to the target bank account. Present only when estimatedArrival is not null. Possible values: null, in_a_minute, today, business_days. If the value is business_days, check the estimatedArrival.businessDays property for the number of business days.
estimatedArrival.message string Present only when estimatedArrival is not null. A localized string that describes the arrival time according to the Accept-Language request header.
estimatedArrival.businessDays int Present only when estimatedArrival is not null. The number of business days that the withdrawal will take. Null if estimatedArrival.code is not business_days. If the customer has a withdrawal delay set, this number is extended with that value.
isInternalTransfer bool Indicates whether the target account belongs to another Barion wallet and the transfer is internal.

This endpoint does not validate whether the wallet has enough funds for the specified amount. It only calculates the fee for that amount.

The selected response language is specified in the Content-Language response header.

To find out which errors this endpoint can produce, visit the Calling the API – Handling the response page. Note that this endpoint uses camelCase field names in error responses.

Possible error messages

Condition ErrorCode HTTP status code
Authentication fails AuthenticationFailed 401
Invalid input data ModelValidationError 400
Payout method is not found or is not connected to the opened wallet PayoutMethodNotFound 404

Localization

The endpoint has a message for the estimated arrival time. The language of this message is based on the request's Accept-Language header. This header expects the standard Accept-Language values.

This header also accepts languages in short form. For example, en can be used instead of en-US, and cs can be used instead of cs-CZ.

If the system supports one of the requested languages, the value of the estimatedArrival.message property will be translated to that language. The selected language is specified in the Content-Language response header.

The fallback locale is en-US.