Skip to main content
POST
/
credit-notes
Create a credit note
curl --request POST \
  --url https://api.alguna.io/credit-notes \
  --header 'Alguna-Version: <alguna-version>' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "customer_id": "cust_01H1VECT",
  "billing_period_end": "2026-04-01T00:00:00Z",
  "billing_period_start": "2026-03-01T00:00:00Z",
  "description": "Overcharge credit for March",
  "invoice_id": "inv_01H1VECT",
  "line_items": [
    {
      "description": "Platform usage credit",
      "quantity": "1",
      "unit_price": "100.00",
      "product_id": "prod_01H1VECT"
    }
  ]
}
'
{
  "attachments": [
    {
      "file_url": "<string>",
      "title": "Credit Note PDF"
    }
  ],
  "created_at": "2026-04-01T10:00:00Z",
  "currency": "USD",
  "customer_id": "cust_01H1VECT",
  "description": "Overcharge credit",
  "external_reference": "<string>",
  "id": "cn_01H1VECT",
  "is_pdf_available": true,
  "line_items": [
    {
      "billing_period_end": "2026-01-31T23:59:59Z",
      "billing_period_start": "2026-01-01T00:00:00Z",
      "description": "Platform usage credit",
      "id": "cnli_01H1VECT",
      "is_editable": true,
      "quantity": "1",
      "total_price": "100.00",
      "unit_price": "100.00",
      "additional_description": "<string>",
      "invoice_line_item_id": "<string>",
      "product_id": "prod_01H1VECT",
      "tax_amount": "10.00",
      "tax_rate": "0.10"
    }
  ],
  "status": "draft",
  "subtotal": "100.00",
  "sync_enabled": true,
  "tax": "10.00",
  "total": "110.00",
  "updated_at": "2026-04-01T12:30:00Z",
  "accounting_credit_note_id": "<string>",
  "accounting_credit_note_url": "<string>",
  "accounting_integration_id": "<string>",
  "accounting_provider": "<string>",
  "apply_date": "2026-03-01T00:00:00Z",
  "billing_period_end": "2026-01-31T23:59:59Z",
  "billing_period_start": "2026-01-01T00:00:00Z",
  "credit_date": "2026-03-01T00:00:00Z",
  "invoice_id": "<string>",
  "last_refund_date": "2023-11-07T05:31:56Z",
  "last_refund_id": "<string>",
  "legal_entity_id": "<string>",
  "purchase_order_number": "<string>",
  "void_date": "2023-11-07T05:31:56Z"
}

Documentation Index

Fetch the complete documentation index at: https://alguna.com/docs/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

API key authentication. Pass your API key as a Bearer token.

Headers

Alguna-Version
enum<string>
required
Available options:
2026-04-01
Idempotency-Key
string

A unique string used to ensure the request is processed exactly once. If you retry a request with the same idempotency key within 24 hours, the original response is returned without re-executing the operation.

Maximum string length: 255
Example:

"ik_a1b2c3d4e5f6"

Body

application/json
customer_id
string
required

Customer ID

Example:

"cust_01H1VECT"

billing_period_end
string<date-time> | null

End of the billing period

Example:

"2026-04-01T00:00:00Z"

billing_period_start
string<date-time> | null

Start of the billing period

Example:

"2026-03-01T00:00:00Z"

description
string | null

Credit note description

Example:

"Overcharge credit for March"

invoice_id
string | null

Invoice to credit against

Example:

"inv_01H1VECT"

line_items
object[]

Line items on the credit note

Response

Success

attachments
object[]
required

Attachments on this credit note

created_at
string<date-time>
required

Timestamp when the credit note was created

Example:

"2026-04-01T10:00:00Z"

currency
string
required

Currency code

Example:

"USD"

customer_id
string
required

Customer this credit note belongs to

Example:

"cust_01H1VECT"

description
string
required

Description of the credit note

Example:

"Overcharge credit"

external_reference
string
required

External reference identifier

id
string
required

Unique identifier for the credit note

Example:

"cn_01H1VECT"

is_pdf_available
boolean
required

Whether a PDF is available for download

line_items
object[]
required

Line items on this credit note

status
enum<string>
required

Current status of the credit note

Available options:
draft,
applied,
void,
pending_refund
Example:

"draft"

subtotal
string
required

Subtotal before tax

Example:

"100.00"

sync_enabled
boolean
required

Whether accounting sync is enabled

tax
string
required

Tax amount

Example:

"10.00"

total
string
required

Total amount including tax

Example:

"110.00"

updated_at
string<date-time>
required

Timestamp when the credit note was last updated

Example:

"2026-04-01T12:30:00Z"

accounting_credit_note_id
string | null

Credit note ID in the accounting system

accounting_credit_note_url
string | null

URL to the credit note in the accounting system

accounting_integration_id
string | null

Accounting integration ID

accounting_provider
string | null

Accounting provider name

apply_date
string<date-time> | null

Date the credit note was applied

Example:

"2026-03-01T00:00:00Z"

billing_period_end
string<date-time> | null

End of the billing period

Example:

"2026-01-31T23:59:59Z"

billing_period_start
string<date-time> | null

Start of the billing period

Example:

"2026-01-01T00:00:00Z"

credit_date
string<date-time> | null

Date of the credit

Example:

"2026-03-01T00:00:00Z"

invoice_id
string | null

Associated invoice ID

last_refund_date
string<date-time> | null

Date of the last refund

last_refund_id
string | null

ID of the last refund

Legal entity ID

purchase_order_number
string | null

Purchase order number

void_date
string<date-time> | null

Date the credit note was voided