# CreateInvoiceRequest

## Example Usage

```typescript
import { CreateInvoiceRequest } from "@flexprice/sdk/sdk/models";

let value: CreateInvoiceRequest = {
  amountDue: "<value>",
  currency: "Guarani",
  customerId: "<id>",
  subtotal: "<value>",
  total: "<value>",
};
```

## Fields

| Field                                                                                                                                                                                                                                                                                            | Type                                                                                                                                                                                                                                                                                             | Required                                                                                                                                                                                                                                                                                         | Description                                                                                                                                                                                                                                                                                      |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `amountDue`                                                                                                                                                                                                                                                                                      | *string*                                                                                                                                                                                                                                                                                         | :heavy_check_mark:                                                                                                                                                                                                                                                                               | amount_due is the total amount that needs to be paid for this invoice                                                                                                                                                                                                                            |
| `amountPaid`                                                                                                                                                                                                                                                                                     | *string*                                                                                                                                                                                                                                                                                         | :heavy_minus_sign:                                                                                                                                                                                                                                                                               | amount_paid is the amount that has been paid towards this invoice                                                                                                                                                                                                                                |
| `billingPeriod`                                                                                                                                                                                                                                                                                  | *string*                                                                                                                                                                                                                                                                                         | :heavy_minus_sign:                                                                                                                                                                                                                                                                               | billing_period is the period this invoice covers (e.g., "monthly", "yearly")                                                                                                                                                                                                                     |
| `billingReason`                                                                                                                                                                                                                                                                                  | [models.InvoiceBillingReason](../../sdk/models/invoice-billing-reason.md)                                                                                                                                                                                                                        | :heavy_minus_sign:                                                                                                                                                                                                                                                                               | N/A                                                                                                                                                                                                                                                                                              |
| `coupons`                                                                                                                                                                                                                                                                                        | *string*[]                                                                                                                                                                                                                                                                                       | :heavy_minus_sign:                                                                                                                                                                                                                                                                               | coupons                                                                                                                                                                                                                                                                                          |
| `currency`                                                                                                                                                                                                                                                                                       | *string*                                                                                                                                                                                                                                                                                         | :heavy_check_mark:                                                                                                                                                                                                                                                                               | currency is the three-letter ISO currency code (e.g., USD, EUR) for the invoice                                                                                                                                                                                                                  |
| `customerId`                                                                                                                                                                                                                                                                                     | *string*                                                                                                                                                                                                                                                                                         | :heavy_check_mark:                                                                                                                                                                                                                                                                               | customer_id is the unique identifier of the customer this invoice belongs to                                                                                                                                                                                                                     |
| `description`                                                                                                                                                                                                                                                                                    | *string*                                                                                                                                                                                                                                                                                         | :heavy_minus_sign:                                                                                                                                                                                                                                                                               | description is an optional text description of the invoice                                                                                                                                                                                                                                       |
| `dueDate`                                                                                                                                                                                                                                                                                        | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date)                                                                                                                                                                                                    | :heavy_minus_sign:                                                                                                                                                                                                                                                                               | due_date is the date by which payment is expected                                                                                                                                                                                                                                                |
| `forceSyncInvoice`                                                                                                                                                                                                                                                                               | *boolean*                                                                                                                                                                                                                                                                                        | :heavy_minus_sign:                                                                                                                                                                                                                                                                               | force_sync_invoice, when true, attempts to synchronously sync this invoice to<br/>Moyasar (if enabled) before returning, instead of relying solely on the async<br/>Kafka + Temporal vendor-sync pipeline. Only honored by CreateOneOffInvoice.<br/>Best-effort: sync failures do not fail invoice creation. |
| `idempotencyKey`                                                                                                                                                                                                                                                                                 | *string*                                                                                                                                                                                                                                                                                         | :heavy_minus_sign:                                                                                                                                                                                                                                                                               | idempotency_key is an optional key used to prevent duplicate invoice creation                                                                                                                                                                                                                    |
| `invoiceCoupons`                                                                                                                                                                                                                                                                                 | [models.InvoiceCoupon](../../sdk/models/invoice-coupon.md)[]                                                                                                                                                                                                                                     | :heavy_minus_sign:                                                                                                                                                                                                                                                                               | Invoice Coupons                                                                                                                                                                                                                                                                                  |
| `invoiceNumber`                                                                                                                                                                                                                                                                                  | *string*                                                                                                                                                                                                                                                                                         | :heavy_minus_sign:                                                                                                                                                                                                                                                                               | invoice_number is an optional human-readable identifier for the invoice                                                                                                                                                                                                                          |
| `invoicePdfUrl`                                                                                                                                                                                                                                                                                  | *string*                                                                                                                                                                                                                                                                                         | :heavy_minus_sign:                                                                                                                                                                                                                                                                               | invoice_pdf_url is the URL where customers can download the PDF version of this invoice                                                                                                                                                                                                          |
| `invoiceStatus`                                                                                                                                                                                                                                                                                  | [models.InvoiceStatus](../../sdk/models/invoice-status.md)                                                                                                                                                                                                                                       | :heavy_minus_sign:                                                                                                                                                                                                                                                                               | N/A                                                                                                                                                                                                                                                                                              |
| `invoiceType`                                                                                                                                                                                                                                                                                    | [models.InvoiceType](../../sdk/models/invoice-type.md)                                                                                                                                                                                                                                           | :heavy_minus_sign:                                                                                                                                                                                                                                                                               | N/A                                                                                                                                                                                                                                                                                              |
| `issueDate`                                                                                                                                                                                                                                                                                      | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date)                                                                                                                                                                                                    | :heavy_minus_sign:                                                                                                                                                                                                                                                                               | issue_date overrides the user-facing date of the invoice.<br/>Defaults to created_at if not provided.                                                                                                                                                                                            |
| `lineItemCoupons`                                                                                                                                                                                                                                                                                | [models.InvoiceLineItemCoupon](../../sdk/models/invoice-line-item-coupon.md)[]                                                                                                                                                                                                                   | :heavy_minus_sign:                                                                                                                                                                                                                                                                               | Invoice Line Item Coupons                                                                                                                                                                                                                                                                        |
| `lineItems`                                                                                                                                                                                                                                                                                      | [models.CreateInvoiceLineItemRequest](../../sdk/models/create-invoice-line-item-request.md)[]                                                                                                                                                                                                    | :heavy_minus_sign:                                                                                                                                                                                                                                                                               | line_items contains the individual items that make up this invoice                                                                                                                                                                                                                               |
| `metadata`                                                                                                                                                                                                                                                                                       | Record<string, *string*>                                                                                                                                                                                                                                                                         | :heavy_minus_sign:                                                                                                                                                                                                                                                                               | N/A                                                                                                                                                                                                                                                                                              |
| `paymentStatus`                                                                                                                                                                                                                                                                                  | [models.PaymentStatus](../../sdk/models/payment-status.md)                                                                                                                                                                                                                                       | :heavy_minus_sign:                                                                                                                                                                                                                                                                               | N/A                                                                                                                                                                                                                                                                                              |
| `periodEnd`                                                                                                                                                                                                                                                                                      | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date)                                                                                                                                                                                                    | :heavy_minus_sign:                                                                                                                                                                                                                                                                               | period_end is the end date of the billing period                                                                                                                                                                                                                                                 |
| `periodStart`                                                                                                                                                                                                                                                                                    | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date)                                                                                                                                                                                                    | :heavy_minus_sign:                                                                                                                                                                                                                                                                               | period_start is the start date of the billing period                                                                                                                                                                                                                                             |
| `preparedTaxRates`                                                                                                                                                                                                                                                                               | [models.TaxRateResponse](../../sdk/models/tax-rate-response.md)[]                                                                                                                                                                                                                                | :heavy_minus_sign:                                                                                                                                                                                                                                                                               | prepared_tax_rates contains the tax rates pre-resolved by the caller (e.g., billing service)                                                                                                                                                                                                     |
| `subscriptionId`                                                                                                                                                                                                                                                                                 | *string*                                                                                                                                                                                                                                                                                         | :heavy_minus_sign:                                                                                                                                                                                                                                                                               | subscription_id is the optional unique identifier of the subscription associated with this invoice                                                                                                                                                                                               |
| `subtotal`                                                                                                                                                                                                                                                                                       | *string*                                                                                                                                                                                                                                                                                         | :heavy_check_mark:                                                                                                                                                                                                                                                                               | subtotal is the amount before taxes and discounts are applied                                                                                                                                                                                                                                    |
| `taxRateOverrides`                                                                                                                                                                                                                                                                               | [models.TaxRateOverride](../../sdk/models/tax-rate-override.md)[]                                                                                                                                                                                                                                | :heavy_minus_sign:                                                                                                                                                                                                                                                                               | tax_rate_overrides is the tax rate overrides to be applied to the invoice                                                                                                                                                                                                                        |
| `taxRates`                                                                                                                                                                                                                                                                                       | *string*[]                                                                                                                                                                                                                                                                                       | :heavy_minus_sign:                                                                                                                                                                                                                                                                               | tax_rates                                                                                                                                                                                                                                                                                        |
| `total`                                                                                                                                                                                                                                                                                          | *string*                                                                                                                                                                                                                                                                                         | :heavy_check_mark:                                                                                                                                                                                                                                                                               | total is the total amount of the invoice including taxes and discounts                                                                                                                                                                                                                           |
| `totalPrepaidApplied`                                                                                                                                                                                                                                                                            | *string*                                                                                                                                                                                                                                                                                         | :heavy_minus_sign:                                                                                                                                                                                                                                                                               | total_prepaid_applied is the total amount of prepaid applied to this invoice.                                                                                                                                                                                                                    |