Detalle tarjeta
curl --request GET \
--url https://api.onepay.la/v1/cards/{card_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.onepay.la/v1/cards/{card_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.onepay.la/v1/cards/{card_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.onepay.la/v1/cards/{card_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.onepay.la/v1/cards/{card_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.onepay.la/v1/cards/{card_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.onepay.la/v1/cards/{card_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "9e01eeae-2868-4564-9d04-84d1d1d027d2",
"brand": "Mastercard",
"label": "Mastercard • 8099",
"last_four": "8099",
"expiration_date": "9/2026",
"customer_id": "9df8018b-6a28-4696-b7b2-63615f34a2f5",
"created_at": "2025-01-19T18:29:25.000000Z",
"country": "CO"
}
{
"message": "Tarjeta no encontrada",
"code": 10004,
"code_name": "not_found"
}
Detalle tarjeta
Endpoint para obtener los detalles de una tarjeta de crédito o débito registrada en OnePay.
GET
/
cards
/
{card_id}
Detalle tarjeta
curl --request GET \
--url https://api.onepay.la/v1/cards/{card_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.onepay.la/v1/cards/{card_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.onepay.la/v1/cards/{card_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.onepay.la/v1/cards/{card_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.onepay.la/v1/cards/{card_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.onepay.la/v1/cards/{card_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.onepay.la/v1/cards/{card_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "9e01eeae-2868-4564-9d04-84d1d1d027d2",
"brand": "Mastercard",
"label": "Mastercard • 8099",
"last_four": "8099",
"expiration_date": "9/2026",
"customer_id": "9df8018b-6a28-4696-b7b2-63615f34a2f5",
"created_at": "2025-01-19T18:29:25.000000Z",
"country": "CO"
}
{
"message": "Tarjeta no encontrada",
"code": 10004,
"code_name": "not_found"
}
ID de la tarjeta tokenizada. Ver cómo registrar tarjetas.
- curl
- JavaScript
- Python
curl https://api.onepay.la/v1/cards/bb02b2fd-154c-4c90-9fdf-cec3a0b25cf5 \
-H "Authorization: Bearer sk_test_xxx"
const response = await fetch(
'https://api.onepay.la/v1/cards/bb02b2fd-154c-4c90-9fdf-cec3a0b25cf5',
{
headers: {
'Authorization': 'Bearer sk_test_xxx',
},
}
);
const card = await response.json();
import requests
response = requests.get(
'https://api.onepay.la/v1/cards/bb02b2fd-154c-4c90-9fdf-cec3a0b25cf5',
headers={'Authorization': 'Bearer sk_test_xxx'},
)
card = response.json()
Identificador único de la tarjeta (UUID).
Marca de la tarjeta. Valores posibles:
Visa, Mastercard, Amex, Diners.Etiqueta de la tarjeta en formato
Marca • últimos 4 dígitos.Últimos 4 dígitos de la tarjeta.
Fecha de expiración en formato
MM/YYYY.ID del cliente (guest) al que pertenece la tarjeta.
Fecha de creación en formato ISO 8601.
Código de país de emisión de la tarjeta (ISO 3166-1 alpha-2).
{
"id": "9e01eeae-2868-4564-9d04-84d1d1d027d2",
"brand": "Mastercard",
"label": "Mastercard • 8099",
"last_four": "8099",
"expiration_date": "9/2026",
"customer_id": "9df8018b-6a28-4696-b7b2-63615f34a2f5",
"created_at": "2025-01-19T18:29:25.000000Z",
"country": "CO"
}
{
"message": "Tarjeta no encontrada",
"code": 10004,
"code_name": "not_found"
}
Was this page helpful?
⌘I