Get Payment Method
curl --request GET \
--url http://api.gu1.ai/entities/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "http://api.gu1.ai/entities/{id}"
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/{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 => "http://api.gu1.ai/entities/{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 := "http://api.gu1.ai/entities/{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("http://api.gu1.ai/entities/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("http://api.gu1.ai/entities/{id}")
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,
"id": "<string>",
"entityType": "<string>",
"entityData": {
"paymentMethod": {}
},
"relationships": [
{}
],
"metadata": {},
"riskScore": 123,
"riskFactors": [
{}
],
"createdAt": "<string>",
"updatedAt": "<string>"
}API Reference
Get Payment Method
Retrieve a payment method entity by ID β in the gu1 entity model for card, account, and wallet records, with examples for get use cases.
GET
/
entities
/
{id}
Get Payment Method
curl --request GET \
--url http://api.gu1.ai/entities/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "http://api.gu1.ai/entities/{id}"
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/{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 => "http://api.gu1.ai/entities/{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 := "http://api.gu1.ai/entities/{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("http://api.gu1.ai/entities/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("http://api.gu1.ai/entities/{id}")
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,
"id": "<string>",
"entityType": "<string>",
"entityData": {
"paymentMethod": {}
},
"relationships": [
{}
],
"metadata": {},
"riskScore": 123,
"riskFactors": [
{}
],
"createdAt": "<string>",
"updatedAt": "<string>"
}Overview
Retrieves detailed information about a specific payment method entity including its data, relationships, and metadata.Endpoint
GET http://api.gu1.ai/entities/{id}
Authentication
Requires a valid API key in the Authorization header:Authorization: Bearer YOUR_API_KEY
Path Parameters
string
required
UUID of the payment method entity to retrieve
Example Requests
curl -X GET "http://api.gu1.ai/entities/payment-method-uuid-123" \
-H "Authorization: Bearer YOUR_API_KEY"
const response = await fetch(
'http://api.gu1.ai/entities/payment-method-uuid-123',
{
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
}
);
const paymentMethod = await response.json();
console.log(paymentMethod.entityData.paymentMethod);
import requests
response = requests.get(
'http://api.gu1.ai/entities/payment-method-uuid-123',
headers={
'Authorization': 'Bearer YOUR_API_KEY'
}
)
payment_method = response.json()
print(payment_method['entityData']['paymentMethod'])
Response
boolean
Whether the request was successful
string
UUID of the payment method entity
string
Always
"payment_method"object
Payment method data
Show properties
Show properties
object
Payment method details (structure varies by type)
array
Array of relationships to other entities (owners, transactions, devices)
object
Additional metadata
number
Calculated risk score (if analyzed)
array
Array of identified risk factors
string
ISO 8601 timestamp of creation
string
ISO 8601 timestamp of last update
Response Examples
Credit Card Response
{
"success": true,
"id": "payment-method-uuid-123",
"entityType": "payment_method",
"entityData": {
"paymentMethod": {
"type": "credit_card",
"last4": "4242",
"brand": "visa",
"expiryMonth": "12",
"expiryYear": "2025",
"holderName": "John Doe",
"issuerCountry": "BR",
"bin": "424242",
"funding": "credit",
"fingerprint": "abc123xyz"
}
},
"relationships": [
{
"targetEntityId": "person-uuid-123",
"relationshipType": "owns",
"strength": 1.0,
"metadata": {
"since": "2024-01-15"
}
}
],
"riskScore": 15,
"riskFactors": [
{
"type": "high_velocity",
"severity": "low",
"description": "Multiple transactions in short timeframe"
}
],
"createdAt": "2024-01-15T10:00:00.000Z",
"updatedAt": "2024-12-23T10:00:00.000Z"
}
Bank Account Response
{
"success": true,
"id": "payment-method-uuid-456",
"entityType": "payment_method",
"entityData": {
"paymentMethod": {
"type": "bank_account",
"accountNumber": "12345-6",
"accountType": "checking",
"bank": "Banco do Brasil",
"currency": "BRL",
"routingNumber": "001",
"holderName": "John Doe"
}
},
"relationships": [
{
"targetEntityId": "person-uuid-123",
"relationshipType": "owns",
"strength": 1.0
}
],
"riskScore": 5,
"riskFactors": [],
"createdAt": "2024-01-15T10:00:00.000Z",
"updatedAt": "2024-12-23T10:00:00.000Z"
}
Use Cases
Get Payment Method with Owner Details
async function getPaymentMethodWithOwner(paymentMethodId) {
// Get payment method
const pmResponse = await fetch(
`http://api.gu1.ai/entities/${paymentMethodId}`,
{
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
}
);
const paymentMethod = await pmResponse.json();
// Get owner (first relationship)
const ownerRelationship = paymentMethod.relationships.find(
r => r.relationshipType === 'owns'
);
if (ownerRelationship) {
const ownerResponse = await fetch(
`http://api.gu1.ai/entities/${ownerRelationship.targetEntityId}`,
{
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
}
);
const owner = await ownerResponse.json();
return {
paymentMethod,
owner
};
}
return { paymentMethod };
}
Check Payment Method Transaction History
async function getPaymentMethodTransactions(paymentMethodId) {
// Get all transactions linked to this payment method
const response = await fetch(
`http://api.gu1.ai/entities?entityType=transaction&relationshipWith=${paymentMethodId}`,
{
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
}
);
const { entities } = await response.json();
return entities;
}
Error Responses
404 Not Found
{
"error": "Entity not found",
"entityId": "payment-method-uuid-123"
}
401 Unauthorized
{
"error": "Invalid or missing API key"
}
See Also
Was this page helpful?