Invoice Preview
1 min
POST
https://api.nue.io/orders/invoice-preview
Body Parameters
- bodyobjectrequiredDescription
- customerobjectDescription
- idstringrequiredDescription
- effectiveDatestring<date>DescriptionFormatdate
- orderProductsobject[]Description
- priceBookEntryIdstringrequiredDescription
- quantitynumberrequiredDescription
- subscriptionStartDatestring<date>requiredDescriptionFormatdate
- subscriptionTermnumberDescription
- coTermAssetstringDescription
- addOnsobject[]Description
- productOptionIdstringrequiredDescription
- productOptionQuantitynumberDescription
- subscriptionStartDatestringDescription
- subscriptionTermnumberDescription
- assetChangesobject[]Description
- changeTypestring<UpdateQuantity | UpdateTerm | Renew | CoTerm | Cancel | ConvertFreeTrial | Upgrade | Downgrade | Swap | Reconfigure>requiredDescriptionAllowedUpdateQuantityUpdateTermRenewCoTermCancelConvertFreeTrialUpgradeDowngradeSwapReconfigure
- assetNumberstringrequiredDescription
- quantitynumberDescription
- startDatestring<date>DescriptionFormatdate
- termnumberDescription
- renewalTermnumberDescription
- coTermDatestring<date>DescriptionFormatdate
- cancellationDatestring<date>DescriptionFormatdate
- targetPriceBookEntryIdstringDescription
- addOnsobject[]Description
- productOptionIdstringrequiredDescription
- reconfigureEffectiveDatestring<date>requiredDescriptionFormatdate
- productOptionQuantitynumberrequiredDescription
- productsobject[]Description
- priceBookEntryIdstringrequiredDescription
- quantitynumberrequiredDescription
- subscriptionStartDatestring<date>requiredDescriptionFormatdate
- subscriptionTermnumberDescription
- coTermAssetstringDescription
- billingPeriodstringDescription
- billingAccountIdstringDescription
- descriptionstringDescription
- customFieldsobjectDescription
- timeZonestringDescription
- poNumberstringDescription
- poDatestring<date>DescriptionFormatdate
Responses
200
- objectDescription
- previewInvoicesobject[]Description
- idstringDescription
- invoiceNumberstringDescription
- amountnumberDescription
- amountWithoutTaxnumberDescription
- currencyIsoCodestringDescription
- invoiceDatestring<date>DescriptionFormatdate
- dueDatestring<date>DescriptionFormatdate
- startDatestring<date>DescriptionFormatdate
- endDatestring<date>DescriptionFormatdate
- statusstringDescription
- itemsobject[]Description
- productNamestringDescription
- amountnumberDescription
- quantitynumberDescription
- unitPricenumberDescription
- startDatestring<date>DescriptionFormatdate
- endDatestring<date>DescriptionFormatdate
- previewsobject[]Description
- assetNumberstringDescription
- priceSummaryobjectDescription
- totalPricenumberDescription
- totalAmountnumberDescription
- todayChargePricenumberDescription
- todayChargeAmountnumberDescription
- nextBillingPeriodPricenumberDescription
- nextBillingPeriodAmountnumberDescription
- nextBillingDatestring<date>DescriptionFormatdate
- previewResultobjectDescription
- assetNumberstringDescription
- quantitynumberDescription
- termnumberDescription
- startDatestring<date>DescriptionFormatdate
- endDatestring<date>DescriptionFormatdate
- cancellationDatestring<date>DescriptionFormatdate
- orderPriceobjectDescription
- billingPriceobjectDescription
- changesobject[]Description
- changeTypestringDescription
- deltaACVnumberDescription
- deltaARRnumberDescription
- deltaCMRRnumberDescription
- deltaTCVnumberDescription
- discountAmountnumberDescription
- discountPercentagenumberDescription
- endDatestringDescription
- lineTypestringDescription
- listTotalnumberDescription
- netSalesPricenumberDescription
- quantitynumberDescription
- refIdstringDescription
- salesPricenumberDescription
- startDatestringDescription
- subtotalnumberDescription
- systemDiscountnumberDescription
- systemDiscountAmountnumberDescription
- termnumberDescription
- totalAmountnumberDescription
- totalPricenumberDescription
- childrenAssetsobject[]Description
- assetNumberstring
- quantitynumber
- termnumber
- startDatestring
- endDatestring
- cancellationDatestring
- reconfigureStartDatestring
- convertFreeTrialStartDatestring
- orderPricemap<string, string>Description
- billingPricemap<string, string>Description
- changesobject[]
- changeTypestringDescription
- deltaACVnumberDescription
- deltaARRnumberDescription
- deltaCMRRnumberDescription
- deltaTCVnumberDescription
- discountAmountnumberDescription
- discountPercentagenumberDescription
- endDatestringDescription
- lineTypestringDescription
- listTotalnumberDescription
- netSalesPricenumberDescription
- quantitynumberDescription
- refIdstringDescription
- salesPricenumberDescription
- startDatestringDescription
- subtotalnumberDescription
- systemDiscountnumberDescription
- systemDiscountAmountnumberDescription
- termnumberDescription
- totalAmountnumberDescription
- totalPricenumberDescription
- childrenAssetsobject[]
- previewRequestobjectDescription
400
- ValidationError
- statusstring<FAILURE>AllowedFAILURE
- errorCodestringDescription
- messagestringDescription
401
- UnauthorizedErrorDescription
- statusDescription
- errorstringDescription
- errorCodestringDescription
- errorTypestringDescription
- messagestringDescription
curl
curl --request POST \
--url https://api.nue.io/orders/invoice-preview \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{
"customer": {
"id": ""
},
"orderProducts": [
{
"priceBookEntryId": "",
"quantity": "",
"subscriptionStartDate": "",
"addOns": [
{
"productOptionId": ""
}
]
}
],
"assetChanges": [
{
"changeType": "",
"assetNumber": "",
"addOns": [
{
"productOptionId": "",
"reconfigureEffectiveDate": "",
"productOptionQuantity": ""
}
]
}
],
"products": [
{
"priceBookEntryId": "",
"quantity": "",
"subscriptionStartDate": ""
}
]
}'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json");
var raw = JSON.stringify({
"customer": {
"id": ""
},
"orderProducts": [
{
"priceBookEntryId": "",
"quantity": "",
"subscriptionStartDate": "",
"addOns": [
{
"productOptionId": ""
}
]
}
],
"assetChanges": [
{
"changeType": "",
"assetNumber": "",
"addOns": [
{
"productOptionId": "",
"reconfigureEffectiveDate": "",
"productOptionQuantity": ""
}
]
}
],
"products": [
{
"priceBookEntryId": "",
"quantity": "",
"subscriptionStartDate": ""
}
]
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://api.nue.io/orders/invoice-preview", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));ruby
require "uri"
require "json"
require "net/http"
url = URI("https://api.nue.io/orders/invoice-preview")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["accept"] = "application/json"
request["content-type"] = "application/json"
request.body = JSON.dump({
"customer": {
"id": ""
},
"orderProducts": [
{
"priceBookEntryId": "",
"quantity": "",
"subscriptionStartDate": "",
"addOns": [
{
"productOptionId": ""
}
]
}
],
"assetChanges": [
{
"changeType": "",
"assetNumber": "",
"addOns": [
{
"productOptionId": "",
"reconfigureEffectiveDate": "",
"productOptionQuantity": ""
}
]
}
],
"products": [
{
"priceBookEntryId": "",
"quantity": "",
"subscriptionStartDate": ""
}
]
})
response = https.request(request)
puts response.read_body
python
import requests
import json
url = "https://api.nue.io/orders/invoice-preview"
payload = json.dumps({
"customer": {
"id": ""
},
"orderProducts": [
{
"priceBookEntryId": "",
"quantity": "",
"subscriptionStartDate": "",
"addOns": [
{
"productOptionId": ""
}
]
}
],
"assetChanges": [
{
"changeType": "",
"assetNumber": "",
"addOns": [
{
"productOptionId": "",
"reconfigureEffectiveDate": "",
"productOptionQuantity": ""
}
]
}
],
"products": [
{
"priceBookEntryId": "",
"quantity": "",
"subscriptionStartDate": ""
}
]
})
headers = {
'accept': 'application/json',
'content-type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
200
// Invoice preview computed successfully. The response shape depends on the request type.
{
"previewInvoices": [
{
"id": "",
"invoiceNumber": "",
"amount": 0,
"amountWithoutTax": 0,
"currencyIsoCode": "",
"invoiceDate": "",
"dueDate": "",
"startDate": "",
"endDate": "",
"status": "",
"items": [
{
"productName": "",
"amount": 0,
"quantity": 0,
"unitPrice": 0,
"startDate": "",
"endDate": ""
}
]
}
],
"previews": [
{
"assetNumber": "",
"priceSummary": {
"totalPrice": 0,
"totalAmount": 0,
"todayChargePrice": 0,
"todayChargeAmount": 0,
"nextBillingPeriodPrice": 0,
"nextBillingPeriodAmount": 0,
"nextBillingDate": ""
},
"previewResult": {
"assetNumber": "",
"quantity": 0,
"term": 0,
"startDate": "",
"endDate": "",
"cancellationDate": "",
"orderPrice": {},
"billingPrice": {},
"changes": [
{
"changeType": "",
"deltaACV": 0,
"deltaARR": 0,
"deltaCMRR": 0,
"deltaTCV": 0,
"discountAmount": 0,
"discountPercentage": 0,
"endDate": "",
"lineType": "",
"listTotal": 0,
"netSalesPrice": 0,
"quantity": 0,
"refId": "",
"salesPrice": 0,
"startDate": "",
"subtotal": 0,
"systemDiscount": 0,
"systemDiscountAmount": 0,
"term": 0,
"totalAmount": 0,
"totalPrice": 0
}
],
"childrenAssets": [
{
"assetNumber": "",
"quantity": 0,
"term": 0,
"startDate": "",
"endDate": "",
"cancellationDate": "",
"reconfigureStartDate": "",
"convertFreeTrialStartDate": "",
"orderPrice": "",
"billingPrice": "",
"changes": [
{
"changeType": "",
"deltaACV": 0,
"deltaARR": 0,
"deltaCMRR": 0,
"deltaTCV": 0,
"discountAmount": 0,
"discountPercentage": 0,
"endDate": "",
"lineType": "",
"listTotal": 0,
"netSalesPrice": 0,
"quantity": 0,
"refId": "",
"salesPrice": 0,
"startDate": "",
"subtotal": 0,
"systemDiscount": 0,
"systemDiscountAmount": 0,
"term": 0,
"totalAmount": 0,
"totalPrice": 0
}
],
"childrenAssets": [
{}
]
}
]
},
"previewRequest": {}
}
]
}GENERATED
// Invoice preview computed successfully. The response shape depends on the request type.
{
"previewInvoices": [
{
"id": "",
"invoiceNumber": "",
"amount": 0,
"amountWithoutTax": 0,
"currencyIsoCode": "",
"invoiceDate": "",
"dueDate": "",
"startDate": "",
"endDate": "",
"status": "",
"items": [
{
"productName": "",
"amount": 0,
"quantity": 0,
"unitPrice": 0,
"startDate": "",
"endDate": ""
}
]
}
],
"previews": [
{
"assetNumber": "",
"priceSummary": {
"totalPrice": 0,
"totalAmount": 0,
"todayChargePrice": 0,
"todayChargeAmount": 0,
"nextBillingPeriodPrice": 0,
"nextBillingPeriodAmount": 0,
"nextBillingDate": ""
},
"previewResult": {
"assetNumber": "",
"quantity": 0,
"term": 0,
"startDate": "",
"endDate": "",
"cancellationDate": "",
"orderPrice": {},
"billingPrice": {},
"changes": [
{
"changeType": "",
"deltaACV": 0,
"deltaARR": 0,
"deltaCMRR": 0,
"deltaTCV": 0,
"discountAmount": 0,
"discountPercentage": 0,
"endDate": "",
"lineType": "",
"listTotal": 0,
"netSalesPrice": 0,
"quantity": 0,
"refId": "",
"salesPrice": 0,
"startDate": "",
"subtotal": 0,
"systemDiscount": 0,
"systemDiscountAmount": 0,
"term": 0,
"totalAmount": 0,
"totalPrice": 0
}
],
"childrenAssets": [
{
"assetNumber": "",
"quantity": 0,
"term": 0,
"startDate": "",
"endDate": "",
"cancellationDate": "",
"reconfigureStartDate": "",
"convertFreeTrialStartDate": "",
"orderPrice": "",
"billingPrice": "",
"changes": [
{
"changeType": "",
"deltaACV": 0,
"deltaARR": 0,
"deltaCMRR": 0,
"deltaTCV": 0,
"discountAmount": 0,
"discountPercentage": 0,
"endDate": "",
"lineType": "",
"listTotal": 0,
"netSalesPrice": 0,
"quantity": 0,
"refId": "",
"salesPrice": 0,
"startDate": "",
"subtotal": 0,
"systemDiscount": 0,
"systemDiscountAmount": 0,
"term": 0,
"totalAmount": 0,
"totalPrice": 0
}
],
"childrenAssets": [
{}
]
}
]
},
"previewRequest": {}
}
]
}initialOrderResponse
// Initial order invoice preview response
{
"previewInvoices": [
{
"amount": 1800,
"amountWithoutTax": 1800,
"taxAmount": 0,
"currencyIsoCode": "USD",
"invoiceDate": "2025-07-01",
"dueDate": "2025-07-31",
"startDate": "2025-07-01",
"endDate": "2026-06-30",
"items": [
{
"productName": "Platform License",
"amount": 1800,
"quantity": 10,
"unitPrice": 15,
"startDate": "2025-07-01",
"endDate": "2026-06-30"
}
]
}
]
}changeOrderResponse
// Change order invoice preview response
{
"previews": [
{
"assetNumber": "SUB-00003725",
"priceSummary": {
"totalPrice": 4500,
"totalAmount": 4500,
"todayChargePrice": 2062.5,
"todayChargeAmount": 2062.5,
"nextBillingPeriodPrice": 375,
"nextBillingPeriodAmount": 375,
"nextBillingDate": "2025-08-01"
},
"previewResult": {
"assetNumber": "SUB-00003725",
"quantity": 35,
"term": 12,
"startDate": "2025-01-01",
"endDate": "2025-12-31"
}
}
]
}400
// Validation error
{
"status": "",
"errorCode": "",
"message": ""
}GENERATED
// Validation error
{
"status": "",
"errorCode": "",
"message": ""
}invalidPayload
// Both orderProducts and assetChanges provided
{
"status": "FAILURE",
"errorType": "VALIDATION_ERROR",
"errorCode": "INVOICE_PREVIEW_INVALID_PAYLOAD",
"message": "Request must contain either orderProducts or assetChanges, not both."
}missingBody
// Neither orderProducts nor assetChanges provided
{
"status": "FAILURE",
"errorType": "VALIDATION_ERROR",
"errorCode": "INVOICE_PREVIEW_MISSING_BODY",
"message": "Request must contain either orderProducts or assetChanges."
}401
// Unauthorized
{
"status": "",
"error": "",
"errorCode": "",
"errorType": "",
"message": ""
}