Skip to main content

Export Bills

GET 

/api/bills/list/export

Export landed cost bills as XLSX or CSV. The response is a binary file download, not JSON.

Required scope: purchase-orders:read

Grant this scope to your token under Settings → Developer → Personal Access Tokens.

Authentication: Requires Bearer token. Scope: purchase-orders (read/write).

Parameters​

  • format — xlsx (default) or csv
  • content_mode — summary (one row per bill, default) or line_items (one row per bill line; bill columns repeat per line, line-item columns are appended)
  • scope — which bills to export:
    • all — every bill, ignoring active filters
    • filtered — bills matching the current filter[...] / filter_groups params (default)
    • current_page — only the current page (honors page / per_page / sort)
    • selected — only the bills in ids
  • columns — comma-separated bill column keys to include (preserves order). Omit for all columns. Available keys: id, invoice_number, invoice_date, supplier_name, link_type, link_reference, proration_strategy, currency_code, currency_rate, line_count, subtotal, tax_total, grand_total, allocated_amount, unallocated_amount, allocation_status, cost_categories, has_accounting_transaction, source, settlement_reference_count, created_at, updated_at
  • ids — comma-separated bill IDs (required when scope=selected)

All filter[...], filter_groups, and sort params from the List Bills endpoint also apply when scope=filtered.

In line_items mode these line columns are always appended: Line Description, Line Cost Category, Line Qty, Line Amount, Line Extended, Line Tax Rate. They are followed by Allocation SKU, Allocation Line ID and Allocation Amount, which are filled only for bills with the manual proration strategy: such a bill gets one extra row per allocation (line columns blank). The file can be imported back with the data-import endpoints: entity_type=bills for bill and line rows, entity_type=bill_allocations for allocation rows.

Response​

Binary file download:

  • XLSX: Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
  • CSV: Content-Type: text/csv
  • Filename: landed-cost-bills-{timestamp}.{ext} (summary) or landed-cost-bills-detail-{timestamp}.{ext} (line_items)

Documents. documents_count is available as a columns key and exports as a Documents column holding the number of attached supporting documents.

Request​

Responses​

OK

Response Headers
    Content-Type
    Content-Disposition