Expand description
§StateSet iCommerce
The SQLite of commerce operations. An embeddable commerce library that runs anywhere with zero external dependencies.
§Quick Start
ⓘ
use stateset_embedded::{Commerce, CreateCustomer, CreateOrder, CreateOrderItem, CreateInventoryItem};
use rust_decimal_macros::dec;
// Initialize with a database file (creates if not exists)
let commerce = Commerce::new("./store.db")?;
// Create a customer
let customer = commerce.customers().create(CreateCustomer {
email: "alice@example.com".into(),
first_name: "Alice".into(),
last_name: "Smith".into(),
..Default::default()
})?;
// Create inventory
commerce.inventory().create_item(CreateInventoryItem {
sku: "SKU-001".into(),
name: "Widget".into(),
initial_quantity: Some(dec!(100)),
..Default::default()
})?;
// Create an order
let order = commerce.orders().create(CreateOrder {
customer_id: customer.id,
items: vec![CreateOrderItem {
sku: "SKU-001".into(),
name: "Widget".into(),
quantity: 2,
unit_price: dec!(29.99),
..Default::default()
}],
..Default::default()
})?;
// Adjust inventory
commerce.inventory().adjust("SKU-001", dec!(-2), "Order fulfillment")?;§Features
- Zero configuration - Just point to a file and go
- Embedded SQLite - No external database server needed (default)
- PostgreSQL support - Scale to production with
postgresfeature - Full commerce stack - Orders, inventory, customers, products, returns
- Sync API - Simple blocking operations
- Async API - True async for PostgreSQL with
AsyncCommerce - Event-driven - Subscribe to commerce events for side effects
§Database Backends
§SQLite (default)
ⓘ
let commerce = Commerce::new("./store.db")?;
// or in-memory for testing
let commerce = Commerce::new(":memory:")?;§PostgreSQL (requires postgres feature)
ⓘ
let commerce = Commerce::with_postgres("postgres://user:pass@localhost/db")?;
// or via builder
let commerce = Commerce::builder()
.postgres("postgres://localhost/stateset")
.max_connections(20)
.build()?;§Async PostgreSQL API
For true async operations with PostgreSQL, use AsyncCommerce:
ⓘ
use stateset_embedded::{AsyncCommerce, CreateOrder, CreateOrderItem};
use rust_decimal_macros::dec;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let commerce = AsyncCommerce::connect("postgres://localhost/stateset").await?;
// All operations are truly async
let order = commerce.orders().create(CreateOrder {
customer_id: uuid::Uuid::new_v4(),
items: vec![CreateOrderItem {
sku: "SKU-001".into(),
name: "Widget".into(),
quantity: 2,
unit_price: dec!(29.99),
..Default::default()
}],
..Default::default()
}).await?;
let customers = commerce.customers().list(Default::default()).await?;
let inventory = commerce.inventory().get_stock("SKU-001").await?;
Ok(())
}§Architecture
┌─────────────────────────────────────────┐
│ Your Application │
│ ┌───────────────────────────────────┐ │
│ │ Commerce (this crate) │ │
│ │ ┌─────────────────────────────┐ │ │
│ │ │ SQLite or PostgreSQL │ │ │
│ │ └─────────────────────────────┘ │ │
│ └───────────────────────────────────┘ │
└─────────────────────────────────────────┘Re-exports§
pub use events::EventBus;eventspub use events::EventConfig;eventspub use events::EventReceiver;eventspub use events::EventSubscription;eventspub use events::EventSystem;eventspub use events::FilteredSubscription;eventspub use events::InMemoryEventStore;eventspub use events::Webhook;eventspub use events::WebhookConfig;eventspub use events::WebhookDelivery;eventspub use events::WebhookManager;eventspub use events::WebhookRegistrationError;eventspub use events::filters;eventspub use maintenance::Maintenance;pub use notifications::EmailBackend;pub use notifications::EmailTemplate;pub use notifications::LogEmailBackend;pub use notifications::NotificationConfig;pub use notifications::NotificationService;pub use notifications::RecipientResolver;pub use notifications::TransactionalEmail;pub use notifications::WebhookEmailBackend;
Modules§
- events
events - Event streaming infrastructure
- maintenance
- Backup, restore and structured export/import.
- notifications
- Transactional email notification service.
- prelude
- Curated stable subset of the public API — see
preludefor whatstateset-embeddedintends to commit to at 1.0. Stable 1.0 surface for directstateset-embeddedconsumers.
Structs§
- A2APurchase
- A persisted A2A purchase between agents
- A2APurchase
Filter - Filter for listing A2A purchases
- A2AQuote
- A2A Quote - Price quote between agents
- A2AQuote
Filter - Filter for listing quotes
- Accounts
Payable - Accounts Payable management interface.
- Accounts
Receivable - Accounts Receivable interface.
- Activity
Logs - Activity log operations.
- AddCart
Item - Input for adding an item to cart
- AddCarton
- Input for adding a carton.
- AddCarton
Item - Input for adding item to carton.
- AddLot
Certificate - Input for adding a certificate to a lot
- AddShipment
Event - Input for adding a tracking event
- AddWork
Order Material - Input for adding material to a work order
- Address
- Address structure (shipping/billing)
- Adjust
Inventory - Input for adjusting inventory
- Adjust
Location Inventory - Input for adjusting location inventory
- Adjust
Lot - Input for adjusting lot quantity
- Agent
Card - Agent Card - Identity and capability advertisement for AI agents
- Agent
Card Filter - Filter for listing agent cards
- Agent
Feedback - Reputation feedback submitted by a client.
- Agent
Feedback Filter - Filter for reading feedback.
- Agent
Feedback Response - Feedback response appended by an agent or third party.
- Agent
Identity - Identity record for an on-chain ERC-8004 agent.
- Agent
Identity Filter - Filter for listing agent identities.
- Agent
Metadata Entry - Metadata entry for on-chain identity metadata.
- Agent
Registration File - Agent registration file (off-chain JSON referenced by agentURI).
- Agent
Registration Ref - Registration reference entry in the registration file.
- Agent
Service Endpoint - Service endpoint advertised by an agent registration file.
- Agent
Validation Filter - Filter for validation summaries.
- Agent
Validation Request - Validation request submitted by an agent owner/operator.
- Agent
Validation Response - Validation response from a validator.
- Agent
Validation Status - Latest validation status for a request hash.
- Allocate
Backorder - Input for allocating inventory to a backorder.
- Analytics
- Analytics operations interface.
- Analytics
Query - Common analytics query parameters
- ApAging
Summary - AP aging summary.
- Applied
Promotion - A promotion that was successfully applied
- Apply
Cart Discount - Input for applying discount/coupon
- Apply
Credit Memo - Input for applying a credit memo to an invoice
- Apply
Payment ToInvoices - Input for applying a payment across invoices
- Apply
Promotions Request - Request to apply promotions to a cart
- Apply
Promotions Result - Result of applying promotions
- ArAging
Filter - Filter for AR aging queries
- ArAging
Summary - AR aging summary across all customers
- ArPayment
Application - AR payment application (maps payments to invoices)
- Auto
Posting Config - Auto-posting configuration
- Backorder
- A backorder record.
- Backorder
Allocation - Backorder allocation (reserved inventory for backorder).
- Backorder
Filter - Filter for listing backorders.
- Backorder
Fulfillment - A backorder fulfillment record.
- Backorder
Summary - Overall backorder summary.
- Backorders
- Backorder Management interface.
- Balance
Sheet - Balance Sheet report
- Balance
Sheet Line - Balance Sheet line item
- Batch
Result - Result of a batch operation that allows partial success.
- Bill
- A bill/invoice from a supplier.
- Bill
Filter - Filter for listing bills.
- Bill
Item - A line item on a bill.
- Bill
OfMaterials - Bill of Materials - defines what components make up a product
- Bill
Payment - A payment made to a supplier.
- Bill
Payment Filter - Filter for listing payments.
- Billing
Cycle - A billing cycle/period for a subscription
- Billing
Cycle Filter - Filter for listing billing cycles
- Bom
- Bill of Materials operations.
- BomComponent
- A component in a Bill of Materials
- BomFilter
- Filter for listing BOMs
- Canadian
TaxInfo - Canadian province/territory tax information
- Cancel
Subscription - Cancel subscription request
- Cart
- Cart/Checkout Session aggregate
- Cart
Address - Cart address (detailed for checkout)
- Cart
Filter - Cart filter for querying
- Cart
Item - Cart line item
- Carton
- A carton/package within a pack task.
- Carton
Item - Item in a carton.
- Carts
- Cart and Checkout operations
- Change
Serial Status - Input for changing serial status with tracking
- Channels
- Channel operations (sales / fulfillment / end-to-end).
- Checkout
Result - Checkout result after completing a cart
- Close
Month Options - Options controlling a month-end close run.
- Close
Month Report - Report returned by the month-end close orchestration.
- Close
Month Step Report - Per-step detail of a month-end close run.
- Collection
Activity - Collection activity record
- Collection
Activity Filter - Filter for collection activity queries
- Commerce
- The main commerce interface.
- Commerce
Builder - Builder for creating a Commerce instance with custom configuration.
- Commerce
Health - Runtime health status for a
Commerceengine instance. - Companies
- B2B company operations.
- Complete
Inspection - Input for completing an inspection
- Complete
Pick - Input for completing a pick.
- Complete
PutAway - Input for completing a put-away task.
- Complete
Ship - Input for completing shipping.
- Confirm
Delivery Input - Input for confirming delivery of a purchase
- Confirm
Delivery Output - Output from
confirm_deliveryskill - Consume
Lot - Input for consuming from a lot
- Conversion
Result - Result of a currency conversion
- Convert
Currency - Request to convert money between currencies
- Cost
Accounting - Cost Accounting management interface.
- Cost
Adjustment - Cost adjustment record.
- Cost
Adjustment Filter - Filter for listing cost adjustments.
- Cost
Layer - A cost layer for FIFO/LIFO costing.
- Cost
Layer Filter - Filter for listing cost layers.
- Cost
Rollup - Standard cost roll-up for manufactured items.
- Cost
Transaction - A cost transaction (records cost movements).
- Cost
Transaction Filter - Filter for listing cost transactions.
- Cost
Variance - Cost variance record.
- Cost
Variance Filter - Filter for listing cost variances.
- Coupon
Code - A coupon code that activates a promotion
- Coupon
Filter - Filter for listing coupon codes
- Create
A2APurchase - Input for creating an A2A purchase
- Create
A2AQuote - Input for creating an A2A quote
- Create
Agent Card - Input for creating an agent card
- Create
Agent Feedback - Input for creating new feedback.
- Create
Agent Feedback Response - Input for appending a feedback response.
- Create
Agent Identity - Input for registering a new agent identity.
- Create
Agent Validation Request - Input for creating a validation request.
- Create
Agent Validation Response - Input for recording a validation response.
- Create
Auto Posting Config - Configuration for automatic postings between accounts
- Create
Backorder - Input for creating a backorder.
- Create
Bill - Input for creating a bill.
- Create
Bill Item - Input for creating a bill item.
- Create
Bill Payment - Input for creating a payment.
- Create
Billing Cycle - Create a billing cycle for a subscription.
- Create
Bom - Input for creating a new BOM
- Create
BomComponent - Input for creating a BOM component
- Create
Cart - Input for creating a new cart
- Create
Collection Activity - Input for logging a collection activity
- Create
Cost Adjustment - Input for creating a cost adjustment.
- Create
Cost Layer - Input for creating a cost layer.
- Create
Coupon Code - Create a coupon code
- Create
Credit Account - Input for creating a credit account.
- Create
Credit Memo - Input for creating a credit memo
- Create
Custom Object - Input for creating a custom object record.
- Create
Custom Object Type - Input for creating a custom object type.
- Create
Customer - Input for creating a customer
- Create
Customer Address - Input for creating a customer address
- Create
Cycle Count - Input for creating a cycle count
- Create
Cycle Count Line - Input line for creating a cycle count
- Create
Defect Code - Input for creating a defect code
- Create
Fraud Assessment - Input for creating a fraud assessment
- Create
Gift Card - Input for creating a gift card
- Create
GlAccount - Input for creating a general ledger account
- Create
GlPeriod - Input for creating a fiscal period
- Create
Inspection - Input for creating an inspection
- Create
Inspection Item - Input for creating an inspection item
- Create
Inventory Item - Input for creating inventory item
- Create
Invoice - Input for creating an invoice
- Create
Invoice Item - Input for creating an invoice line item
- Create
Journal Entry - Input for creating a journal entry with lines
- Create
Journal Entry Line - Input for a journal entry line
- Create
Location - Input for creating a location
- Create
Lot - Input for creating a lot
- Create
Loyalty Program - Input for creating a loyalty program
- Create
NonConformance - Input for creating an NCR
- Create
Order - Input for creating a new order
- Create
Order Item - Input for creating an order item
- Create
Pack Task - Input for creating a pack task.
- Create
Payment - Input for creating a new payment
- Create
Payment Method - Input for creating a payment method
- Create
Payment Run - Input for creating a payment run.
- Create
Pick Task - Input for creating a pick task.
- Create
Product - Input for creating a product
- Create
Product Variant - Input for creating a product variant
- Create
Promotion - Create a new promotion
- Create
Promotion Condition - Condition input used when creating a promotion
- Create
Purchase Order - Input for creating a purchase order
- Create
Purchase Order Item - Input for creating a PO line item
- Create
PutAway - Input for creating a put-away task.
- Create
Quality Hold - Input for creating a quality hold
- Create
Receipt - Input for creating a receipt.
- Create
Receipt Item - Input for creating a receipt item.
- Create
Refund - Input for creating a refund
- Create
Return - Input for creating a return
- Create
Return Item - Input for creating a return item
- Create
Review - Input for creating a review
- Create
Search Config - Input for creating a search configuration
- Create
Segment - Input for creating a new segment
- Create
Serial Number - Input for creating a serial number
- Create
Serial Numbers Bulk - Input for creating multiple serial numbers in bulk
- Create
Ship Task - Input for creating a ship task.
- Create
Shipment - Input for creating a new shipment
- Create
Shipment Item - Input for creating a shipment item
- Create
Shipping Zone - Input for creating a shipping zone
- Create
Store Credit - Input for creating a new store credit
- Create
Subscription - Create a new subscription
- Create
Subscription Item - Item override when creating a subscription
- Create
Subscription Plan - Create a new subscription plan
- Create
Subscription Plan Item - Item definition for creating a subscription plan
- Create
Supplier - Input for creating a supplier
- Create
TaxExemption - Create a tax exemption for a customer
- Create
TaxJurisdiction - Create a new tax jurisdiction
- Create
TaxRate - Create a new tax rate
- Create
Warehouse - Input for creating a warehouse
- Create
Warranty - Input for creating a warranty
- Create
Warranty Claim - Input for creating a warranty claim
- Create
Wave - Input for creating a wave.
- Create
Wishlist - Input for creating a wishlist
- Create
Work Order - Input for creating a work order
- Create
Work Order Task - Input for creating a work order task
- Create
Write Off - Input for creating a write-off
- Create
X402 Credit Account - Create a new x402 credit account
- Create
X402 Payment Intent - Input for creating an x402 payment intent
- Create
Zone - Input for creating a zone
- Credit
- Credit Management interface.
- Credit
Account - Customer credit account.
- Credit
Account Filter - Filter for listing credit accounts.
- Credit
Aging Bucket - Credit aging bucket.
- Credit
Application - Credit application from a customer.
- Credit
Application Filter - Filter for listing credit applications.
- Credit
Check Result - Credit check result.
- Credit
Hold - Credit hold on an order.
- Credit
Hold Filter - Filter for listing credit holds.
- Credit
Memo - Credit memo
- Credit
Memo Application - Credit memo application to invoice
- Credit
Memo Filter - Filter for credit memo queries
- Credit
Transaction - Credit transaction history.
- Credit
Transaction Filter - Filter for listing credit transactions.
- Currency
Code - ISO 4217 three-letter currency code.
- Currency
Ops - Currency operations interface.
- Custom
Field Definition - Field definition inside a custom object type.
- Custom
Object - Custom object record (instance of a type definition).
- Custom
Object Filter - Filter for querying custom object records.
- Custom
Object Type - Custom object type (schema / definition).
- Custom
Object Type Filter - Filter for listing custom object types.
- Custom
Objects - Custom object operations interface.
- Customer
- Customer entity
- Customer
Address - Customer address
- Customer
ArAging - AR aging by customer
- Customer
ArSummary - Customer AR summary
- Customer
Credit Summary - Customer credit summary.
- Customer
Filter - Customer filter for querying
- Customer
Id - Strongly-typed customer identifier.
- Customer
Metrics - Customer segment metrics
- Customer
Statement - Customer statement
- Customers
- Customer operations interface.
- Cycle
Count - A cycle count header
- Cycle
Count Filter - Filter for listing cycle counts
- Cycle
Count Line - A single SKU line on a cycle count
- Date
Range - Date range for custom period queries
- Defect
Code - Defect code definition
- Demand
Forecast - Demand forecast for a SKU
- Discount
Tier - A tiered discount level
- Discover
Sellers Input - Input for discovering seller agents
- Discover
Sellers Output - Output from
discover_sellersskill - EdiDocuments
- EDI document operations.
- Erc8004
- ERC-8004 operations
- EuVat
Info - EU VAT rates by country
- Exchange
Rate - An exchange rate between two currencies
- Exchange
Rate Filter - Filter for listing exchange rates
- Feedback
Summary - Summary for feedback aggregation.
- Fixed
Assets - Fixed asset register operations.
- Fraud
- Fraud detection operations for risk assessment and rules.
- Fulfill
Backorder - Input for fulfilling a backorder.
- Fulfillment
- Fulfillment (pick/pack/ship) management interface.
- Fulfillment
Id - Strongly-typed fulfillment identifier.
- Fulfillment
Metrics - Order fulfillment metrics
- General
Ledger - General Ledger interface.
- Generate
Statement Request - Request to generate a customer statement
- Gift
Cards - Gift card operations for issuing, charging, and refunding.
- GlAccount
- A GL Account (Chart of Accounts entry)
- GlAccount
Filter - Filter for listing general ledger accounts
- GlPeriod
- GL Period (accounting period)
- GlPeriod
Filter - Filter for listing fiscal periods
- Http
Idempotency Record - A durable idempotency entry: request fingerprint plus the stored response.
- Inbound
Shipments - Inbound shipment operations.
- Income
Statement - Income Statement report
- Income
Statement Line - Income Statement line item
- Initiate
Purchase Input - Input for initiating a purchase from a quote
- Initiate
Purchase Output - Output from
initiate_purchaseskill - Inspection
- Quality inspection for goods
- Inspection
Filter - Filter for listing inspections
- Inspection
Item - Line item in an inspection
- Integration
Field Mappings - Integration field-mapping operations.
- Integration
Mappings - Integration mapping operations.
- Inventory
- Inventory operations interface.
- Inventory
Balance - Inventory balance at a location
- Inventory
Filter - Inventory filter for querying
- Inventory
Health - Inventory health summary
- Inventory
Item - Inventory item (SKU master record)
- Inventory
Movement - Inventory movement summary
- Inventory
Reservation - Inventory reservation
- Inventory
Transaction - Inventory transaction (audit trail)
- Inventory
Valuation - Inventory valuation summary.
- Invoice
- An invoice
- Invoice
Filter - Filter for listing invoices
- Invoice
Item - A line item on an invoice
- Invoices
- Invoice operations for billing and accounts receivable
- Issue
Cost Layers - Input for issuing from cost layers (FIFO/LIFO).
- Item
Cost - Cost record for an inventory item (standard cost master).
- Item
Cost Filter - Filter for listing item costs.
- Journal
Entry - Journal Entry header
- Journal
Entry Filter - Filter for listing journal entries
- Journal
Entry Line - Journal Entry line (detail)
- Jurisdiction
Summary - Summary of a jurisdiction involved in calculation
- Line
Item Discount - Discount applied to a specific line item
- Line
Item Tax - Tax for a specific line item
- Location
- A location within a warehouse (zone/aisle/rack/bin)
- Location
Filter - Filter for listing locations
- Location
Inventory - Inventory at a specific location
- Location
Inventory Filter - Filter for location inventory
- Location
Movement - Record of inventory movement between locations
- Location
Stock - Stock at a specific location
- Lot
- A lot/batch of inventory items
- LotCertificate
- Certificate/document associated with a lot
- LotFilter
- Filter for listing lots
- LotLocation
- Inventory of a lot at a specific location
- LotTransaction
- Transaction record for lot movements
- Lots
- Lot/Batch tracking management interface.
- LowStock
Item - Low stock alert
- Loyalty
- Loyalty program operations for points, accounts, and rewards.
- Merge
Lots - Input for merging lots
- Metrics
- Thread-safe metrics handle for in-process telemetry.
- Metrics
Config - Configuration for metrics initialization.
- Metrics
Snapshot - Snapshot of recorded metrics values.
- Money
- A monetary amount paired with its currency.
- Move
Inventory - Input for moving inventory between locations
- Move
Serial - Input for moving a serial to a new location
- Movement
Filter - Filter for inventory movements
- NonConformance
- Non-Conformance Report for quality issues
- NonConformance
Filter - Filter for listing NCRs
- Order
- Order aggregate root
- Order
Filter - Order filter for querying
- OrderId
- Strongly-typed order identifier.
- Order
Item - Order line item
- Order
Item Id - Strongly-typed order line item identifier.
- Order
Status Breakdown - Order status breakdown
- Orders
- Order operations interface.
- Pack
Task - A pack task for packaging picked items.
- Pack
Task Filter - Filter for listing pack tasks.
- Pause
Subscription - Pause subscription request
- PayBill
- Input for paying a bill directly.
- Payment
- A payment transaction
- Payment
Allocation - Allocation of a payment to specific bills.
- Payment
Allocation Input - Payment allocation input.
- Payment
Application Line - Payment allocation to a single invoice
- Payment
Filter - Filter for listing payments
- Payment
Id - Strongly-typed payment identifier.
- Payment
Method - A stored payment method for a customer
- Payment
Obligations - Payment obligation operations.
- Payment
Run - A scheduled payment batch.
- Payment
RunFilter - Filter for payment runs.
- Payments
- Payment operations for transaction processing and refunds
- Pick
Task - A pick task for retrieving items from warehouse locations.
- Pick
Task Filter - Filter for listing pick tasks.
- Place
Credit Hold - Input for placing a credit hold.
- Prepayments
- Prepayment operations.
- Price
Levels - Price level operations.
- Price
Schedules - Price schedule operations.
- Print
Stations - Print station operations.
- Product
- Product entity
- Product
Attribute - Product attribute
- Product
Filter - Product filter for querying
- Product
Id - Strongly-typed product identifier.
- Product
Performance - Product performance metrics
- Product
Variant - Product variant (SKU-level)
- Production
Batches - Production batch operations.
- Products
- Product operations interface.
- Promotion
- A promotion/discount offer
- Promotion
Condition - A condition that must be met for promotion to apply
- Promotion
Filter - Filter for listing promotions
- Promotion
Line Item - Line item for promotion calculation
- Promotion
Usage - Record of promotion usage
- Promotions
- Promotions and discounts management interface.
- Purchase
Order - A purchase order
- Purchase
Order Filter - Filter for listing purchase orders
- Purchase
Order Item - A line item on a purchase order
- Purchase
Orders - Purchase Order operations for supplier procurement
- Purgatory
- Purgatory (order ingestion staging) operations.
- PutAway
- Put-away record for received items.
- PutAway
Filter - Filter for listing put-aways.
- Quality
- Quality control management interface.
- Quality
Hold - Quality hold to prevent inventory movement
- Quality
Hold Filter - Filter for listing quality holds
- Quote
Item - Item to include in a quote request
- Quoted
Item - A quoted item with pricing
- Receipt
- A goods receipt document.
- Receipt
Filter - Filter for listing receipts.
- Receipt
Item - A line item on a receipt.
- Receive
Item Line - A line in a receive operation.
- Receive
Items - Input for receiving items.
- Receive
Purchase Order Items - Input for receiving items on a purchase order
- Receiving
- Receiving and goods receipt management interface.
- Record
Cost Variance - Input for recording a cost variance.
- Record
Credit Transaction - Input for recording a credit transaction.
- Record
Cycle Count Line - A recorded physical count for one line
- Record
Inspection Result - Input for recording inspection results
- Record
Invoice Payment - Input for recording a payment on an invoice
- Refund
- A refund for a payment
- Rejected
Promotion - A promotion that could not be applied
- Release
Credit Hold - Input for releasing a credit hold.
- Release
Quality Hold - Input for releasing a quality hold
- Request
Quote Input - Input for requesting a quote from a seller
- Request
Quote Output - Output from
request_quoteskill - Reserve
Inventory - Input for reserving inventory
- Reserve
Lot - Input for reserving from a lot
- Reserve
Serial Number - Input for reserving a serial number
- Return
- Return entity
- Return
Filter - Return filter for querying
- Return
Id - Strongly-typed return/RMA identifier.
- Return
Item - Return line item
- Return
Metrics - Return metrics
- Return
Reason Count - Return count by reason
- Returns
- Return operations interface.
- Revenue
ByPeriod - Revenue breakdown by time bucket
- Revenue
Forecast - Revenue forecast
- Revenue
Recognition - Revenue recognition (ASC 606) operations.
- Review
Credit Application - Input for reviewing a credit application.
- Reviews
- Product review operations.
- Sales
Summary - Sales summary metrics
- Search
Configs - Search configuration operations.
- Segments
- Customer segment operations for grouping and targeting.
- Seller
Info - Information about a seller agent
- SeoMetadata
- SEO metadata
- Serial
Filter - Filter for listing serial numbers
- Serial
History - History event for a serial number
- Serial
History Filter - Filter for serial history
- Serial
Lookup Result - Result of scanning/looking up a serial number
- Serial
Number - A uniquely serialized unit of inventory
- Serial
Reservation - Reservation of a specific serial number
- Serial
Validation - Serial number validation result
- Serials
- Serial number management interface.
- SetCart
Payment - Input for setting payment on cart
- SetCart
Shipping - Input for setting shipping on cart
- SetExchange
Rate - Request to set an exchange rate
- SetItem
Cost - Input for setting item cost.
- Ship
Task - A ship task for final shipping handoff.
- Ship
Task Filter - Filter for listing ship tasks.
- Shipment
- A shipment tracks the physical delivery of items from an order
- Shipment
Event - A tracking event in a shipment’s history
- Shipment
Filter - Filter for querying shipments
- Shipment
Id - Strongly-typed shipment identifier.
- Shipment
Item - An item within a shipment
- Shipments
- Shipment operations for order fulfillment and delivery tracking
- Shipping
Rate - Shipping rate/option
- Shipping
Zones - Shipping zone and method operations.
- Sign
X402 Payment Intent - Input for signing an x402 payment intent
- Skill
Quote - A persisted A2A quote between agents
- Skill
Quote Filter - Filter for listing A2A quotes
- Skip
Billing Cycle - Skip next billing cycle
- SkuBackorder
Summary - Backorder summary by SKU.
- SkuCost
Summary - Cost summary by SKU.
- Split
Lot - Input for splitting a lot
- Statement
Line Item - Customer statement line item
- Stock
Level - Stock level summary
- Stock
Snapshots - Stock snapshot operations.
- Store
Credits - Store credit operations for managing customer balances.
- Store
Currency Settings - Store-level currency configuration
- Submit
Credit Application - Input for submitting a credit application.
- Subscription
- A customer’s subscription
- Subscription
Event - An event in a subscription’s history
- Subscription
Filter - Filter for listing subscriptions
- Subscription
Item - A line item in a subscription
- Subscription
Plan - A subscription plan template
- Subscription
Plan Filter - Filter for listing subscription plans
- Subscription
Plan Item - An item included in a subscription plan
- Subscriptions
- Subscription management interface.
- Supplier
- A supplier/vendor
- Supplier
ApSummary - AP summary by supplier.
- Supplier
Filter - Filter for listing suppliers
- Supplier
Skus - Supplier SKU operations.
- Tax
- Tax calculation and management interface.
- TaxAddress
- Address for tax jurisdiction determination
- TaxBreakdown
- Tax breakdown by jurisdiction
- TaxCalculation
Request - Input for tax calculation
- TaxCalculation
Result - Result of tax calculation
- TaxDetail
- Detailed tax information
- TaxExemption
- Customer tax exemption certificate
- TaxJurisdiction
- A tax jurisdiction (country, state, city, district)
- TaxJurisdiction
Filter - Filter for querying jurisdictions
- TaxLine
Item - A line item for tax calculation
- TaxRate
- A tax rate for a specific jurisdiction and category
- TaxRate
Filter - Filter for querying tax rates
- TaxSettings
- Store-level tax configuration
- TopCustomer
- Top customer by spend
- TopProduct
- Top selling product
- TopReturned
Product - Product with high return rate
- Topology
Snapshots - Topology snapshot operations.
- Trace
Node - A node in the traceability chain
- Traceability
Result - Result of a traceability query
- Transfer
Lot - Input for transferring lot between locations
- Transfer
Orders - Transfer order operations.
- Transfer
Serial Ownership - Input for transferring ownership of a serial number
- Trial
Balance - Trial Balance report
- Trial
Balance Line - Trial Balance line
- Units
OfMeasure - Units-of-measure operations.
- Update
Agent Card - Input for updating an agent card
- Update
Agent Identity - Input for updating an agent identity.
- Update
Backorder - Input for updating a backorder.
- Update
Bill - Input for updating a bill.
- Update
Bom - Input for updating a BOM
- Update
Cart - Input for updating a cart
- Update
Cart Item - Input for updating a cart item
- Update
Credit Account - Input for updating a credit account.
- Update
Custom Object - Input for updating a custom object record.
- Update
Custom Object Type - Input for updating a custom object type.
- Update
Customer - Input for updating a customer
- Update
GlAccount - Input for updating a general ledger account
- Update
Inspection - Input for updating an inspection
- Update
Invoice - Input for updating an invoice
- Update
Location - Input for updating a location
- Update
Lot - Input for updating a lot
- Update
NonConformance - Input for updating an NCR
- Update
Order - Input for updating an order
- Update
Payment - Input for updating a payment
- Update
Product - Input for updating a product
- Update
Promotion - Update a promotion
- Update
Purchase Order - Input for updating a purchase order
- Update
Receipt - Input for updating a receipt.
- Update
Return - Input for updating a return
- Update
Serial Number - Input for updating a serial number
- Update
Shipment - Input for updating a shipment
- Update
Subscription - Update a subscription
- Update
Subscription Plan - Update a subscription plan
- Update
Supplier - Input for updating a supplier
- Update
Warehouse - Input for updating a warehouse
- Update
Warranty - Input for updating a warranty
- Update
Warranty Claim - Input for updating a warranty claim
- Update
Work Order - Input for updating a work order
- Update
Work Order Task - Input for updating a work order task
- Update
Zone - Input for updating a zone
- UsState
TaxInfo - US State tax information
- Validation
Summary - Summary of validation responses for an agent.
- Variant
Option - Variant option (e.g., size: Large, color: Blue)
- Vendor
Credits - Vendor credit operations.
- Vendor
Returns - Vendor return operations.
- Warehouse
- A warehouse or distribution center
- Warehouse
Address - Physical address for a warehouse
- Warehouse
Filter - Filter for listing warehouses
- Warehouse
Ops - Warehouse and Location management interface.
- Warranties
- Warranty operations for product warranty management
- Warranty
- A warranty registration
- Warranty
Claim - A warranty claim
- Warranty
Claim Filter - Filter for listing warranty claims
- Warranty
Filter - Filter for listing warranties
- Warranty
Lookup Status - Warranty status for lookup
- Wave
- A wave groups multiple orders for efficient picking.
- Wave
Filter - Filter for listing waves.
- Wishlists
- Wishlist operations for managing customer wishlists.
- Work
Order - Work Order - a manufacturing job to build products
- Work
Order Filter - Filter for listing work orders
- Work
Order Material - Material tracking for a work order
- Work
Order Task - A task within a work order (a step in manufacturing)
- Work
Orders - Work Order operations.
- Write
Off - Write-off record
- Write
OffFilter - Filter for write-off queries
- X402
- x402 payment protocol operations
- X402
Credit Account - x402 Credit Account - tracks prepaid balances for metered usage
- X402
Credit Adjustment - Credit ledger adjustment (credit or debit)
- X402
Credit Transaction - x402 credit transaction (ledger entry)
- X402
Credit Transaction Filter - Filter for listing credit ledger transactions
- X402
Payment Batch - x402 Payment Batch - A collection of payment intents for batch settlement
- X402
Payment Intent - x402 Payment Intent - A signed off-chain payment request
- X402
Payment Intent Filter - Filter for listing x402 payment intents
- X402
Payment Receipt - x402 Payment Receipt - Proof that payment was made
- X402
Payment Required - x402 Payment Required Response
- Zone
- A zone within a warehouse (grouping of locations)
Enums§
- A2ASkill
- A2A commerce skills that an agent can advertise
- Account
Status - Account status
- Account
SubType - Account sub-types for more granular classification
- Account
Type - GL Account type (follows standard accounting)
- Address
Type - Address type enumeration
- Agent
Wallet Proof Type - Type of proof used to set or update agent wallet ownership.
- Aging
Bucket - AR aging bucket classification
- Allocation
Status - Allocation status.
- Backorder
Priority - Backorder priority.
- Backorder
Status - Backorder status.
- Balance
Side - Balance side (debit or credit)
- Bill
Status - Status of a bill.
- Billing
Cycle Status - Status of a billing cycle
- Billing
Interval - Billing interval for subscriptions
- BomStatus
- BOM lifecycle status
- Card
Brand - Card brand for credit/debit cards
- Cart
Payment Status - Cart payment status
- Cart
Status - Cart status enumeration
- Certificate
Type - Type of certificate
- Claim
Resolution - Claim resolution type
- Claim
Status - Warranty claim status
- Close
Month Step Status - Outcome of one step in a month-end close run.
- Collection
Activity Type - Collection activity type
- Collection
Status - Collection status for an invoice
- Commerce
Backend - Active database backend used by a
Commerceinstance. - Commerce
Error - Main error type for commerce operations.
- Commerce
Event - Commerce domain event
- Condition
Operator - Condition operator for rules
- Condition
Type - Type of condition
- Cost
Adjustment Status - Cost adjustment status.
- Cost
Adjustment Type - Cost adjustment type.
- Cost
Layer Source - Source of a cost layer.
- Cost
Method - Inventory costing method.
- Cost
Transaction Type - Cost transaction type.
- Coupon
Status - Status of an individual coupon code
- Credit
Account Status - Credit account status.
- Credit
Application Status - Credit application status.
- Credit
Hold Status - Credit hold status.
- Credit
Hold Type - Credit hold type.
- Credit
Memo Reason - Credit memo reason
- Credit
Memo Status - Credit memo status
- Credit
Transaction Type - Credit transaction type.
- Currency
- ISO 4217 Currency codes
- Custom
Field Type - Custom object field type.
- Customer
Status - Customer status enumeration
- Cycle
Count Status - Status of a cycle count
- Disposition
- Disposition decision for non-conforming material
- Dunning
Letter Type - Dunning letter template type
- Exemption
Type - Customer exemption type
- Fulfillment
Source Type - Source type for fulfillment.
- Fulfillment
Status - Fulfillment status enumeration.
- Fulfillment
Type - Fulfillment type
- Hold
Type - Type of quality hold
- Inspection
Result - Result of inspecting an item
- Inspection
Status - Status of an inspection
- Inspection
Type - Type of inspection
- Invoice
Status - Invoice status
- Invoice
Type - Invoice type
- Item
Availability - Item availability status
- Item
Condition - Item condition on return
- Journal
Entry Source - Journal entry source
- Journal
Entry Status - Journal entry status
- Journal
Entry Type - Journal entry type
- Jurisdiction
Level - Level of tax jurisdiction
- Location
Type - Type of location within a warehouse
- LotStatus
- Status of a lot
- LotTransaction
Type - Type of lot transaction
- Movement
Type - Type of inventory movement
- NcrStatus
- Status of an NCR
- NonConformance
Source - Source of the non-conformance
- Order
Status - Order status enumeration.
- Pack
Status - Status of a pack task.
- Package
Type - Package type for cartons.
- Payment
MethodAP - AP payment method.
- Payment
Method Type - Payment method type
- Payment
RunStatus - Payment run status.
- Payment
Status - Payment status enumeration.
- Payment
StatusAP - AP payment status.
- Payment
Terms - Payment terms for purchase orders
- Payment
Transaction Status - Payment transaction status in the processing lifecycle
- Period
Status - GL Period status
- Pick
Status - Status of a pick task.
- Plan
Status - Status of a subscription plan
- Product
Status - Product status enumeration
- Product
TaxCategory - Product tax category
- Product
Type - Product type enumeration
- Promotion
Status - Status of a promotion
- Promotion
Target - What the promotion applies to
- Promotion
Trigger - How the promotion is triggered
- Promotion
Type - Type of promotion
- Purchase
Order Status - Purchase order status
- Purchase
Status - Purchase status
- PutAway
Status - Status of a put-away task.
- Quote
Status - Quote status
- Receipt
Item Status - Status of a receipt line item.
- Receipt
Status - Status of a receipt.
- Receipt
Type - Type of receipt.
- Refund
Status - Refund status
- Rejection
Reason - Reason a promotion or coupon was rejected during evaluation
- Reservation
Status - Reservation status enumeration
- Return
Reason - Return reason enumeration
- Return
Status - Return status enumeration
- Risk
Rating - Risk rating.
- Rounding
Mode - Rounding mode for currency conversions
- Segment
Type - Segment type
- Serial
Event Type - Type of serial number event
- Serial
Status - Status of a serial number
- Severity
- Severity level
- Ship
Status - Status of a ship task.
- Shipment
Status - Status of a shipment through its lifecycle
- Shipping
Carrier - Shipping carrier for deliveries
- Shipping
Method - Shipping method/speed
- Stacking
Behavior - Stacking behavior with other promotions
- Statement
Transaction Type - Statement transaction type
- Store
Credit Reason - Reason for issuing store credit
- Subscription
Event Type - Type of subscription event
- Subscription
Status - Status of a subscription
- Task
Status - Task status
- TaxCalculation
Method - Tax calculation method
- TaxCompound
Method - How to apply multiple tax rates
- TaxType
- Types of taxes supported
- Time
Granularity - Granularity for time-series data
- Time
Period - Time period for analytics queries
- Trace
Node Type - Type of node in traceability chain
- Transaction
Type - Transaction type enumeration
- Trend
- Trend direction
- Trust
Level - Trust level for agent cards
- Variance
Type - Variance type.
- Warehouse
Type - Type of warehouse
- Warranty
Status - Warranty status
- Warranty
Type - Warranty type/tier
- Wave
Status - Status of a wave.
- Wave
Type - Type of wave for order grouping
- Work
Order Priority - Work order priority
- Work
Order Status - Work order status
- Write
OffReason - Write-off reason code
- X402
Asset - Supported payment assets for x402
- X402
Batch Status - Status of a payment batch
- X402
Credit Direction - Direction of x402 credit ledger entries
- X402
Crypto Error - X402
Intent Status - Status of an x402 payment intent
- X402
Network - Supported blockchain networks for x402 payments
Constants§
- ERC8004_
REGISTRATION_ V1 - ERC-8004 registration file type URL (v1)
- X402_
DEFAULT_ VALIDITY_ SECONDS - Default payment validity window (1 hour in seconds)
- X402_
DOMAIN_ SEPARATOR - Domain separator for x402 payment signing (per EIP-712 style)
- X402_
MAX_ VALIDITY_ SECONDS - Maximum payment validity window (24 hours in seconds)
- X402_
VERSION - x402 protocol version
Traits§
- Database
- Unified database trait that both SQLite and PostgreSQL implement. This allows stateset-embedded to work with either backend.
- Http
Idempotency Repository - Repository over the
http_idempotency_keystable.
Functions§
- from_
smallest_ unit - Calculate decimal amount from smallest unit
- generate_
ap_ payment_ number - Generate a payment number.
- generate_
backorder_ number - Generate a backorder number.
- generate_
bill_ number - Generate a bill number.
- generate_
claim_ number - Generate a unique claim number
- generate_
cost_ adjustment_ number - Generate a cost adjustment number.
- generate_
coupon_ code - Generate a unique coupon code (human-friendly)
- generate_
credit_ application_ number - Generate a credit application number.
- generate_
credit_ memo_ number - Generate a credit memo reference number
- generate_
invoice_ number - Generate a unique invoice number
- generate_
journal_ entry_ number - Generate a journal entry number using a timestamp
- generate_
payment_ number - Generate a unique payment number
- generate_
payment_ run_ number - Generate a payment run number.
- generate_
plan_ code - Generate a unique plan code
- generate_
po_ number - Generate a unique purchase order number
- generate_
promotion_ code - Generate a unique promotion code
- generate_
refund_ number - Generate a unique refund number
- generate_
subscription_ number - Generate a unique subscription number
- generate_
warranty_ number - Generate a unique warranty number
- generate_
write_ off_ number - Generate a write-off reference number
- generate_
x402_ intent_ id - Generate a unique x402 intent ID
- get_
canadian_ tax_ info - Get Canadian tax information for a province
- get_
eu_ vat_ info - Get EU VAT information for a country
- get_
us_ state_ tax_ info - Pre-configured US state tax data
- is_
eu_ member - Check if a country is in the EU
- to_
smallest_ unit - Calculate amount in smallest unit from decimal
- validate_
currency_ code - Validate a currency code (ISO 4217 format).
- validate_
custom_ object_ type_ input - Validate a type definition input.
- validate_
email - Validate an email address format.
- validate_
phone - Validate a phone number format (basic validation).
- validate_
postal_ code - Validate a postal/ZIP code format (basic validation).
- validate_
price - Validate a price/amount value.
- validate_
quantity - Validate a quantity value.
- validate_
sku - Validate a SKU format.
Type Aliases§
- Create
Ncr - Alias for
CreateNonConformancefor API convenience - Create
Receipt Line - Alias for
CreateReceiptItemfor API convenience - Create
Serial - Alias for
CreateSerialNumberfor API convenience - Create
Warehouse Location - Alias for
CreateLocationfor API convenience - Result
- Result type alias for commerce operations.