Credit Notes#
Credit Notes are documents that reduce the amount owed on an invoice. They can be issued for partial refunds, billing adjustments, or corrections.
The Credit Note object#
| Attribute | Type | Description |
|---|---|---|
id | string | Unique identifier with cn_ prefix |
object | string | Always "credit_note" |
invoice | string | The invoice this credit note applies to |
customer | string | Customer ID |
amount | integer | Credit amount in smallest currency unit |
currency | string | ISO 4217 currency code |
reason | enum | duplicate, fraudulent, order_change, product_unsatisfactory, other |
status | enum | issued, void |
memo | string | Internal memo |
lines | array | Credit note line items |
pdf_url | string | URL of the generated PDF |
metadata | hash | Key-value pairs |
created | timestamp | Time at which the object was created |
{
"id": "cn_xyz789",
"object": "credit_note",
"invoice": "inv_abc123",
"customer": "cus_123456789",
"amount": 5000,
"currency": "eur",
"reason": "order_change",
"status": "issued",
"memo": "Parking space cancelled for February",
"lines": [
{
"description": "Parking space — credit",
"amount": 5000
}
],
"pdf_url": "https://files.casapay.com/credit-notes/cn_xyz789.pdf",
"created": 1706140800
}Create a Credit Note#
POST /v1/credit_notes
| Parameter | Type | Required | Description |
|---|---|---|---|
invoice | string | Yes | Invoice to credit |
amount | integer | Yes | Credit amount |
reason | string | Yes | Reason for credit |
memo | string | No | Internal memo |
lines | array | No | Credit note line items |
curl https://api.casapay.com/v1/credit_notes \
-H "Authorization: Bearer sk_test_4eC39HqLyjWDarjtT1zdp7dc" \
-H "Content-Type: application/json" \
-d '{
"invoice": "inv_abc123",
"amount": 5000,
"reason": "order_change",
"memo": "Parking space cancelled"
}'Retrieve, List, Void#
GET /v1/credit_notes/:id
GET /v1/credit_notes?invoice=inv_abc123
POST /v1/credit_notes/:id/void