Balance query
Querying the balance allows the user to know exactly how much funds are available and be able toeither proceed with the cash out or to top-up.
To request the balance, we need to perform the following request where the id parameter of theURL
import requests
url = "https://api.dev.alignet.io/onboarding/payfac/{id}/account/balance/monnet" payload={}
headers = {
'Authorization': '8STsQ4p1jzg0sbgY.6aXDbd42wCH83QIorBHBJVDvOOuZFPOr8n8v6JWxRip7582hzOiYlQkPoHG5X Mrs'
}
response = requests.request("GET", url, headers=headers, data=payload) print(response.text)
This request will reply with a similar response payload, where the balance is given by the
“total_balance” element.
{
"action": "pay_out_balance", "balance": [
{
"bank_name": "Banco Continental", "commerce_id": "12",
"commerce_name": "Comercio de Prueba", "country": "PE",
"currency": "PEN", "total_balance": 1000000000,
"total_expenditure_amount": 500000000,
"total_income_amount": 500000000
}
],
"meta": {
"metrics": {
"aggregate": {
"start": "1614875661264",
"end": "1614875672681",
"duration": { "milliseconds": "1000",
"seconds": "1"
}
}
},
"status": { "code": "00",
"message": "OK", "message_ilgn": [
{
"locale": "es_PE",
"value": "Se encontro balance"
}
]
}
}
}
To proceed with the pay-out, process a pay-out must be created. The pay-out can be done to one ormore entities, but each entity must be identified with the correct information. The following request creates a pay-out
import requests import json
url = "https://api.dev.alignet.io/onboarding/payfac/1234/payouts" payload = json.dumps({
"action": "pay_out", "pay_out": {
"name": "Retiro de apuestas ganadas 20220311134434",
"country": "PER",
"currency": "PEN", "payments": [
{
"internal_transaction_id": "123e4567-e89b-12d3-a456-426614174000", "payment_date": "2022-03-11",
"amount": 12500000,
"amount_usd": 3317000, "currency": "PEN", "payee": {
"bank_name": "Banco Continental", "first_name": "Mariano Leon", "last_name": "Sanchez Carranza", "email_address": "foo.bar@email.com", "account_type": "savings_account", "account_number": "10040404000400938",
"cci_number": "111040404000400940",
"identity_document_country": "PE", "identity_document_type": "DNI", "identity_document_identifier": "44998831", "department": "Lima",
"phone": { "country_code": "51",
"subscriber": "967918120"
},
},
"user": {
"name": "foo2022",
"id": "1195859"
}
}
]
}
})
headers = { 'Authorization':
'8STsQ4p1jzg0sbgY.6aXDbd42wCH83QIorBHBJVDvOOuZFPOr8n8v6JWxRip7582hzOiYlQkPoHG5X Mrs',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload) print(response.text)
Continuar Parameters ➡️