---
title: "Preview"
method: POST
path: "/billing_new/rate_sheets/preview/v1"
tags: ["/billing_new", "/billing_new/rate_sheets"]
---

# Preview

`POST /billing_new/rate_sheets/preview/v1`

## Request

- Base URL: `http://localhost:8000`
- URL: `http://localhost:8000/billing_new/rate_sheets/preview/v1`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/chrt/apis/chrt-fastapi/docs/billing_new/rate_sheets/preview/v1/post.ts> (a function with typed inputs; its response is checked against the schema)

Prices one of the caller's orders with a rate sheet as written, saved or not, and returns the lines it would charge without writing anything. | authz: allowed_org_types=[provider], min_org_role=operator | authz_personas=[coordinator_org_operators, order_executor_org_operators] | (RateSheetPreviewReq) -> (RateSheetPreviewRes)

## Request body

- RateSheetPreviewReq
  - `rate_sheet` RateSheetClientCreate1, required
    - `schema_version` 1, required
    - `name` string, required
    - `invoice_type` 'accounts_receivable' | 'accounts_payable', required
    - `currency_code` 'USD' | 'CAD' | 'EUR' | 'GBP' | 'MXN' | 'AUD' | 'JPY' | 'CNY' | 'CHF' | 'INR', required
    - `counterparty_org_id` string, nullable: Must be a string starting with `org_`
    - `counterparty_off_chrt_org_data_id` string, nullable
    - `counterparty_driver_id` string, nullable
    - `task_group_type` 'chrt_ground_provider' | 'cargo_on_flight' | 'cargo_on_vessel' | 'onboard_courier', required
    - `applies_to_service_lines` ServiceLineEnum[]
    - `effective_time_zone_name` string: IANA time zone name (e.g. `America/New_York`).
    - `effective_starts_at_timestamp` string, date-time, nullable
    - `effective_ends_at_timestamp` string, date-time, nullable
    - `rules` union[], required
      - union
        - BaseRateChargeRule1
          - `rule_type` 'base_rate', required
          - `rule_key` string, uuid4
          - `charged_per` 'order' | 'task_group' | 'task'
          - `line_item_description` string, required
          - `export_ref__sage__item_id` string, nullable
          - `flat_rate` number, required
        - LocationRateChargeRule1
          - `rule_type` 'location_rate', required
          - `rule_key` string, uuid4
          - `charged_per` 'task'
          - `line_item_description` string, required
          - `export_ref__sage__item_id` string, nullable
          - `location_rates` RateSheetLocationRate1[], required
            - `shipper_account_id` string, nullable
            - `pricing_zone_id` string, nullable
            - `flat_rate` number, required
        - ZoneToZoneChargeRule1
          - `rule_type` 'zone_to_zone', required
          - `rule_key` string, uuid4
          - `charged_per` 'order' | 'task_group' | 'task'
          - `line_item_description` string, required
          - `export_ref__sage__item_id` string, nullable
          - `zone_pair_rates` RateSheetZonePairRate1[], required
            - `origin_pricing_zone_id` string, required
            - `destination_pricing_zone_id` string, required
            - `flat_rate` number, required
          - `rates_apply_both_directions` boolean
        - MileageChargeRule1
          - `rule_type` 'mileage', required
          - `rule_key` string, uuid4
          - `charged_per` 'task_group' | 'task'
          - `line_item_description` string, required
          - `export_ref__sage__item_id` string, nullable
          - `included_distance_miles` number
          - `rate_per_mile` number, required
          - `ends_at_total_distance_miles` number, nullable
          - `minimum_charge` number, nullable
        - LongDistanceMileageChargeRule1
          - `rule_type` 'long_distance_mileage', required
          - `rule_key` string, uuid4
          - `charged_per` 'task_group' | 'task'
          - `line_item_description` string, required
          - `export_ref__sage__item_id` string, nullable
          - `included_distance_miles` number
          - `rate_per_mile` number, required
          - `ends_at_total_distance_miles` number, nullable
          - `minimum_charge` number, nullable
        - WaitTimeChargeRule1
          - `rule_type` 'wait_time', required
          - `rule_key` string, uuid4
          - `charged_per` 'task'
          - `line_item_description` string, required
          - `export_ref__sage__item_id` string, nullable
          - `included_wait_minutes` number, required
          - `rate_per_wait_minute` number, required
        - ExtraStopChargeRule1
          - `rule_type` 'extra_stop', required
          - `rule_key` string, uuid4
          - `charged_per` 'task_group'
          - `line_item_description` string, required
          - `export_ref__sage__item_id` string, nullable
          - `included_stops` integer
          - `rate_per_extra_stop` number, required
          - `attempted_stops_count_as_stops` boolean
        - StopFeeChargeRule1
          - `rule_type` 'stop_fee', required
          - `rule_key` string, uuid4
          - `charged_per` 'task'
          - `line_item_description` string, required
          - `export_ref__sage__item_id` string, nullable
          - `flat_rate` number, required
          - `applies_to_task_actions` union[], required
            - union
              - …
        - PieceCountChargeRule1
          - `rule_type` 'piece_count', required
          - `rule_key` string, uuid4
          - `charged_per` 'order' | 'task_group'
          - `line_item_description` string, required
          - `export_ref__sage__item_id` string, nullable
          - `included_pieces` integer, required
          - `rate_per_piece` number, required
          - `quantity_basis` 'order_unique_cargo' | 'task_group_unique_cargo' | 'task_handled_cargo', required
        - WeightChargeRule1
          - `rule_type` 'weight', required
          - `rule_key` string, uuid4
          - `charged_per` 'order' | 'task_group'
          - `line_item_description` string, required
          - `export_ref__sage__item_id` string, nullable
          - `included_weight` number, required
          - `rate_per_weight_unit` number, required
          - `weight_unit` 'lb' | 'kg', required
          - `weight_type` 'gross' | 'chargeable' | 'volumetric', required
          - `quantity_basis` 'order_unique_cargo' | 'task_group_unique_cargo' | 'task_handled_cargo', required
          - `weight_breaks` RateSheetWeightBreak1[]
            - `starts_at_weight` number, required
            - `rate_per_weight_unit` number, required
          - `minimum_charge` number, nullable
          - `dim_factor_cubic_inches_per_pound` number, nullable
        - FuelSurchargeChargeRule1
          - `rule_type` 'fuel_surcharge', required
          - `rule_key` string, uuid4
          - `charged_per` 'task_group'
          - `line_item_description` string, required
          - `export_ref__sage__item_id` string, nullable
        - VehicleSurchargeChargeRule1
          - `rule_type` 'vehicle_surcharge', required
          - `rule_key` string, uuid4
          - `charged_per` 'task_group' | 'task'
          - `line_item_description` string, required
          - `export_ref__sage__item_id` string, nullable
          - `vehicle_types` VehicleTypeEnum[], required
          - `flat_rate` number, nullable
          - `surcharge_percentage` number, nullable
          - `applies_to_line_item_types` InvoiceLineItemTypeEnum1[]
        - AirWaybillResaleChargeRule1
          - `rule_type` 'air_waybill_resale', required
          - `rule_key` string, uuid4
          - `charged_per` 'task_group'
          - `line_item_description` string, required
          - `export_ref__sage__item_id` string, nullable
          - `pricing_method` 'markup' | 'margin', required
          - `pricing_percentage` number, required
          - `applies_to_line_item_types` InvoiceLineItemTypeEnum1[], required
          - `combine_sources_into_one_charge` boolean
          - `applies_to_relationship_types` string[]
        - FlightTicketResaleChargeRule1
          - `rule_type` 'flight_ticket_resale', required
          - `rule_key` string, uuid4
          - `charged_per` 'task_group'
          - `line_item_description` string, required
          - `export_ref__sage__item_id` string, nullable
          - `pricing_method` 'markup' | 'margin', required
          - `pricing_percentage` number, required
          - `applies_to_line_item_types` InvoiceLineItemTypeEnum1[], required
          - `combine_sources_into_one_charge` boolean
          - `applies_to_relationship_types` string[]
        - SupplierMarkupChargeRule1
          - `rule_type` 'supplier_markup', required
          - `rule_key` string, uuid4
          - `charged_per` 'task_group'
          - `line_item_description` string, required
          - `export_ref__sage__item_id` string, nullable
          - `pricing_method` 'markup' | 'margin', required
          - `pricing_percentage` number, required
          - `applies_to_line_item_types` InvoiceLineItemTypeEnum1[], required
          - `combine_sources_into_one_charge` boolean
          - `applies_to_relationship_types` string[]
        - RevenueShareChargeRule1
          - `rule_type` 'revenue_share', required
          - `rule_key` string, uuid4
          - `charged_per` 'order'
          - `line_item_description` string, required
          - `export_ref__sage__item_id` string, nullable
          - `revenue_share_percentage` number, required
          - `applies_to_line_item_types` InvoiceLineItemTypeEnum1[], required
        - OnboardCourierMissionBaseChargeRule1
          - `rule_type` 'onboard_courier_mission_base', required
          - `rule_key` string, uuid4
          - `charged_per` 'task_group' | 'task'
          - `line_item_description` string, required
          - `export_ref__sage__item_id` string, nullable
          - `flat_rate` number, required
        - AttemptChargeRule1
          - `rule_type` 'attempt', required
          - `rule_key` string, uuid4
          - `charged_per` 'task'
          - `line_item_description` string, required
          - `export_ref__sage__item_id` string, nullable
          - `rate_per_occurrence` number, required
        - PickAndHoldChargeRule1
          - `rule_type` 'pick_and_hold', required
          - `rule_key` string, uuid4
          - `charged_per` 'task_group'
          - `line_item_description` string, required
          - `export_ref__sage__item_id` string, nullable
          - `rate_per_occurrence` number, required
        - EquipmentChargeRule1
          - `rule_type` 'equipment', required
          - `rule_key` string, uuid4
          - `charged_per` 'order' | 'task_group' | 'task'
          - `line_item_description` string, required
          - `export_ref__sage__item_id` string, nullable
          - `flat_rate` number, required
        - DangerousGoodsChargeRule1
          - `rule_type` 'dangerous_goods', required
          - `rule_key` string, uuid4
          - `charged_per` 'order' | 'task_group' | 'task'
          - `line_item_description` string, required
          - `export_ref__sage__item_id` string, nullable
          - `flat_rate` number, required
        - AfterHoursChargeRule1
          - `rule_type` 'after_hours', required
          - `rule_key` string, uuid4
          - `charged_per` 'order' | 'task_group' | 'task'
          - `line_item_description` string, required
          - `export_ref__sage__item_id` string, nullable
          - `flat_rate` number, required
        - WeekendChargeRule1
          - `rule_type` 'weekend', required
          - `rule_key` string, uuid4
          - `charged_per` 'order' | 'task_group' | 'task'
          - `line_item_description` string, required
          - `export_ref__sage__item_id` string, nullable
          - `flat_rate` number, required
        - HolidayChargeRule1
          - `rule_type` 'holiday', required
          - `rule_key` string, uuid4
          - `charged_per` 'order' | 'task_group' | 'task'
          - `line_item_description` string, required
          - `export_ref__sage__item_id` string, nullable
          - `flat_rate` number, required
        - OrderMinimumChargeRule1
          - `rule_type` 'order_minimum', required
          - `rule_key` string, uuid4
          - `charged_per` 'order'
          - `line_item_description` string, required
          - `export_ref__sage__item_id` string, nullable
          - `minimum_charge` number, required
  - `order_id` string, required

