Quote

Canonical contract for persisted quote payloads.

Identity source_id, connection_id

Attributes

Field
Type
Description
id
string
Canonical ID — Backfill canonical record ID assigned after persistence. This is distinct from the source-system ID.
source_idrequiredidentity
string
Source ID — Stable external record ID from the source system. Backfill uses this with source_system and, when present, connection_id for idempotent imports and upserts.
source_systemrequired
string
Source System — Connector or provider that supplied the record, such as stripe, shopify, qbo, csv_upload, or manual.
connection_ididentity
string
Connection ID — Backfill tenant connection ID that scopes records to a specific external account, store, realm, or integration instance. It may participate in source identity without being required on every create payload.
subsidiary_id
string
Subsidiary ID — Business entity or subsidiary identifier for multi-entity accounting. Leave blank when the tenant does not use subsidiaries.
document_number
string
Document Number
customer_id
string
Customer ID — Identifier for the related customer record.
statusrequired
string
Status
approval_status
string
Approval Status
draftpending_approvalapprovedrejectedvoid
memo
string
Memo
currencyrequired
string
Currency
total_amountrequired
decimal
Total Amount
issued_at
datetime
Issued At — Timestamp when the source system issued, created, or finalized the document. Backfill can use its date to derive document_date and effective_date.
expires_at
datetime
Expires At
accepted_at
datetime
Accepted At
lines[]
array<object>
Lines
default: []
line_number
integer
Line Number — One-based display order of the line within the document. Use for ordering and presentation, not stable identity.
line_ref
string
Line Ref — Provider-native line reference. Use it to match the same source line across document versions and related documents.
line_type
string
Line Type — Normalized kind of line, such as product, service, discount, tax, shipping, subtotal, or description_only. Used for rollups and posting behavior.
productservicediscounttaxshippingsubtotaldescription_only
detail
object
Line Detail — Typed line-detail payload. It normalizes selected flat line fields into item, discount, subtotal, or description_only shapes so consumers can branch on line kind without inferring from loose fields; the flat line fields remain the canonical compatibility surface.
typerequired
string
Detail Type — Line-detail variant. item covers product or service rows; discount, subtotal, and description_only represent non-item rows.
itemdiscountsubtotaldescription_only
item_id
string
Item ID
sku
string
SKU
quantity
decimal
Quantity
unit_amount
decimal
Unit Amount
account_id
string
Account ID
class_id
string
Class ID
location_id
string
Location ID
product
map
Product
discount_amount
decimal
Discount Amount
discount_percent
decimal
Discount Percent
basis_amount
decimal
Basis Amount
subtotal_amount
decimal
Subtotal Amount
metadata
map
Metadata
description
string
Description
amount
decimal
Amount
currency
string
Currency
quantity
decimal
Quantity
unit_amount
decimal
Unit Amount
sku
string
SKU
product_id
string
Product ID — Identifier for the related product record.
class_id
string
Class ID — Identifier for the related class record.
location_id
string
Location ID — Identifier for the related location record.
tax_code
string
Tax Code
tax_amount
decimal
Tax Amount
taxable_amount
decimal
Taxable Amount
tax_rate
decimal
Tax Rate
tax_status
string
Tax Status
taxableexemptzero_ratedreverse_chargenot_applicable
tax_exempt_reason
string
Tax Exempt Reason
discount_amount
decimal
Discount Amount
amount_includes_tax
boolean
Amount Includes Tax
tax_details[]
array<object>
Tax Details
tax_detail_refrequired
string
Tax Detail Ref
tax_name
string
Tax Name
tax_type
string
Tax Type
tax_code
string
Tax Code
jurisdiction_name
string
Jurisdiction Name
jurisdiction_code
string
Jurisdiction Code
jurisdiction_level
string
Jurisdiction Level
rate
decimal
Rate
taxable_amount
decimal
Taxable Amount
tax_amountrequired
decimal
Tax Amount
amount_includes_taxrequired
boolean
Amount Includes Tax
provider_key
string
Provider Key
provider_tax_rate_ref
string
Provider Tax Rate Ref
provider_detail_ref
string
Provider Detail Ref
taxability_reason
string
Taxability Reason
ship_to_ref
string
Ship To Ref
ship_from_ref
string
Ship From Ref
fulfillment_ref
string
Fulfillment Ref
allocation_ref
string
Allocation Ref
metadata
map
Metadata
product
map
Product
optional
boolean
Optional
discount_percent
decimal
Discount Percent
tiered_pricing
map
Tiered Pricing
dimensions
map
Dimensions
metadata
map
Metadata
dimensions
map
Dimensions
default: %{}
metadata
map
Metadata
default: %{}

TypeScript SDK

Import

Every canonical resource is exposed as a top-level entity global on @backfill-io/sdk.

import { Quote } from "@backfill-io/sdk";

Create

Pass an object matching QuoteCreateInput. Required fields are shown below.

const quote = Quote.create({
  source_id: "source_id_123",
  source_system: "…",
  status: "open",
  currency: "USD",
  total_amount: "100.00",
});

Get and query

Look up a single record by canonical ID, or query with filters and pagination.

const quote = Quote.get("quote_123");

const results = Quote.query({
  where: { },
  orderBy: [{ field: "inserted_at", direction: "desc" }],
  limit: 50,
});

Update

Partial update — pass only the fields you want to change.

Quote.update("quote_123", {
  // …fields to update
});

Delete

Quote.delete("quote_123");