---
title: "Apply credit to invoice"
method: POST
path: "/credit-memos/{id}/apply"
tags: ["Credit Memos"]
---

# Apply credit to invoice

`POST /credit-memos/{id}/apply`

Apply credit memo amount to an invoice.

## What happens

- Creates credit application record
- Reduces credit memo remaining balance
- Reduces invoice open balance
- Updates order status if invoice is fully paid

## Constraints

- Amount must not exceed remaining balance
- Invoice must belong to same customer
- Invoice must have outstanding balance
- Currency must match

## Path parameters

- `id` string, required

## Query parameters

- `by` 'id' | 'key'

## Request body

- ApplyCreditRequest
  - `invoiceId` string, uuid, required — Invoice to apply credit to
  - `amount` number, required — Amount to apply

## Response `200`

Credit applied successfully

- ApplyCreditResponse
  - `application` CreditMemoApplication, required
    - `id` string, uuid, required
    - `invoiceId` string, uuid, required
    - `invoiceFriendlyId` string, nullable
    - `paymentId` string, uuid — Payment through which this credit was applied
    - `paymentKey` string, nullable
    - `amount` number, required — Amount applied
    - `appliedAt` string, date-time
  - `creditMemo` CreditMemo, required
    - `id` string, uuid, required
    - `key` string, nullable — Client-defined key
    - `reference` string, nullable — Reference number
    - `customer` CustomerReference — Enhanced reference to a customer resource (returned in responses). Includes full customer details in addition to id/key. Note: Does NOT include nested references (paymentTerm, contacts, etc.) to prevent recursion. Maximum nesting depth: 1 level.
      - `id` string, uuid, required — Customer UUID
      - `key` string, nullable — Client-defined reference ID if set
      - `name` string, required — Customer company name
      - `friendlyId` string, required — Human-readable customer identifier
      - `status` 'PROSPECT' | 'ACTIVE' | 'INACTIVE' | 'CHURNED', required — Customer status
      - `phoneNumber` string, nullable — Primary phone number
      - `website` string, nullable — Customer website URL
      - `createdAt` string, date-time, required — When the customer was created
      - `updatedAt` string, date-time, required — When the customer was last updated
      - `deletedAt` string, date-time, nullable — When the customer was soft deleted (null if active)
    - `amount` number, required — Original credit amount
    - `appliedAmount` number — Total amount applied to invoices
    - `remainingBalance` number, required — Available balance
    - `currency` string, nullable — Currency code
    - `status` 'OPEN' | 'PARTIALLY_APPLIED' | 'APPLIED' | 'VOIDED', required — Current status of the credit memo (derived from remaining balance). - `OPEN`: No applications, full balance available - `PARTIALLY_APPLIED`: Some amount applied, balance remains - `APPLIED`: Fully applied to invoices - `VOIDED`: Credit memo cancelled
    - `memoDate` string, date, required — Credit memo date
    - `notes` string, nullable — Notes or description
    - `sourcePaymentGroupId` string, uuid, nullable — Payment that created this credit (if from overpayment)
    - `sourcePaymentKey` string, nullable
    - `applications` CreditMemoApplication[] — Invoices this credit is applied to
      - `id` string, uuid, required
      - `invoiceId` string, uuid, required
      - `invoiceFriendlyId` string, nullable
      - `paymentId` string, uuid — Payment through which this credit was applied
      - `paymentKey` string, nullable
      - `amount` number, required — Amount applied
      - `appliedAt` string, date-time
    - `qboId` string, nullable — QuickBooks Online credit memo ID
    - `createdAt` string, date-time, required
    - `updatedAt` string, date-time, nullable
    - `voidedAt` string, date-time, nullable
    - `voidReason` string, nullable
    - `createdBy` UserReference — Enhanced reference to a user resource (returned in responses). Includes full user details in addition to id/key. Note: Does NOT include nested references (teams, etc.) to prevent recursion. Maximum nesting depth: 1 level.
      - `id` string, uuid, required — User UUID
      - `key` string, nullable — Client-defined reference ID if set
      - `email` string, email, required — User's email address
      - `name` string, nullable — User's full name
      - `phone` string, nullable — User's phone number
      - `phoneExt` string, nullable — Phone extension
      - `status` 'PENDING' | 'ACTIVE' | 'INACTIVE', required — User account status
      - `avatarId` string, uuid, nullable — Profile avatar document ID
      - `createdAt` string, date-time, required — When the user was created
      - `updatedAt` string, date-time, required — When the user was last updated
      - `deletedAt` string, date-time, nullable — When the user was soft deleted (null if active)

## Other responses

- `400` — Bad request - invalid input
- `401` — Unauthorized - invalid or missing access token
- `404` — Resource not found
- `409` — Cannot apply - insufficient balance or invalid invoice
- `422` — Validation error - invalid field values

---

[API](https://skmtc.net/mvmnt/apis/mvmnt-api.md) · [All operations](https://skmtc.net/mvmnt/apis/mvmnt-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/mvmnt/mvmnt-api/versions/c44e5e7a4256/schema)
