> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# Resource: AI Credits

# Type: Credit Transaction Object

# Link: https://dev.wix.com/docs/api-reference/account-level/ai-credits/credit-transaction-object.md

## Description: A CreditTransaction represents a credit charge deducted from a user's balance for performing an AI action or other credit-consuming operation.

Each transaction records the monetary cost of the operation, the equivalent number of credits charged and metadata about the operation that triggered the charge.
CreditTransactions are immutable records created through the Charge method and serve as an audit trail for credit usage and billing purposes.

## Schema:

```json
 Type: Credit Transaction Object | type: CreditTransaction
 Description: A CreditTransaction represents a credit charge deducted from a user's balance for performing an AI action or other credit-consuming operation.

Each transaction records the monetary cost of the operation, the equivalent number of credits charged and metadata about the operation that triggered the charge.
CreditTransactions are immutable records created through the Charge method and serve as an audit trail for credit usage and billing purposes.
       - name: id  | type: string | description: CreditTransaction ID.
           - name: value  | type: string | description: 
       - name: revision  | type: string | description: Revision number, which increments by 1 each time the CreditTransaction is updated. To prevent conflicting changes, the current revision must be passed when updating the CreditTransaction.  Ignored when creating a CreditTransaction.
           - name: value  | type: string | description: 
       - name: createdDate  | type: string | description: Date and time the CreditTransaction was created.
           - name: seconds  | type: string | description: 
           - name: nanos  | type: number | description: 
       - name: updatedDate  | type: string | description: Date and time the CreditTransaction was last updated.
       - name: amount  | type: Amount | description: Transaction value in credits and actual price.
           - name: credits  | type: number | description: Amount of credits charged
           - name: cost  | type: Money | description: Monetary value of the transaction.
               - name: amount  | type: string | description: Monetary amount in main currency units, formatted as a decimal string with a period as a decimal separator. For example, `3456.99` or `-789`.
               - name: currencyCode  | type: string | description: Currency code in [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) format. For example, `USD`.
               - name: formattedValue  | type: string | description: Localized monetary amount including the currency symbol. For example `1.000,30 €` or `-$12,345.67`.
       - name: description  | type: string | description: Description of the transaction
       - name: callerAppId  | type: string | description: App ID of app that initiated the action
       - name: externalRefId  | type: string | description: External reference ID that links this credit transaction to the specific operation or action that triggered it. This ID is provided by the calling application when creating the transaction and can be used to correlate credit charges with specific AI actions, API calls, or other operations for tracking and reconciliation purposes.
       - name: metadata  | type: Struct | description: Additional context about the operation that triggered this credit transaction. May include details such as the AI feature type, operation parameters, usage metrics, or other relevant information that helps track and understand credit consumption patterns.
           - name: fields  | type: object | description: 
       - name: idempotencyKey  | type: string | description: 

```