cURL
curl --request GET \ --url http://api.gu1.ai/entities/{id} \ --header 'Authorization: Bearer <token>'
{ "success": true, "id": "<string>", "entityType": "<string>", "entityData": { "paymentMethod": {} }, "relationships": [ {} ], "metadata": {}, "riskScore": 123, "riskFactors": [ {} ], "createdAt": "<string>", "updatedAt": "<string>" }
Retrieve a payment method entity by ID
GET http://api.gu1.ai/entities/{id}
Authorization: Bearer YOUR_API_KEY
curl -X GET "http://api.gu1.ai/entities/payment-method-uuid-123" \ -H "Authorization: Bearer YOUR_API_KEY"
"payment_method"
Show properties
{ "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" }
{ "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" }
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 }; }
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": "Entity not found", "entityId": "payment-method-uuid-123" }
{ "error": "Invalid or missing API key" }
Was this page helpful?