Skip to main content

Freight Invoice All V1 Ep

POST 

/v1/freight/invoice/all

Get All Freight Invoices V1 Endpoint

Retrieves invoice data and download links for the physical invoices. Responses limited to 5,000 invoices.

Required Scopes (io.r)

Request​

order_numbers: list[int] | None = None
List of order numbers to filter invoices by. If provided, the endpoint will return only invoices associated with these order numbers.


order_ids: list[str] | None = None
List of internal order IDs to filter invoices by. If provided, the endpoint will return only invoices associated with these order IDs.

movement_audit_ids: list[str] | None = None
List of internal movement_audit_ids to filter invoices by. If provided, the endpoint will return only invoices associated with these audit IDs.


invoice_numbers: list[str] | None = None
List of invoice numbers to filter by. If provided, the endpoint will return only invoices with these numbers.


status: InvoiceStaticStatus | None = InvoiceStaticStatus.SENT
Invoice status to filter by. By default, returns only sent invoices.

Show Supported Status Values

open
Invoice is ready to send but the send date is in the future.

sent
Invoice has been sent to the recipient.

blocked
Invoice is passed the send date and is blocked by an issue.

hold
Invoice is on hold and cannot be sent.


counterparty_names: list[str] | None = None
Names of counterparties to filter invoices by (case-insensitive). If provided, the endpoint will return only invoices associated with these counterparties. These will be the carriers or the customers. Names that do not match a known counterparty are ignored; if no names match, an empty result is returned rather than an error.


counterparty_id: str | None = None
ID of the counterparty to filter invoices by. If provided, the endpoint will return only invoices associated with this counterparty. This will be the carrier or the customer.


book_type: RateBookType = RateBookType.revenue
The type of rate book to filter by. Default is revenue. Revenue is used to retrieve invoices sent to customers

Show Supported Book Types

revenue
Revenue-based rate books. Typically used for customer invoices.

cost
Cost-based rate books. Typically used for carrier invoices.


as_of: datetime | None = None
Filter invoices as of this date. Filters on the intended send date of the invoice.


updated_as_of: datetime | None = None
Filter invoices last updated on or after this date.


between: DateWindow | None = None
Date range to filter invoices. If provided, returns invoices within this date window. Filters on the intended send date of the invoice.


sent_between: DateWindow | None = None
Datetime range to filter invoices. If provided, returns invoices within this date window. Filters on the datetime the invoice was sent.


exported: bool | None = None
Filters on whether the invoice has been exported. Leave unset to return both exported and un-exported invoices.


Response​

Returns a list of InvoiceRow objects with the following fields:

invoice_number: str
Unique identifier for the invoice.


sent_date: datetime | None
Date when the invoice was sent.


when_to_send_date: datetime | None
Scheduled date for sending the invoice. E.g. If invoices are billed monthly this will be a month from the creation of the invoice.


created_on: datetime | None
Date when the invoice was created.


type: InvoiceType
Type of the invoice.

Show Invoice Types

original
Standard invoice.

credit
Credit invoice.

rebill
Rebilled invoice.


status: InvoiceStaticStatus | None
Current status of the invoice.


manual_invoice: bool
True when the invoice was created manually. Manual invoices are not tied to orders in the system. Their order reference is optional free text, so it may be empty or reference an order that exists outside of Gravitate.


transactions: list[FreightTransactionRow]
List of freight transactions included in this invoice. Each transaction includes:

  • suppliers: list[object]
    Suppliers on this transaction, captured from the bill of lading details at the time freight was calculated. A single transaction may span multiple suppliers. Empty when no supplier information is available. Each entry has supplier_id (str) and supplier (str, name).

  • hauled_by: str | None
    Who hauled the order: the assigned drivers joined by ", " (a relay order run by more than one driver lists them all), falling back to the carrier, then the manager, then the order's own driver. Null when the order records none of those. Resolved from the order at read time, so it reflects the current assignment and driver name rather than the assignment as invoiced.

  • carrier_id: str | None
    The carrier that hauled the freight. Resolved from the order for order-backed freight, and from the carrier chosen on the invoice for a manual invoice. Null when neither records one.

  • carrier_name: str | None
    Name of that carrier. Null when carrier_id is null.

  • details: list[object]
    The individual line items on this transaction. Alongside the rate and amount fields, each entry carries:

    • tractor_text: str | None
      Free-text tractor on a manual line item. Always null for order-backed freight, which reports equipment through tractor_number instead.

    • driver_text: str | None
      Free-text driver on a manual line item. Always null for order-backed freight, which reports the driver through hauled_by instead.

    • order_number_text: str | None
      Free-text order reference on a manual line item. Always null for order-backed freight.


