/
v3.0.11Get access

getWithdrawInfoV2

Handles withdrawal requests from the user’s account. It sends a withdrawal to the chosen payment method and returns the result of the request. It is used when users withdraw funds from their balance and to show whether the withdrawal was accepted or rejected.

Request parameters:

Name
DescriptionTypeValuesDefault
amount
Withdrawal amountnumber--
service
Payment service identifiernumber--
confirmationCode
Withdrawal confirmation code sent to the userstring--
host
Host or payment provider identifier string--
forProduct
Product or product type for the withdrawal string--
address
Payment address (wallet, account, etc.) string--
...rest
The rest data contains dynamic data according to partner configurationobject-

Call example:

getWithdrawInfoV2({
  amount: '10',
  service: 10742,
  payee: {
    forProduct: 'casino',
    statusUrls: {
      cancel: 'http://localhost:3000/en?section=account&menu=payment&nested=withdraw&method=VivaWallet',
      fail: 'http://localhost:3000/en?section=account&menu=payment&nested=withdraw&method=VivaWallet&status=fail',
      pending: 'http://localhost:3000/en?section=account&menu=payment&nested=withdraw&method=VivaWallet&status=pending',
      success: 'http://localhost:3000/en?section=account&menu=payment&nested=withdraw&method=VivaWallet&status=success&amount=10'
    }
  }
})

Response examples:

{
  code: 0,
  rid: 1232676999,
  data: {
    name: 'VivaWallet',
    paymentId: '10742',
    status: 'ok',
    message: '',
    action: '',
    method: 'formDraw',
    fields: [
      [
        [{
          type: 'select',
          label: 'Cards',
          className: '',
          customAttrs: [],
          name: 'WalletId',
          options: [{
            value: 'ab35fb0a-bf2d-4ec3-ad0e-ffd4df661b72',
            label: '516794XXXXXX8832'
          }],
          rules: {
            required: {
              message: 'Card is required'
            }
          }
        }, {
          type: 'hidden',
          label: 'Amount',
          className: '',
          customAttrs: [],
          name: 'amount',
          value: '10',
          rules: []
        }, {
          type: 'submit',
          label: 'Do Withdraw',
          className: '',
          customAttrs: [],
          name: ''
        }]
      ]
    ]
  }
}

Response parameters:

NameDescriptionTypeValues
name
Payment system namestring-
paymentId
Payment system identifierstring-
status
Response statusstring-
message
Response messagestring-
action
Action URL or endpoint for the form submissionstring-
method
Form rendering methodstring-
fields
Form structure definitionarray-
└─
array-
└─
array-
└─
array-
└─
object
└─ type
Field type string-
└─ label
Field label string-
└─ className
CSS class name string-
└─ customAttrs
Custom HTML attributes array-
└─ name
Field name string-
└─ value
Field valuestring-
└─ options
Options for select fields array-
└─
object
└─ value
Option value string-
└─ label
Option label string-
└─ rules
Validation rules object
└─ required
Required rule object
└─ message
Validation error message string-
type
Field typestring-
label
Field label displayed to the userstring-
className
CSS class name for the fieldstring-
customAttrs
Custom HTML attributesarray-
name
Field name used when submitting the formstring-
options
Selectable options for select fieldarray-
value
Default field valuestring-
rules
Field validation rulesstring-