Listar Métodos de Pago
curl --request GET \
--url http://api.gu1.ai/entities \
--header 'Authorization: Bearer <token>'import requests
url = "http://api.gu1.ai/entities"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('http://api.gu1.ai/entities', 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 => "http://api.gu1.ai/entities",
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 := "http://api.gu1.ai/entities"
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("http://api.gu1.ai/entities")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("http://api.gu1.ai/entities")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"entities": [
{}
],
"pagination": {}
}Referencia API
Listar Métodos de Pago
Listar todas las entidades de método de pago con filtrado y paginación — en el modelo de entidades gu1 para tarjetas, cuentas y billeteras.
GET
/
entities
Listar Métodos de Pago
curl --request GET \
--url http://api.gu1.ai/entities \
--header 'Authorization: Bearer <token>'import requests
url = "http://api.gu1.ai/entities"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('http://api.gu1.ai/entities', 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 => "http://api.gu1.ai/entities",
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 := "http://api.gu1.ai/entities"
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("http://api.gu1.ai/entities")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("http://api.gu1.ai/entities")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"entities": [
{}
],
"pagination": {}
}Descripción General
Recupera una lista de entidades de método de pago con filtrado opcional por propietario, tipo u otros criterios.Endpoint
GET http://api.gu1.ai/entities?entityType=payment_method
Autenticación
Requiere una clave API válida en el encabezado de Autorización:Authorization: Bearer YOUR_API_KEY
Parámetros de Consulta
string
required
Debe ser
"payment_method" para filtrar métodos de pagostring
Filtrar por relación con otra entidad (ej. UUID del propietario persona o empresa)
number
Número de resultados a devolver (predeterminado: 50, máx: 100)
number
Número de resultados a omitir para paginación (predeterminado: 0)
string
Campo por el que ordenar:
createdAt, updatedAt, riskScorestring
Orden de clasificación:
asc o desc (predeterminado: desc)Ejemplos de Solicitudes
Listar Todos los Métodos de Pago
curl -X GET "http://api.gu1.ai/entities?entityType=payment_method" \
-H "Authorization: Bearer YOUR_API_KEY"
const response = await fetch(
'http://api.gu1.ai/entities?entityType=payment_method',
{
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
}
);
const { entities, pagination } = await response.json();
console.log(`Se encontraron ${entities.length} métodos de pago`);
import requests
response = requests.get(
'http://api.gu1.ai/entities',
headers={
'Authorization': 'Bearer YOUR_API_KEY'
},
params={
'entityType': 'payment_method'
}
)
data = response.json()
print(f"Se encontraron {len(data['entities'])} métodos de pago")
Listar Métodos de Pago para una Persona
curl -X GET "http://api.gu1.ai/entities?entityType=payment_method&relationshipWith=person-uuid-123" \
-H "Authorization: Bearer YOUR_API_KEY"
const personId = 'person-uuid-123';
const response = await fetch(
`http://api.gu1.ai/entities?entityType=payment_method&relationshipWith=${personId}`,
{
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
}
);
const { entities } = await response.json();
console.log(`La persona tiene ${entities.length} métodos de pago`);
entities.forEach(pm => {
const type = pm.entityData.paymentMethod.type;
const last4 = pm.entityData.paymentMethod.last4;
console.log(` - ${type} terminando en ${last4}`);
});
person_id = 'person-uuid-123'
response = requests.get(
'http://api.gu1.ai/entities',
headers={'Authorization': 'Bearer YOUR_API_KEY'},
params={
'entityType': 'payment_method',
'relationshipWith': person_id
}
)
entities = response.json()['entities']
print(f"La persona tiene {len(entities)} métodos de pago")
for pm in entities:
pm_type = pm['entityData']['paymentMethod']['type']
last4 = pm['entityData']['paymentMethod'].get('last4', 'N/A')
print(f" - {pm_type} terminando en {last4}")
Respuesta
boolean
Si la solicitud fue exitosa
array
Array de entidades de método de pago
object
Información de paginación
Ejemplo de Respuesta
{
"success": true,
"entities": [
{
"id": "payment-method-uuid-123",
"entityType": "payment_method",
"entityData": {
"paymentMethod": {
"type": "credit_card",
"last4": "4242",
"brand": "visa",
"holderName": "John Doe"
}
},
"riskScore": 15,
"createdAt": "2024-01-15T10:00:00.000Z"
}
],
"pagination": {
"total": 1,
"limit": 50,
"offset": 0,
"hasMore": false
}
}
Ver También
Was this page helpful?