Order data model

@deprecated; use AccountingSalesorder or AccountingPurchaseorder

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)
typeenumNoValues: SALES, PURCHASE
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
organization_idstringNo
metadataAccountingMetadata[]No
metadata[].idstringNo
metadata[].slugstringNo
metadata[].valueobjectNo
metadata[].namespacestringNo
metadata[].formatenumNoValues: TEXT, NUMBER, DATE, BOOLEAN, FILE, TEXTAREA, SINGLE_SELECT, MULTIPLE_SELECT, MEASUREMENT, PRICE, YES_NO, CURRENCY, URL
metadata[].extra_dataobjectNo

TypeScript

TypeScript
export type AccountingOrder = {
	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)
	type?: 'SALES' | 'PURCHASE';
	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?: [];
	organization_id?: string;
	metadata?: [];
	raw?: any;
} 

Zod

Zod
import { z } from 'zod';

export const ZodAccountingOrder = 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)"),
	type: z.enum("SALES", "PURCHASE").optional(),
	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(),
	organization_id: z.string().optional(),
	metadata: z.array().optional(),

});

Python

Python
import dataclasses

@dataclasses.dataclass
class AccountingOrderType(str, Enum):
	SALES = 'SALES'
	PURCHASE = 'PURCHASE'

@dataclasses.dataclass
class AccountingOrderStatus(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 PropertyAccountingOrderShipping_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 PropertyAccountingOrderBilling_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 AccountingOrder:
	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]
	type: Optional[AccountingOrderType]
	currency: Optional[str]
	total_amount: Optional[int]
	shipping_address: Optional[PropertyAccountingOrderShipping_address]
	billing_address: Optional[PropertyAccountingOrderBilling_address]
	status: Optional[AccountingOrderStatus]
	lineitems: Optional[PropertyAccountingOrderLineitems]
	organization_id: Optional[str]
	metadata: Optional[PropertyAccountingOrderMetadata]
Are we missing anything? Let us know
Was this page helpful?