note: str | None
Additional notes attached to the invoice.


bill_to: BillTo | None
Billing address information for the invoice recipient.

Show Child Attributes

name: str | None = None
Name on the billing address.

address: str | None = None
Street address for billing.

city: str | None = None
City for billing address.

state: str | None = None
State for billing address.

postal_code: str | None = None
Postal code for billing address.


download_url: str | None
URL to download the invoice PDF. Only available for sent invoices.


base_amount: float
Base amount of the invoice (calculated field).


base_distance: float
Base distance covered for this invoice (calculated field).


distance_uom: str
Unit of measure for distance (calculated field).


accessorial_amount: float
Total amount of accessorial charges (calculated field).


surcharge_amount: float
Total amount of surcharges (calculated field).


total_amount: float
Total invoice amount (calculated field).


due_date: datetime | None
Date the invoice is due.


updated_on: datetime | None
Timestamp of the most recent update to the invoice.


exported: bool = False
Whether the invoice has been exported.


exported_at: datetime | None
When the invoice was exported.


errors: list[FreightError | InvoiceError] = []
Errors raised against the invoice or its freight transactions.


threshold_violation_reasons: list[str]
The distinct threshold violations raised across this invoice's transactions (calculated field).


is_multi_order: bool
Whether the invoice covers more than one order (calculated field). Multi-order rows leave order_number and order_reference empty.


order_number: int | None
The single order behind the invoice (calculated field). Null for manual-invoice and multi-order rows — intended for joining and grouping rather than display.


order_number_text: str | None
Free-text order reference taken from manual line items (calculated field). Always null for order-backed freight.


order_reference: str
The value to display for the order (calculated field): order_number when there is one, otherwise order_number_text, otherwise blank.


bol_numbers: list[str]
BOL numbers behind the invoice's transactions (calculated field).


bol_dates: list[datetime]
Dates of those BOLs, in the terminal's local time (calculated field).


bol_dates_local: str | None
IANA timezone the bol_dates values should be rendered in (calculated field).

Responses​

Successful Response

