Add Beneficiary Payment Details

To add Payment details to a beneficiary:

STEP 1

Make a GET {{baseUrl}}/beneficiary/form/show/{{gatewayID}}to get the Dynamic Form (The form response is different for each gateway) for adding the beneficiary details

Request

Headers

  • Authorization: Bearer YOUR_ACCESS_TOKEN

  • Content-Type: application/json

Request Example

import requests

gateway_id = "331" // example gateway ID
url = f"{{baseUrl}}/beneficiary/form/show/{gateway_id}"
headers = {
    "Authorization": "Bearer YOUR_ACCESS_TOKEN"
}

response = requests.get(url, headers=headers)
print(response.json())

Example response of the Dynamic Form

{
    "nickname": "John Doe Vitawallet",
    "gateway_id": 331,
    "currency": "USD",
    "beneficiary_id": 17,
    "payment_data": {
        "beneficiary_type": "",
        "beneficiary_first_name": "",
        "beneficiary_last_name": "",
        "company_name": "",
        "beneficiary_email": "",
        "state": "",
        "city": "",
        "beneficiary_address": "",
        "zipcode": "",
        "beneficiary_document_type": "",
        "beneficiary_document_number": "",
        "account_type_bank": "",
        "account_bank": "",
        "routing_number": "",
        "purpose": "",
        "purpose_comentary": ""
    }
}

STEP 2

Make a post request using the filled dynamic form as body

POST {{baseUrl}}/beneficiaries/payment-methods/

this form Requires the Beneficiary ID (gotten in the response when you Add Beneficiary or Get Beneficiaries) to bind the payment details to the Beneficiary

Request

Headers

  • Authorization: Bearer YOUR_ACCESS_TOKEN

  • Content-Type: application/json

Request Example

NOTE: This body example matches the retrieved dynamic form from Gateway ID 331 in the above example

{
    "nickname": "John Doe Vitawallet",
    "gateway_id": 331,
    "currency": "USD",
    "beneficiary_id": 17,
    "payment_data": {
        "beneficiary_type": "Individual",
        "beneficiary_first_name": "John",
        "beneficiary_last_name": "Doe",
        "company_name": "Zee Technologies",
        "beneficiary_email": "john.doe@example.com",
        "state": "California",
        "city": "Los Angeles",
        "beneficiary_address": "123 Main St",
        "zipcode": "90001",
        "beneficiary_document_type": "DNI",
        "beneficiary_document_number": "12345678",
        "account_type_bank": "Checking",
        "account_bank": "1234567890123456",
        "routing_number": "987654321",
        "purpose": "ISGDDS",
        "purpose_comentary": "For business purposes"
    }
}

Example Request

import requests
import json

url = "https://api.yourservice.com/beneficiaries/payment-methods/"
headers = {
    "Authorization": "Bearer YOUR_ACCESS_TOKEN",
    "Content-Type": "application/json"
}
data = {
    "nickname": "John Doe Vitawallet",
    "gateway_id": 331,
    "currency": "USD",
    "beneficiary_id": 17,
    "payment_data": {
        "beneficiary_type": "Individual",
        "beneficiary_first_name": "John",
        "beneficiary_last_name": "Doe",
        "company_name": "Zee Technologies",
        "beneficiary_email": "john.doe@example.com",
        "state": "California",
        "city": "Los Angeles",
        "beneficiary_address": "123 Main St",
        "zipcode": "90001",
        "beneficiary_document_type": "DNI",
        "beneficiary_document_number": "12345678",
        "account_type_bank": "Checking",
        "account_bank": "1234567890123456",
        "routing_number": "987654321",
        "purpose": "ISGDDS",
        "purpose_comentary": "For business purposes"
    }
}

response = requests.post(url, headers=headers, data=json.dumps(data))
print(response.json())

Last updated