credit-notes

Stable. Describes behaviour that is built and covered by tests in this repository.

API reference

GET /v1/credit-notes #

Credit notes, newest first

Parameters

NameInTypeDescription
invoice_idquerystring · uuid
customerquerystringCustomer external id
page_sizequeryinteger
page_tokenquerystring

Responses

StatusMeaningBody
200OKListCreditNotesResponse
400Error envelopeError
Example response
{
  "credit_notes": [
    {
      "id": "0192f0b4-6f6e-7c3a-9a3e-6a1f2b3c4d5e",
      "number": "string",
      "invoice_id": "0192f0b4-6f6e-7c3a-9a3e-6a1f2b3c4d5e",
      "invoice_number": "string",
      "customer_id": "0192f0b4-6f6e-7c3a-9a3e-6a1f2b3c4d5e",
      "customer_external_id": "string",
      "currency": "string",
      "total_minor": "string",
      "tax_minor": "string",
      "reason": "string",
      "create_time": "2026-11-03T10:15:00Z",
      "disposition": "CREDIT_NOTE_DISPOSITION_CREDIT",
      "refund_state": "REFUND_STATE_REQUESTED",
      "refund_error": "string"
    }
  ],
  "next_page_token": "string"
}
curl
curl -X GET https://YOUR-API-ADDRESS/v1/credit-notes \
  -H "Authorization: Bearer $PAYRUDDER_API_KEY"

POST /v1/credit-notes/{id}/retry-refund #

Ask the payment provider again for a refund to the card that failed

Only a credit note whose refund failed: 409 billing.credit_note.refund_not_failed for any other. Settling a failed refund by hand (it was made at the provider some other way) is the operator's. Needs invoices:write.

Parameters

NameInTypeDescription
id requiredpathstring · uuid

Responses

StatusMeaningBody
200OKCreditNote
403Error envelopeError
404Error envelopeError
409Error envelopeError
Example response
{
  "id": "0192f0b4-6f6e-7c3a-9a3e-6a1f2b3c4d5e",
  "number": "string",
  "invoice_id": "0192f0b4-6f6e-7c3a-9a3e-6a1f2b3c4d5e",
  "invoice_number": "string",
  "customer_id": "0192f0b4-6f6e-7c3a-9a3e-6a1f2b3c4d5e",
  "customer_external_id": "string",
  "currency": "string",
  "total_minor": "string",
  "tax_minor": "string",
  "reason": "string",
  "create_time": "2026-11-03T10:15:00Z",
  "disposition": "CREDIT_NOTE_DISPOSITION_CREDIT",
  "refund_state": "REFUND_STATE_REQUESTED",
  "refund_error": "string"
}
curl
curl -X POST https://YOUR-API-ADDRESS/v1/credit-notes/<id>/retry-refund \
  -H "Authorization: Bearer $PAYRUDDER_API_KEY"

GET /v1/credit-notes/{id} #

A credit note

Parameters

NameInTypeDescription
id requiredpathstring · uuid

Responses

StatusMeaningBody
200OKCreditNote
404Error envelopeError
Example response
{
  "id": "0192f0b4-6f6e-7c3a-9a3e-6a1f2b3c4d5e",
  "number": "string",
  "invoice_id": "0192f0b4-6f6e-7c3a-9a3e-6a1f2b3c4d5e",
  "invoice_number": "string",
  "customer_id": "0192f0b4-6f6e-7c3a-9a3e-6a1f2b3c4d5e",
  "customer_external_id": "string",
  "currency": "string",
  "total_minor": "string",
  "tax_minor": "string",
  "reason": "string",
  "create_time": "2026-11-03T10:15:00Z",
  "disposition": "CREDIT_NOTE_DISPOSITION_CREDIT",
  "refund_state": "REFUND_STATE_REQUESTED",
  "refund_error": "string"
}
curl
curl -X GET https://YOUR-API-ADDRESS/v1/credit-notes/<id> \
  -H "Authorization: Bearer $PAYRUDDER_API_KEY"

Models

CreditNote

FieldTypeDescription
id requiredstring · uuid
number requiredstringCN-2026-000007 (live) or SBX-CN-2026-000007 (sandbox)
invoice_id requiredstring · uuid
invoice_number requiredstring
customer_id requiredstring · uuid
customer_external_id requiredstring
currency requiredstring
total_minor requiredstring · int64
tax_minor requiredstring · int64The part of total_minor that is the invoice's tax given back: the note's share of the invoice's total taken from the invoice's tax, so the notes of an invoice give back its tax exactly. 0 for an untaxed invoice and for a note made before this field existed
reason requiredstring
create_time requiredstring · date-time
disposition requiredCREDIT_NOTE_DISPOSITION_CREDIT | CREDIT_NOTE_DISPOSITION_REFUNDWhere the amount went: the credit balance, or back to the card
refund_state requiredREFUND_STATE_REQUESTED | REFUND_STATE_REFUNDED | REFUND_STATE_FAILEDOnly for a refund to the card
refund_error requiredstring

Error

FieldTypeDescription
error requiredobject

ListCreditNotesResponse

FieldTypeDescription
credit_notes requiredarray of CreditNote
next_page_token requiredstring