Crear Cuenta
Endpoint para crear una cuenta bancaria.
POST
/
accounts
curl https://api.onepay.la/v1/accounts \
-X POST \
-H "Authorization: Bearer sk_test_KjbE0Vobf5Lg1yNZ4HoKawDItDs3Rod9VXNBWrEYmGn06tkesPIi" \
-H "Content-Type: application/json" \
-H "x-idempotency: account-001" \
-d '{
"subtype": "SAVINGS",
"authorization": true,
"re-enrollment": false,
"account_number": "1234567890",
"customer_id": "9dd4158b-0e45-42bc-b56f-a4c1f856814d",
"bank_id": "9957817c-f17e-472b-b531-e3d1490bf757"
}'
const response = await fetch('https://api.onepay.la/v1/accounts', {
method: 'POST',
headers: {
'Authorization': 'Bearer sk_test_KjbE0Vobf5Lg1yNZ4HoKawDItDs3Rod9VXNBWrEYmGn06tkesPIi',
'Content-Type': 'application/json',
'x-idempotency': 'account-001'
},
body: JSON.stringify({
subtype: 'SAVINGS',
authorization: true,
're-enrollment': false,
account_number: '1234567890',
customer_id: '9dd4158b-0e45-42bc-b56f-a4c1f856814d',
bank_id: '9957817c-f17e-472b-b531-e3d1490bf757'
})
});
const account = await response.json();
import requests
response = requests.post(
'https://api.onepay.la/v1/accounts',
headers={
'Authorization': 'Bearer sk_test_KjbE0Vobf5Lg1yNZ4HoKawDItDs3Rod9VXNBWrEYmGn06tkesPIi',
'Content-Type': 'application/json',
'x-idempotency': 'account-001'
},
json={
'subtype': 'SAVINGS',
'authorization': True,
're-enrollment': False,
'account_number': '1234567890',
'customer_id': '9dd4158b-0e45-42bc-b56f-a4c1f856814d',
'bank_id': '9957817c-f17e-472b-b531-e3d1490bf757'
}
)
account = response.json()
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.onepay.la/v1/accounts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer sk_test_KjbE0Vobf5Lg1yNZ4HoKawDItDs3Rod9VXNBWrEYmGn06tkesPIi",
"Content-Type: application/json",
"x-idempotency: account-001"
],
CURLOPT_POSTFIELDS => json_encode([
"subtype" => "SAVINGS",
"authorization" => true,
"re-enrollment" => false,
"account_number" => "1234567890",
"customer_id" => "9dd4158b-0e45-42bc-b56f-a4c1f856814d",
"bank_id" => "9957817c-f17e-472b-b531-e3d1490bf757"
])
]);
$response = curl_exec($curl);
$account = json_decode($response, true);
?>
{
"id":"84cc072e-90e8-33cf-9305-098095fed32f",
"title":"Ms.",
"subtype":"CHECKING",
"status":"PENDING",
"authorization":true,
"customer_id":"9e01d019-b438-40d2-89e1-52430c69dfb7",
"re_enroll":false,
"external_id":null,
"bank_id":"9e01d019-b731-48bc-b111-2baa3ea56ef6",
"bank":{
"id":"9e01d019-b731-48bc-b111-2baa3ea56ef6",
"name":"Maggio-Hills",
"logo":null,
"base64_logo":""
},
"customer":{
"id":"9e01d019-b438-40d2-89e1-52430c69dfb7",
"first_name":"Izaiah",
"last_name":"Rogahn",
"email":"",
"phone":"+17478695836",
"document_type":"CC",
"document_number":"156762",
"created_at":"2025-01-19T17:03:55.000000Z",
"is_test":true
}
}
{
"message": "No se puede generar la operación, genera un token de idempotencia y envíelo en los headers como x-idempotency",
"code": 10003,
"code_name": "idempotency_error"
}
Headers
El parámetro
authorization debe ser true. Sin esto, la cuenta se crea pero el usuario nunca recibe la solicitud de enrolamiento en su billetera y no podrás realizar cargos.Tipo de cuenta bancaria [SAVINGS, CHECKING, ELECTRONIC_DEPOSIT, KEY(Bre-B), WALLET]
WALLET es el saldo OnePay de otra empresa, para dividir cobros hacia ella. El account_number
es el identificador de ese saldo y el bank_id es siempre el de ONE BANK.
Ver la guía completa.Indica si es una re-vinculación de una cuenta que ya existió previamente. Útil para rastrear cuentas que fueron eliminadas y vueltas a crear.
ID del cliente dueño de la cuenta. Crear cliente.
ID del cliente relacionado (opcional). Útil para vincular cuentas de familiares, socios o representantes autorizados al cliente principal.
{
"id":"84cc072e-90e8-33cf-9305-098095fed32f",
"title":"Ms.",
"subtype":"CHECKING",
"status":"PENDING",
"authorization":true,
"customer_id":"9e01d019-b438-40d2-89e1-52430c69dfb7",
"re_enroll":false,
"external_id":null,
"bank_id":"9e01d019-b731-48bc-b111-2baa3ea56ef6",
"bank":{
"id":"9e01d019-b731-48bc-b111-2baa3ea56ef6",
"name":"Maggio-Hills",
"logo":null,
"base64_logo":""
},
"customer":{
"id":"9e01d019-b438-40d2-89e1-52430c69dfb7",
"first_name":"Izaiah",
"last_name":"Rogahn",
"email":"",
"phone":"+17478695836",
"document_type":"CC",
"document_number":"156762",
"created_at":"2025-01-19T17:03:55.000000Z",
"is_test":true
}
}
{
"message": "No se puede generar la operación, genera un token de idempotencia y envíelo en los headers como x-idempotency",
"code": 10003,
"code_name": "idempotency_error"
}
curl https://api.onepay.la/v1/accounts \
-X POST \
-H "Authorization: Bearer sk_test_KjbE0Vobf5Lg1yNZ4HoKawDItDs3Rod9VXNBWrEYmGn06tkesPIi" \
-H "Content-Type: application/json" \
-H "x-idempotency: account-001" \
-d '{
"subtype": "SAVINGS",
"authorization": true,
"re-enrollment": false,
"account_number": "1234567890",
"customer_id": "9dd4158b-0e45-42bc-b56f-a4c1f856814d",
"bank_id": "9957817c-f17e-472b-b531-e3d1490bf757"
}'
const response = await fetch('https://api.onepay.la/v1/accounts', {
method: 'POST',
headers: {
'Authorization': 'Bearer sk_test_KjbE0Vobf5Lg1yNZ4HoKawDItDs3Rod9VXNBWrEYmGn06tkesPIi',
'Content-Type': 'application/json',
'x-idempotency': 'account-001'
},
body: JSON.stringify({
subtype: 'SAVINGS',
authorization: true,
're-enrollment': false,
account_number: '1234567890',
customer_id: '9dd4158b-0e45-42bc-b56f-a4c1f856814d',
bank_id: '9957817c-f17e-472b-b531-e3d1490bf757'
})
});
const account = await response.json();
import requests
response = requests.post(
'https://api.onepay.la/v1/accounts',
headers={
'Authorization': 'Bearer sk_test_KjbE0Vobf5Lg1yNZ4HoKawDItDs3Rod9VXNBWrEYmGn06tkesPIi',
'Content-Type': 'application/json',
'x-idempotency': 'account-001'
},
json={
'subtype': 'SAVINGS',
'authorization': True,
're-enrollment': False,
'account_number': '1234567890',
'customer_id': '9dd4158b-0e45-42bc-b56f-a4c1f856814d',
'bank_id': '9957817c-f17e-472b-b531-e3d1490bf757'
}
)
account = response.json()
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.onepay.la/v1/accounts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer sk_test_KjbE0Vobf5Lg1yNZ4HoKawDItDs3Rod9VXNBWrEYmGn06tkesPIi",
"Content-Type: application/json",
"x-idempotency: account-001"
],
CURLOPT_POSTFIELDS => json_encode([
"subtype" => "SAVINGS",
"authorization" => true,
"re-enrollment" => false,
"account_number" => "1234567890",
"customer_id" => "9dd4158b-0e45-42bc-b56f-a4c1f856814d",
"bank_id" => "9957817c-f17e-472b-b531-e3d1490bf757"
])
]);
$response = curl_exec($curl);
$account = json_decode($response, true);
?>
Was this page helpful?
⌘I
curl https://api.onepay.la/v1/accounts \
-X POST \
-H "Authorization: Bearer sk_test_KjbE0Vobf5Lg1yNZ4HoKawDItDs3Rod9VXNBWrEYmGn06tkesPIi" \
-H "Content-Type: application/json" \
-H "x-idempotency: account-001" \
-d '{
"subtype": "SAVINGS",
"authorization": true,
"re-enrollment": false,
"account_number": "1234567890",
"customer_id": "9dd4158b-0e45-42bc-b56f-a4c1f856814d",
"bank_id": "9957817c-f17e-472b-b531-e3d1490bf757"
}'
const response = await fetch('https://api.onepay.la/v1/accounts', {
method: 'POST',
headers: {
'Authorization': 'Bearer sk_test_KjbE0Vobf5Lg1yNZ4HoKawDItDs3Rod9VXNBWrEYmGn06tkesPIi',
'Content-Type': 'application/json',
'x-idempotency': 'account-001'
},
body: JSON.stringify({
subtype: 'SAVINGS',
authorization: true,
're-enrollment': false,
account_number: '1234567890',
customer_id: '9dd4158b-0e45-42bc-b56f-a4c1f856814d',
bank_id: '9957817c-f17e-472b-b531-e3d1490bf757'
})
});
const account = await response.json();
import requests
response = requests.post(
'https://api.onepay.la/v1/accounts',
headers={
'Authorization': 'Bearer sk_test_KjbE0Vobf5Lg1yNZ4HoKawDItDs3Rod9VXNBWrEYmGn06tkesPIi',
'Content-Type': 'application/json',
'x-idempotency': 'account-001'
},
json={
'subtype': 'SAVINGS',
'authorization': True,
're-enrollment': False,
'account_number': '1234567890',
'customer_id': '9dd4158b-0e45-42bc-b56f-a4c1f856814d',
'bank_id': '9957817c-f17e-472b-b531-e3d1490bf757'
}
)
account = response.json()
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.onepay.la/v1/accounts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer sk_test_KjbE0Vobf5Lg1yNZ4HoKawDItDs3Rod9VXNBWrEYmGn06tkesPIi",
"Content-Type: application/json",
"x-idempotency: account-001"
],
CURLOPT_POSTFIELDS => json_encode([
"subtype" => "SAVINGS",
"authorization" => true,
"re-enrollment" => false,
"account_number" => "1234567890",
"customer_id" => "9dd4158b-0e45-42bc-b56f-a4c1f856814d",
"bank_id" => "9957817c-f17e-472b-b531-e3d1490bf757"
])
]);
$response = curl_exec($curl);
$account = json_decode($response, true);
?>
{
"id":"84cc072e-90e8-33cf-9305-098095fed32f",
"title":"Ms.",
"subtype":"CHECKING",
"status":"PENDING",
"authorization":true,
"customer_id":"9e01d019-b438-40d2-89e1-52430c69dfb7",
"re_enroll":false,
"external_id":null,
"bank_id":"9e01d019-b731-48bc-b111-2baa3ea56ef6",
"bank":{
"id":"9e01d019-b731-48bc-b111-2baa3ea56ef6",
"name":"Maggio-Hills",
"logo":null,
"base64_logo":""
},
"customer":{
"id":"9e01d019-b438-40d2-89e1-52430c69dfb7",
"first_name":"Izaiah",
"last_name":"Rogahn",
"email":"",
"phone":"+17478695836",
"document_type":"CC",
"document_number":"156762",
"created_at":"2025-01-19T17:03:55.000000Z",
"is_test":true
}
}
{
"message": "No se puede generar la operación, genera un token de idempotencia y envíelo en los headers como x-idempotency",
"code": 10003,
"code_name": "idempotency_error"
}