> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stigg.io/llms.txt
> Use this file to discover all available pages before exploring further.

# previewNextInvoice



**mutation** `previewNextInvoice(input: PreviewNextInvoiceInput!): SubscriptionInvoicePreview!`

## Arguments

**`input`**: `PreviewNextInvoiceInput!` (required)

## Returns

`SubscriptionInvoicePreview!`

**`amountDue`**: `Money!`

The amount due for the invoice after taxes, discounts and credits

---

**`billingDate`**: `DateTime`

The date the invoice is expected to be billed

---

**`credits`**: `SubscriptionPreviewCredits`

Credits information (initial, used, remaining)

---

**`discount`**: `Money`

The total discount amount of the invoice

---

**`discountDetails`**: `SubscriptionPreviewDiscount`

The applied discount details

---

**`lastUpdatedAt`**: `DateTime!`

The date when the invoice was last updated

---

**`lines`**: `[SubscriptionInvoicePreviewLineItem!]!`

The line items of the invoice

---

**`minimumSpendAdjustment`**: `Money!`

The minimum spend adjustment applied to the invoice

---

**`subTotal`**: `Money!`

The sub total amount of the invoice excluding  discounts

---

**`subTotalExcludingTax`**: `Money!`

The sub total amount of the invoice excluding taxes and discounts

---

**`tax`**: `Money`

The total tax amount of the invoice

---

**`taxDetails`**: `SubscriptionPreviewTaxDetails`

The applied tax details

---

**`total`**: `Money!`

The total amount of the invoice including taxes and discounts

---

**`totalExcludingTax`**: `Money!`

The total amount of the invoice excluding taxes

## Examples

```graphql Mutation
mutation PreviewNextInvoice($input: PreviewNextInvoiceInput!) {
  previewNextInvoice(input: $input) {
    amountDue {
      amount
      currency
    }
    billingDate
    credits {
      initial {
        amount
        currency
      }
      remaining {
        amount
        currency
      }
      used {
        amount
        currency
      }
    }
    discount {
      amount
      currency
    }
    discountDetails {
      durationInMonths
      durationType
      end
      name
      start
      type
    }
    lastUpdatedAt
  }
}
```

```json Variables
{
  "input": {
    "subscriptionId": "string"
  }
}
```

```json Response
{
  "data": {
    "previewNextInvoice": {
      "amountDue": {
        "amount": 1.5,
        "currency": "AED"
      },
      "billingDate": "value",
      "credits": {
        "initial": {
          "amount": 1.5,
          "currency": "AED"
        },
        "remaining": {
          "amount": 1.5,
          "currency": "AED"
        },
        "used": {
          "amount": 1.5,
          "currency": "AED"
        }
      },
      "discount": {
        "amount": 1.5,
        "currency": "AED"
      },
      "discountDetails": {
        "durationInMonths": 1.5,
        "durationType": "FOREVER",
        "end": "value",
        "name": "string",
        "start": "value",
        "type": "FIXED"
      },
      "lastUpdatedAt": "value"
    }
  }
}
```


## Related topics

- [Node.js SDK](https://docs.stigg.io/api-and-sdks/changelog/backend-graphql/node.md)
- [JavaScript SDK](https://docs.stigg.io/api-and-sdks/changelog/frontend/javascript.md)
- [API Client (JS)](https://docs.stigg.io/api-and-sdks/changelog/backend-graphql/api-client-js.md)
- [.NET SDK](https://docs.stigg.io/api-and-sdks/changelog/backend-graphql/dotnet.md)
- [Go SDK](https://docs.stigg.io/api-and-sdks/changelog/backend-graphql/go.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.