Create an 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

users
Customer Management

Generates invoices tied to specific customers with detailed item listings, taxes, and custom memos.

paper-plane
Flexible Sending

Send immediately via email or save as drafts for future editing and sending.

globe
Hosted Payment Pages

Integrates with Stax Pay Hosted Invoice Page for seamless customer payments.

share-alt
Instructed Funding

Advanced feature to distribute payments across multiple bank accounts.

Usage Guide

Immediate Sending

  • Set send_now=true to send the invoice immediately
  • If omitted or set to false, the invoice will save as a draft

Draft Management

  • Draft invoices can be updated or sent later using the PUT /invoice/{id}/send endpoint
  • Perfect for preparing invoices in advance

API Response Reference

list-altResponse Codes
CodeResponseReason
201CreatedInvoice successfully created.
400Bad RequestInvalid invoice parameters or funding configuration.
401UnauthorizedAuthentication failed.
422Unprocessable EntitySplit funding amounts do not match the invoice total.
500Internal Server ErrorUnexpected server error.

Important Considerations

exclamation-triangleConfiguration & 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
Body Params
string
required

If provided, it auto-assigns the invoice to a specific customer. If not, the invoice requires manual assignment before payment.

string
required
Defaults to https://app.staxpayments.com/#/bill/

Set it to https://app.staxpayments.com/#/bill/ to enable a clickable button in the invoice email, directing customers to our Stax bill pay page. Use a different URL only if you have a custom domain configured with Stax Connect.

string

Optional field. Defaults to current timestamp if blank. Used to track the date of service or work provided by the merchant.

date-time

Invoice due date.

meta
object

Within this JSON object, certain fields are recognized by the Stax Pay web platform and are used for emailed receipts.

boolean

Determines whether the customer can make a partial payment in the Stax Pay user interface. Set to true to allow partial payments, or false to disallow partial payments.

funding
array of strings

An array specifying funding instructions for payments made to this invoice. Each element should include an account_id that identifies the destination account and an amount specifying the portion of the payment to be allocated to that account. This feature requires Instructed Funding to be enabled.

funding
float
required

The total of the invoice.

Responses

Language
Credentials
Bearer
JWT
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json