Skip to content

Invoice.create

POST /{namespace}/invoices

Creates an Invoice.

Mode
do
Event
Invoice.created

Create makes a new Invoice from the inputs below. It is inherited: every Noun has get, list, create, update and delete.

Inputs

InputTypeRequiredDescription
totalmoneyrequiredThe amount due.
duedaterequiredWhen payment is due.
paidAtdatetimeWhen it was paid.
collectionstringcharge charges the saved payment method; send sends the Invoice and waits for a transfer. charge by default.
termsintegerDays from issue until a send Invoice is due, such as 30; sets due.
purchaseOrderstringThe Customer’s purchase order number, printed on the Invoice.
refundedmoneyThe total returned to the Customer, from zero up to the amount paid.
numberstringThe Invoice number, sequential per Startup and never reused, voided Invoices included.
linesjsonEach Offer billed: its quantity, Period and amount, with any Coupon or Credit Grant applied.
pdfurlThe Invoice, or its receipt once paid, as a PDF on the Startup’s Domain that names the seller of record.
payUrlurlThe page on the Startup’s Domain where the Customer pays it by card or bank transfer.
subscriptionSubscriptionThe Invoices the Subscription issues, one for each period it renews.
customerCustomerEach Invoice is owed by one Customer.

Outputs

OutputTypeRequiredDescription
invoiceInvoicerequiredThe Invoice.

Effects

  • Emits Invoice.created.
  • Two-way: try, send, do.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.Invoice.create

When it waits

GateDefault
Decision classLow: two-way, nothing at stake
Delay windowNone: it runs once review passes.
LimitThe call Limit of the Permission it runs under.
Over the LimitIt waits pending for an Approval from the Founder. Approved, it runs; refused, it ends refused with limit-exceeded; unanswered by its deadline, it ends canceled.