Creditmemo 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)
paid_atstring (date-time)No(ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
refunded_atstring (date-time)No(ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
cancelled_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
paid_amountnumberNo
refund_amountnumberNo
tax_amountnumberNo
discount_amountnumberNo
balance_amountnumberNo
creditmemo_numberstringNoExternal identifier for this invoice
contact_idstringNo(reference to AccountingContact)
invoice_idstringNo(reference to AccountingInvoice)
currencystringNo
notesstringNo
refund_reasonstringNo
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
urlstringNoThe public URL for the invoice to send to a customer to view or pay.
payment_collection_methodenumNoWhen set to charging_automatically, an automated attempt will occur to pay this invoice using the default payment source attached to the contactcustomer. When set to send_invoice, an will email will be sent with this invoice to the contact/customer with payment instructions. Values: send_invoice, charge_automatically
attachmentsAccountingAttachment[]No
attachments[].idstringNo
attachments[].download_urlstringNo
attachments[].namestringNo
attachments[].mime_typestringNo
sendbooleanNo
organization_idstringNo
apply_amountnumberNo
applicationsAccountingCreditApplication[]NoWhat this credit memo 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 AccountingCreditmemo = {
	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)
	paid_at?: string-time; // (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
	refunded_at?: string-time; // (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
	cancelled_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;
	paid_amount?: number;
	refund_amount?: number;
	tax_amount?: number;
	discount_amount?: number;
	balance_amount?: number;
	creditmemo_number?: string; // External identifier for this invoice
	contact_id?: string; // (reference to AccountingContact)
	invoice_id?: string; // (reference to AccountingInvoice)
	currency?: string;
	notes?: string;
	refund_reason?: string;
	lineitems?: [];
	status?: 'DRAFT' | 'VOIDED' | 'AUTHORIZED' | 'PAID' | 'PARTIALLY_PAID' | 'PARTIALLY_REFUNDED' | 'REFUNDED' | 'SUBMITTED' | 'DELETED' | 'OVERDUE';
	url?: string; // The public URL for the invoice to send to a customer to view or pay.
	payment_collection_method?: 'send_invoice' | 'charge_automatically'; // When set to charging_automatically, an automated attempt will occur to pay this invoice using the default payment source attached to the contactcustomer. When set to send_invoice, an will email will be sent with this invoice to the contact/customer with payment instructions.
	attachments?: [];
	send?: boolean;
	organization_id?: string;
	apply_amount?: number;
	applications?: []; // What this credit memo was applied to (invoices/bills). Writable inline on create/update.
	metadata?: [];
	raw?: any;
} 

Zod

Zod
import { z } from 'zod';

export const ZodAccountingCreditmemo = 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)"),
	paid_at: z.string-time().optional().describe("(ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"),
	refunded_at: z.string-time().optional().describe("(ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"),
	cancelled_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(),
	paid_amount: z.number().optional(),
	refund_amount: z.number().optional(),
	tax_amount: z.number().optional(),
	discount_amount: z.number().optional(),
	balance_amount: z.number().optional(),
	creditmemo_number: z.string().optional().describe("External identifier for this invoice"),
	contact_id: z.string().optional().describe("(reference to AccountingContact)"),
	invoice_id: z.string().optional().describe("(reference to AccountingInvoice)"),
	currency: z.string().optional(),
	notes: z.string().optional(),
	refund_reason: z.string().optional(),
	lineitems: z.array().optional(),
	status: z.enum("DRAFT", "VOIDED", "AUTHORIZED", "PAID", "PARTIALLY_PAID", "PARTIALLY_REFUNDED", "REFUNDED", "SUBMITTED", "DELETED", "OVERDUE").optional(),
	url: z.string().optional().describe("The public URL for the invoice to send to a customer to view or pay."),
	payment_collection_method: z.enum("send_invoice", "charge_automatically").optional().describe("When set to charging_automatically, an automated attempt will occur to pay this invoice using the default payment source attached to the contactcustomer. When set to send_invoice, an will email will be sent with this invoice to the contact/customer with payment instructions."),
	attachments: z.array().optional(),
	send: z.boolean().optional(),
	organization_id: z.string().optional(),
	apply_amount: z.number().optional(),
	applications: z.array().optional().describe("What this credit memo was applied to (invoices/bills). Writable inline on create/update."),
	metadata: z.array().optional(),

});

Python

Python
import dataclasses

@dataclasses.dataclass
class AccountingCreditmemoStatus(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 AccountingCreditmemoPayment_collection_method(str, Enum):
	send_invoice = 'send_invoice'
	charge_automatically = 'charge_automatically'

@dataclasses.dataclass
class AccountingCreditmemo:
	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)"""
	paid_at: Optional[str]
	"""(ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"""
	refunded_at: Optional[str]
	"""(ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"""
	cancelled_at: Optional[str]
	"""(ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"""
	posted_at: Optional[str]
	total_amount: Optional[int]
	paid_amount: Optional[int]
	refund_amount: Optional[int]
	tax_amount: Optional[int]
	discount_amount: Optional[int]
	balance_amount: Optional[int]
	"""External identifier for this invoice"""
	creditmemo_number: Optional[str]
	"""(reference to AccountingContact)"""
	contact_id: Optional[str]
	"""(reference to AccountingInvoice)"""
	invoice_id: Optional[str]
	currency: Optional[str]
	notes: Optional[str]
	refund_reason: Optional[str]
	lineitems: Optional[PropertyAccountingCreditmemoLineitems]
	status: Optional[AccountingCreditmemoStatus]
	"""The public URL for the invoice to send to a customer to view or pay."""
	url: Optional[str]
	"""When set to charging_automatically, an automated attempt will occur to pay this invoice using the default payment source attached to the contactcustomer. When set to send_invoice, an will email will be sent with this invoice to the contact/customer with payment instructions."""
	payment_collection_method: Optional[AccountingCreditmemoPayment_collection_method]
	attachments: Optional[PropertyAccountingCreditmemoAttachments]
	send: Optional[bool]
	organization_id: Optional[str]
	apply_amount: Optional[int]
	"""What this credit memo was applied to (invoices/bills). Writable inline on create/update."""
	applications: Optional[PropertyAccountingCreditmemoApplications]
	metadata: Optional[PropertyAccountingCreditmemoMetadata]
Are we missing anything? Let us know
Was this page helpful?