post
https://apiprod.fattlabs.com/invoice
Creates an invoice
Creates an invoice for a customer, detailing items, taxes, memos, and more. Invoices can be sent immediately or saved as a draft for future editing and sending. Invoices generated through this endpoint can also integrate with the Stax Pay Hosted Invoice Page.
Key Features
Customer Management
Generates invoices tied to specific customers with detailed item listings, taxes, and custom memos.
Flexible Sending
Send immediately via email or save as drafts for future editing and sending.
Hosted Payment Pages
Integrates with Stax Pay Hosted Invoice Page for seamless customer payments.
Instructed Funding
Advanced feature to distribute payments across multiple bank accounts.
Usage Guide
Setting Up Hosted Pages
- Combine the
urlandidfrom the response to generate a hosted invoice page URL - Example:
https://app.staxpayments.com/#/bill/{id}
Available Customizations
- Enable/disable credit card or ACH payment methods
- Allow customers to make partial payments
- Add a tip field for customers to leave tips
- Include a read-only memo for customer reference (e.g., "Thank you for your business!")
- Hide line items on the customer-facing bill page by setting
meta.hideCustomerLineItemstotrue
Advanced Payment Distribution
Distribute transaction funds to multiple bank accounts:
funding[n].account_id: The ID of the funding accountfunding[n].amount: Amount to allocate to the account- Important: Total funding amounts must exactly equal the invoice
totalfield - If funding fields are not provided, funds default to the merchant's primary account
API Response Reference
Response Codes
| Code | Response | Reason |
|---|---|---|
| 201 | Created | Invoice successfully created. |
| 400 | Bad Request | Invalid invoice parameters or funding configuration. |
| 401 | Unauthorized | Authentication failed. |
| 422 | Unprocessable Entity | Split funding amounts do not match the invoice total. |
| 500 | Internal Server Error | Unexpected server error. |
Important Considerations
Configuration & Limitations
Customization Options
- Configure hosted invoice pages in Stax Pay settings or during invoice creation via API
- Custom fields support various payment scenarios and customer interactions
Data Restrictions
meta.lineitems.*is restricted to the ID, Quantity, Price, Item name, and Description- Ensure all required fields are properly formatted before submission
Best Practices
- Test split funding configurations thoroughly before production use
- Consider customer experience when designing hosted invoice pages
- Use draft mode for complex invoices that require review
