Custom Attributes
Enrich your data with flexible custom metadata for reporting and integration
Custom attributes provide a flexible way to enrich your Payload objects with business-specific
metadata. Every object in the Payload API supports custom attributes via the attrs property.
Add custom data to any object including transactions, invoices, accounts, billing schedules, and
more. These attributes appear in the dashboard, can be used in reports, are searchable, and
serve as reference information for system integrations.
Common Use Cases
- Business Context - Add order IDs, customer references, project codes, and purchase order numbers to link transactions to your business systems
- Reporting & Analytics - Track by department, cost center, product category, or region for detailed financial reporting and segmentation
- Customer Segmentation - Store customer tier, industry, account health scores, and lifetime value for targeted analysis
- System Integration - Connect with external systems using CRM IDs, sync timestamps, and reconciliation status (use underscore prefix to hide from dashboard)
Custom attributes are stored in the attrs property as a flexible JSON object. You can add
any custom fields you need for your business - there are no predefined fields. Attributes are
available in the Payload dashboard (except underscore-prefixed fields), dashboard reports, and
can be queried via API. Prefix attribute names with underscore (_) to hide them from the
dashboard for integration-only use.
Prerequisites
Before using custom attributes, understand:
Objects and APIs
Understand the different Payload objects where you can add custom attributes.
Dashboard reporting
Custom attributes populate to dashboard reports for analysis.
System integration
Use attributes to store external system references and sync metadata.
What Are Custom Attributes
Custom attributes extend Payload objects with your business-specific data.
The attrs property
Every Payload object includes an attrs property that accepts any JSON structure:
{
"id": "txn_abc123",
"type": "payment",
"amount": 150.00,
"attrs": {
"Order ID": "ORD-2024-5678",
"Project Code": "PROJ-Q1",
"department": "Sales",
"_crm_account_id": "sf_00123456"
}
}Key characteristics:
- Flexible structure: Add any fields you need
- No predefined schema: Fields are not enforced
- Nested objects supported: Create complex structures
- Queryable: Filter and search by attribute values
- Dashboard visible: Appears in Payload dashboard (except underscore-prefixed fields)
- Report friendly: Available in dashboard reports
- Integration fields: Prefix with underscore (_) to hide from dashboard
Where to use custom attributes
Custom attributes are available on every object in the Payload API, including:
- Transactions - Payments, payouts, transfers
- Invoices - Invoice-level metadata and tracking
- Accounts - Customer segmentation and classification
- Billing Schedules - Subscription and contract information
- Payment Methods - Card or bank account metadata
- Billing Items - Line item categorization
- And all other API objects - Every object supports custom attributes
Underscore Prefix: Attribute names beginning with an underscore (e.g., _external_id,
_sync_status) are hidden from the Payload dashboard and are intended for integration use
only. Use underscore-prefixed attributes for system references and internal metadata that
shouldn't be visible to dashboard users.
Adding Custom Attributes
Add custom attributes when creating or updating objects.
Enrich transactions with business context, categorization, and tracking information.
Receipt formatting:
Transaction attributes appear on customer receipts. Use display-friendly key names with title case and spaces (e.g., "Order ID", "Project Code") for customer-facing fields. Use snake_case for internal fields and underscore prefix for integration-only fields.
Add invoice-level metadata for contract tracking and reporting.
Segment and classify accounts for reporting and analysis.
Querying Custom Attributes
Filter and search objects using custom attribute values.
Query by custom attributes using the same filter syntax as standard fields.
Query examples:
- Find all sales department transactions
- Get invoices for specific billing period
- List accounts by customer segment
- Search by external system IDs
- Filter by project or cost center
Complex queries: Combine multiple attributes with standard fields:
// High-value approved sales transactions
q: 'attrs[department] == "Sales" && attrs[approval_code] != null && amount >= 1000.00'
// Enterprise invoices past due
q: 'attrs[customer_tier] == "enterprise" && status == "unpaid" && due_date < date("now")'
// Accounts by region with high churn risk
q: 'attrs[sales_region] == "US-West" && attrs[churn_risk] == "high"'Dashboard Filtering: The Payload dashboard allows filtering by custom attributes (except underscore-prefixed fields). Add commonly-used attributes like customer tier, department, or project code to enable quick filtering. Prefix integration-only fields with underscore to keep them hidden.
Dashboard and Reporting Integration
Custom attributes enhance dashboard visibility and reporting capabilities.
Dashboard display
Where attributes appear:
- Object detail pages show all custom attributes (except underscore-prefixed)
- Search includes custom attribute fields
- Exports can be customized to include custom attributes
Dashboard features:
- Searchable: Find records by any attribute value
- Filterable: Create saved filters using attributes
- Exportable: Export includes all custom attributes
- Hidden fields: Attributes starting with underscore (_) are hidden from dashboard
Integration-only attributes:
Prefix attribute names with an underscore to hide them from the dashboard. These attributes are still queryable via API but won't appear in the dashboard UI:
{
"attrs": {
"customer_tier": "enterprise",
"_crm_id": "sf_00123456",
"_last_sync": "2024-01-15T10:30:00Z"
}
}Use underscore-prefixed attributes for system references, sync metadata, and internal fields that dashboard users don't need to see.
Receipts and Custom Attributes
Custom attributes on transactions automatically appear on receipts (except underscore-prefixed).
Transaction custom attributes are included in generated receipts, providing customers with complete context. Use display-friendly key names (e.g., "Order ID", "Project Code") instead of snake_case for better presentation on customer-facing receipts.
Receipt formatting best practices:
- Use title case with spaces for customer-facing fields: "Order ID", "Project Code"
- Underscore-prefixed attributes are always excluded from receipts
Example:
{
"attrs": {
"Order ID": "ORD-2024-5678",
"Project Code": "PROJ-Q1",
"_crm_id": "sf_00123456"
}
}For complete details on receipt generation and customization, see Transaction Receipts.
System Integration
Use custom attributes to integrate Payload with external systems.
Store external system references and synchronization metadata using underscore-prefixed attributes to keep integration fields hidden from the dashboard.
External system references
Common integration attributes:
Use underscore prefix for integration-only fields:
-
_external_id- External system IDs (CRM, ERP, accounting) -
_external_url- External URLs for deep linking -
_sync_timestamp- Last sync timestamp -
_sync_batch_id- Sync batch or job ID -
_source_system- Source system identifier
Bi-directional sync tracking
Track synchronization with hidden attributes:
-
_last_sync- Last sync timestamp -
_sync_version- Sync version or revision number -
_sync_status- Sync status (completed, pending, failed) -
_sync_batch_id- Sync batch or job ID -
_source_system- Source system identifier
Example with both visible and hidden attributes:
{
"attrs": {
"order_id": "ORD-2024-5678",
"_crm_account_id": "sf_00123456",
"_last_sync": "2024-01-15T10:30:00Z",
"_sync_status": "completed"
}
}Reconciliation tracking
Reconciliation attributes:
-
_reconciliation_status- Reconciliation status flags -
_reconciliation_date- Reconciliation date and time -
_reconciled_by- Reconciled by (user or system) -
_reconciliation_notes- Reconciliation notes -
_match_confidence- Matching confidence scores
Sensitive Data: Avoid storing sensitive information like passwords, API keys, or PII in custom attributes. Use attributes for reference IDs and non-sensitive metadata only.
Next Steps
Leverage custom attributes for enhanced data management and reporting
Use Attributes in Reporting
Build powerful reports with Reporting Overview for dashboard analytics, master advanced filtering with Building Report Queries using custom attribute filters, and explore Report Examples for common reporting patterns using custom attributes.
Integrate with External Systems
Connect external systems with System Integration best practices, receive real-time updates via Webhooks for automatic sync, and explore complete API capabilities in API Reference for integration development.
Customize Transaction Receipts
Include custom attributes on receipts with Transaction Receipts documentation, understand the full lifecycle with Transaction Status, and learn about bank statement customization with Custom Descriptors.
Related articles
- Reporting Overview - Dashboard and custom reports
- Building Report Queries - Advanced reporting
- Transaction Receipts - Receipts include custom attributes
- Bank Reconciliation - Use attributes for reconciliation
- Custom Descriptors - Customize transaction descriptors
- Transactions API - Complete transaction API
- Invoices API - Complete invoice API
- Accounts API - Complete account API