Salesorder data model

Updated:

View field support, webhooks, and list parameters for each integration on the Supported Integrations page.

FieldTypeRequiredDescription
idstringNo
created_atstring (date-time)No(ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
updated_atstring (date-time)No(ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
posted_atstring (date-time)No(ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
contact_idstringNoCustomer, Supplier (reference to AccountingContact)
account_idstringNo(reference to AccountingAccount)
currencystringNo
total_amountnumberNo
shipping_addressobjectNo
shipping_address.address1stringNo
shipping_address.address2stringNo
shipping_address.citystringNo
shipping_address.regionstringNoRegional area of the employee's address. For example, in the U.S., the region is the employee's state; in Canada, the region is the employee’s province.
shipping_address.region_codestringNoShort form for the regional area of the employee's address. For example, in the U.S., the region code is the two-letter abbreviation for the employee’s state; in Canada, the region is the two-letter abbreviation for the employee's province.
shipping_address.postal_codestringNo
shipping_address.countrystringNo
shipping_address.country_codestringNoCountry code for the country, in ISO 3166 A-2 format
billing_addressobjectNo
billing_address.address1stringNo
billing_address.address2stringNo
billing_address.citystringNo
billing_address.regionstringNoRegional area of the employee's address. For example, in the U.S., the region is the employee's state; in Canada, the region is the employee’s province.
billing_address.region_codestringNoShort form for the regional area of the employee's address. For example, in the U.S., the region code is the two-letter abbreviation for the employee’s state; in Canada, the region is the two-letter abbreviation for the employee's province.
billing_address.postal_codestringNo
billing_address.countrystringNo
billing_address.country_codestringNoCountry code for the country, in ISO 3166 A-2 format
statusenumNoValues: DRAFT, VOIDED, AUTHORIZED, PAID, PARTIALLY_PAID, PARTIALLY_REFUNDED, REFUNDED, SUBMITTED, DELETED, OPEN, COMPLETED, CANCELED
lineitemsAccountingLineitem[]No
lineitems[].idstringNo
lineitems[].created_atstring (date-time)No(ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
lineitems[].updated_atstring (date-time)No(ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
lineitems[].refunded_atstring (date-time)No(ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
lineitems[].total_amountnumberNounit_quantity * unit_amount + tax_amount
lineitems[].refund_amountnumberNo
lineitems[].discount_amountnumberNo
lineitems[].tax_amountnumberNo
lineitems[].item_idstringNo(reference to CommerceItem)
lineitems[].unit_amountnumberNo
lineitems[].unit_quantitynumberNo
lineitems[].item_skustringNo
lineitems[].item_namestringNo
lineitems[].item_descriptionstringNo
lineitems[].notesstringNo
lineitems[].taxrate_idstringNo
lineitems[].account_idstringNo(reference to AccountingAccount)
lineitems[].category_idsstring[]No(reference to AccountingCategory)
lineitems[].locationsAccountingReference[]No
lineitems[].locations[].idstringNo
lineitems[].locations[].namestringNo
lineitems[].item_variantsAccountingReference[]No
lineitems[].item_variants[].idstringNo
lineitems[].item_variants[].namestringNo
lineitems[].feesAccountingFee[]No
lineitems[].fees[].typeenumYesUnified fee category Values: TAX, DISCOUNT, PROMOTION, SHIPPING, GIFT_WRAP, COD, SURCHARGE, TIP, SERVICE_CHARGE, OTHER
lineitems[].fees[].original_typestringNoThe provider's original fee label, e.g. "VAT" or a shipping carrier name
lineitems[].fees[].amountnumberYes
lineitems[].fees[].currencystringNoISO 4217 currency code, e.g. USD
lineitems[].contact_idstringNo(reference to AccountingContact)
lineitems[].project_idstringNoref -> AccountingProject; the project this line is coded to (reference to TaskProject)
lineitems[].exchange_ratenumberNoThe exchange rate applied to this line, for multi-currency documents
lineitems[].is_billablebooleanNoTrue when the line is rebillable to a customer
sales_channelstringNo
organization_idstringNo
feesAccountingFee[]No
fees[].typeenumYesUnified fee category Values: TAX, DISCOUNT, PROMOTION, SHIPPING, GIFT_WRAP, COD, SURCHARGE, TIP, SERVICE_CHARGE, OTHER
fees[].original_typestringNoThe provider's original fee label, e.g. "VAT" or a shipping carrier name
fees[].amountnumberYes
fees[].currencystringNoISO 4217 currency code, e.g. USD
category_idsstring[]No(reference to AccountingCategory)
metadataAccountingMetadata[]No
metadata[].idstringNoThe ID of the custom field definition (from the metadata/metadata endpoint).
metadata[].slugstringNoThe integration's API name (key) of an existing custom field. List valid slugs for this object with the metadata/metadata endpoint; unknown slugs are rejected by the integration.
metadata[].valueobjectNoThe field's value, typed by format: DATE as ISO-8601 (YYYY-MM-DD, or YYYY-MM-DDTHH:MM:SSZ for date-times); NUMBER, PRICE and CURRENCY as a number; BOOLEAN and YES_NO as true/false; MULTIPLE_SELECT as an array of option values; otherwise a string.
metadata[].namespacestringNo
metadata[].formatenumNoThe data type of the custom field, which determines how value is formatted. Values: TEXT, NUMBER, DATE, BOOLEAN, FILE, TEXTAREA, SINGLE_SELECT, MULTIPLE_SELECT, MEASUREMENT, PRICE, YES_NO, CURRENCY, URL
metadata[].extra_dataobjectNo
order_numberstringNohuman-facing receipt/ticket/check number, distinct from id
location_idstringNostore/site; reference to a commerce_location or hris_location
employee_user_idstringNoselling/serving HR employee (server, cashier) (reference to HrisEmployee)
device_idstringNoPOS register/terminal/device (HRIS Device)
fulfillment_typeenumNoValues: DINE_IN, TAKEOUT, DELIVERY, PICKUP, CURBSIDE, SHIPPING, DIGITAL, OTHER
guest_countnumberNo
subtotal_amountnumberNopre-tax, pre-tip amount
tax_amountnumberNo
discount_amountnumberNo
tip_amountnumberNo
service_charge_amountnumberNo
refunded_amountnumberNo
closed_atstring (date-time)No(ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
subscription_idstringNopayment_subscription that generated this order, if recurring
paymentsAccountingPaymentReference[]Noread-only reciprocal of PaymentPayment.allocations; payments applied to this sales order
payments[].payment_idstringNoreferences a PaymentPayment that was applied to this object (reference to PaymentPayment)
payments[].amountnumberNoamount of the payment applied to this object
payments[].allocated_atstring (date-time)NoDate and time when the payment was applied, in ISO 8601 format and UTC (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
table_idstringNoreference to a commerce_table (restaurant table) the order is seated at
paid_amountnumberNototal of the payments applied so far

TypeScript

TypeScript
export type AccountingSalesorder = {
	id?: string;
	created_at?: string-time; // (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
	updated_at?: string-time; // (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
	posted_at?: string-time; // (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
	contact_id?: string; // Customer, Supplier (reference to AccountingContact)
	account_id?: string; // (reference to AccountingAccount)
	currency?: string;
	total_amount?: number;
	shipping_address?: {
		address1?: string; 
		address2?: string; 
		city?: string; 
		region?: string; // Regional area of the employee's address.  For example, in the U.S., the region is the employee's state; in Canada, the region is the employee’s province. 
		region_code?: string; // Short form for the regional area of the employee's address.   For example, in the U.S., the region code is the two-letter abbreviation for the employee’s state; in Canada, the region is the two-letter abbreviation for the employee's province. 
		postal_code?: string; 
		country?: string; 
		country_code?: string; // Country code for the country, in ISO 3166 A-2 format 
	};
	billing_address?: {
		address1?: string; 
		address2?: string; 
		city?: string; 
		region?: string; // Regional area of the employee's address.  For example, in the U.S., the region is the employee's state; in Canada, the region is the employee’s province. 
		region_code?: string; // Short form for the regional area of the employee's address.   For example, in the U.S., the region code is the two-letter abbreviation for the employee’s state; in Canada, the region is the two-letter abbreviation for the employee's province. 
		postal_code?: string; 
		country?: string; 
		country_code?: string; // Country code for the country, in ISO 3166 A-2 format 
	};
	status?: 'DRAFT' | 'VOIDED' | 'AUTHORIZED' | 'PAID' | 'PARTIALLY_PAID' | 'PARTIALLY_REFUNDED' | 'REFUNDED' | 'SUBMITTED' | 'DELETED' | 'OPEN' | 'COMPLETED' | 'CANCELED';
	lineitems?: [];
	sales_channel?: string;
	organization_id?: string;
	fees?: [];
	category_ids?: string[]; // (reference to AccountingCategory)
	metadata?: [];
	order_number?: string; // human-facing receipt/ticket/check number, distinct from id
	location_id?: string; // store/site; reference to a commerce_location or hris_location
	employee_user_id?: string; // selling/serving HR employee (server, cashier) (reference to HrisEmployee)
	device_id?: string; // POS register/terminal/device (HRIS Device)
	fulfillment_type?: 'DINE_IN' | 'TAKEOUT' | 'DELIVERY' | 'PICKUP' | 'CURBSIDE' | 'SHIPPING' | 'DIGITAL' | 'OTHER';
	guest_count?: number;
	subtotal_amount?: number; // pre-tax, pre-tip amount
	tax_amount?: number;
	discount_amount?: number;
	tip_amount?: number;
	service_charge_amount?: number;
	refunded_amount?: number;
	closed_at?: string-time; // (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
	subscription_id?: string; // payment_subscription that generated this order, if recurring
	payments?: []; // read-only reciprocal of PaymentPayment.allocations; payments applied to this sales order
	table_id?: string; // reference to a commerce_table (restaurant table) the order is seated at
	paid_amount?: number; // total of the payments applied so far
	raw?: any;
} 

Zod

Zod
import { z } from 'zod';

export const ZodAccountingSalesorder = z.object({
	id: z.string().optional(),
	created_at: z.string-time().optional().describe("(ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"),
	updated_at: z.string-time().optional().describe("(ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"),
	posted_at: z.string-time().optional().describe("(ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"),
	contact_id: z.string().optional().describe("Customer, Supplier (reference to AccountingContact)"),
	account_id: z.string().optional().describe("(reference to AccountingAccount)"),
	currency: z.string().optional(),
	total_amount: z.number().optional(),
	shipping_address: z.object({
			address1: z.string().optional(),
			address2: z.string().optional(),
			city: z.string().optional(),
			region: z.string().optional().describe("Regional area of the employee's address.  For example, in the U.S., the region is the employee's state; in Canada, the region is the employee’s province."),
			region_code: z.string().optional().describe("Short form for the regional area of the employee's address.   For example, in the U.S., the region code is the two-letter abbreviation for the employee’s state; in Canada, the region is the two-letter abbreviation for the employee's province."),
			postal_code: z.string().optional(),
			country: z.string().optional(),
			country_code: z.string().optional().describe("Country code for the country, in ISO 3166 A-2 format")
}).optional(),
	billing_address: z.object({
			address1: z.string().optional(),
			address2: z.string().optional(),
			city: z.string().optional(),
			region: z.string().optional().describe("Regional area of the employee's address.  For example, in the U.S., the region is the employee's state; in Canada, the region is the employee’s province."),
			region_code: z.string().optional().describe("Short form for the regional area of the employee's address.   For example, in the U.S., the region code is the two-letter abbreviation for the employee’s state; in Canada, the region is the two-letter abbreviation for the employee's province."),
			postal_code: z.string().optional(),
			country: z.string().optional(),
			country_code: z.string().optional().describe("Country code for the country, in ISO 3166 A-2 format")
}).optional(),
	status: z.enum("DRAFT", "VOIDED", "AUTHORIZED", "PAID", "PARTIALLY_PAID", "PARTIALLY_REFUNDED", "REFUNDED", "SUBMITTED", "DELETED", "OPEN", "COMPLETED", "CANCELED").optional(),
	lineitems: z.array().optional(),
	sales_channel: z.string().optional(),
	organization_id: z.string().optional(),
	fees: z.array().optional(),
	category_ids: z.array().optional().describe("(reference to AccountingCategory)"),
	metadata: z.array().optional(),
	order_number: z.string().optional().describe("human-facing receipt/ticket/check number, distinct from id"),
	location_id: z.string().optional().describe("store/site; reference to a commerce_location or hris_location"),
	employee_user_id: z.string().optional().describe("selling/serving HR employee (server, cashier) (reference to HrisEmployee)"),
	device_id: z.string().optional().describe("POS register/terminal/device (HRIS Device)"),
	fulfillment_type: z.enum("DINE_IN", "TAKEOUT", "DELIVERY", "PICKUP", "CURBSIDE", "SHIPPING", "DIGITAL", "OTHER").optional(),
	guest_count: z.number().optional(),
	subtotal_amount: z.number().optional().describe("pre-tax, pre-tip amount"),
	tax_amount: z.number().optional(),
	discount_amount: z.number().optional(),
	tip_amount: z.number().optional(),
	service_charge_amount: z.number().optional(),
	refunded_amount: z.number().optional(),
	closed_at: z.string-time().optional().describe("(ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"),
	subscription_id: z.string().optional().describe("payment_subscription that generated this order, if recurring"),
	payments: z.array().optional().describe("read-only reciprocal of PaymentPayment.allocations; payments applied to this sales order"),
	table_id: z.string().optional().describe("reference to a commerce_table (restaurant table) the order is seated at"),
	paid_amount: z.number().optional().describe("total of the payments applied so far"),

});

Python

Python
import dataclasses

@dataclasses.dataclass
class AccountingSalesorderStatus(str, Enum):
	DRAFT = 'DRAFT'
	VOIDED = 'VOIDED'
	AUTHORIZED = 'AUTHORIZED'
	PAID = 'PAID'
	PARTIALLY_PAID = 'PARTIALLY_PAID'
	PARTIALLY_REFUNDED = 'PARTIALLY_REFUNDED'
	REFUNDED = 'REFUNDED'
	SUBMITTED = 'SUBMITTED'
	DELETED = 'DELETED'
	OPEN = 'OPEN'
	COMPLETED = 'COMPLETED'
	CANCELED = 'CANCELED'

@dataclasses.dataclass
class AccountingSalesorderFulfillment_type(str, Enum):
	DINE_IN = 'DINE_IN'
	TAKEOUT = 'TAKEOUT'
	DELIVERY = 'DELIVERY'
	PICKUP = 'PICKUP'
	CURBSIDE = 'CURBSIDE'
	SHIPPING = 'SHIPPING'
	DIGITAL = 'DIGITAL'
	OTHER = 'OTHER'

@dataclasses.dataclass
class PropertyAccountingSalesorderShipping_address:
	address1: Optional[str]
	address2: Optional[str]
	city: Optional[str]
	"""Regional area of the employee's address.  For example, in the U.S., the region is the employee's state; in Canada, the region is the employee’s province."""
	region: Optional[str]
	"""Short form for the regional area of the employee's address.   For example, in the U.S., the region code is the two-letter abbreviation for the employee’s state; in Canada, the region is the two-letter abbreviation for the employee's province."""
	region_code: Optional[str]
	postal_code: Optional[str]
	country: Optional[str]
	"""Country code for the country, in ISO 3166 A-2 format"""
	country_code: Optional[str]

@dataclasses.dataclass
class PropertyAccountingSalesorderBilling_address:
	address1: Optional[str]
	address2: Optional[str]
	city: Optional[str]
	"""Regional area of the employee's address.  For example, in the U.S., the region is the employee's state; in Canada, the region is the employee’s province."""
	region: Optional[str]
	"""Short form for the regional area of the employee's address.   For example, in the U.S., the region code is the two-letter abbreviation for the employee’s state; in Canada, the region is the two-letter abbreviation for the employee's province."""
	region_code: Optional[str]
	postal_code: Optional[str]
	country: Optional[str]
	"""Country code for the country, in ISO 3166 A-2 format"""
	country_code: Optional[str]

@dataclasses.dataclass
class AccountingSalesorder:
	id: Optional[str]
	"""(ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"""
	created_at: Optional[str]
	"""(ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"""
	updated_at: Optional[str]
	"""(ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"""
	posted_at: Optional[str]
	"""Customer, Supplier (reference to AccountingContact)"""
	contact_id: Optional[str]
	"""(reference to AccountingAccount)"""
	account_id: Optional[str]
	currency: Optional[str]
	total_amount: Optional[int]
	shipping_address: Optional[PropertyAccountingSalesorderShipping_address]
	billing_address: Optional[PropertyAccountingSalesorderBilling_address]
	status: Optional[AccountingSalesorderStatus]
	lineitems: Optional[PropertyAccountingSalesorderLineitems]
	sales_channel: Optional[str]
	organization_id: Optional[str]
	fees: Optional[PropertyAccountingSalesorderFees]
	"""(reference to AccountingCategory)"""
	category_ids: Optional[List[List[str]]]
	metadata: Optional[PropertyAccountingSalesorderMetadata]
	"""human-facing receipt/ticket/check number, distinct from id"""
	order_number: Optional[str]
	"""store/site; reference to a commerce_location or hris_location"""
	location_id: Optional[str]
	"""selling/serving HR employee (server, cashier) (reference to HrisEmployee)"""
	employee_user_id: Optional[str]
	"""POS register/terminal/device (HRIS Device)"""
	device_id: Optional[str]
	fulfillment_type: Optional[AccountingSalesorderFulfillment_type]
	guest_count: Optional[int]
	"""pre-tax, pre-tip amount"""
	subtotal_amount: Optional[int]
	tax_amount: Optional[int]
	discount_amount: Optional[int]
	tip_amount: Optional[int]
	service_charge_amount: Optional[int]
	refunded_amount: Optional[int]
	"""(ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"""
	closed_at: Optional[str]
	"""payment_subscription that generated this order, if recurring"""
	subscription_id: Optional[str]
	"""read-only reciprocal of PaymentPayment.allocations; payments applied to this sales order"""
	payments: Optional[PropertyAccountingSalesorderPayments]
	"""reference to a commerce_table (restaurant table) the order is seated at"""
	table_id: Optional[str]
	"""total of the payments applied so far"""
	paid_amount: Optional[int]
Are we missing anything? Let us know
Was this page helpful?