Cryptocurrency invoices serve as digital payment requests, linking a unique crypto address to a specified amount for a limited time. This guide explores how they function, their lifecycle, and best practices for handling them effectively.
How Cryptocurrency Invoices Work
An invoice represents a payment request tied to:
- A unique cryptocurrency address
- A specific amount (denominated in crypto or fiat)
- A 10-minute validity window (due to exchange rate freezing)
When created, Cryptopay generates distinct payment addresses per cryptocurrency to track customer payments. Transactions undergo network validation before completion.
Invoice Lifecycle Stages
- Creation: Invoice generates with a
newstatus - Payment Detection:
transaction_createdcallback fires when payment is identified - Network Confirmation:
transaction_confirmedcallback after network validation - Completion: Status changes from
newtocompleted
๐ Discover how top platforms streamline crypto payments
Handling Special Cases
Late Payments
- Status:
unresolved - Context:
paid_late - Occurs when payment arrives after invoice expiration
Payment Discrepancies
| Scenario | Status | Context |
|---|---|---|
| Overpayment | unresolved | overpaid |
| Underpayment | unresolved | underpaid |
Resolution options include manual status updates or automated network validation based on account settings.
Best Practices for Developers
- Callback Implementation: Set up endpoints to receive status updates
- Expiration Handling: Clearly communicate 10-minute windows to users
- Discrepancy Protocols: Establish rules for handling over/under payments
๐ Learn advanced crypto payment integration techniques
Frequently Asked Questions
Q: Why do invoices expire after 10 minutes?
A: Cryptopay freezes exchange rates for 10 minutes per invoice to prevent rate fluctuation issues.
Q: What happens if a payment is partially received?
A: The invoice marks as unresolved with underpaid context, requiring manual or automated resolution.
Q: Can fiat amounts be specified in invoices?
A: Yes, invoices can display amounts in either cryptocurrency or fiat equivalent.
Q: How are payment addresses generated?
A: Cryptopay creates unique addresses per cryptocurrency per invoice to track transactions accurately.
Q: What triggers the 'completed' status?
A: Full network validation of the payment changes the status from new to completed.
Key Takeaways
- Cryptocurrency invoices facilitate traceable, time-sensitive payments
- Status callbacks provide real-time payment tracking
- Special cases require predefined resolution strategies
- Proper integration ensures smooth payment experiences
This comprehensive approach to cryptocurrency invoices ensures secure, transparent transactions while accommodating various payment scenarios.