Credit notes
The credit_note object
A credit note lowers what a customer owes on an open invoice, or records credit given back after a paid invoice, by refund, outside Paycose, or as customer credit. You create one with POST /credit_notes, for invoices Paycose bills itself and invoices a provider hosts; credit notes created directly at the invoice's hosting provider also appear here once Paycose is notified.
Attributes
idstringRequiredUnique identifier for the object.
objectstringRequiredString naming the object's type.
livemodebooleanRequiredtruewhen the object exists in live mode,falsein test mode.createdtimestampRequiredTime the object was created, in Unix seconds.
updatedtimestampRequiredTime the object last changed, in Unix seconds.
invoice_idstringRequiredID of the invoice this credit note credits.
customer_idstringRequiredID of the customer of the credited invoice.
numberstringRequiredSequential document number Paycose assigns to the credit note when it is created.
line_itemsarray of objectsRequiredThe credited lines, each crediting part of an invoice line or a custom amount, with its taxes.
Show child attributes
line_items.objectstringRequiredString naming the object's type.
line_items.reference_idstringRequiredThe hosting provider's ID for this line. Empty when the provider gives none.
line_items.amountintegerRequiredAmount credited on this line, in the smallest currency unit.
line_items.amount_taxintegerRequiredTax on this credited line, in the smallest currency unit: the sum of the line's
taxes.line_items.descriptionstringRequiredNullableDescription of the line; for an invoice line, the invoice line's description.
nullwhen there is none.line_items.discount_amountintegerRequiredDiscount included in this credited line, in the smallest currency unit.
line_items.invoice_line_itemstringRequiredNullableID of the invoice line item (
il_…) this line credits.nullon custom lines, and when a provider credited a line that is not on the Paycose invoice.line_items.quantityintegerRequiredNullableNumber of units credited.
nullon a line credited byamount, as at Stripe.line_items.typestringRequiredWhat the line credits.
invoice_line_itemCredits part or all of an invoice line item.
custom_line_itemCredits a custom amount that is not tied to an invoice line.
line_items.unit_amountintegerRequiredNullablePrice per unit, in the smallest currency unit.
nullon a line credited byamount, and when not known.line_items.unit_amount_decimalstringRequiredNullablePrice per unit as a decimal string, as the hosting provider reports it when the credit note is created. It is not stored, so it is
nullwhen you retrieve or list credit notes.line_items.taxesarray of objectsRequiredTaxes on this credited line, one entry per tax rate.
Show child attributes
line_items.taxes.idstringRequiredUnique identifier for the object.
line_items.taxes.createdtimestampRequiredTime the object was created, in Unix seconds.
line_items.taxes.updatedtimestampRequiredTime the object last changed, in Unix seconds.
line_items.taxes.tax_rate_idstringNullableID of the Paycose tax rate.
nullwhen the hosting provider's tax rate has no matching Paycose tax rate.line_items.taxes.taxable_amountintegerRequiredAmount the tax was calculated on, in the smallest currency unit.
line_items.taxes.tax_amountintegerRequiredTax credited on the line, in the smallest currency unit.
line_items.taxes.display_namestringRequiredName of the tax as printed on the document, e.g.
VAT.line_items.taxes.percentagenumberRequiredTax rate as a percentage, e.g.
7for 7%.line_items.taxes.inclusivebooleanRequiredtruewhen the tax is already included in the line amount;falsewhen it is added on top.
subscription_idstringRequiredID of the subscription the credited invoice was billed for. Empty when the invoice is not part of a subscription.
reasonstringRequiredWhy the credit note was issued. Empty when no reason was given.
duplicateThe invoice or charge was a duplicate.
fraudulentThe purchase was fraudulent.
order_changeThe order changed after the invoice was issued.
product_unsatisfactoryThe customer was not satisfied with the product or service.
currencystringRequiredThree-letter ISO 4217 currency code, in lowercase.
subtotalintegerRequiredSum of the line amounts requested when the credit note was created, before tax and shipping, in the smallest currency unit.
totalintegerRequiredTotal amount credited, including tax and shipping, in the smallest currency unit (e.g.
49900= 499.00 THB).scaling_factorintegerRequiredNumber of smallest currency units in one unit of
currency(10 to the power of the currency's decimal places), e.g.100for THB. Divide an amount by it to get the value in major units.amount_refundedintegerRequiredPart of the credit paid back to the customer's original payment by a refund, in the smallest currency unit. It goes back down if that refund fails or is canceled.
amount_remainingintegerRequiredThe credit amount computed from the requested
lineswhen the credit note was created, in the smallest currency unit. It does not change afterwards, and is0on credit notes created at the hosting provider.descriptionstringRequiredThe note you sent as
memowhen creating the credit note. Empty when none.destinationstringRequiredWhere the credited amount goes, comma-separated in this order:
invoice(it lowers what is still due),refund,customer_balanceandout_of_band. For exampleinvoice,refundfor amixednote refunded in part. Empty when not known.statusenumRequiredState of the credit note.
draftCreated but not yet issued. A credit note is normally issued as soon as it is created.
issuedIssued; it counts against the invoice. A credit note that covered everything still due on an
openinvoice, so that the invoice was markedpaid, isissuedtoo, as at Stripe.canceledCanceled; it no longer counts against the invoice.
voidVoided with
POST /credit_notes/{id}/cancelor at the hosting provider; it no longer counts against the invoice.
typestringRequiredWhether the credit lowered what was still due, gave back money already paid, or both. Empty when the provider does not report it.
pre_paymentIssued while the invoice was still unpaid; it lowers the amount due.
post_paymentIssued after the invoice was paid; the credit is refunded, settled outside Paycose, or added to the customer's credit balance.
mixedLarger than what was still due: the due part lowers the amount due, and the rest is given back as for
post_payment.
issued_attimestampRequiredNullableTime the credit note was issued, in Unix seconds. Null for a draft. Notes issued before this field existed show their creation time.
effective_attimestampRequiredNullableTime the credit note takes effect on the invoice, in Unix seconds: the
effective_atsent, else when it was issued, as at Stripe. Null when a provider reported none.providerstringRequiredName of the payment provider that hosts the credited invoice and this credit note, e.g.
stripe.reference_idstringRequiredThe hosting provider's ID for this credit note.
metadataobjectRequiredKey-value pairs you attach to the object for your own use. Paycose never reads or changes them.
pdfstringURL of the credit note's PDF: the hosting provider's, or for an invoice Paycose bills itself a Paycose link behind the invoice's hosted page. Absent when there is none.
voided_attimestampNullableTime the credit note was voided, in Unix seconds. Omitted unless it was voided.
amount_shippingintegerRequiredShipping amount credited, in the smallest currency unit.
0when no shipping was credited.subtotal_excluding_taxintegerRequiredCredited amount excluding all tax and invoice-level discounts, in the smallest currency unit, as reported by the hosting provider.
0when the provider does not report it.total_excluding_taxintegerRequiredTotal amount credited excluding tax, in the smallest currency unit, as reported by the hosting provider.
0when the provider does not report it.customer_balance_transactionstringID of the customer balance transaction at the hosting provider that added part of this credit to the customer's credit balance (see
credit_amount). Absent when none.refund_idstringID of the refund that pays this credit back to the customer, either created from
refund_amountor linked withrefund. Absent when none.amount_out_of_bandintegerRequiredPart of the credit you settled outside Paycose, for example in cash, as recorded from
out_of_band_amount, in the smallest currency unit.0when none was recorded.amount_withholdingintegerRequiredThe part of
totalthat reverses the invoice's withholding tax: the invoice'samount_withholdingtimes this note's share of the invoicetotal, rounded half up. It was never paid, so onlytotalless this is refunded or lowers what is due.The full customer object when you pass
expand[]=customer; otherwise absent. Usecustomer_id.The full invoice object when you pass
expand[]=invoice; otherwise absent. Useinvoice_id.The full subscription object when you pass
expand[]=subscription; otherwise absent. Usesubscription_id.