xid (external identifier) and xmetadata (external metadata). These fields allow you to attach your own identifiers and structured data to resources, simplifying integration and eliminating the need for complex ID mapping between your platform and UTGL.
Overview
Bothxid and xmetadata are optional fields that can be attached to resources during creation or updates. They are included in all API responses and webhook events, making them ideal for:
- Resource Mapping - Map UTGL resources to your internal systems
- Context Storage - Store additional structured information about resources
- Search and Query - Use
xidto search for resources - Integration Tracking - Track resources across systems without maintaining separate mapping tables
External Identifier (xid)
Thexid field allows you to attach your own unique identifier to resources created through the Issuing API.
Characteristics
- Type: String
- Max Length: 256 characters
- Uniqueness: Must be unique across all resources created under your account
- Visibility: Visible in the UTGL platform user interface
- Included In: All API responses and webhook events
Use Cases
- Internal System Mapping - Map UTGL resource IDs to your internal database IDs
- Cross-Platform References - Reference resources using your own identifiers
- Search and Filtering - Query resources by your external identifiers
- Audit Trails - Track resources using your own reference system
Example Usage
Creating a resource with xid:Best Practices
- Use Consistent Format - Establish a consistent naming convention for your
xidvalues - Include Context - Use prefixes or patterns that indicate resource type (e.g.,
account-,card-,transfer-) - Avoid Sensitive Data - Don’t include sensitive information in
xidvalues - Keep It Readable - Use human-readable identifiers for easier debugging and support
External Metadata (xmetadata)
Thexmetadata field allows you to attach structured key-value pairs to resources for storing additional context and information.
Characteristics
- Type: Object with string key-value pairs
- Max Keys: 25 key-value pairs per resource
- Key Constraints:
- Max length: 40 characters
- Must be strings
- Value Constraints:
- Max length: 1024 characters per value
- Must be strings or arrays of strings
- Nested Objects: Not supported
- Visibility: Visible in the UTGL platform user interface
Schema Definition
- A string (up to 1024 characters)
- An array of strings (each string up to 1024 characters)
Use Cases
- Routing Information - Store SMS or OTP routing preferences for cards
- Business Context - Attach department, project, or cost center information
- Integration Data - Store references to related resources in your system
- Custom Attributes - Add domain-specific metadata for your use case
- Workflow State - Track processing status or workflow stages
Example Usage
Creating a card with metadata:Metadata Merging
When a parent resource (e.g., card account) and child resource (e.g., card) both contain metadata, the metadata is merged in responses: Parent Resource (Card Account):Metadata Merging: When metadata keys conflict between parent and child resources, both values are preserved with prefixed keys to avoid overwriting.
Limitations
| Constraint | Limit |
|---|---|
| Maximum keys | 25 key-value pairs |
| Key length | 40 characters |
| Value length (string) | 1024 characters |
| Value length (array item) | 1024 characters per item |
| Nested objects | Not supported |
Best Practices
- Use Descriptive Keys - Choose clear, descriptive key names that indicate purpose
- Keep Values Concise - Stay within the 1024 character limit per value
- Avoid Sensitive Data - Never store sensitive information in metadata
- Plan Key Names - Establish a naming convention to avoid conflicts
- Document Your Schema - Document your metadata structure for your team
Security Considerations
These fields are:- Visible in the UTGL platform user interface
- Included in all API responses
- Included in all webhook events
- Accessible to anyone with API access to your account
Code Examples
JavaScript/TypeScript
Python
Using xid for Resource Lookup
Common Patterns
Pattern 1: Internal Reference Mapping
Usexid to maintain a direct mapping between your internal IDs and UTGL resources:
Pattern 2: Routing Configuration
Store routing preferences in metadata:Pattern 3: Business Context
Attach business context to resources:Pattern 4: Integration References
Store references to related resources in your system:API Endpoints Supporting xid and xmetadata
Most POST endpoints supportxid and xmetadata:
- Account creation
- Card account creation
- Card issuance
- Transfer creation
- Payout creation
- Fee charging
- And more…
Troubleshooting
Common Issues
Issue: xid already exists- Solution: Ensure
xidvalues are unique across all resources. Use a prefix or namespace to avoid conflicts.
- Solution: Keep key names under 40 characters. Use abbreviations if necessary.
- Solution: Split long values into multiple keys or use arrays for related values.
- Solution: Consolidate related information into fewer keys. Maximum is 25 key-value pairs.
- Solution: Verify metadata was included in the creation request. Check that you’re reading the correct resource response.
Next Steps
- Review API Reference for endpoint-specific
xidandxmetadatasupport - Learn about Webhook Events to see how metadata is included in events
- Explore Resource Management for more integration patterns

