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

# Custom Billing Format (FOCUS) in BigQuery

> Import any FOCUS-compliant billing data from a BigQuery table into Costory.

Import any billing data that follows the [FOCUS specification](https://focus.finops.org/) from a BigQuery table. This is useful for SaaS vendors or internal services that are not natively supported.

<Accordion title="Importable Columns">
  | Mapping Key                  | Output Column                  | Type                                      | Default             | Status       |
  | ---------------------------- | ------------------------------ | ----------------------------------------- | ------------------- | ------------ |
  | `billedCost`                 | `billed_cost`                  | FLOAT64                                   | NULL                | Optional     |
  | `contractedCost`             | `contracted_cost`              | FLOAT64                                   | NULL                | Optional     |
  | `billingAccountId`           | `billing_account_id`           | STRING                                    | NULL                | Optional     |
  | `billingCurrency`            | `billing_currency`             | STRING                                    | NULL                | Optional     |
  | `originalBillingCurrency`    | `original_billing_currency`    | STRING                                    | NULL                | Optional     |
  | `billingPeriodEnd`           | `billing_period_end`           | DATETIME                                  | NULL                | **Required** |
  | `billingPeriodStart`         | `billing_period_start`         | DATETIME                                  | NULL                | **Required** |
  | `chargeCategory`             | `charge_category`              | STRING                                    | NULL                | **Required** |
  | `chargeDescription`          | `charge_description`           | STRING                                    | NULL                | Optional     |
  | `chargeFrequency`            | `charge_frequency`             | STRING                                    | NULL                | Optional     |
  | `chargePeriodStart`          | `charge_period_start`          | TIMESTAMP                                 | NULL                | Optional     |
  | `chargePeriodEnd`            | `charge_period_end`            | TIMESTAMP                                 | NULL                | Optional     |
  | `commitmentDiscountCategory` | `commitment_discount_category` | STRING                                    | NULL                | Optional     |
  | `commitmentDiscountId`       | `commitment_discount_id`       | STRING                                    | NULL                | Optional     |
  | `commitmentDiscountType`     | `commitment_discount_type`     | STRING                                    | NULL                | Optional     |
  | `consumedQuantity`           | `consumed_quantity`            | FLOAT64                                   | NULL                | Optional     |
  | `consumedUnit`               | `consumed_unit`                | STRING                                    | NULL                | Optional     |
  | `effectiveCost`              | `effective_cost`               | FLOAT64                                   | NULL                | Optional     |
  | `invoiceIssuer`              | `invoice_issuer`               | STRING                                    | NULL                | Optional     |
  | `listCost`                   | `list_cost`                    | FLOAT64                                   | NULL                | Optional     |
  | `listUnitPrice`              | `list_unit_price`              | STRING                                    | NULL                | Optional     |
  | `pricingCategory`            | `pricing_category`             | STRING                                    | NULL                | Optional     |
  | `pricingQuantity`            | `pricing_quantity`             | FLOAT64                                   | NULL                | Optional     |
  | `pricingUnit`                | `pricing_unit`                 | STRING                                    | NULL                | Optional     |
  | `provider`                   | `provider`                     | STRING                                    | `"Custom BigQuery"` | Optional     |
  | `publisher`                  | `publisher`                    | STRING                                    | NULL                | Optional     |
  | `regionId`                   | `region_id`                    | STRING                                    | NULL                | Optional     |
  | `resourceId`                 | `resource_id`                  | STRING                                    | NULL                | Optional     |
  | `resourceName`               | `resource_name`                | STRING                                    | NULL                | Optional     |
  | `resourceType`               | `resource_type`                | STRING                                    | NULL                | Optional     |
  | `categoryFocus`              | `category_focus`               | STRING                                    | NULL                | Optional     |
  | `serviceName`                | `service_name`                 | STRING                                    | NULL                | Optional     |
  | `skuId`                      | `sku_id`                       | STRING                                    | NULL                | Optional     |
  | `sku`                        | `sku`                          | STRING                                    | NULL                | Optional     |
  | `skuPriceId`                 | `sku_price_id`                 | STRING                                    | NULL                | Optional     |
  | `subAccountId`               | `sub_account_id`               | STRING                                    | NULL                | Optional     |
  | `tags`                       | `labels`                       | ARRAY\<STRUCT\<key STRING, value STRING>> | NULL                | Optional     |
</Accordion>

<Tabs>
  <Tab title="Terraform">
    Not supported.
  </Tab>

  <Tab title="Manual setup">
    Open Costory and go to **Billing > Import new billing datasource > Custom Billing Format (FOCUS)**. The stepper guides you through each field.

    1. Prepare a BigQuery table in FOCUS format.
    2. Provide the BigQuery table path, provider name, and optional billing account ID and date range.
    3. Map the FOCUS columns to Costory fields during the import flow.

    Costory imports whatever date range exists in the BigQuery table. No separate backfill step is needed.
  </Tab>
</Tabs>
