Vendorcredit 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)
due_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)
total_amountnumberNo
balance_amountnumberNo
account_idstringNo(reference to AccountingAccount)
currencystringNo
contact_idstringNo(reference to AccountingContact)
bill_idstringNo
notesstringNo
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
statusenumNoValues: DRAFT, VOIDED, AUTHORIZED, PAID, PARTIALLY_PAID, PARTIALLY_REFUNDED, REFUNDED, SUBMITTED, DELETED, OVERDUE
organization_idstringNo
apply_amountnumberNo
applicationsAccountingCreditApplication[]NoWhat this vendor credit was applied to (invoices/bills). Writable inline on create/update.
applications[].object_typeenumNoThe type of object this credit was applied to Values: INVOICE, BILL
applications[].object_idstringNoThe id of the object this credit was applied to
applications[].amountnumberNoThe amount of credit applied to this object
applications[].applied_atstring (date-time)NoDate and time when the credit was applied, in ISO 8601 format and UTC (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
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

TypeScript

TypeScript
export type AccountingVendorcredit = {
	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)
	due_at?: string-time; // (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
	posted_at?: string-time; // (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
	total_amount?: number;
	balance_amount?: number;
	account_id?: string; // (reference to AccountingAccount)
	currency?: string;
	contact_id?: string; // (reference to AccountingContact)
	bill_id?: string;
	notes?: string;
	lineitems?: [];
	status?: 'DRAFT' | 'VOIDED' | 'AUTHORIZED' | 'PAID' | 'PARTIALLY_PAID' | 'PARTIALLY_REFUNDED' | 'REFUNDED' | 'SUBMITTED' | 'DELETED' | 'OVERDUE';
	organization_id?: string;
	apply_amount?: number;
	applications?: []; // What this vendor credit was applied to (invoices/bills). Writable inline on create/update.
	metadata?: [];
	raw?: any;
} 

Zod

Zod
import { z } from 'zod';

export const ZodAccountingVendorcredit = 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)"),
	due_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)"),
	total_amount: z.number().optional(),
	balance_amount: z.number().optional(),
	account_id: z.string().optional().describe("(reference to AccountingAccount)"),
	currency: z.string().optional(),
	contact_id: z.string().optional().describe("(reference to AccountingContact)"),
	bill_id: z.string().optional(),
	notes: z.string().optional(),
	lineitems: z.array().optional(),
	status: z.enum("DRAFT", "VOIDED", "AUTHORIZED", "PAID", "PARTIALLY_PAID", "PARTIALLY_REFUNDED", "REFUNDED", "SUBMITTED", "DELETED", "OVERDUE").optional(),
	organization_id: z.string().optional(),
	apply_amount: z.number().optional(),
	applications: z.array().optional().describe("What this vendor credit was applied to (invoices/bills). Writable inline on create/update."),
	metadata: z.array().optional(),

});

Python

Python
import dataclasses

@dataclasses.dataclass
class AccountingVendorcreditStatus(str, Enum):
	DRAFT = 'DRAFT'
	VOIDED = 'VOIDED'
	AUTHORIZED = 'AUTHORIZED'
	PAID = 'PAID'
	PARTIALLY_PAID = 'PARTIALLY_PAID'
	PARTIALLY_REFUNDED = 'PARTIALLY_REFUNDED'
	REFUNDED = 'REFUNDED'
	SUBMITTED = 'SUBMITTED'
	DELETED = 'DELETED'
	OVERDUE = 'OVERDUE'

@dataclasses.dataclass
class AccountingVendorcredit:
	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)"""
	due_at: Optional[str]
	"""(ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"""
	posted_at: Optional[str]
	total_amount: Optional[int]
	balance_amount: Optional[int]
	"""(reference to AccountingAccount)"""
	account_id: Optional[str]
	currency: Optional[str]
	"""(reference to AccountingContact)"""
	contact_id: Optional[str]
	bill_id: Optional[str]
	notes: Optional[str]
	lineitems: Optional[PropertyAccountingVendorcreditLineitems]
	status: Optional[AccountingVendorcreditStatus]
	organization_id: Optional[str]
	apply_amount: Optional[int]
	"""What this vendor credit was applied to (invoices/bills). Writable inline on create/update."""
	applications: Optional[PropertyAccountingVendorcreditApplications]
	metadata: Optional[PropertyAccountingVendorcreditMetadata]
Are we missing anything? Let us know
Was this page helpful?