Skip to Content
Paycose Docs
Credit notes

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

  • idstringRequired

    Unique identifier for the object.

  • objectstringRequired

    String naming the object's type.

  • livemodebooleanRequired

    true when the object exists in live mode, false in test mode.

  • createdtimestampRequired

    Time the object was created, in Unix seconds.

  • updatedtimestampRequired

    Time the object last changed, in Unix seconds.

  • invoice_idstringRequired

    ID of the invoice this credit note credits.

  • customer_idstringRequired

    ID of the customer of the credited invoice.

  • numberstringRequired

    Sequential document number Paycose assigns to the credit note when it is created.

  • line_itemsarray of objectsRequired

    The credited lines, each crediting part of an invoice line or a custom amount, with its taxes.

    Show child attributes
    • line_items.objectstringRequired

      String naming the object's type.

    • line_items.reference_idstringRequired

      The hosting provider's ID for this line. Empty when the provider gives none.

    • line_items.amountintegerRequired

      Amount credited on this line, in the smallest currency unit.

    • line_items.amount_taxintegerRequired

      Tax on this credited line, in the smallest currency unit: the sum of the line's taxes.

    • line_items.descriptionstringRequiredNullable

      Description of the line; for an invoice line, the invoice line's description. null when there is none.

    • line_items.discount_amountintegerRequired

      Discount included in this credited line, in the smallest currency unit.

    • line_items.invoice_line_itemstringRequiredNullable

      ID of the invoice line item (il_…) this line credits. null on custom lines, and when a provider credited a line that is not on the Paycose invoice.

    • line_items.quantityintegerRequiredNullable

      Number of units credited. null on a line credited by amount, as at Stripe.

    • line_items.typestringRequired

      What the line credits.

      • invoice_line_item

        Credits part or all of an invoice line item.

      • custom_line_item

        Credits a custom amount that is not tied to an invoice line.

    • line_items.unit_amountintegerRequiredNullable

      Price per unit, in the smallest currency unit. null on a line credited by amount, and when not known.

    • line_items.unit_amount_decimalstringRequiredNullable

      Price 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 null when you retrieve or list credit notes.

    • line_items.taxesarray of objectsRequired

      Taxes on this credited line, one entry per tax rate.

      Show child attributes
      • line_items.taxes.idstringRequired

        Unique identifier for the object.

      • line_items.taxes.createdtimestampRequired

        Time the object was created, in Unix seconds.

      • line_items.taxes.updatedtimestampRequired

        Time the object last changed, in Unix seconds.

      • line_items.taxes.tax_rate_idstringNullable

        ID of the Paycose tax rate. null when the hosting provider's tax rate has no matching Paycose tax rate.

      • line_items.taxes.taxable_amountintegerRequired

        Amount the tax was calculated on, in the smallest currency unit.

      • line_items.taxes.tax_amountintegerRequired

        Tax credited on the line, in the smallest currency unit.

      • line_items.taxes.display_namestringRequired

        Name of the tax as printed on the document, e.g. VAT.

      • line_items.taxes.percentagenumberRequired

        Tax rate as a percentage, e.g. 7 for 7%.

      • line_items.taxes.inclusivebooleanRequired

        true when the tax is already included in the line amount; false when it is added on top.

  • subscription_idstringRequired

    ID of the subscription the credited invoice was billed for. Empty when the invoice is not part of a subscription.

  • reasonstringRequired

    Why the credit note was issued. Empty when no reason was given.

    • duplicate

      The invoice or charge was a duplicate.

    • fraudulent

      The purchase was fraudulent.

    • order_change

      The order changed after the invoice was issued.

    • product_unsatisfactory

      The customer was not satisfied with the product or service.

  • currencystringRequired

    Three-letter ISO 4217 currency code, in lowercase.

  • subtotalintegerRequired

    Sum of the line amounts requested when the credit note was created, before tax and shipping, in the smallest currency unit.

  • totalintegerRequired

    Total amount credited, including tax and shipping, in the smallest currency unit (e.g. 49900 = 499.00 THB).

  • scaling_factorintegerRequired

    Number of smallest currency units in one unit of currency (10 to the power of the currency's decimal places), e.g. 100 for THB. Divide an amount by it to get the value in major units.

  • amount_refundedintegerRequired

    Part 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_remainingintegerRequired

    The credit amount computed from the requested lines when the credit note was created, in the smallest currency unit. It does not change afterwards, and is 0 on credit notes created at the hosting provider.

  • descriptionstringRequired

    The note you sent as memo when creating the credit note. Empty when none.

  • destinationstringRequired

    Where the credited amount goes, comma-separated in this order: invoice (it lowers what is still due), refund, customer_balance and out_of_band. For example invoice,refund for a mixed note refunded in part. Empty when not known.

  • statusenumRequired

    State of the credit note.

    • draft

      Created but not yet issued. A credit note is normally issued as soon as it is created.

    • issued

      Issued; it counts against the invoice. A credit note that covered everything still due on an open invoice, so that the invoice was marked paid, is issued too, as at Stripe.

    • canceled

      Canceled; it no longer counts against the invoice.

    • void

      Voided with POST /credit_notes/{id}/cancel or at the hosting provider; it no longer counts against the invoice.

  • typestringRequired

    Whether the credit lowered what was still due, gave back money already paid, or both. Empty when the provider does not report it.

    • pre_payment

      Issued while the invoice was still unpaid; it lowers the amount due.

    • post_payment

      Issued after the invoice was paid; the credit is refunded, settled outside Paycose, or added to the customer's credit balance.

    • mixed

      Larger than what was still due: the due part lowers the amount due, and the rest is given back as for post_payment.

  • issued_attimestampRequiredNullable

    Time the credit note was issued, in Unix seconds. Null for a draft. Notes issued before this field existed show their creation time.

  • effective_attimestampRequiredNullable

    Time the credit note takes effect on the invoice, in Unix seconds: the effective_at sent, else when it was issued, as at Stripe. Null when a provider reported none.

  • providerstringRequired

    Name of the payment provider that hosts the credited invoice and this credit note, e.g. stripe.

  • reference_idstringRequired

    The hosting provider's ID for this credit note.

  • metadataobjectRequired

    Key-value pairs you attach to the object for your own use. Paycose never reads or changes them.

  • pdfstring

    URL 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_attimestampNullable

    Time the credit note was voided, in Unix seconds. Omitted unless it was voided.

  • amount_shippingintegerRequired

    Shipping amount credited, in the smallest currency unit. 0 when no shipping was credited.

  • subtotal_excluding_taxintegerRequired

    Credited amount excluding all tax and invoice-level discounts, in the smallest currency unit, as reported by the hosting provider. 0 when the provider does not report it.

  • total_excluding_taxintegerRequired

    Total amount credited excluding tax, in the smallest currency unit, as reported by the hosting provider. 0 when the provider does not report it.

  • customer_balance_transactionstring

    ID 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_idstring

    ID of the refund that pays this credit back to the customer, either created from refund_amount or linked with refund. Absent when none.

  • amount_out_of_bandintegerRequired

    Part of the credit you settled outside Paycose, for example in cash, as recorded from out_of_band_amount, in the smallest currency unit. 0 when none was recorded.

  • amount_withholdingintegerRequired

    The part of total that reverses the invoice's withholding tax: the invoice's amount_withholding times this note's share of the invoice total, rounded half up. It was never paid, so only total less this is refunded or lowers what is due.

  • customerobject (customer)NullableExpandable

    The full customer object when you pass expand[]=customer; otherwise absent. Use customer_id.

  • invoiceobject (invoice)NullableExpandable

    The full invoice object when you pass expand[]=invoice; otherwise absent. Use invoice_id.

  • subscriptionobject (subscription)NullableExpandable

    The full subscription object when you pass expand[]=subscription; otherwise absent. Use subscription_id.