---
title: Preview Billing Information
slug: preview-billing-information
docTags: 
createdAt: 2026-08-25T19:28:59.170Z
---

{
  "id": "PeHi5QTS3xi_6bfbu8qWm",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://api.nue.io/orders/invoices:preview",
    "servers": [
      {
        "url": "https://api.nue.io/orders/invoices:preview",
        "description": "Nue Production API Endpoint"
      },
      {
        "url": "https://api.sandbox.nue.io/orders/invoices:preview",
        "description": "Nue Sandbox API Endpoint"
      }
    ],
    "name": "Preview Billing Information",
    "description": "<p>Generate the preview invoices in memory for a list of order products of a given customer.  The generated invoices will be included in the response payload.  There are 2 preview modes: First Invoice Only, Invoices with a Target Date. When choose first invoice only option, only the first invoice will be previewed. The system will use Today's date or the next billing date, which comes later as the invoice target date to generate a preview of the first invoice. To choose this option, set the firstInvoiceOnly parameter to true. When choose invoice with a target date option, the system will default the invoice target date as the Start Date of the quote or the order. To choose this option. set the firstInvoiceOnly parameter to false and set the targetDate parameter to the desired target date.</p>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json",
            "*/*"
          ],
          "default": "application/json"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "body",
          "type": "object",
          "description": "Invoice preview request",
          "customType": "OrderInvoicePreviewRequest",
          "schema": [
            {
              "name": "customerId",
              "kind": "required",
              "type": "string",
              "description": "Customer ID."
            },
            {
              "name": "billingAccountId",
              "kind": "optional",
              "type": "string",
              "description": "Billing Account ID."
            },
            {
              "name": "targetDate",
              "kind": "optional",
              "type": "string<date>",
              "description": "Invoice target date.",
              "format": "date"
            },
            {
              "name": "billingPeriod",
              "kind": "optional",
              "type": "string<Month | Quarter | Semi-Annual | Annual>",
              "description": "<p>The billing period determines how often the order products are billed, for example, Monthly, Quarterly, Annual, etc.There is an organization default, and each customer may have its own default value. When an order is created, the Billing Period is defaulted from that of the customer.</p>",
              "enum": [
                "Month",
                "Quarter",
                "Semi-Annual",
                "Annual"
              ],
              "pattern": "^(Month|Quarter|Semi-Annual|Annual|SameAsSubscriptionTerm|UseSystemDefault)$"
            },
            {
              "name": "billCycleDay",
              "kind": "optional",
              "type": "string",
              "description": "<p>Determines on which day the billing cycle starts. There is an organizational default Bill Cycle Day, but can be overridden at product, account, and order product (asset) level.</p>",
              "pattern": "^([0-9]{1,2}(st|nd|rd|th) of Month|AutoSetToFirstSubscription)$"
            },
            {
              "name": "billCycleStartMonth",
              "kind": "optional",
              "type": "string",
              "description": "The billing start month",
              "pattern": "^(0[1-9]{1}|1[0-2]{1})$"
            },
            {
              "name": "paymentTerm",
              "kind": "optional",
              "type": "string",
              "description": "Determines when customers pay for their products or services",
              "pattern": "^(Due Upon Receipt|Net 15|Net 30|Net 45|Net 60|[0-9]+)$"
            },
            {
              "name": "prorationEnabled",
              "kind": "optional",
              "type": "boolean",
              "description": "Billing Proration Enabled."
            },
            {
              "name": "firstInvoiceOnly",
              "kind": "optional",
              "type": "boolean",
              "description": "First invoice only."
            },
            {
              "name": "skipInvoicedItems",
              "kind": "optional",
              "type": "boolean",
              "description": "Skip invoiced items from future invoice preview."
            },
            {
              "name": "salesAccountBillCycleStartMonth",
              "kind": "optional",
              "type": "string",
              "description": "The billing start month on sales account",
              "pattern": "^(0[1-9]{1}|1[0-2]{1})$"
            },
            {
              "name": "salesAccountBillCycleDay",
              "kind": "optional",
              "type": "string",
              "description": "<p>Determines on which day the billing cycle starts on sales account. There is an organizational default Bill Cycle Day, but can be overridden at product, account, and order product (asset) level.</p>",
              "pattern": "^([0-9]{1,2}(st|nd|rd|th) of Month|AutoSetToFirstSubscription)$"
            },
            {
              "name": "salesAccountPaymentTerm",
              "kind": "optional",
              "type": "string",
              "description": "Determines when customers pay for their products or services on sales account",
              "pattern": "^(Due Upon Receipt|Net 15|Net 30|Net 45|Net 60|[0-9]+)$"
            },
            {
              "name": "salesAccountBillingPeriod",
              "kind": "optional",
              "type": "string<Month | Quarter | Semi-Annual | Annual>",
              "description": "<p>The billing period on sales account determines how often the order products are billed, for example, Monthly, Quarterly, Annual, etc.There is an organization default, and each customer may have its own default value. When an order is created, the Billing Period is defaulted from that of the customer.</p>",
              "enum": [
                "Month",
                "Quarter",
                "Semi-Annual",
                "Annual"
              ],
              "pattern": "^(Month|Quarter|Semi-Annual|Annual|SameAsSubscriptionTerm|UseSystemDefault)$"
            },
            {
              "name": "salesAccountProrationEnabled",
              "kind": "optional",
              "type": "boolean",
              "description": "Billing Proration Enabled on sales account."
            },
            {
              "name": "billingAccountBillCycleStartMonth",
              "kind": "optional",
              "type": "string",
              "description": "The billing start month on billing account",
              "pattern": "^(0[1-9]{1}|1[0-2]{1})$"
            },
            {
              "name": "billingAccountBillCycleDay",
              "kind": "optional",
              "type": "string",
              "description": "<p>Determines on which day the billing cycle starts on billing account. There is an organizational default Bill Cycle Day, but can be overridden at product, account, and order product (asset) level.</p>",
              "pattern": "^([0-9]{1,2}(st|nd|rd|th) of Month|AutoSetToFirstSubscription)$"
            },
            {
              "name": "billingAccountPaymentTerm",
              "kind": "optional",
              "type": "string",
              "description": "Determines when customers pay for their products or services on billing account",
              "pattern": "^(Due Upon Receipt|Net 15|Net 30|Net 45|Net 60|[0-9]+)$"
            },
            {
              "name": "billingAccountBillingPeriod",
              "kind": "optional",
              "type": "string<Month | Quarter | Semi-Annual | Annual>",
              "description": "<p>The billing period on billing account determines how often the order products are billed, for example, Monthly, Quarterly, Annual, etc.There is an organization default, and each customer may have its own default value. When an order is created, the Billing Period is defaulted from that of the customer.</p>",
              "enum": [
                "Month",
                "Quarter",
                "Semi-Annual",
                "Annual"
              ],
              "pattern": "^(Month|Quarter|Semi-Annual|Annual|SameAsSubscriptionTerm|UseSystemDefault)$"
            },
            {
              "name": "billingAccountProrationEnabled",
              "kind": "optional",
              "type": "boolean",
              "description": "Billing Proration Enabled on billing account."
            },
            {
              "name": "orders",
              "kind": "optional",
              "type": "array",
              "description": "Orders.",
              "modelRef": "#/components/schemas/OrderForPreview",
              "customType": "OrderForPreview[]",
              "schema": [
                {
                  "name": "id",
                  "kind": "required",
                  "type": "string",
                  "description": "ID of order. "
                },
                {
                  "name": "customerId",
                  "kind": "optional",
                  "type": "string",
                  "description": "Customer ID. Optional if different from parent customer ID."
                },
                {
                  "name": "billingAccountId",
                  "kind": "optional",
                  "type": "string",
                  "description": "Billing Account ID. Optional if different from customer ID. "
                },
                {
                  "name": "billingPeriod",
                  "kind": "optional",
                  "type": "string<Month | Quarter | Semi-Annual | Annual>",
                  "description": "<p>The billing period determines how often the order products are billed, for example, Monthly, Quarterly, Annual, etc.There is an organization default, and each customer may have its own default value. When an order is created, the Billing Period is defaulted from that of the customer.</p>",
                  "enum": [
                    "Month",
                    "Quarter",
                    "Semi-Annual",
                    "Annual"
                  ],
                  "pattern": "^(Month|Quarter|Semi-Annual|Annual|SameAsSubscriptionTerm|UseSystemDefault)$"
                },
                {
                  "name": "billCycleDay",
                  "kind": "optional",
                  "type": "string",
                  "description": "<p>Determines on which day the billing cycle starts. There is an organizational default Bill Cycle Day, but can be overridden at product, account, and order product (asset) level.</p>",
                  "pattern": "^([0-9]{1,2}(st|nd|rd|th) of Month|AutoSetToFirstSubscription)$"
                },
                {
                  "name": "billCycleStartMonth",
                  "kind": "optional",
                  "type": "string",
                  "description": "The billing start month",
                  "pattern": "^(0[1-9]{1}|1[0-2]{1})$"
                },
                {
                  "name": "paymentTerm",
                  "kind": "optional",
                  "type": "string",
                  "description": "Determines when customers pay for their products or services",
                  "pattern": "^(Due Upon Receipt|Net 15|Net 30|Net 45|Net 60|[0-9]+)$"
                },
                {
                  "name": "salesAccountBillCycleStartMonth",
                  "kind": "optional",
                  "type": "string",
                  "description": "The billing start month on sales account",
                  "pattern": "^(0[1-9]{1}|1[0-2]{1})$"
                },
                {
                  "name": "salesAccountBillCycleDay",
                  "kind": "optional",
                  "type": "string",
                  "description": "<p>Determines on which day the billing cycle starts on sales account. There is an organizational default Bill Cycle Day, but can be overridden at product, account, and order product (asset) level.</p>",
                  "pattern": "^([0-9]{1,2}(st|nd|rd|th) of Month|AutoSetToFirstSubscription)$"
                },
                {
                  "name": "salesAccountPaymentTerm",
                  "kind": "optional",
                  "type": "string",
                  "description": "Determines when customers pay for their products or services on sales account",
                  "pattern": "^(Due Upon Receipt|Net 15|Net 30|Net 45|Net 60|[0-9]+)$"
                },
                {
                  "name": "salesAccountBillingPeriod",
                  "kind": "optional",
                  "type": "string<Month | Quarter | Semi-Annual | Annual>",
                  "description": "<p>The billing period on sales account determines how often the order products are billed, for example, Monthly, Quarterly, Annual, etc.There is an organization default, and each customer may have its own default value. When an order is created, the Billing Period is defaulted from that of the customer.</p>",
                  "enum": [
                    "Month",
                    "Quarter",
                    "Semi-Annual",
                    "Annual"
                  ],
                  "pattern": "^(Month|Quarter|Semi-Annual|Annual|SameAsSubscriptionTerm|UseSystemDefault)$"
                },
                {
                  "name": "salesAccountProrationEnabled",
                  "kind": "optional",
                  "type": "boolean",
                  "description": "Billing Proration Enabled on sales account."
                },
                {
                  "name": "salesAccountSubscriptionCreated",
                  "kind": "optional",
                  "type": "boolean",
                  "description": "Indicate if sales account has subscription created."
                },
                {
                  "name": "billingAccountBillCycleStartMonth",
                  "kind": "optional",
                  "type": "string",
                  "description": "The billing start month on billing account",
                  "pattern": "^(0[1-9]{1}|1[0-2]{1})$"
                },
                {
                  "name": "billingAccountBillCycleDay",
                  "kind": "optional",
                  "type": "string",
                  "description": "<p>Determines on which day the billing cycle starts on billing account. There is an organizational default Bill Cycle Day, but can be overridden at product, account, and order product (asset) level.</p>",
                  "pattern": "^([0-9]{1,2}(st|nd|rd|th) of Month|AutoSetToFirstSubscription)$"
                },
                {
                  "name": "billingAccountPaymentTerm",
                  "kind": "optional",
                  "type": "string",
                  "description": "Determines when customers pay for their products or services on billing account",
                  "pattern": "^(Due Upon Receipt|Net 15|Net 30|Net 45|Net 60|[0-9]+)$"
                },
                {
                  "name": "billingAccountBillingPeriod",
                  "kind": "optional",
                  "type": "string<Month | Quarter | Semi-Annual | Annual>",
                  "description": "<p>The billing period on billing account determines how often the order products are billed, for example, Monthly, Quarterly, Annual, etc.There is an organization default, and each customer may have its own default value. When an order is created, the Billing Period is defaulted from that of the customer.</p>",
                  "enum": [
                    "Month",
                    "Quarter",
                    "Semi-Annual",
                    "Annual"
                  ],
                  "pattern": "^(Month|Quarter|Semi-Annual|Annual|SameAsSubscriptionTerm|UseSystemDefault)$"
                },
                {
                  "name": "billingAccountProrationEnabled",
                  "kind": "optional",
                  "type": "boolean",
                  "description": "Billing Proration Enabled on billing account."
                },
                {
                  "name": "billingAccountSubscriptionCreated",
                  "kind": "optional",
                  "type": "boolean",
                  "description": "Indicate if billing account has subscription created"
                }
              ]
            },
            {
              "name": "orderProducts",
              "kind": "required",
              "type": "array",
              "description": "Order products.",
              "modelRef": "#/components/schemas/OrderProductForPreview",
              "customType": "OrderProductForPreview[]",
              "schema": [
                {
                  "name": "id",
                  "kind": "required",
                  "type": "string",
                  "description": "ID of order product. "
                },
                {
                  "name": "customerId",
                  "kind": "optional",
                  "type": "string",
                  "description": "Customer ID. Optional if different from parent customer ID."
                },
                {
                  "name": "billingAccountId",
                  "kind": "optional",
                  "type": "string",
                  "description": "Billing Account ID. Optional if different from customer ID. "
                },
                {
                  "name": "orderId",
                  "kind": "optional",
                  "type": "string",
                  "description": "ID of order."
                },
                {
                  "name": "orderProductNumber",
                  "kind": "optional",
                  "type": "string",
                  "description": "Order Product Number."
                },
                {
                  "name": "priceBookEntryId",
                  "kind": "optional",
                  "type": "string",
                  "description": "Price Book Entry."
                },
                {
                  "name": "subscriptionTerm",
                  "kind": "optional",
                  "type": "number",
                  "description": "Subscription Term."
                },
                {
                  "name": "summaryLineItemId",
                  "kind": "optional",
                  "type": "string",
                  "description": "Summary Line Item"
                },
                {
                  "name": "uomId",
                  "kind": "optional",
                  "type": "string",
                  "description": "UOM Id."
                },
                {
                  "name": "evergreen",
                  "kind": "optional",
                  "type": "boolean",
                  "description": "Evergreen. This indicates if the line item is a evergreen item."
                },
                {
                  "name": "description",
                  "kind": "optional",
                  "type": "string",
                  "description": "Description."
                },
                {
                  "name": "priceModel",
                  "kind": "required",
                  "type": "string",
                  "description": "Price model.",
                  "pattern": "^(OneTime|Recurring|Usage|CRBD)$"
                },
                {
                  "name": "startDate",
                  "kind": "required",
                  "type": "string<date>",
                  "description": "Subscription start date.",
                  "format": "date"
                },
                {
                  "name": "endDate",
                  "kind": "optional",
                  "type": "string<date>",
                  "description": "Subscription end date.",
                  "format": "date"
                },
                {
                  "name": "totalPrice",
                  "kind": "required",
                  "type": "number",
                  "description": "<p>Total price. The line time's sales price multiplied by the quantity and Term, minus discounts.</p>"
                },
                {
                  "name": "totalAmount",
                  "kind": "optional",
                  "type": "number",
                  "description": "Total amount. "
                },
                {
                  "name": "tax",
                  "kind": "required",
                  "type": "number",
                  "description": "The tax amount."
                },
                {
                  "name": "quantity",
                  "kind": "required",
                  "type": "number",
                  "description": "The quantity of the product. "
                },
                {
                  "name": "productId",
                  "kind": "required",
                  "type": "string",
                  "description": "ID of the product associated with this OrderLineItem. "
                },
                {
                  "name": "productName",
                  "kind": "required",
                  "type": "string",
                  "description": "Name of the product associated with this OrderLineItem. "
                },
                {
                  "name": "lineType",
                  "kind": "required",
                  "type": "string<LineItem | RampItem | SummaryItem | SplitItem>",
                  "description": "The order product type. ",
                  "enum": [
                    "LineItem",
                    "RampItem",
                    "SummaryItem",
                    "SplitItem"
                  ]
                },
                {
                  "name": "netSalesPrice",
                  "kind": "required",
                  "type": "number",
                  "description": "<p>The actual sales price after the on-the-fly discount</p>"
                },
                {
                  "name": "billingTiming",
                  "kind": "optional",
                  "type": "string",
                  "description": "Determines whether customers are billed for the products or services before or after they are provided or consumed."
                },
                {
                  "name": "billingPeriod",
                  "kind": "optional",
                  "type": "string<Month | Quarter | Semi-Annual | Annual>",
                  "description": "<p>The billing period determines how often the order products are billed, for example, Monthly, Quarterly, Annual, etc.There is an organization default, and each customer may have its own default value. When an order is created, the Billing Period is defaulted from that of the customer.</p>",
                  "enum": [
                    "Month",
                    "Quarter",
                    "Semi-Annual",
                    "Annual"
                  ],
                  "pattern": "^(Month|Quarter|Semi-Annual|Annual|SameAsSubscriptionTerm|UseSystemDefault)$"
                },
                {
                  "name": "billCycleDay",
                  "kind": "optional",
                  "type": "string",
                  "description": "<p>Determines on which day the billing cycle starts. There is an organizational default Bill Cycle Day, but can be overridden at product, account, and order product (asset) level.</p>",
                  "pattern": "^([0-9]{1,2}(st|nd|rd|th) of Month|AutoSetToFirstSubscription)$"
                },
                {
                  "name": "billCycleStartMonth",
                  "kind": "optional",
                  "type": "string",
                  "description": "The billing start month",
                  "pattern": "^(0[1-9]{1}|1[0-2]{1})$"
                },
                {
                  "name": "paymentTerm",
                  "kind": "optional",
                  "type": "string",
                  "description": "Determines when customers pay for their products or services",
                  "pattern": "^(Due Upon Receipt|Net 15|Net 30|Net 45|Net 60|[0-9]+)$"
                },
                {
                  "name": "uomEx",
                  "kind": "optional",
                  "type": "string",
                  "description": "UOM in JSON form"
                },
                {
                  "name": "currencyIsoCode",
                  "kind": "optional",
                  "type": "string",
                  "description": "Available only for organizations with the multiplcurrency feature enabled. Contains the ISO code for any currency allowed by the organization."
                },
                {
                  "name": "entityId",
                  "kind": "optional",
                  "type": "string",
                  "description": "The associated entity."
                },
                {
                  "name": "assetType",
                  "kind": "optional",
                  "type": "string<Subscription | Asset | Entitlement>",
                  "description": "<p>The type of the associated asset, including Subscription, Asset, Entitlement, etc.</p>",
                  "enum": [
                    "Subscription",
                    "Asset",
                    "Entitlement"
                  ]
                },
                {
                  "name": "productSku",
                  "kind": "required",
                  "type": "string",
                  "description": "Sku of the product associated with this OrderLineItem. "
                },
                {
                  "name": "change",
                  "kind": "optional",
                  "type": "boolean",
                  "description": ""
                }
              ]
            }
          ],
          "modelRef": "#/components/schemas/OrderInvoicePreviewRequest",
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "apiKeyAuth",
          "name": "nue-api-key",
          "kind": "optional",
          "type": "apiKey",
          "in": "header"
        }
      ],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Successfully generated preview invoices",
        "jsonExample": "",
        "isExpanded": true,
        "subExamples": [
          {
            "label": "GENERATED",
            "code": "// Successfully generated preview invoices\n[\n  {\n    \"accountEx\": \"\",\n    \"accountId\": \"\",\n    \"accountingStatus\": \"\",\n    \"activatedById\": \"\",\n    \"activatedTime\": \"\",\n    \"amount\": 0,\n    \"amountWithoutTax\": 0,\n    \"autoNumberFormat\": \"\",\n    \"autoNumberSequence\": \"\",\n    \"balance\": 0,\n    \"billToContactEx\": \"\",\n    \"billToContactId\": \"\",\n    \"cancellationDate\": \"\",\n    \"currencyIsoCode\": \"\",\n    \"dueDate\": \"\",\n    \"einvoicingDocId\": \"\",\n    \"einvoicingDocStatus\": \"\",\n    \"einvoicingMandateCode\": \"\",\n    \"einvoicingMandateId\": \"\",\n    \"einvoicingMessage\": \"\",\n    \"endDate\": \"\",\n    \"entityId\": \"\",\n    \"externalInvoiceId\": \"\",\n    \"externalTaxId\": \"\",\n    \"groupKey\": \"\",\n    \"id\": \"\",\n    \"invoiceDate\": \"\",\n    \"invoiceNumber\": \"\",\n    \"invoicePdf\": \"\",\n    \"isCatchUp\": false,\n    \"items\": [\n      {\n        \"tenantId\": \"\",\n        \"accountId\": \"\",\n        \"groupKey\": \"\",\n        \"invoiceId\": \"\",\n        \"invoiceNumber\": \"\",\n        \"id\": \"\",\n        \"recordType\": \"\",\n        \"isCatchUp\": false,\n        \"invoiceItemNumber\": \"\",\n        \"productId\": \"\",\n        \"productName\": \"\",\n        \"assetId\": \"\",\n        \"assetNumber\": \"\",\n        \"assetType\": \"\",\n        \"uomId\": \"\",\n        \"uomEx\": \"\",\n        \"currencyIsoCode\": \"\",\n        \"transactionDate\": \"\",\n        \"transactionAmount\": 0,\n        \"transactionAmountWithoutTax\": 0,\n        \"transactionQuantity\": 0,\n        \"shippingAndHandling\": 0,\n        \"taxAmount\": 0,\n        \"ratedCredits\": 0,\n        \"appliedCredits\": 0,\n        \"netSalesPrice\": 0,\n        \"balance\": 0,\n        \"startDate\": \"\",\n        \"endDate\": \"\",\n        \"billingTiming\": \"\",\n        \"status\": \"\",\n        \"taxStatus\": \"\",\n        \"salesAccountId\": \"\",\n        \"details\": [\n          {\n            \"tenantId\": \"\",\n            \"accountId\": \"\",\n            \"invoiceId\": \"\",\n            \"invoiceItemId\": \"\",\n            \"id\": \"\",\n            \"isCatchUp\": false,\n            \"orderProductId\": \"\",\n            \"detailType\": \"\",\n            \"billedAmount\": 0,\n            \"transactionAmount\": 0,\n            \"transactionAmountWithoutTax\": 0,\n            \"transactionQuantity\": 0,\n            \"shippingAndHandling\": 0,\n            \"billedShipping\": 0,\n            \"taxAmount\": 0,\n            \"netSalesPrice\": 0,\n            \"ratedCredits\": 0,\n            \"appliedCredits\": 0,\n            \"startDate\": \"\",\n            \"endDate\": \"\",\n            \"billingTiming\": \"\",\n            \"status\": \"\",\n            \"taxStatus\": \"\",\n            \"currencyIsoCode\": \"\",\n            \"salesAccountId\": \"\",\n            \"invoiceItemDetailNumber\": \"\",\n            \"taxRates\": \"\",\n            \"vatCode\": \"\",\n            \"vatNumberTypeId\": \"\",\n            \"avtUserBIN\": \"\",\n            \"autoNumberFormat\": \"\",\n            \"autoNumberSequence\": \"\",\n            \"entityId\": \"\"\n          }\n        ],\n        \"taxCode\": \"\",\n        \"taxMode\": \"\",\n        \"taxRates\": \"\",\n        \"taxPercent\": 0,\n        \"description\": \"\",\n        \"autoNumberFormat\": \"\",\n        \"autoNumberSequence\": \"\",\n        \"entityId\": \"\",\n        \"targetDate\": \"\",\n        \"customFields\": \"\",\n        \"paymentStatus\": \"\"\n      }\n    ],\n    \"paymentMethods\": [\n      \"\"\n    ],\n    \"poDates\": \"\",\n    \"poNumbers\": \"\",\n    \"recordType\": \"\",\n    \"salesAccountId\": \"\",\n    \"shippingAndHandling\": 0,\n    \"source\": \"\",\n    \"startDate\": \"\",\n    \"status\": \"\",\n    \"syncTime\": \"\",\n    \"targetDate\": \"\",\n    \"taxAmount\": 0,\n    \"taxCompanyCode\": \"\",\n    \"taxErrorMessage\": \"\",\n    \"taxStatus\": \"\",\n    \"templateId\": \"\",\n    \"tenantId\": \"\",\n    \"vatMessages\": \"\"\n  }\n]"
          },
          {
            "label": "Invoice preview response sample",
            "code": "[\n  {\n    \"accountId\": \"0018G00000WpYFiQAN\",\n    \"status\": \"Draft\",\n    \"accountingStatus\": \"NotStarted\",\n    \"recordType\": \"Invoice\",\n    \"amount\": 8.25,\n    \"amountWithoutTax\": 8.25,\n    \"taxAmount\": 0,\n    \"taxStatus\": \"NotCalculated\",\n    \"balance\": 8.25,\n    \"invoiceDate\": \"2023-10-25\",\n    \"dueDate\": \"2023-11-24\",\n    \"startDate\": \"2023-10-06\",\n    \"endDate\": \"2023-11-01\",\n    \"targetDate\": \"2023-10-09\",\n    \"items\": [\n      {\n        \"accountId\": \"0018G00000WpYFiQAN\",\n        \"recordType\": \"Invoice\",\n        \"productId\": \"01t8G000002Rf6gQAC\",\n        \"productName\": \"Nue Platform\",\n        \"assetId\": \"01t8G000002Rf6gQAC_preview\",\n        \"transactionDate\": \"2023-10-25\",\n        \"transactionAmount\": 8.25,\n        \"transactionAmountWithoutTax\": 8.25,\n        \"transactionQuantity\": 1,\n        \"taxAmount\": 0,\n        \"ratedCredits\": 0,\n        \"appliedCredits\": 0,\n        \"netSalesPrice\": 8.25,\n        \"balance\": 8.25,\n        \"startDate\": \"2023-10-06\",\n        \"endDate\": \"2023-11-01\",\n        \"billingTiming\": \"InAdvance\",\n        \"status\": \"Draft\",\n        \"taxStatus\": \"NotCalculated\",\n        \"details\": [\n          {\n            \"accountId\": \"0018G00000WpYFiQAN\",\n            \"orderProductId\": \"8028G000001KXtcQAG\",\n            \"detailType\": \"Committed\",\n            \"billedAmount\": 8.25,\n            \"transactionAmount\": 8.25,\n            \"transactionAmountWithoutTax\": 8.25,\n            \"transactionQuantity\": 1,\n            \"taxAmount\": 0,\n            \"ratedCredits\": 0,\n            \"appliedCredits\": 0,\n            \"startDate\": \"2023-10-06\",\n            \"endDate\": \"2023-11-01\",\n            \"billingTiming\": \"InAdvance\",\n            \"status\": \"Draft\",\n            \"taxStatus\": \"NotCalculated\"\n          }\n        ],\n        \"priceModel\": \"Recurring\"\n      }\n    ]\n  }\n]"
          }
        ],
        "schema": [
          {
            "kind": "optional",
            "type": "array",
            "description": "Preview Invoices.",
            "customType": "Invoice[]",
            "schema": [
              {
                "name": "accountEx",
                "kind": "optional",
                "type": "string",
                "description": ""
              },
              {
                "name": "accountId",
                "kind": "optional",
                "type": "string",
                "description": ""
              },
              {
                "name": "accountingStatus",
                "kind": "optional",
                "type": "string<NotStarted | Complete | Error | Skipped>",
                "description": "",
                "enum": [
                  "NotStarted",
                  "Complete",
                  "Error",
                  "Skipped"
                ]
              },
              {
                "name": "activatedById",
                "kind": "optional",
                "type": "string",
                "description": ""
              },
              {
                "name": "activatedTime",
                "kind": "optional",
                "type": "string<date-time>",
                "description": "",
                "format": "date-time"
              },
              {
                "name": "amount",
                "kind": "optional",
                "type": "number",
                "description": ""
              },
              {
                "name": "amountWithoutTax",
                "kind": "optional",
                "type": "number",
                "description": ""
              },
              {
                "name": "autoNumberFormat",
                "kind": "optional",
                "type": "string",
                "description": ""
              },
              {
                "name": "autoNumberSequence",
                "kind": "optional",
                "type": "integer<int64>",
                "description": "",
                "format": "int64"
              },
              {
                "name": "balance",
                "kind": "optional",
                "type": "number",
                "description": ""
              },
              {
                "name": "billToContactEx",
                "kind": "optional",
                "type": "string",
                "description": ""
              },
              {
                "name": "billToContactId",
                "kind": "optional",
                "type": "string",
                "description": ""
              },
              {
                "name": "cancellationDate",
                "kind": "optional",
                "type": "string<date>",
                "description": "",
                "format": "date"
              },
              {
                "name": "currencyIsoCode",
                "kind": "optional",
                "type": "string",
                "description": ""
              },
              {
                "name": "dueDate",
                "kind": "optional",
                "type": "string<date>",
                "description": "",
                "format": "date"
              },
              {
                "name": "einvoicingDocId",
                "kind": "optional",
                "type": "string<uuid>",
                "description": "",
                "format": "uuid"
              },
              {
                "name": "einvoicingDocStatus",
                "kind": "optional",
                "type": "string<Submitted | Accepted | Pending | Error | Complete>",
                "description": "",
                "enum": [
                  "Submitted",
                  "Accepted",
                  "Pending",
                  "Error",
                  "Complete"
                ]
              },
              {
                "name": "einvoicingMandateCode",
                "kind": "optional",
                "type": "string",
                "description": ""
              },
              {
                "name": "einvoicingMandateId",
                "kind": "optional",
                "type": "string<uuid>",
                "description": "",
                "format": "uuid"
              },
              {
                "name": "einvoicingMessage",
                "kind": "optional",
                "type": "string",
                "description": ""
              },
              {
                "name": "endDate",
                "kind": "optional",
                "type": "string<date>",
                "description": "",
                "format": "date"
              },
              {
                "name": "entityId",
                "kind": "optional",
                "type": "string",
                "description": ""
              },
              {
                "name": "externalInvoiceId",
                "kind": "optional",
                "type": "string",
                "description": ""
              },
              {
                "name": "externalTaxId",
                "kind": "optional",
                "type": "string",
                "description": ""
              },
              {
                "name": "groupKey",
                "kind": "required",
                "type": "map",
                "description": "",
                "example": "",
                "customType": "map<string, string>",
                "schema": [
                  {
                    "name": "empty",
                    "kind": "optional",
                    "type": "boolean",
                    "description": ""
                  }
                ]
              },
              {
                "name": "id",
                "kind": "optional",
                "type": "string<uuid>",
                "description": "",
                "format": "uuid"
              },
              {
                "name": "invoiceDate",
                "kind": "optional",
                "type": "string<date>",
                "description": "",
                "format": "date"
              },
              {
                "name": "invoiceNumber",
                "kind": "optional",
                "type": "string",
                "description": ""
              },
              {
                "name": "invoicePdf",
                "kind": "optional",
                "type": "string",
                "description": ""
              },
              {
                "name": "isCatchUp",
                "kind": "optional",
                "type": "boolean",
                "description": ""
              },
              {
                "name": "items",
                "kind": "optional",
                "type": "array",
                "description": "",
                "modelRef": "#/components/schemas/InvoiceItem",
                "customType": "InvoiceItem[]",
                "schema": [
                  {
                    "name": "tenantId",
                    "kind": "optional",
                    "type": "string<uuid>",
                    "description": "",
                    "format": "uuid"
                  },
                  {
                    "name": "accountId",
                    "kind": "optional",
                    "type": "string",
                    "description": ""
                  },
                  {
                    "name": "groupKey",
                    "kind": "optional",
                    "type": "map",
                    "description": "",
                    "example": "",
                    "customType": "map<string, string>",
                    "schema": [
                      {
                        "name": "empty",
                        "kind": "optional",
                        "type": "boolean",
                        "description": ""
                      }
                    ]
                  },
                  {
                    "name": "invoiceId",
                    "kind": "optional",
                    "type": "string<uuid>",
                    "description": "",
                    "format": "uuid"
                  },
                  {
                    "name": "invoiceNumber",
                    "kind": "optional",
                    "type": "string",
                    "description": ""
                  },
                  {
                    "name": "id",
                    "kind": "optional",
                    "type": "string<uuid>",
                    "description": "",
                    "format": "uuid"
                  },
                  {
                    "name": "recordType",
                    "kind": "optional",
                    "type": "string<Invoice | CreditMemo>",
                    "description": "",
                    "enum": [
                      "Invoice",
                      "CreditMemo"
                    ]
                  },
                  {
                    "name": "isCatchUp",
                    "kind": "optional",
                    "type": "boolean",
                    "description": ""
                  },
                  {
                    "name": "invoiceItemNumber",
                    "kind": "optional",
                    "type": "string",
                    "description": ""
                  },
                  {
                    "name": "productId",
                    "kind": "optional",
                    "type": "string",
                    "description": ""
                  },
                  {
                    "name": "productName",
                    "kind": "optional",
                    "type": "string",
                    "description": ""
                  },
                  {
                    "name": "assetId",
                    "kind": "optional",
                    "type": "string",
                    "description": ""
                  },
                  {
                    "name": "assetNumber",
                    "kind": "optional",
                    "type": "string",
                    "description": ""
                  },
                  {
                    "name": "assetType",
                    "kind": "optional",
                    "type": "string<Subscription | Asset | Entitlement>",
                    "description": "",
                    "enum": [
                      "Subscription",
                      "Asset",
                      "Entitlement"
                    ]
                  },
                  {
                    "name": "uomId",
                    "kind": "optional",
                    "type": "string",
                    "description": ""
                  },
                  {
                    "name": "uomEx",
                    "kind": "optional",
                    "type": "string",
                    "description": ""
                  },
                  {
                    "name": "currencyIsoCode",
                    "kind": "optional",
                    "type": "string",
                    "description": ""
                  },
                  {
                    "name": "transactionDate",
                    "kind": "optional",
                    "type": "string<date>",
                    "description": "",
                    "format": "date"
                  },
                  {
                    "name": "transactionAmount",
                    "kind": "optional",
                    "type": "number",
                    "description": ""
                  },
                  {
                    "name": "transactionAmountWithoutTax",
                    "kind": "optional",
                    "type": "number",
                    "description": ""
                  },
                  {
                    "name": "transactionQuantity",
                    "kind": "optional",
                    "type": "number",
                    "description": ""
                  },
                  {
                    "name": "shippingAndHandling",
                    "kind": "optional",
                    "type": "number",
                    "description": ""
                  },
                  {
                    "name": "taxAmount",
                    "kind": "optional",
                    "type": "number",
                    "description": ""
                  },
                  {
                    "name": "ratedCredits",
                    "kind": "optional",
                    "type": "number",
                    "description": ""
                  },
                  {
                    "name": "appliedCredits",
                    "kind": "optional",
                    "type": "number",
                    "description": ""
                  },
                  {
                    "name": "netSalesPrice",
                    "kind": "optional",
                    "type": "number",
                    "description": ""
                  },
                  {
                    "name": "balance",
                    "kind": "optional",
                    "type": "number",
                    "description": ""
                  },
                  {
                    "name": "startDate",
                    "kind": "optional",
                    "type": "string<date>",
                    "description": "",
                    "format": "date"
                  },
                  {
                    "name": "endDate",
                    "kind": "optional",
                    "type": "string<date>",
                    "description": "",
                    "format": "date"
                  },
                  {
                    "name": "billingTiming",
                    "kind": "optional",
                    "type": "string<InAdvance | InArrears>",
                    "description": "",
                    "enum": [
                      "InAdvance",
                      "InArrears"
                    ]
                  },
                  {
                    "name": "status",
                    "kind": "optional",
                    "type": "string<Draft | PendingActivation | Active | Canceled | EInvoicing>",
                    "description": "",
                    "enum": [
                      "Draft",
                      "PendingActivation",
                      "Active",
                      "Canceled",
                      "EInvoicing"
                    ]
                  },
                  {
                    "name": "taxStatus",
                    "kind": "optional",
                    "type": "string<NotCalculated | Calculated | Error | Committed>",
                    "description": "",
                    "enum": [
                      "NotCalculated",
                      "Calculated",
                      "Error",
                      "Committed"
                    ]
                  },
                  {
                    "name": "salesAccountId",
                    "kind": "optional",
                    "type": "string",
                    "description": ""
                  },
                  {
                    "name": "details",
                    "kind": "optional",
                    "type": "array",
                    "description": "",
                    "modelRef": "#/components/schemas/InvoiceItemDetail",
                    "customType": "InvoiceItemDetail[]",
                    "schema": [
                      {
                        "name": "tenantId",
                        "kind": "optional",
                        "type": "string<uuid>",
                        "description": "",
                        "format": "uuid"
                      },
                      {
                        "name": "accountId",
                        "kind": "optional",
                        "type": "string",
                        "description": ""
                      },
                      {
                        "name": "invoiceId",
                        "kind": "optional",
                        "type": "string<uuid>",
                        "description": "",
                        "format": "uuid"
                      },
                      {
                        "name": "invoiceItemId",
                        "kind": "optional",
                        "type": "string<uuid>",
                        "description": "",
                        "format": "uuid"
                      },
                      {
                        "name": "id",
                        "kind": "optional",
                        "type": "string<uuid>",
                        "description": "",
                        "format": "uuid"
                      },
                      {
                        "name": "isCatchUp",
                        "kind": "optional",
                        "type": "boolean",
                        "description": ""
                      },
                      {
                        "name": "orderProductId",
                        "kind": "optional",
                        "type": "string",
                        "description": ""
                      },
                      {
                        "name": "detailType",
                        "kind": "optional",
                        "type": "string<Committed | Overage>",
                        "description": "",
                        "enum": [
                          "Committed",
                          "Overage"
                        ]
                      },
                      {
                        "name": "billedAmount",
                        "kind": "optional",
                        "type": "number",
                        "description": ""
                      },
                      {
                        "name": "transactionAmount",
                        "kind": "optional",
                        "type": "number",
                        "description": ""
                      },
                      {
                        "name": "transactionAmountWithoutTax",
                        "kind": "optional",
                        "type": "number",
                        "description": ""
                      },
                      {
                        "name": "transactionQuantity",
                        "kind": "optional",
                        "type": "number",
                        "description": ""
                      },
                      {
                        "name": "shippingAndHandling",
                        "kind": "optional",
                        "type": "number",
                        "description": ""
                      },
                      {
                        "name": "billedShipping",
                        "kind": "optional",
                        "type": "number",
                        "description": ""
                      },
                      {
                        "name": "taxAmount",
                        "kind": "optional",
                        "type": "number",
                        "description": ""
                      },
                      {
                        "name": "netSalesPrice",
                        "kind": "optional",
                        "type": "number",
                        "description": ""
                      },
                      {
                        "name": "ratedCredits",
                        "kind": "optional",
                        "type": "number",
                        "description": ""
                      },
                      {
                        "name": "appliedCredits",
                        "kind": "optional",
                        "type": "number",
                        "description": ""
                      },
                      {
                        "name": "startDate",
                        "kind": "optional",
                        "type": "string<date>",
                        "description": "",
                        "format": "date"
                      },
                      {
                        "name": "endDate",
                        "kind": "optional",
                        "type": "string<date>",
                        "description": "",
                        "format": "date"
                      },
                      {
                        "name": "billingTiming",
                        "kind": "optional",
                        "type": "string<InAdvance | InArrears>",
                        "description": "",
                        "enum": [
                          "InAdvance",
                          "InArrears"
                        ]
                      },
                      {
                        "name": "status",
                        "kind": "optional",
                        "type": "string<Draft | PendingActivation | Active | Canceled | EInvoicing>",
                        "description": "",
                        "enum": [
                          "Draft",
                          "PendingActivation",
                          "Active",
                          "Canceled",
                          "EInvoicing"
                        ]
                      },
                      {
                        "name": "taxStatus",
                        "kind": "optional",
                        "type": "string<NotCalculated | Calculated | Error | Committed>",
                        "description": "",
                        "enum": [
                          "NotCalculated",
                          "Calculated",
                          "Error",
                          "Committed"
                        ]
                      },
                      {
                        "name": "currencyIsoCode",
                        "kind": "optional",
                        "type": "string",
                        "description": ""
                      },
                      {
                        "name": "salesAccountId",
                        "kind": "optional",
                        "type": "string",
                        "description": ""
                      },
                      {
                        "name": "invoiceItemDetailNumber",
                        "kind": "optional",
                        "type": "string",
                        "description": ""
                      },
                      {
                        "name": "taxRates",
                        "kind": "optional",
                        "type": "string",
                        "description": ""
                      },
                      {
                        "name": "vatCode",
                        "kind": "optional",
                        "type": "string",
                        "description": ""
                      },
                      {
                        "name": "vatNumberTypeId",
                        "kind": "optional",
                        "type": "string",
                        "description": ""
                      },
                      {
                        "name": "avtUserBIN",
                        "kind": "optional",
                        "type": "string",
                        "description": ""
                      },
                      {
                        "name": "autoNumberFormat",
                        "kind": "optional",
                        "type": "string",
                        "description": ""
                      },
                      {
                        "name": "autoNumberSequence",
                        "kind": "optional",
                        "type": "integer<int64>",
                        "description": "",
                        "format": "int64"
                      },
                      {
                        "name": "entityId",
                        "kind": "optional",
                        "type": "string",
                        "description": ""
                      }
                    ]
                  },
                  {
                    "name": "taxCode",
                    "kind": "optional",
                    "type": "string",
                    "description": ""
                  },
                  {
                    "name": "taxMode",
                    "kind": "optional",
                    "type": "string",
                    "description": ""
                  },
                  {
                    "name": "taxRates",
                    "kind": "optional",
                    "type": "string",
                    "description": ""
                  },
                  {
                    "name": "taxPercent",
                    "kind": "optional",
                    "type": "number",
                    "description": ""
                  },
                  {
                    "name": "description",
                    "kind": "optional",
                    "type": "string",
                    "description": ""
                  },
                  {
                    "name": "autoNumberFormat",
                    "kind": "optional",
                    "type": "string",
                    "description": ""
                  },
                  {
                    "name": "autoNumberSequence",
                    "kind": "optional",
                    "type": "integer<int64>",
                    "description": "",
                    "format": "int64"
                  },
                  {
                    "name": "entityId",
                    "kind": "optional",
                    "type": "string",
                    "description": ""
                  },
                  {
                    "name": "targetDate",
                    "kind": "optional",
                    "type": "string<date>",
                    "description": "",
                    "format": "date"
                  },
                  {
                    "name": "customFields",
                    "kind": "optional",
                    "type": "map",
                    "description": "",
                    "example": "",
                    "customType": "map<string, object>",
                    "schema": []
                  },
                  {
                    "name": "paymentStatus",
                    "kind": "optional",
                    "type": "string<NotTransferred | Transferred | TransferError | Paid | PartialPaid | Canceled | Refunded | PartialRefunded | CreditBack | Applied | PartiallyApplied | WrittenOff | PartiallyWrittenOff | Processing>",
                    "description": "",
                    "enum": [
                      "NotTransferred",
                      "Transferred",
                      "TransferError",
                      "Paid",
                      "PartialPaid",
                      "Canceled",
                      "Refunded",
                      "PartialRefunded",
                      "CreditBack",
                      "Applied",
                      "PartiallyApplied",
                      "WrittenOff",
                      "PartiallyWrittenOff",
                      "Processing"
                    ]
                  }
                ]
              },
              {
                "name": "paymentMethods",
                "kind": "optional",
                "type": "array",
                "description": "",
                "example": "",
                "itemType": "string",
                "customType": "string[]",
                "itemExample": "",
                "itemDefault": ""
              },
              {
                "name": "poDates",
                "kind": "optional",
                "type": "string",
                "description": ""
              },
              {
                "name": "poNumbers",
                "kind": "optional",
                "type": "string",
                "description": ""
              },
              {
                "name": "recordType",
                "kind": "optional",
                "type": "string<Invoice | CreditMemo>",
                "description": "",
                "enum": [
                  "Invoice",
                  "CreditMemo"
                ]
              },
              {
                "name": "salesAccountId",
                "kind": "optional",
                "type": "string",
                "description": ""
              },
              {
                "name": "shippingAndHandling",
                "kind": "optional",
                "type": "number",
                "description": ""
              },
              {
                "name": "source",
                "kind": "optional",
                "type": "string<Billing | CreditConversion | PaymentOperation | Standalone | GenerateFromTransaction>",
                "description": "",
                "enum": [
                  "Billing",
                  "CreditConversion",
                  "PaymentOperation",
                  "Standalone",
                  "GenerateFromTransaction"
                ]
              },
              {
                "name": "startDate",
                "kind": "optional",
                "type": "string<date>",
                "description": "",
                "format": "date"
              },
              {
                "name": "status",
                "kind": "optional",
                "type": "string<Draft | PendingActivation | Active | Canceled | EInvoicing>",
                "description": "",
                "enum": [
                  "Draft",
                  "PendingActivation",
                  "Active",
                  "Canceled",
                  "EInvoicing"
                ]
              },
              {
                "name": "syncTime",
                "kind": "optional",
                "type": "string<date-time>",
                "description": "",
                "format": "date-time"
              },
              {
                "name": "targetDate",
                "kind": "optional",
                "type": "string<date>",
                "description": "",
                "format": "date"
              },
              {
                "name": "taxAmount",
                "kind": "optional",
                "type": "number",
                "description": ""
              },
              {
                "name": "taxCompanyCode",
                "kind": "optional",
                "type": "string",
                "description": ""
              },
              {
                "name": "taxErrorMessage",
                "kind": "optional",
                "type": "string",
                "description": ""
              },
              {
                "name": "taxStatus",
                "kind": "optional",
                "type": "string<NotCalculated | Calculated | Error | Committed>",
                "description": "",
                "enum": [
                  "NotCalculated",
                  "Calculated",
                  "Error",
                  "Committed"
                ]
              },
              {
                "name": "templateId",
                "kind": "optional",
                "type": "string",
                "description": ""
              },
              {
                "name": "tenantId",
                "kind": "optional",
                "type": "string<uuid>",
                "description": "",
                "format": "uuid"
              },
              {
                "name": "vatMessages",
                "kind": "optional",
                "type": "string",
                "description": ""
              }
            ],
            "modelRef": "#/components/schemas/Invoice",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "400",
        "description": "Bad Request",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "schema": [
              {
                "name": "title",
                "kind": "optional",
                "type": "string",
                "description": ""
              },
              {
                "name": "message",
                "kind": "optional",
                "type": "string",
                "description": ""
              },
              {
                "name": "errorCode",
                "kind": "optional",
                "type": "string",
                "description": ""
              }
            ],
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "404",
        "description": "Not Found",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "wfnvCWvjXq_rGiQAUngXr",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url https://api.nue.io/orders/invoices:preview \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --data '{\n     \"customerId\": \"\",\n     \"orders\": [\n     {\n     \"id\": \"\"\n     }\n     ],\n     \"orderProducts\": [\n     {\n     \"id\": \"\",\n     \"priceModel\": \"\",\n     \"startDate\": \"\",\n     \"totalPrice\": \"\",\n     \"tax\": \"\",\n     \"quantity\": \"\",\n     \"productId\": \"\",\n     \"productName\": \"\",\n     \"lineType\": \"\",\n     \"netSalesPrice\": \"\",\n     \"productSku\": \"\"\n     }\n     ]\n     }'"
        },
        {
          "id": "pMsKSEOL6g6uZhDEc_XyV",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\n\nvar raw = JSON.stringify({\n   \"customerId\": \"\",\n   \"orders\": [\n      {\n         \"id\": \"\"\n      }\n   ],\n   \"orderProducts\": [\n      {\n         \"id\": \"\",\n         \"priceModel\": \"\",\n         \"startDate\": \"\",\n         \"totalPrice\": \"\",\n         \"tax\": \"\",\n         \"quantity\": \"\",\n         \"productId\": \"\",\n         \"productName\": \"\",\n         \"lineType\": \"\",\n         \"netSalesPrice\": \"\",\n         \"productSku\": \"\"\n      }\n   ]\n});\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   body: raw,\n   redirect: 'follow'\n};\n\nfetch(\"https://api.nue.io/orders/invoices:preview\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "cNHsxgIS9GqY84RxyfSWP",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.nue.io/orders/invoices:preview\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Post.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\nrequest.body = JSON.dump({\n   \"customerId\": \"\",\n   \"orders\": [\n      {\n         \"id\": \"\"\n      }\n   ],\n   \"orderProducts\": [\n      {\n         \"id\": \"\",\n         \"priceModel\": \"\",\n         \"startDate\": \"\",\n         \"totalPrice\": \"\",\n         \"tax\": \"\",\n         \"quantity\": \"\",\n         \"productId\": \"\",\n         \"productName\": \"\",\n         \"lineType\": \"\",\n         \"netSalesPrice\": \"\",\n         \"productSku\": \"\"\n      }\n   ]\n})\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "MDiVH4ABcx-iR2oK4iv76",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.nue.io/orders/invoices:preview\"\n\npayload = json.dumps({\n   \"customerId\": \"\",\n   \"orders\": [\n      {\n         \"id\": \"\"\n      }\n   ],\n   \"orderProducts\": [\n      {\n         \"id\": \"\",\n         \"priceModel\": \"\",\n         \"startDate\": \"\",\n         \"totalPrice\": \"\",\n         \"tax\": \"\",\n         \"quantity\": \"\",\n         \"productId\": \"\",\n         \"productName\": \"\",\n         \"lineType\": \"\",\n         \"netSalesPrice\": \"\",\n         \"productSku\": \"\"\n      }\n   ]\n})\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "wfnvCWvjXq_rGiQAUngXr"
    },
    "results": {
      "languages": [
        {
          "id": "CCW9jvmHqIX_ybMBx6-6R",
          "language": "200",
          "code": "// Successfully generated preview invoices\n[\n  {\n    \"accountEx\": \"\",\n    \"accountId\": \"\",\n    \"accountingStatus\": \"\",\n    \"activatedById\": \"\",\n    \"activatedTime\": \"\",\n    \"amount\": 0,\n    \"amountWithoutTax\": 0,\n    \"autoNumberFormat\": \"\",\n    \"autoNumberSequence\": \"\",\n    \"balance\": 0,\n    \"billToContactEx\": \"\",\n    \"billToContactId\": \"\",\n    \"cancellationDate\": \"\",\n    \"currencyIsoCode\": \"\",\n    \"dueDate\": \"\",\n    \"einvoicingDocId\": \"\",\n    \"einvoicingDocStatus\": \"\",\n    \"einvoicingMandateCode\": \"\",\n    \"einvoicingMandateId\": \"\",\n    \"einvoicingMessage\": \"\",\n    \"endDate\": \"\",\n    \"entityId\": \"\",\n    \"externalInvoiceId\": \"\",\n    \"externalTaxId\": \"\",\n    \"groupKey\": \"\",\n    \"id\": \"\",\n    \"invoiceDate\": \"\",\n    \"invoiceNumber\": \"\",\n    \"invoicePdf\": \"\",\n    \"isCatchUp\": false,\n    \"items\": [\n      {\n        \"tenantId\": \"\",\n        \"accountId\": \"\",\n        \"groupKey\": \"\",\n        \"invoiceId\": \"\",\n        \"invoiceNumber\": \"\",\n        \"id\": \"\",\n        \"recordType\": \"\",\n        \"isCatchUp\": false,\n        \"invoiceItemNumber\": \"\",\n        \"productId\": \"\",\n        \"productName\": \"\",\n        \"assetId\": \"\",\n        \"assetNumber\": \"\",\n        \"assetType\": \"\",\n        \"uomId\": \"\",\n        \"uomEx\": \"\",\n        \"currencyIsoCode\": \"\",\n        \"transactionDate\": \"\",\n        \"transactionAmount\": 0,\n        \"transactionAmountWithoutTax\": 0,\n        \"transactionQuantity\": 0,\n        \"shippingAndHandling\": 0,\n        \"taxAmount\": 0,\n        \"ratedCredits\": 0,\n        \"appliedCredits\": 0,\n        \"netSalesPrice\": 0,\n        \"balance\": 0,\n        \"startDate\": \"\",\n        \"endDate\": \"\",\n        \"billingTiming\": \"\",\n        \"status\": \"\",\n        \"taxStatus\": \"\",\n        \"salesAccountId\": \"\",\n        \"details\": [\n          {\n            \"tenantId\": \"\",\n            \"accountId\": \"\",\n            \"invoiceId\": \"\",\n            \"invoiceItemId\": \"\",\n            \"id\": \"\",\n            \"isCatchUp\": false,\n            \"orderProductId\": \"\",\n            \"detailType\": \"\",\n            \"billedAmount\": 0,\n            \"transactionAmount\": 0,\n            \"transactionAmountWithoutTax\": 0,\n            \"transactionQuantity\": 0,\n            \"shippingAndHandling\": 0,\n            \"billedShipping\": 0,\n            \"taxAmount\": 0,\n            \"netSalesPrice\": 0,\n            \"ratedCredits\": 0,\n            \"appliedCredits\": 0,\n            \"startDate\": \"\",\n            \"endDate\": \"\",\n            \"billingTiming\": \"\",\n            \"status\": \"\",\n            \"taxStatus\": \"\",\n            \"currencyIsoCode\": \"\",\n            \"salesAccountId\": \"\",\n            \"invoiceItemDetailNumber\": \"\",\n            \"taxRates\": \"\",\n            \"vatCode\": \"\",\n            \"vatNumberTypeId\": \"\",\n            \"avtUserBIN\": \"\",\n            \"autoNumberFormat\": \"\",\n            \"autoNumberSequence\": \"\",\n            \"entityId\": \"\"\n          }\n        ],\n        \"taxCode\": \"\",\n        \"taxMode\": \"\",\n        \"taxRates\": \"\",\n        \"taxPercent\": 0,\n        \"description\": \"\",\n        \"autoNumberFormat\": \"\",\n        \"autoNumberSequence\": \"\",\n        \"entityId\": \"\",\n        \"targetDate\": \"\",\n        \"customFields\": \"\",\n        \"paymentStatus\": \"\"\n      }\n    ],\n    \"paymentMethods\": [\n      \"\"\n    ],\n    \"poDates\": \"\",\n    \"poNumbers\": \"\",\n    \"recordType\": \"\",\n    \"salesAccountId\": \"\",\n    \"shippingAndHandling\": 0,\n    \"source\": \"\",\n    \"startDate\": \"\",\n    \"status\": \"\",\n    \"syncTime\": \"\",\n    \"targetDate\": \"\",\n    \"taxAmount\": 0,\n    \"taxCompanyCode\": \"\",\n    \"taxErrorMessage\": \"\",\n    \"taxStatus\": \"\",\n    \"templateId\": \"\",\n    \"tenantId\": \"\",\n    \"vatMessages\": \"\"\n  }\n]",
          "subExamples": [
            {
              "label": "GENERATED",
              "code": "// Successfully generated preview invoices\n[\n  {\n    \"accountEx\": \"\",\n    \"accountId\": \"\",\n    \"accountingStatus\": \"\",\n    \"activatedById\": \"\",\n    \"activatedTime\": \"\",\n    \"amount\": 0,\n    \"amountWithoutTax\": 0,\n    \"autoNumberFormat\": \"\",\n    \"autoNumberSequence\": \"\",\n    \"balance\": 0,\n    \"billToContactEx\": \"\",\n    \"billToContactId\": \"\",\n    \"cancellationDate\": \"\",\n    \"currencyIsoCode\": \"\",\n    \"dueDate\": \"\",\n    \"einvoicingDocId\": \"\",\n    \"einvoicingDocStatus\": \"\",\n    \"einvoicingMandateCode\": \"\",\n    \"einvoicingMandateId\": \"\",\n    \"einvoicingMessage\": \"\",\n    \"endDate\": \"\",\n    \"entityId\": \"\",\n    \"externalInvoiceId\": \"\",\n    \"externalTaxId\": \"\",\n    \"groupKey\": \"\",\n    \"id\": \"\",\n    \"invoiceDate\": \"\",\n    \"invoiceNumber\": \"\",\n    \"invoicePdf\": \"\",\n    \"isCatchUp\": false,\n    \"items\": [\n      {\n        \"tenantId\": \"\",\n        \"accountId\": \"\",\n        \"groupKey\": \"\",\n        \"invoiceId\": \"\",\n        \"invoiceNumber\": \"\",\n        \"id\": \"\",\n        \"recordType\": \"\",\n        \"isCatchUp\": false,\n        \"invoiceItemNumber\": \"\",\n        \"productId\": \"\",\n        \"productName\": \"\",\n        \"assetId\": \"\",\n        \"assetNumber\": \"\",\n        \"assetType\": \"\",\n        \"uomId\": \"\",\n        \"uomEx\": \"\",\n        \"currencyIsoCode\": \"\",\n        \"transactionDate\": \"\",\n        \"transactionAmount\": 0,\n        \"transactionAmountWithoutTax\": 0,\n        \"transactionQuantity\": 0,\n        \"shippingAndHandling\": 0,\n        \"taxAmount\": 0,\n        \"ratedCredits\": 0,\n        \"appliedCredits\": 0,\n        \"netSalesPrice\": 0,\n        \"balance\": 0,\n        \"startDate\": \"\",\n        \"endDate\": \"\",\n        \"billingTiming\": \"\",\n        \"status\": \"\",\n        \"taxStatus\": \"\",\n        \"salesAccountId\": \"\",\n        \"details\": [\n          {\n            \"tenantId\": \"\",\n            \"accountId\": \"\",\n            \"invoiceId\": \"\",\n            \"invoiceItemId\": \"\",\n            \"id\": \"\",\n            \"isCatchUp\": false,\n            \"orderProductId\": \"\",\n            \"detailType\": \"\",\n            \"billedAmount\": 0,\n            \"transactionAmount\": 0,\n            \"transactionAmountWithoutTax\": 0,\n            \"transactionQuantity\": 0,\n            \"shippingAndHandling\": 0,\n            \"billedShipping\": 0,\n            \"taxAmount\": 0,\n            \"netSalesPrice\": 0,\n            \"ratedCredits\": 0,\n            \"appliedCredits\": 0,\n            \"startDate\": \"\",\n            \"endDate\": \"\",\n            \"billingTiming\": \"\",\n            \"status\": \"\",\n            \"taxStatus\": \"\",\n            \"currencyIsoCode\": \"\",\n            \"salesAccountId\": \"\",\n            \"invoiceItemDetailNumber\": \"\",\n            \"taxRates\": \"\",\n            \"vatCode\": \"\",\n            \"vatNumberTypeId\": \"\",\n            \"avtUserBIN\": \"\",\n            \"autoNumberFormat\": \"\",\n            \"autoNumberSequence\": \"\",\n            \"entityId\": \"\"\n          }\n        ],\n        \"taxCode\": \"\",\n        \"taxMode\": \"\",\n        \"taxRates\": \"\",\n        \"taxPercent\": 0,\n        \"description\": \"\",\n        \"autoNumberFormat\": \"\",\n        \"autoNumberSequence\": \"\",\n        \"entityId\": \"\",\n        \"targetDate\": \"\",\n        \"customFields\": \"\",\n        \"paymentStatus\": \"\"\n      }\n    ],\n    \"paymentMethods\": [\n      \"\"\n    ],\n    \"poDates\": \"\",\n    \"poNumbers\": \"\",\n    \"recordType\": \"\",\n    \"salesAccountId\": \"\",\n    \"shippingAndHandling\": 0,\n    \"source\": \"\",\n    \"startDate\": \"\",\n    \"status\": \"\",\n    \"syncTime\": \"\",\n    \"targetDate\": \"\",\n    \"taxAmount\": 0,\n    \"taxCompanyCode\": \"\",\n    \"taxErrorMessage\": \"\",\n    \"taxStatus\": \"\",\n    \"templateId\": \"\",\n    \"tenantId\": \"\",\n    \"vatMessages\": \"\"\n  }\n]"
            },
            {
              "label": "Invoice preview response sample",
              "code": "[\n  {\n    \"accountId\": \"0018G00000WpYFiQAN\",\n    \"status\": \"Draft\",\n    \"accountingStatus\": \"NotStarted\",\n    \"recordType\": \"Invoice\",\n    \"amount\": 8.25,\n    \"amountWithoutTax\": 8.25,\n    \"taxAmount\": 0,\n    \"taxStatus\": \"NotCalculated\",\n    \"balance\": 8.25,\n    \"invoiceDate\": \"2023-10-25\",\n    \"dueDate\": \"2023-11-24\",\n    \"startDate\": \"2023-10-06\",\n    \"endDate\": \"2023-11-01\",\n    \"targetDate\": \"2023-10-09\",\n    \"items\": [\n      {\n        \"accountId\": \"0018G00000WpYFiQAN\",\n        \"recordType\": \"Invoice\",\n        \"productId\": \"01t8G000002Rf6gQAC\",\n        \"productName\": \"Nue Platform\",\n        \"assetId\": \"01t8G000002Rf6gQAC_preview\",\n        \"transactionDate\": \"2023-10-25\",\n        \"transactionAmount\": 8.25,\n        \"transactionAmountWithoutTax\": 8.25,\n        \"transactionQuantity\": 1,\n        \"taxAmount\": 0,\n        \"ratedCredits\": 0,\n        \"appliedCredits\": 0,\n        \"netSalesPrice\": 8.25,\n        \"balance\": 8.25,\n        \"startDate\": \"2023-10-06\",\n        \"endDate\": \"2023-11-01\",\n        \"billingTiming\": \"InAdvance\",\n        \"status\": \"Draft\",\n        \"taxStatus\": \"NotCalculated\",\n        \"details\": [\n          {\n            \"accountId\": \"0018G00000WpYFiQAN\",\n            \"orderProductId\": \"8028G000001KXtcQAG\",\n            \"detailType\": \"Committed\",\n            \"billedAmount\": 8.25,\n            \"transactionAmount\": 8.25,\n            \"transactionAmountWithoutTax\": 8.25,\n            \"transactionQuantity\": 1,\n            \"taxAmount\": 0,\n            \"ratedCredits\": 0,\n            \"appliedCredits\": 0,\n            \"startDate\": \"2023-10-06\",\n            \"endDate\": \"2023-11-01\",\n            \"billingTiming\": \"InAdvance\",\n            \"status\": \"Draft\",\n            \"taxStatus\": \"NotCalculated\"\n          }\n        ],\n        \"priceModel\": \"Recurring\"\n      }\n    ]\n  }\n]"
            }
          ]
        },
        {
          "id": "hLGNLKXrBfDKE9hOXHz_6",
          "language": "400",
          "code": "// Bad Request\n{\n  \"title\": \"\",\n  \"message\": \"\",\n  \"errorCode\": \"\"\n}"
        },
        {
          "id": "GMDeJoms3yQtFmknSbZuG",
          "language": "404",
          "code": "// Not Found\n"
        }
      ],
      "selectedLanguageId": "CCW9jvmHqIX_ybMBx6-6R"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}