Skip to main content

Metadata

Updateable Smartbills objects—including Receipts, Customers, Products, and Merchants—have a metadata parameter. You can use this parameter to attach key-value data to these Smartbills objects.

Overview

Metadata allows you to store additional, structured information on an object. This is useful for:
  • Linking Smartbills objects to your internal systems
  • Storing custom business logic data
  • Adding context that’s specific to your application
  • Tracking additional information not covered by standard fields
Smartbills doesn’t use metadata for any internal purposes—for example, we don’t use it to authorize or decline operations, and it won’t be seen by your users unless you choose to show it to them.
Don’t store any sensitive information (like passwords, API keys, or personal identification numbers) as metadata.

Limitations

  • Maximum keys: 50 keys per object
  • Key name length: Up to 40 characters
  • Value length: Up to 500 characters
  • Format: Key-value pairs (both must be strings)

Supported Objects

Metadata can be attached to the following object types:
  • Receipts
  • Customers
  • Products
  • Merchants
  • Locations
  • Employees
  • Expenses
  • Expense Reports

Adding Metadata

You can add metadata when creating or updating an object:

Updating Metadata

You can update metadata on existing objects:
When updating metadata, the entire metadata object is replaced. Include all keys you want to keep, not just the ones you’re changing.

Retrieving Metadata

Metadata is included in the object response:

Deleting Metadata

To remove specific metadata keys, set them to null:
To remove all metadata, set the metadata field to an empty object:

Sample Use Cases

Store business-specific information for reporting and analytics.
Annotate customers with segmentation data.
Track approval workflows and processing status.
Associate receipts or transactions with marketing campaigns.

Filtering by Metadata

You can filter list requests by metadata values:

Best Practices

Use a consistent naming convention for metadata keys across your application.
Maintain documentation of which metadata keys you use and their purposes.
Validate metadata values in your application before sending to the API.
Never store sensitive information in metadata:
  • Passwords or API keys
  • Credit card numbers
  • Social security numbers
  • Personal health information
  • Any PII that requires encryption
Design your metadata schema to support efficient filtering and querying.

Error Handling

Common metadata-related errors:

Example: Complete Integration

Here’s a complete example showing how to use metadata in a real-world scenario:

API Reference

Complete API documentation

Best Practices

Learn API best practices