---
title: "Preview Bill"
method: POST
path: "/organizations/{orgId}/bills/preview"
tags: ["Bill"]
---

# Preview Bill

`POST /organizations/{orgId}/bills/preview`

Preview the current Bill for a specific account. 

This endpoint is designed to provide a preview of the Bill for exactly one account, allowing you to review charges, frequencies, and other details before finalization. Required parameters include: 
* `accountIds` - exactly 1 account must be specified for previewing a Bill. 
* `billingFrequency` 
* `billFrequencyInterval` 

Other request parameters are optional. If `version` is not specified, the latest version of the Bill is previewed.

## Path parameters

- `orgId` string, required

## Query parameters

- `debug` boolean, nullable

## Request body

- BillJobRequest
  - `version` integer — The version number of the entity: - **Create entity:** Not valid for initial insertion of new entity - *do not use for Create*. On initial Create, version is set at 1 and listed in the response. - **Update Entity:** On Update, version is required and must match the existing version because a check is performed to ensure sequential versioning is preserved. Version is incremented by 1 and listed in the response.
  - `lastDateInBillingPeriod` string, date — Specifies the date *(in ISO 8601 format)* of the last day in the billing period, defining the time range for the associated Bills. For example: `"2023-03-24"`.
  - `billingFrequency` 'DAILY' | 'WEEKLY' | 'MONTHLY' | 'ANNUALLY' | 'AD_HOC' — Defines how often Bills are generated. - **Daily**. Starting at midnight each day, covering a twenty-four hour period following. - **Weekly**. Starting at midnight on a Monday morning covering the seven-day period following. - **Monthly**. Starting at midnight on the morning of the first day of each month covering the entire calendar month following. - **Annually**. Starting at midnight on the morning of the first day of each year covering the entire calendar year following. - **Ad_Hoc**. Use this setting when a custom billing schedule is used for billing an Account, such as for billing of Prepayment/Commitment fees using a custom billing schedule.
  - `billFrequencyInterval` integer — How often Bills are issued - used in conjunction with `billingFrequency`. For example, if `billingFrequency` is set to Monthly and `billFrequencyInterval` is set to 3, Bills are issued every three months.
  - `billDate` string, date — The specific billing date *(in ISO 8601 format)*, determining when the Bill was generated. For example: `"2023-01-24"`.
  - `externalInvoiceDate` string, date — For accounting purposes, the date set at Organization level to use for external invoicing with respect to billing periods - two options: * `FIRST_DAY_OF_NEXT_PERIOD` *(Default)*. Used when you want to recognize usage revenue in the following period. * `LAST_DAY_OF_ARREARS`. Used when you want to recognize usage revenue in the same period that it's consumed, instead of in the following period. For example, if the retrieved Bill was on a monthly billing frequency and the billing period for the Bill is September 2023 and the *External invoice date* is set at `FIRST_DAY_OF_NEXT_PERIOD`, then the `externalInvoiceDate` will be `"2023-10-01"`. **NOTE:** To change the `externalInvoiceDate` setting for your Organization, you can use the [Update OrganizationConfig](https://www.m3ter.com/docs/api#tag/OrganizationConfig/operation/GetOrganizationConfig) call.
  - `dueDate` string, date — The due date *(in ISO 8601 format)* for payment of the Bill. For example: `"2023-02-24"`.
  - `accountIds` string[] — An array of UUIDs representing the end customer Accounts associated with the BillJob.
  - `targetCurrency` string — The currency code used for the Bill, such as USD, GBP, or EUR.
  - `currencyConversions` CurrencyConversion[] — An array of currency conversion rates from Bill currency to Organization currency. For example, if Account is billed in GBP and Organization is set to USD, Bill line items are calculated in GBP and then converted to USD using the defined rate.
    - `from` string, required — Currency to convert from. For example: GBP.
    - `to` string, required — Currency to convert to. For example: USD.
    - `multiplier` number, double — Conversion rate between currencies.
  - `timezone` string — Specifies the time zone used for the generated Bills, ensuring alignment with the local time zone.
  - `yearEpoch` string, date — The starting date *(epoch)* for Yearly billing frequency *(in ISO 8601 format)*, determining the first Bill date for yearly Bills.
  - `monthEpoch` string, date — The starting date *(epoch)* for Monthly billing frequency *(in ISO 8601 format)*, determining the first Bill date for monthly Bills.
  - `weekEpoch` string, date — The starting date *(epoch)* for Weekly billing frequency *(in ISO 8601 format)*, determining the first Bill date for weekly Bills.
  - `dayEpoch` string, date — The starting date *(epoch)* for Daily billing frequency *(in ISO 8601 format)*, determining the first Bill date for daily Bills.

