# Update a credit memo Update credit memo fields. ## Constraints - Amount cannot be changed if any applications exist - Customer cannot be changed once created Endpoint: PATCH /credit-memos/{id} Version: 1.0.0 Security: BearerAuth ## Path parameters: - `id` (string, required) Resource ID (UUID) or client key Example: "550e8400-e29b-41d4-a716-446655440000" ## Query parameters: - `by` (string) Specify lookup type for faster retrieval. If omitted, defaults to looking up by ID first, then falls back to client key if not found. Use by=key when you know you're providing a client key for best performance. Enum: "id", "key" ## Request fields (application/json): - `reference` (string,null) - `notes` (string,null) - `memoDate` (string) ## Response 200 fields (application/json): - `id` (string, required) Example: "550e8400-e29b-41d4-a716-446655440000" - `key` (string,null) Client-defined key - `reference` (string,null) Reference number Example: "CM-00001" - `customer` (object) 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. - `customer.id` (string, required) Customer UUID Example: "550e8400-e29b-41d4-a716-446655440000" - `customer.key` (string,null) Client-defined reference ID if set Example: "ERP-CUSTOMER-ACME" - `customer.name` (string, required) Customer company name Example: "Acme Manufacturing Corp" - `customer.friendlyId` (string, required) Human-readable customer identifier Example: "A123456" - `customer.status` (string, required) Customer status Enum: "PROSPECT", "ACTIVE", "INACTIVE", "CHURNED" - `customer.phoneNumber` (string,null) Primary phone number Example: "+1-555-123-4567" - `customer.website` (string,null) Customer website URL Example: "https://acme-manufacturing.com" - `customer.createdAt` (string, required) When the customer was created Example: "2025-01-15T10:00:00Z" - `customer.updatedAt` (string, required) When the customer was last updated Example: "2025-01-15T14:30:00Z" - `customer.deletedAt` (string,null) 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,null) Currency code Example: "USD" - `status` (string, 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 Enum: "OPEN", "PARTIALLY_APPLIED", "APPLIED", "VOIDED" - `memoDate` (string, required) Credit memo date - `notes` (string,null) Notes or description - `sourcePaymentGroupId` (string,null) Payment that created this credit (if from overpayment) - `sourcePaymentKey` (string,null) - `applications` (array) Invoices this credit is applied to - `applications.invoiceId` (string, required) - `applications.invoiceFriendlyId` (string,null) - `applications.paymentId` (string) Payment through which this credit was applied - `applications.paymentKey` (string,null) - `applications.amount` (number, required) Amount applied - `applications.appliedAt` (string) - `qboId` (string,null) QuickBooks Online credit memo ID - `createdAt` (string, required) - `updatedAt` (string,null) - `voidedAt` (string,null) - `voidReason` (string,null) - `createdBy` (object) 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. - `createdBy.id` (string, required) User UUID Example: "550e8400-e29b-41d4-a716-446655440000" - `createdBy.email` (string, required) User's email address Example: "john.doe@example.com" - `createdBy.name` (string,null) User's full name Example: "John Doe" - `createdBy.phone` (string,null) User's phone number Example: "+1-555-123-4567" - `createdBy.phoneExt` (string,null) Phone extension Example: "123" - `createdBy.status` (string, required) User account status Enum: "PENDING", "ACTIVE", "INACTIVE" - `createdBy.avatarId` (string,null) Profile avatar document ID Example: "7c9e6679-7425-40de-944b-e07fc1f90ae7" - `createdBy.createdAt` (string, required) When the user was created Example: "2025-01-15T10:00:00Z" - `createdBy.updatedAt` (string, required) When the user was last updated Example: "2025-01-15T14:30:00Z" - `createdBy.deletedAt` (string,null) When the user was soft deleted (null if active) ## Response 400 fields (application/json): - `error` (string, required) Error code - `message` (string, required) Human-readable error message ## Response 401 fields (application/json): - `error` (string, required) Error code - `message` (string, required) Human-readable error message ## Response 404 fields (application/json): - `error` (string, required) Error code - `message` (string, required) Human-readable error message ## Response 422 fields (application/json): - `error` (string, required) Error code Example: "validation_error" - `message` (string, required) Human-readable error message - `details` (array, required) Validation error details - `details.field` (string, required) Field name that failed validation - `details.message` (string, required) Validation error message