---
title: "Create Customer Credit"
method: POST
path: "/v1/platform/businesses/{business_id}/customer-credits/"
tags: ["Customer Credits"]
---

# Create Customer Credit

`POST /v1/platform/businesses/{business_id}/customer-credits/`

## Request

- Base URL: `https://docs.thredfi.com` (the document declares no server; this is the origin it was published from)
- URL: `https://docs.thredfi.com/v1/platform/businesses/{business_id}/customer-credits/`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer
  - HTTP basic
  - HTTP bearer
  - HTTP bearer

Create a customer credit note with line items and optional allocations.

## Path parameters

- `business_id` string, uuid, required

## Request body

- CreateCustomerCreditRequest: Customer credit creation serializer with line_items support. Creates customer credits with line_items for flexible account allocation.
  - `external_id` string, required: External system identifier for this customer credit
  - `line_items` CustomerCreditLineItemRequest[], required: Array of line items for this customer credit
    - `amount` integer, required: NET credit amount in cents (BEFORE taxes) for this line item
    - `tax_amount_cents` integer, required: Tax amount in cents (e.g., VAT). Required field.
    - `revenue_account_identifier` unknown
    - `memo` string: Line item memo/description
    - `metadata` object: Line item metadata (max 10kb)
    - `reference_number` string: Line item reference number
    - `tags` object[]: Line item transaction tags
  - `customer_id` string, uuid: Existing customer ID to assign credit to
  - `customer_external_id` string: External customer ID. Will create customer if not found
  - `source_invoice_id` string, uuid, nullable: Optional invoice ID this credit note was created from (origin tracking, not allocation)
  - `sent_at` string, date-time: When the credit was sent (ISO 8601 format). Defaults to now
  - `allocations` CustomerCreditAllocationRequest[]: Array of invoice allocations for this credit
    - `amount` integer, required: Amount to allocate to invoice in cents
    - `invoice_id` string, uuid, required: Invoice ID to allocate credit to
  - `tags` object[]: Transaction tags for the credit
  - `document` CustomerCreditDocumentUploadRequest: Customer credit specific document upload payload.
    - `file` string, binary
    - `document_type` string
    - `upload_source` string
    - `metadata` unknown
    - `tags` unknown

## Response `201`

- CustomerCredit: Customer credit serializer for API responses.
  - `id` string, uuid, required: Unique customer credit identifier
  - `external_id` string: Your external system identifier for this credit
  - `status` 'draft' | 'sent' | 'applied' | 'partially_applied' | 'void', required: Credit status: draft, sent, partially_applied, applied, void (computed from allocations)
  - `sent_at` string, date-time, required: When the credit was sent
  - `customer` object, required: Customer receiving this credit (inline details)
  - `source_invoice_id` string, uuid, nullable, required: Invoice ID this credit was created from (origin tracking, not allocation)
  - `line_items` CustomerCreditLineItemResponse[], required: Array of credit line items
    - `amount` integer, required: Credit amount in cents
    - `revenue_account_identifier` AccountIdentifier, required: Standard account identifier format used across the API.
      - `type` string: Account identifier type (always 'AccountId')
      - `id` string, uuid, required: Account UUID
    - `memo` string
    - `metadata` unknown
    - `tags` string[], required: Line item transaction tags
  - `allocations` CustomerCreditInvoiceAllocationResponse[], required: Array of invoice allocations
    - `invoice_id` string, uuid, required: UUID of the invoice this credit is allocated to
    - `invoice_number` string, required: Invoice number (e.g., INV-00019)
    - `amount_cents` integer, required: Amount allocated to this invoice in cents
    - `invoice_outstanding_balance_cents` integer, required: Current outstanding balance on the invoice in cents (after all allocations)
    - `applied_at` string, date-time, required: When the allocation was applied
  - `tags` object[], required: Transaction tags for the credit
  - `total_amount` integer, required: Total credit amount in cents
  - `applied_amount` integer, required: Applied credit amount in cents
  - `currency` 'EUR' | 'GBP' | 'USD' | 'SEK' | 'NOK' | 'DKK' | 'ISK' | 'MYR' | 'SGD': Credit currency (e.g., GBP, EUR, USD) * `EUR` - Euro * `GBP` - British Pound * `USD` - US Dollar * `SEK` - Swedish Krona * `NOK` - Norwegian Krone * `DKK` - Danish Krone * `ISK` - Icelandic Króna * `MYR` - Malaysian Ringgit * `SGD` - Singapore Dollar
  - `document` DocumentFileUrl, required: Serializer for document file URL with metadata.
    - `url` string, uri, required: Presigned URL for document download
    - `expires_in` integer, required: Seconds until URL expires
    - `document_id` string, uuid, required: Document UUID
    - `file_name` string, required: Original document filename
    - `file_size` integer, required: File size in bytes
    - `mime_type` string, required: MIME type of the document
  - `created_at` string, date-time, required: Credit creation timestamp
  - `updated_at` string, date-time, required: Last update timestamp

## Other responses

- `400`: Validation errors in request data
- `401`: Authentication required - missing or invalid API key
- `403`: Permission denied - insufficient privileges
- `404`: Resource not found
- `409`: Conflict - resource already exists or invalid state transition
- `422`: Unprocessable entity - business logic validation failed
- `500`: Internal server error

---

[API](https://skmtc.dev/thredfi/apis/thredfi-accounting-platform-api.md) - [All operations](https://skmtc.dev/thredfi/apis/thredfi-accounting-platform-api/llms.txt) - [OpenAPI document](https://skmtc.dev/thredfi/apis/thredfi-accounting-platform-api/revisions/0c1918254db3?raw)