## Response `200`

Returns the Bill preview

- BillResponse
  - `lineItems` BillLineItem[] — An array of the Bill line items.
    - `id` string — The UUID for the line item.
    - `productId` string — The UUID of the Product for the line item.
    - `productName` string — The name of the Product for the line item.
    - `productCode` string
    - `accountingProductId` string
    - `accountingProductName` string
    - `accountingProductCode` string
    - `aggregationId` string — The Aggregation ID used for the line item.
    - `compoundAggregationId` string — The Compound Aggregation ID for the line item if a Compound Aggregation has been used.
    - `counterId` string
    - `chargeId` string
    - `segment` object — Applies only when segmented Aggregations have been used. The Segment to which the usage data in this line item belongs.
    - `group` object
    - `meterId` string — The UUID of the Meter used in the line item.
    - `planId` string — The ID of the Plan used for the line item.
    - `planGroupId` string — The UUID of the PlanGroup, provided the line item used a PlanGroup.
    - `commitmentId` string — If Commitments *(prepayments)* are used in the line item, this shows the Commitment UUID.
    - `balanceId` string
    - `description` string, required — Line item description.
    - `quantity` number, required — The amount of usage for the line item.
    - `units` number, required — The number of units used for the line item.
    - `unit` string, required — The unit for the usage data in thie line item. For example: **GB** of disk storage space.
    - `subtotal` number, required — The subtotal amount for the line item, before any currency conversions.
    - `currency` string, required — The currency code for the currency used in the line item. For example: USD, GBP, or EUR.
    - `conversionRate` number, required — The currency conversion rate if currency conversion is required for the line item.
    - `convertedSubtotal` number, required — The converted subtotal amount if currency conversions have been used.
    - `creditTypeId` string
    - `lineItemType` 'STANDING_CHARGE' | 'USAGE' | 'COUNTER_RUNNING_TOTAL_CHARGE' | 'COUNTER_ADJUSTMENT_DEBIT' | 'COUNTER_ADJUSTMENT_CREDIT' | 'USAGE_CREDIT' | 'MINIMUM_SPEND' | 'MINIMUM_SPEND_REFUND' | 'CREDIT_DEDUCTION' | 'MANUAL_ADJUSTMENT' | 'CREDIT_MEMO' | 'DEBIT_MEMO' | 'COMMITMENT_CONSUMED' | 'COMMITMENT_FEE' | 'OVERAGE_SURCHARGE' | 'OVERAGE_USAGE' | 'BALANCE_CONSUMED' | 'BALANCE_FEE' | 'AD_HOC', required — See [Bill Line Item Types](https://www.m3ter.com/docs/guides/running-viewing-and-managing-bills/bill-line-item-types) for more information.
    - `pricingId` string — The UUID of the Pricing used on the line item.
    - `childAccountId` string — If part of a Parent/Child account billing hierarchy, this is the child Account UUID.
    - `childAccountCode` string — If part of a Parent/Child account billing hierarchy, this is the code for the child Account.
    - `usagePerPricingBand` BillLineItemPricingBandUsage[] — Shows the usage by pricing band for tiered pricing structures.
      - `pricingBandId` string — The UUID for the pricing band.
      - `lowerLimit` number, double — The lower limit *(start)* of the pricing band.
      - `fixedPrice` number — Fixed price is a charge entered for certain pricing types such as Stairstep, Custom Tiered, and Custom Volume. It is a set price and not dependent on usage.
      - `unitSubtotal` number — The subtotal of the unit usage.
      - `unitPrice` number — The price per unit in the band.
      - `bandUnits` number — The number of units used within the band.
      - `bandQuantity` number — Usage amount within the band.
      - `bandSubtotal` number — Subtotal amount for the band.
      - `creditTypeId` string — The UUID of the credit type.
      - `convertedBandSubtotal` number
    - `servicePeriodStartDate` string, date-time — The starting date *(inclusive)* for the service period *(in ISO 8601 format)*.
    - `servicePeriodEndDate` string, date-time — The ending date *(exclusive)* for the service period *(in ISO 8601 format)*.
    - `referencedBillId` string
    - `referencedLineItemId` string
    - `reasonId` string
    - `contractId` string — The UUID for the Contract used in the line item.
    - `averageUnitPrice` number, required — The average unit price across all tiers / pricing bands.
    - `sequenceNumber` integer — The number used for sequential invoices.
    - `additional` object
  - `purchaseOrderNumber` string — Purchase Order number linked to the Account the Bill is for.
  - `externalInvoiceReference` string — The reference ID to use for external invoice.
  - `externalInvoiceDate` string, date — For accounting purposes, the date set at Organization level to use for external invoicing with respect to billing periods - two options: * `FIRST_DAY_OF_NEXT_PERIOD` *(Default)*. * `LAST_DAY_OF_ARREARS` For example, if the retrieved Bill was on a monthly billing frequency and the billing period for the Bill is September 2023 and the *External invoice date* is set at `FIRST_DAY_OF_NEXT_PERIOD`, then the `externalInvoiceDate` will be `"2023-10-01"`. **NOTE:** To change the `externalInvoiceDate` setting for your Organization, you can use the [Update OrganizationConfig](https://www.m3ter.com/docs/api#tag/OrganizationConfig/operation/GetOrganizationConfig) call.
  - `jsonStatementGenerated` boolean — Flag to indicate that the statement in JSON format has been generated for the Bill. * **TRUE** - JSON statement has been generated. * **FALSE** - no JSON statement generated.
  - `csvStatementGenerated` boolean — Flag to indicate that the statement in CSV format has been generated for the Bill. * **TRUE** - CSV statement has been generated. * **FALSE** - no CSV statement generated.
  - `statementStale` boolean — True if the existing bill statement (JSON or CSV) is marked as stale/outdated.
  - `billTotal` number — The sum total for the Bill.
  - `sequentialInvoiceNumber` string — The sequential invoice number of the Bill. **NOTE:** If you have not defined a `billPrefix` for your Organization, a `sequentialInvoiceNumber` is not returned in the response. See [Update OrganizationConfig](https://www.m3ter.com/docs/api#tag/OrganizationConfig/operation/UpdateOrganizationConfig)
  - `dtCreated` string, date-time — The date and time *(in ISO 8601 format)* when the Bill was first created.
  - `dtLastModified` string, date-time — The date and time *(in ISO 8601 format)* when the Bill was last modified.
  - `createdBy` string — The unique identifier (UUID) for the user who created the Bill.
  - `lastModifiedBy` string — The unique identifier (UUID) for the user who last modified this Bill.
  - `dtApproved` string, date-time — The DateTime when the bill was approved.
  - `approvedBy` string — The id of the user who approved this bill.
  - `dtLocked` string, date-time — The DateTime when the bill was locked.
  - `lockedBy` string — The id of the user who locked this bill.
  - `id` string, required — The UUID of the entity.
  - `version` integer — The version number: - **Create:** On initial Create to insert a new entity, the version is set at 1 in the response. - **Update:** On successful Update, the version is incremented by 1 in the response.
  - `accountId` string
  - `accountCode` string
  - `startDate` string, date
  - `endDate` string, date
  - `startDateTimeUTC` string, date-time
  - `endDateTimeUTC` string, date-time
  - `billDate` string, date
  - `dueDate` string, date
  - `billingFrequency` 'DAILY' | 'WEEKLY' | 'MONTHLY' | 'ANNUALLY' | 'AD_HOC' | 'MIXED' — Defines how often Bills are generated. * **Daily**. Starting at midnight each day, covering a twenty-four hour period following. * **Weekly**. Starting at midnight on a Monday morning covering the seven-day period following. * **Monthly**. Starting at midnight on the morning of the first day of each month covering the entire calendar month following. * **Annually**. Starting at midnight on the morning of the first day of each year covering the entire calendar year following. * **Ad_Hoc**. Use this setting when a custom billing schedule is used for billing an Account, such as for billing of Prepayment/Commitment fees using a custom billing schedule.
  - `billFrequencyInterval` integer
  - `timezone` string
  - `currency` string
  - `locked` boolean
  - `createdDate` string, date-time
  - `status` 'PENDING' | 'APPROVED' — Indicates whether the Bill has passed human/manual approval. * **Pending** - Bill has not yet been passed by a human reviewer. * **Approved** - Bill has been approved after manual review.
  - `billJobId` string
  - `currencyConversions` CurrencyConversion[]
    - `from` string, required — Currency to convert from. For example: GBP.
    - `to` string, required — Currency to convert to. For example: USD.
    - `multiplier` number, double — Conversion rate between currencies.
  - `lastCalculatedDate` string, date-time

## Other responses

- `4XX` — Error message
- `5XX` — Error message

---

[API](https://skmtc.net/m3ter-com/apis/m3ter-api.md) · [All operations](https://skmtc.net/m3ter-com/apis/m3ter-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/m3ter-com/m3ter-api/versions/ac93d1a9e6d9/schema)
