Skip to Content
Paycose Docs
FlowEvents

Credit note events

What data you get for credit_note.created, credit_note.issued, credit_note.applied, credit_note.voided, and credit_note.updated.

Fires when a credit note against an invoice is created, issued, applied, voided, or updated. This covers invoices Paycose bills itself and invoices a provider such as Stripe hosts.

Each event arrives as an event object. The examples on this page show its data.object.

Prop

Type

{
  "id": "cn_01J9ABCDEFGHJKMNPQRSTV",
  "object": "credit_note",
  "invoice_id": "in_01J9ABCDEFGHJKMNPQRSTV",
  "customer_id": "cus_01J8XYZABCDEFGHJKMNPQR",
  "reason": "order_change",
  "currency": "thb",
  "total": 53500,
  "amount_refunded": 0,
  "amount_remaining": 53500,
  "status": "issued",
  "type": "post_payment",
  "destination": "refund",
  "issued_at": 1784973600,
  "line_items": [
    {
      "type": "invoice_line_item",
      "invoice_line_item": "il_01J9ABCDEFGHJKMNPQRSTV",
      "amount": 50000,
      "quantity": 1
    }
  ]
}
EventWhen
credit_note.createdThe credit note was created.
credit_note.issuedThe credit note was issued and now counts against the invoice. Sent once, together with credit_note.created.
credit_note.appliedThe credit covered everything still due on an open invoice, so the invoice was marked paid. The note's status stays issued.
credit_note.voidedThe credit note was voided with POST /credit_notes/{id}/cancel or at the hosting provider. Sent exactly once.
credit_note.updatedThe hosting provider reported a change to the credit note.

type says when the credit was given: pre_payment lowers what is still due, post_payment gives back money already paid, and mixed does both, the due part first.

Issuing a credit note with POST /credit_notes also emails the invoice's customer: the amount, the reason, the invoice number, what was refunded and a link to the credit note's PDF when it has one. Each address gets it once per credit note.

A voided note shows status: "void", as Stripe does. A void credit note, or one that settled its invoice, can't be voided again: POST /credit_notes/{id}/cancel answers 409 with E4704 (credit_note.finite_state).

credit_note.canceled is retired. An endpoint that listed it now receives credit_note.voided instead, and new endpoints can't subscribe to it.