[
{
"invoice_number": "string",
"sent_date": "2026-09-25T19:33:18.361Z",
"when_to_send_date": "2026-09-25T19:33:18.361Z",
"created_on": "2026-09-25T19:33:18.361Z",
"due_date": "2026-09-25T19:33:18.361Z",
"updated_on": "2026-09-25T19:33:18.361Z",
"type": "credit",
"status": "open",
"errors": [
{
"type": "No Freight Rate",
"message": "string"
},
{
"type": "Email Failed",
"message": "string"
}
],
"transactions": [
{
"order_id": "string",
"order_number": 0,
"po": "string",
"date": "2026-09-25T19:33:18.361Z",
"invoice_group_id": "string",
"invoice_number": "string",
"details": [
{
"timezone_data": {},
"id": "string",
"counterparty": "string",
"counterparty_id": "string",
"product_group": "Gasoline",
"product_name": "string",
"product_id": "string",
"type": "Base Freight",
"subtype": "string",
"manual": true,
"dwell_minutes": 0,
"has_dependency": true,
"origin_name": "string",
"origin_id": "string",
"origin_name_override": "string",
"origin_id_override": "string",
"origin_name_original": "string",
"origin_id_original": "string",
"destination_name": "string",
"destination_id": "string",
"destination_name_override": "string",
"destination_id_override": "string",
"destination_name_original": "string",
"destination_id_original": "string",
"requires_approval": false,
"requires_approval_reason_code": true,
"is_approved": true,
"approved_by": "string",
"approved_date": "2026-09-25T19:33:18.361Z",
"approval_reason_code": "string",
"note": "string",
"threshold_violation": false,
"threshold_violation_reason": "string",
"threshold_violation_approved": false,
"threshold_violation_approved_by": "string",
"threshold_violation_approved_date": "2026-09-25T19:33:18.361Z",
"rejected": false,
"rejected_by": "string",
"rejected_date": "2026-09-25T19:33:18.362Z",
"invoice_id": "string",
"invoice_group_id": "string",
"amount_original": 0,
"rate_original": 0,
"product_id_original": "string",
"product_name_original": "string",
"product_group_original": "Gasoline",
"subtype_original": "string",
"uom_original": "string",
"total_original": 0,
"amount_override": 0,
"rate_override": 0,
"product_id_override": "string",
"product_name_override": "string",
"product_group_override": "Gasoline",
"subtype_override": "string",
"uom_override": "string",
"total_override": 0,
"override_by": "string",
"override_date": "2026-09-25T19:33:18.362Z",
"rate": 0,
"amount": 0,
"total": 0,
"uom": "string",
"date": "2026-09-25T19:33:18.362Z",
"status": "estimated",
"error": {
"type": "No Freight Rate",
"message": "string"
},
"legs": [
{
"origin": "string",
"origin_id": "string",
"destination": "string",
"destination_id": "string",
"distance": 0
}
],
"credit_rebill_metadata": {
"impact_type": "impacted",
"delta_amount": 0,
"delta_base_total": 0,
"delta_surcharge_total": 0,
"delta_accessorial_total": 0,
"delta_total": 0
},
"net_volume": 0,
"gross_volume": 0,
"bol_number": "string",
"bol_number_override": "string",
"bol_number_original": "string",
"bol_date": "2026-09-25T19:33:18.362Z",
"delivery_date": "2026-09-25T19:33:18.362Z",
"ordered_volume": 0,
"linked_sp_info": {
"special_pay": "string",
"order_number": "string",
"created_by": "string",
"created_on": "2026-09-25T19:33:18.362Z",
"approved_by": "string",
"approved_on": "2026-09-25T19:33:18.362Z",
"status": "string",
"notes": [
{
"action": "created",
"note": "string",
"date": "2026-09-25T19:33:18.362Z",
"username": "string"
}
]
},
"book_type": "Cost",
"can_edit": true,
"order_number_text": "string",
"tractor_text": "string",
"driver_text": "string",
"service_date": "2026-09-25T19:33:18.362Z",
"has_override": true
}
],
"carrier_id": "string",
"carrier_name": "string",
"customer_id": "string",
"customer_name": "string",
"book_type": "Cost",
"origins": [
"string"
],
"destinations": [
"string"
],
"bol_numbers": [
"string"
],
"status": "estimated",
"error": {
"type": "No Freight Rate",
"message": "string"
},
"credit_rebill_metadata": {
"impact_type": "impacted",
"delta_amount": 0,
"delta_base_total": 0,
"delta_surcharge_total": 0,
"delta_accessorial_total": 0,
"delta_total": 0
},
"parent_transaction_id": "string",
"new_version_available": false,
"new_version_total": 0,
"is_multi_customer": false,
"tractor_number": "string",
"trailer_number": "string",
"movement_audit_id": "string",
"suppliers": [
{
"supplier_id": "string",
"supplier": "string"
}
],
"hauled_by": "string",
"product_groups": [
"Gasoline",
"string"
],
"bol_dates": [
"2026-09-25T19:33:18.362Z"
],
"bol_dates_local": "string",
"distance": 0,
"distance_uom": "string",
"volume": 0,
"net_volume": 0,
"gross_volume": 0,
"ordered_volume": 0,
"volume_uom": "string",
"total": 0,
"accessorial_total": 0,
"surcharge_total": 0,
"base_total": 0,
"threshold_violation_reasons": [
"string"
]
}
],
"note": "string",
"bill_to": {
"name": "string",
"address": "string",
"city": "string",
"state": "string",
"postal_code": "string"
},
"cross_counterparty_move": {
"order_id": "string",
"order_number": "string",
"from_counterparty_id": "string",
"to_counterparty_id": "string",
"to_counterparty_name": "string",
"moved_products": [
"string"
],
"moved_executed_detail_ids": [
"string"
],
"credit_detail_ids": [
"string"
],
"credit_group_id": "string",
"credit_invoice_number": "string",
"rebill_group_id": "string",
"rebill_invoice_number": "string",
"rebill_line": {
"id": "string",
"parent": "string",
"created_at": "2026-09-25T19:33:18.362Z",
"type": "freight",
"status": "open",
"reversed": false,
"transactions": [
{
"model_type": "base",
"type": "Base Freight",
"subtype": "string",
"rate": 0,
"amount": 0,
"total": 0,
"uom": "string",
"errors": [
"string"
],
"id": "string",
"product_group": "string",
"product_id": "string",
"product_name": "string",
"origin": "string",
"origin_id": "string",
"origin_override": "string",
"origin_id_override": "string",
"destination": "string",
"destination_id": "string",
"destination_override": "string",
"destination_id_override": "string",
"legs": [
{
"origin": "string",
"origin_id": "string",
"destination": "string",
"destination_id": "string",
"distance": 0
}
],
"use_surcharge": true,
"manual": false,
"has_dependency": false,
"dwell_minutes": 0,
"created_date": "2026-09-25T19:33:18.362Z",
"requires_approval": false,
"requires_approval_reason_code": false,
"is_approved": false,
"approved_by": "string",
"approved_date": "2026-09-25T19:33:18.362Z",
"approved_reason_code": "string",
"note": "string",
"threshold_violation": false,
"threshold_violation_approved": false,
"threshold_violation_approved_by": "string",
"threshold_violation_approved_date": "2026-09-25T19:33:18.362Z",
"threshold_violation_reason": "string",
"rejected": false,
"rejected_by": "string",
"rejected_date": "2026-09-25T19:33:18.362Z",
"amount_override": 0,
"rate_override": 0,
"product_id_override": "string",
"product_name_override": "string",
"product_group_override": "string",
"subtype_override": "string",
"uom_override": "string",
"total_override": 0,
"override_by": "string",
"override_date": "2026-09-25T19:33:18.362Z",
"exclude_from_invoice": false,
"exclude_from_costing": false,
"credit_rebill_metadata": {
"impact_type": "impacted",
"delta_amount": 0,
"delta_base_total": 0,
"delta_surcharge_total": 0,
"delta_accessorial_total": 0,
"delta_total": 0
},
"extra_data": {},
"gross_volume": 0,
"net_volume": 0,
"bol_date": "2026-09-25T19:33:18.362Z",
"bol_number": "string",
"bol_number_override": "string",
"delivery_date": "2026-09-25T19:33:18.362Z",
"ordered_volume": 0
}
],
"counterparty_id": "string",
"book_type": "Cost",
"effective_date_used": "2026-09-25T19:33:18.362Z",
"invoice_group_id": "string",
"invoice_number": "string",
"accessorial_invoice_number": "string",
"new_version_available": false,
"new_version_total": 0,
"error": {
"type": "No Freight Rate",
"message": "string"
},
"movement_audit_id": "string",
"suppliers": [
{
"supplier_id": "string",
"supplier": "string"
}
],
"order_number": 0,
"order_id": "string",
"po": "string",
"order_version": 0,
"order_revision": "string"
},
"rebill_a_invoice_number": "string",
"initiated_by": "string",
"initiated_on": "2026-09-25T19:33:18.362Z"
},
"exported": false,
"exported_at": "2026-09-25T19:33:18.362Z",
"base_amount": 0,
"base_distance": 0,
"distance_uom": "string",
"accessorial_amount": 0,
"surcharge_amount": 0,
"total_amount": 0,
"threshold_violation_reasons": [
"string"
],
"is_multi_order": true,
"order_number": 0,
"order_number_text": "string",
"order_reference": "string",
"bol_numbers": [
"string"
],
"bol_dates": [
"2026-09-25T19:33:18.362Z"
],
"bol_dates_local": "string"
}
]
Loading...