# The account credit model

Source: https://developers.swell.is/backend-api/account-credits/the-account-credit-model

## Fields

- `id` (objectId): Unique identifier for the credit.
- `amount` (currency, required): Credit amount denominated in currency. Minimum of 0.01.
- `parent_id` (objectId, required): The ID of the parent customer.
- `credit` (Credit memo): Expandable list of the customer’s credit transactions.
- `credit_id` (objectId): ID of the credit applied to the customer's account.
- `currency` (string): Three-letter ISO currency code in uppercase. Defaults to the store's base currency.
- `date_created` (date, auto): Date and time the credit was created.
- `date_updated` (date, auto): Date and time the credit was last updated.
- `giftcard_id` (objectId): ID of the gift card used to make the payment, if applicable.
- `giftcard` (Gift Card): Expandable link to the gift card that generated the credit, if applicable.
- `invoice` (Invoice): Expandable link to the invoice the credit was applied to, if applicable.
- `invoice_id` (objectId): ID of the invoice the credit was applied to, if applicable.
- `number` (string, auto): Unique incremental number assigned automatically each time an account credit is created.
- `parent` (Account): Expandable link to the parent customer.
- `payment` (Payment): Expandable link to the payment.
- `payment_id` (objectId): Unique identifier for the payment.
- `reason` (string): The reason for the refund.
- `reason_message` (string): A brief message describing the reason for the refund.
- `refund` (Refund): Expandable list of refunds that apply to the credit.
- `refund_id` (objectId): ID of the refund the credit was applied to.

## Example request

**The account credit model**

## Example response

```json
{
  "parent_id": "5ffd413300b58e2a4a017831",
  "payment_id": "61e78cbed7e71014da0f1b2c",
  "amount": 100,
  "reason": "promo",
  "reason_message": "Found a bag of gold in a tree stump."
  "currency": "USD",
  "date_created": "2022-01-19T03:59:58.816Z",
  "number": "101082",
  "id": "61e78cbed7e71014da0f1b87"
}
```
