curl https://api.onepay.la/v1/customers/session/payment-methods \
-X POST \
-H "Authorization: Bearer sk_test_KjbE0Vobf5Lg1yNZ4HoKawDItDs3Rod9VXNBWrEYmGn06tkesPIi" \
-H "X-Customer-Token: 83|i7Cs8TpuDXOLOsDmEKSUPPW3GiFaz83bzFg73yFp" \
-H "Content-Type: application/json" \
-d '{
"token": "tok_5183e3ae3ac4"
}'
const response = await fetch('https://api.onepay.la/v1/customers/session/payment-methods', {
method: 'POST',
headers: {
'Authorization': 'Bearer sk_test_KjbE0Vobf5Lg1yNZ4HoKawDItDs3Rod9VXNBWrEYmGn06tkesPIi',
'X-Customer-Token': '83|i7Cs8TpuDXOLOsDmEKSUPPW3GiFaz83bzFg73yFp',
'Content-Type': 'application/json'
},
body: JSON.stringify({
token: 'tok_5183e3ae3ac4'
})
});
const card = await response.json();
import requests
response = requests.post(
'https://api.onepay.la/v1/customers/session/payment-methods',
headers={
'Authorization': 'Bearer sk_test_KjbE0Vobf5Lg1yNZ4HoKawDItDs3Rod9VXNBWrEYmGn06tkesPIi',
'X-Customer-Token': '83|i7Cs8TpuDXOLOsDmEKSUPPW3GiFaz83bzFg73yFp',
'Content-Type': 'application/json'
},
json={
'token': 'tok_5183e3ae3ac4'
}
)
card = response.json()
{
"id": "bb02b2fd-154c-4c90-9fdf-cec3a0b25cf5",
"brand": "visa",
"last_four": "4242",
"label": "Visa ····4242"
}
{
"message": "El campo token es obligatorio.",
"errors": {
"token": [
"El campo token es obligatorio."
]
}
}
{
"message": "Token de sesión inválido o expirado."
}
Tokenizar tarjeta
Registra una nueva tarjeta de crédito/débito para el cliente autenticado usando tokenización.
POST
/
customers
/
session
/
payment-methods
curl https://api.onepay.la/v1/customers/session/payment-methods \
-X POST \
-H "Authorization: Bearer sk_test_KjbE0Vobf5Lg1yNZ4HoKawDItDs3Rod9VXNBWrEYmGn06tkesPIi" \
-H "X-Customer-Token: 83|i7Cs8TpuDXOLOsDmEKSUPPW3GiFaz83bzFg73yFp" \
-H "Content-Type: application/json" \
-d '{
"token": "tok_5183e3ae3ac4"
}'
const response = await fetch('https://api.onepay.la/v1/customers/session/payment-methods', {
method: 'POST',
headers: {
'Authorization': 'Bearer sk_test_KjbE0Vobf5Lg1yNZ4HoKawDItDs3Rod9VXNBWrEYmGn06tkesPIi',
'X-Customer-Token': '83|i7Cs8TpuDXOLOsDmEKSUPPW3GiFaz83bzFg73yFp',
'Content-Type': 'application/json'
},
body: JSON.stringify({
token: 'tok_5183e3ae3ac4'
})
});
const card = await response.json();
import requests
response = requests.post(
'https://api.onepay.la/v1/customers/session/payment-methods',
headers={
'Authorization': 'Bearer sk_test_KjbE0Vobf5Lg1yNZ4HoKawDItDs3Rod9VXNBWrEYmGn06tkesPIi',
'X-Customer-Token': '83|i7Cs8TpuDXOLOsDmEKSUPPW3GiFaz83bzFg73yFp',
'Content-Type': 'application/json'
},
json={
'token': 'tok_5183e3ae3ac4'
}
)
card = response.json()
{
"id": "bb02b2fd-154c-4c90-9fdf-cec3a0b25cf5",
"brand": "visa",
"last_four": "4242",
"label": "Visa ····4242"
}
{
"message": "El campo token es obligatorio.",
"errors": {
"token": [
"El campo token es obligatorio."
]
}
}
{
"message": "Token de sesión inválido o expirado."
}
Registra una nueva tarjeta de crédito o débito para el cliente autenticado. Requiere un token temporal generado previamente por tu frontend con el SDK de tokenización.
Nunca envíes datos de tarjeta (PAN, CVV, fecha de expiración) directamente a este endpoint. Usa el SDK de tokenización para obtener un
token seguro.Headers
string
required
Bearer token de tu empresa.
string
required
Token de sesión del cliente obtenido en /customers/login/verify.
Body
string
required
Token temporal de la tarjeta obtenido del SDK de tokenización. Este token es de un solo uso.
Respuesta
string
ID de la tarjeta registrada.
string
Marca de la tarjeta:
visa, mastercard, amex, diners.string
Últimos 4 dígitos de la tarjeta.
string
Etiqueta legible (ej.
Visa ····4242).curl https://api.onepay.la/v1/customers/session/payment-methods \
-X POST \
-H "Authorization: Bearer sk_test_KjbE0Vobf5Lg1yNZ4HoKawDItDs3Rod9VXNBWrEYmGn06tkesPIi" \
-H "X-Customer-Token: 83|i7Cs8TpuDXOLOsDmEKSUPPW3GiFaz83bzFg73yFp" \
-H "Content-Type: application/json" \
-d '{
"token": "tok_5183e3ae3ac4"
}'
const response = await fetch('https://api.onepay.la/v1/customers/session/payment-methods', {
method: 'POST',
headers: {
'Authorization': 'Bearer sk_test_KjbE0Vobf5Lg1yNZ4HoKawDItDs3Rod9VXNBWrEYmGn06tkesPIi',
'X-Customer-Token': '83|i7Cs8TpuDXOLOsDmEKSUPPW3GiFaz83bzFg73yFp',
'Content-Type': 'application/json'
},
body: JSON.stringify({
token: 'tok_5183e3ae3ac4'
})
});
const card = await response.json();
import requests
response = requests.post(
'https://api.onepay.la/v1/customers/session/payment-methods',
headers={
'Authorization': 'Bearer sk_test_KjbE0Vobf5Lg1yNZ4HoKawDItDs3Rod9VXNBWrEYmGn06tkesPIi',
'X-Customer-Token': '83|i7Cs8TpuDXOLOsDmEKSUPPW3GiFaz83bzFg73yFp',
'Content-Type': 'application/json'
},
json={
'token': 'tok_5183e3ae3ac4'
}
)
card = response.json()
{
"id": "bb02b2fd-154c-4c90-9fdf-cec3a0b25cf5",
"brand": "visa",
"last_four": "4242",
"label": "Visa ····4242"
}
{
"message": "El campo token es obligatorio.",
"errors": {
"token": [
"El campo token es obligatorio."
]
}
}
{
"message": "Token de sesión inválido o expirado."
}
Was this page helpful?
⌘I