## Response `200`

Successful Response

- RateSheetPreviewRes
  - `order_id` string, required
  - `task_group_ids` string[]
  - `line_items` OrderBillingEstimateLineItem1[]
    - `billing_line_key` string, required
    - `invoice_type` 'accounts_receivable' | 'accounts_payable', required
    - `counterparty_org_id` string, nullable: Must be a string starting with `org_`
    - `counterparty_off_chrt_org_data_id` string, nullable
    - `counterparty_driver_id` string, nullable
    - `task_group_id` string, nullable
    - `rate_sheet_id` string, nullable
    - `line_item_type` 'base_rate' | 'additional_mileage' | 'long_distance_mileage' | 'fuel' | 'extra_stop' | 'wait_time' | 'attempt' | 'pick_and_hold' | 'stop_fee' | 'parking' | 'tolls' | 'additional_fee' | 'dispute' | 'equipment' | 'dangerous_goods' | 'special_vehicle' | 'after_hours' | 'weekend' | 'holiday' | 'air_waybill' | 'insurance' | 'off_network_carrier' | 'obc_day_rate' | 'flight_ticket' | 'piece_count' | 'weight' | 'revenue_share' | 'minimum_charge' | 'tracking_device_label' | 'tracking_device_tag' | 'tracking_device_other' | 'tax' | 'adjustment' | 'other', required
    - `description` string, required
    - `quantity` number, required
    - `unit` 'each' | 'shipment' | 'minute' | 'hour' | 'day' | 'mile' | 'kilometer' | 'pound' | 'kilogram'
    - `unit_price` number, required
    - `currency_code` 'USD' | 'CAD' | 'EUR' | 'GBP' | 'MXN' | 'AUD' | 'JPY' | 'CNY' | 'CHF' | 'INR', required
  - `unpriced_reasons` UnpricedReason1[]
    - `code` 'no_rate_sheet' | 'rate_sheet_not_found' | 'rate_sheet_not_in_effect' | 'rule_not_priced_yet' | 'missing_stops' | 'no_lane_rate' | 'no_location_rate' | 'missing_miles' | 'no_cargo_to_measure' | 'missing_measurements' | 'charged_on_gross_weight' | 'currency_left_out' | 'no_payable_lines' | 'no_receivable_lines_to_share' | 'order_wide_charges_left_out' | 'no_fuel_surcharge_configuration', required
    - `relationship_type` 'receivable' | 'executor_payable' | 'driver_payable'
    - `task_group_id` string, nullable
    - `task_id` string, nullable
    - `rate_sheet_id` string, nullable
    - `rule_key` string, uuid4, nullable

## Other responses

- `422`: Validation Error

## Changes

- **2026-11-06** `05afd8b01f0c`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/chrt/apis/chrt-fastapi/changes/billing_new/rate_sheets/preview/v1/post.md)

---

[API](https://skmtc.dev/chrt/apis/chrt-fastapi.md) - [All operations](https://skmtc.dev/chrt/apis/chrt-fastapi/llms.txt) - [OpenAPI document](https://skmtc.dev/chrt/apis/chrt-fastapi/revisions/2945f2b4f0cf?raw)
