curl https://api.onepay.la/v1/customers/9dd4158b-0e45-42bc-b56f-a4c1f856814d/cards \
-H "Authorization: Bearer sk_test_xxx"
const customerId = '9dd4158b-0e45-42bc-b56f-a4c1f856814d';
const response = await fetch(`https://api.onepay.la/v1/customers/${customerId}/cards`, {
method: 'GET',
headers: {
'Authorization': 'Bearer sk_test_xxx'
}
});
const data = await response.json();
console.log(data.data); // Array de tarjetas
console.log(data.current_page); // Página actual
import requests
customer_id = "9dd4158b-0e45-42bc-b56f-a4c1f856814d"
url = f"https://api.onepay.la/v1/customers/{customer_id}/cards"
headers = {
"Authorization": "Bearer sk_test_xxx"
}
response = requests.get(url, headers=headers)
data = response.json()
print(data["data"]) # Array de tarjetas
print(data["current_page"]) # Página actual
<?php
$customerId = "9dd4158b-0e45-42bc-b56f-a4c1f856814d";
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => "https://api.onepay.la/v1/customers/{$customerId}/cards",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer sk_test_xxx"
]
]);
$response = curl_exec($ch);
$data = json_decode($response, true);
print_r($data["data"]); // Array de tarjetas
echo $data["current_page"]; // Página actual
curl_close($ch);
?>
{
{
"data":[
{
"id": "9a7a7105-631d-4ad0-8e06-5c7bc2dfe32e",
"brand": "mastercard",
"label": "**** **** **** 8212",
"last_four": "8212",
"expiration_date": "2030-09-30",
"customer_id": "9a708f99-fc8b-4a09-ad20-bea12f4af1b3",
"created_at": "2024-12-12 10:30:01",
"country": "CO"
}
],
"current_page":1,
"first_page_url":"https:\/\/api.onepay.la\/v1\/customers\/9a7a6ccf-f75c-45f9-ad11-aae3c80971f0\/cards?page=1",
"from":null,
"next_page_url":null,
"path":"https:\/\/api.onepay.la\/v1\/customers\/9a7a6ccf-f75c-45f9-ad11-aae3c80971f0\/cards",
"per_page":20,
"prev_page_url":null,
"to":null
}
}
{
"message": "Registro no encontrado, Cliente no existe",
"code": 10002,
"code_name": "record_not_found"
}
Tarjetas de un cliente
GET
/
customers
/
{customer_id}
/
cards
curl https://api.onepay.la/v1/customers/9dd4158b-0e45-42bc-b56f-a4c1f856814d/cards \
-H "Authorization: Bearer sk_test_xxx"
const customerId = '9dd4158b-0e45-42bc-b56f-a4c1f856814d';
const response = await fetch(`https://api.onepay.la/v1/customers/${customerId}/cards`, {
method: 'GET',
headers: {
'Authorization': 'Bearer sk_test_xxx'
}
});
const data = await response.json();
console.log(data.data); // Array de tarjetas
console.log(data.current_page); // Página actual
import requests
customer_id = "9dd4158b-0e45-42bc-b56f-a4c1f856814d"
url = f"https://api.onepay.la/v1/customers/{customer_id}/cards"
headers = {
"Authorization": "Bearer sk_test_xxx"
}
response = requests.get(url, headers=headers)
data = response.json()
print(data["data"]) # Array de tarjetas
print(data["current_page"]) # Página actual
<?php
$customerId = "9dd4158b-0e45-42bc-b56f-a4c1f856814d";
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => "https://api.onepay.la/v1/customers/{$customerId}/cards",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer sk_test_xxx"
]
]);
$response = curl_exec($ch);
$data = json_decode($response, true);
print_r($data["data"]); // Array de tarjetas
echo $data["current_page"]; // Página actual
curl_close($ch);
?>
{
{
"data":[
{
"id": "9a7a7105-631d-4ad0-8e06-5c7bc2dfe32e",
"brand": "mastercard",
"label": "**** **** **** 8212",
"last_four": "8212",
"expiration_date": "2030-09-30",
"customer_id": "9a708f99-fc8b-4a09-ad20-bea12f4af1b3",
"created_at": "2024-12-12 10:30:01",
"country": "CO"
}
],
"current_page":1,
"first_page_url":"https:\/\/api.onepay.la\/v1\/customers\/9a7a6ccf-f75c-45f9-ad11-aae3c80971f0\/cards?page=1",
"from":null,
"next_page_url":null,
"path":"https:\/\/api.onepay.la\/v1\/customers\/9a7a6ccf-f75c-45f9-ad11-aae3c80971f0\/cards",
"per_page":20,
"prev_page_url":null,
"to":null
}
}
{
"message": "Registro no encontrado, Cliente no existe",
"code": 10002,
"code_name": "record_not_found"
}
Obtiene las tarjetas de un cliente específico.
Parámetros de Ruta
string
required
ID del cliente dueño de las tarjetas. Crear cliente.
curl https://api.onepay.la/v1/customers/9dd4158b-0e45-42bc-b56f-a4c1f856814d/cards \
-H "Authorization: Bearer sk_test_xxx"
const customerId = '9dd4158b-0e45-42bc-b56f-a4c1f856814d';
const response = await fetch(`https://api.onepay.la/v1/customers/${customerId}/cards`, {
method: 'GET',
headers: {
'Authorization': 'Bearer sk_test_xxx'
}
});
const data = await response.json();
console.log(data.data); // Array de tarjetas
console.log(data.current_page); // Página actual
import requests
customer_id = "9dd4158b-0e45-42bc-b56f-a4c1f856814d"
url = f"https://api.onepay.la/v1/customers/{customer_id}/cards"
headers = {
"Authorization": "Bearer sk_test_xxx"
}
response = requests.get(url, headers=headers)
data = response.json()
print(data["data"]) # Array de tarjetas
print(data["current_page"]) # Página actual
<?php
$customerId = "9dd4158b-0e45-42bc-b56f-a4c1f856814d";
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => "https://api.onepay.la/v1/customers/{$customerId}/cards",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer sk_test_xxx"
]
]);
$response = curl_exec($ch);
$data = json_decode($response, true);
print_r($data["data"]); // Array de tarjetas
echo $data["current_page"]; // Página actual
curl_close($ch);
?>
Response
number
Número de la página actual
string
URL para acceder a la primera página de resultados
number
Índice inicial del primer elemento en la página actual
string
URL para acceder a la siguiente página de resultados. Será
null si es la última páginastring
URL base de la API sin los parámetros de paginación
number
Cantidad de elementos por página
string
URL para acceder a la página anterior. Será
null si es la primera páginanumber
Índice final del último elemento en la página actual
array
Datos de la página actual
Hide data
Hide data
string
Identificador único de la tarjeta en formato UUID
string
Marca de la tarjeta
string
Etiqueta de la tarjeta
string
Últimos cuatro dígitos de la tarjeta
string
Fecha de expiración de la tarjeta
string
Identificador único del cliente en formato UUID
date
Fecha y hora de creación de la tarjeta
string
País de la tarjeta
Ejemplo de petición
{
{
"data":[
{
"id": "9a7a7105-631d-4ad0-8e06-5c7bc2dfe32e",
"brand": "mastercard",
"label": "**** **** **** 8212",
"last_four": "8212",
"expiration_date": "2030-09-30",
"customer_id": "9a708f99-fc8b-4a09-ad20-bea12f4af1b3",
"created_at": "2024-12-12 10:30:01",
"country": "CO"
}
],
"current_page":1,
"first_page_url":"https:\/\/api.onepay.la\/v1\/customers\/9a7a6ccf-f75c-45f9-ad11-aae3c80971f0\/cards?page=1",
"from":null,
"next_page_url":null,
"path":"https:\/\/api.onepay.la\/v1\/customers\/9a7a6ccf-f75c-45f9-ad11-aae3c80971f0\/cards",
"per_page":20,
"prev_page_url":null,
"to":null
}
}
{
"message": "Registro no encontrado, Cliente no existe",
"code": 10002,
"code_name": "record_not_found"
}
Was this page helpful?
⌘I