Guides and Examples
...
Invoices
Generate Invoices
6 min
overview this guide explains how customer invoices are generated in nue via api what is billing schedule a billing schedule in nue defines when and how invoices are generated for customers it supports both “on demand” (one time/single run) and “recurring” (e g , daily, weekly, monthly, custom) execution patterns administrators can target specific customers, products, or orders by applying filters when setting up a schedule each billing schedule comprises a series of billing jobs—each billing job triggers invoice creation for all matching subscriptions/orders within its scope core concepts billing schedule a saved set of parameters that governs how and when invoices are generated for associated orders/products can be run on demand or set to recur on custom intervals billing job a single execution instance of a billing schedule each run creates invoices (and optionally credit memos), processes results, and tracks job status create billing schedule you can create a billing schedule through the nue api ( create billing schedule ) to generate invoices for specific customers, products, or orders for example, the below request creates a recurring billing schedule for a specific customer (id "001ks00000dvz1ayad"), and the billing job will be executed every day at 3 00 am curl x post "https //api nue io/billing/schedules" \\ h "nue api key {yourapikey}" \\ h "accept application/json" \\ h "content type application/json" \\ d '{ "createdthrough" "api", "schedulestartdate" "2025 06 30", "invoicedate" "2025 06 30", "targetdate" null, "scheduletype" "recurring", "status" "draft", "recurringschedule" "0 0 3 ? ", "dailyobject" {}, "customexpression" \[], "recordtype" "billingschedule", "customerfilter" "{id { in \[\\"001ks00000dvz1ayad\\"]}}", "orderfilter" null, "billcycledayfilter" null, "productfilter" null, "description" "this is a sample billing schedule!" }' the details of the created billing schedule will be returned { "orderfilter" null, "dailyobject" {}, "description" "this is a sample billing schedule!", "lastrundate" null, "customexpression" \[], "billcycledayfilter" null, "recurringschedule" "0 0 3 ? ", "lastmodifiedbyid" "424cb15f da63 4d6a b397 c15142058084", "zoneid" "asia/shanghai", "targetdateincrementtimeunit" "days", "id" "da17ce49 31b4 4f25 98b3 a7c1fc4a3d3a", "createdbyid" "424cb15f da63 4d6a b397 c15142058084", "targetdateincrement" 0, "targetdateincrementsign" "plus", "productfilter" null, "lastmodifieddate" "2025 06 30t02 42 32 016+00 00", "targetdate" null, "recordtype" "billingschedule", "createdthrough" "api", "invoicedate" "2025 06 30", "customerfilter" "{id { in \[\\"001ks00000dvz1ayad\\"]}}", "createddate" "2025 06 30t02 42 32 016+00 00", "scheduletype" "recurring", "schedulestartdate" "2025 06 30", "name" "bs 00000200", "status" "draft" } activate billing schedule once the billing schedule is activated, billing jobs will start at the scheduled time, and invoices will be generated after executing the billing jobs ( activate billing schedules ) curl x post "https //api nue io/billing/schedules\ activate" \\ h "nue api key {yourapikey}" \\ h "accept application/json" \\ h "content type application/json" \\ d '{ "scheduleids" \[ "da17ce49 31b4 4f25 98b3 a7c1fc4a3d3a" ] }' if the setting ' automatically generate the first invoice when an order is activated ' is enabled, invoices will be generated when activating an order through nue api