> ## Documentation Index
> Fetch the complete documentation index at: https://docs.corsair.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# MoonClerk API reference

> API reference for the MoonClerk plugin in Corsair: every `moonclerk.api.*` operation with its input and output types, taken from the plugin's Zod schemas.

> [!NOTE]
>
> **New to Corsair?** See [API access](https://docs.corsair.dev/concepts/api.md), [authentication](https://docs.corsair.dev/concepts/auth.md), and [error handling](https://docs.corsair.dev/concepts/error-handling).

## Customers

### get

`customers.get`

Get a customer and subscription

**Risk:** `read`

```ts theme={null}
await corsair.moonclerk.api.customers.get({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `customer` | `object` | Yes | — |

> [accordion] customer full type
>
> ```ts theme={null}
> {
>   id?: number | null,
>   account_balance?: number | null,
>   name?: string | null,
>   email?: string | null,
>   payment_method?: {
>     type?: string | null,
>     last4?: string | null,
>     exp_month?: number | null,
>     exp_year?: number | null,
>     brand?: string | null
>   } | null,
>   custom_id?: string | null,
>   customer_reference?: string | null,
>   discount?: {
>     coupon?: {
>       code?: string | null,
>       duration?: string | null,
>       amount_off?: number | null,
>       currency?: string | null,
>       percent_off?: number | null,
>       duration_in_months?: number | null,
>       max_redemptions?: number | null,
>       redeem_by?: string | null
>     } | null,
>     starts_at?: string | null,
>     ends_at?: string | null
>   } | null,
>   delinquent?: boolean | null,
>   management_url?: string | null,
>   custom_fields?: Record<string, {
>     id?: number | null,
>     type?: string | null,
>     response?: string | number | boolean | null | {
>       line1?: string | null,
>       line2?: string | null,
>       city?: string | null,
>       state?: string | null,
>       postal_code?: string | null,
>       country?: string | null
>     } | null
>   }> | null,
>   form_id?: number | null,
>   checkout?: {
>     amount_due?: number | null,
>     coupon_amount?: number | null,
>     coupon_code?: string | null,
>     date?: string | null,
>     fee?: number | null,
>     subtotal?: number | null,
>     token?: string | null,
>     total?: number | null,
>     trial_period_days?: number | null,
>     upfront_amount?: number | null
>   } | null,
>   subscription?: {
>     id?: number | null,
>     subscription_reference?: string | null,
>     status?: active | canceled | expired | past_due | pending | unpaid | string | null,
>     start?: string | null,
>     first_payment_attempt?: string | null,
>     next_payment_attempt?: string | null,
>     current_period_start?: string | null,
>     current_period_end?: string | null,
>     trial_start?: string | null,
>     trial_end?: string | null,
>     trial_period_days?: number | null,
>     expires_at?: string | null,
>     canceled_at?: string | null,
>     ended_at?: string | null,
>     plan?: {
>       id?: number | null,
>       plan_reference?: string | null,
>       amount?: number | null,
>       amount_description?: string | null,
>       currency?: string | null,
>       interval?: string | null,
>       interval_count?: number | null
>     } | null
>   } | null
> }
> ```

***

### list

`customers.list`

List customers and subscriptions

**Risk:** `read`

```ts theme={null}
await corsair.moonclerk.api.customers.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `count` | `number` | No | — |
| `offset` | `number` | No | — |
| `form_id` | `number` | No | — |
| `checkout_from` | `string` | No | — |
| `checkout_to` | `string` | No | — |
| `next_payment_from` | `string` | No | — |
| `next_payment_to` | `string` | No | — |
| `status` | `active \| canceled \| expired \| past_due \| pending \| unpaid` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `customers` | `object[]` | Yes | — |

> [accordion] customers full type
>
> ```ts theme={null}
> {
>   id?: number | null,
>   account_balance?: number | null,
>   name?: string | null,
>   email?: string | null,
>   payment_method?: {
>     type?: string | null,
>     last4?: string | null,
>     exp_month?: number | null,
>     exp_year?: number | null,
>     brand?: string | null
>   } | null,
>   custom_id?: string | null,
>   customer_reference?: string | null,
>   discount?: {
>     coupon?: {
>       code?: string | null,
>       duration?: string | null,
>       amount_off?: number | null,
>       currency?: string | null,
>       percent_off?: number | null,
>       duration_in_months?: number | null,
>       max_redemptions?: number | null,
>       redeem_by?: string | null
>     } | null,
>     starts_at?: string | null,
>     ends_at?: string | null
>   } | null,
>   delinquent?: boolean | null,
>   management_url?: string | null,
>   custom_fields?: Record<string, {
>     id?: number | null,
>     type?: string | null,
>     response?: string | number | boolean | null | {
>       line1?: string | null,
>       line2?: string | null,
>       city?: string | null,
>       state?: string | null,
>       postal_code?: string | null,
>       country?: string | null
>     } | null
>   }> | null,
>   form_id?: number | null,
>   checkout?: {
>     amount_due?: number | null,
>     coupon_amount?: number | null,
>     coupon_code?: string | null,
>     date?: string | null,
>     fee?: number | null,
>     subtotal?: number | null,
>     token?: string | null,
>     total?: number | null,
>     trial_period_days?: number | null,
>     upfront_amount?: number | null
>   } | null,
>   subscription?: {
>     id?: number | null,
>     subscription_reference?: string | null,
>     status?: active | canceled | expired | past_due | pending | unpaid | string | null,
>     start?: string | null,
>     first_payment_attempt?: string | null,
>     next_payment_attempt?: string | null,
>     current_period_start?: string | null,
>     current_period_end?: string | null,
>     trial_start?: string | null,
>     trial_end?: string | null,
>     trial_period_days?: number | null,
>     expires_at?: string | null,
>     canceled_at?: string | null,
>     ended_at?: string | null,
>     plan?: {
>       id?: number | null,
>       plan_reference?: string | null,
>       amount?: number | null,
>       amount_description?: string | null,
>       currency?: string | null,
>       interval?: string | null,
>       interval_count?: number | null
>     } | null
>   } | null
> }[]
> ```

***

## Forms

### get

`forms.get`

Get a payment form

**Risk:** `read`

```ts theme={null}
await corsair.moonclerk.api.forms.get({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `form` | `object` | Yes | — |

> [accordion] form full type
>
> ```ts theme={null}
> {
>   id?: number | null,
>   title?: string | null,
>   access_token?: string | null,
>   currency?: string | null,
>   payment_volume?: number | null,
>   successful_checkout_count?: number | null,
>   created_at?: string | null,
>   updated_at?: string | null
> }
> ```

***

### list

`forms.list`

List payment forms

**Risk:** `read`

```ts theme={null}
await corsair.moonclerk.api.forms.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `count` | `number` | No | — |
| `offset` | `number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `forms` | `object[]` | Yes | — |

> [accordion] forms full type
>
> ```ts theme={null}
> {
>   id?: number | null,
>   title?: string | null,
>   access_token?: string | null,
>   currency?: string | null,
>   payment_volume?: number | null,
>   successful_checkout_count?: number | null,
>   created_at?: string | null,
>   updated_at?: string | null
> }[]
> ```

***

## Payments

### get

`payments.get`

Get a payment

**Risk:** `read`

```ts theme={null}
await corsair.moonclerk.api.payments.get({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `number` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `payment` | `object` | Yes | — |

> [accordion] payment full type
>
> ```ts theme={null}
> {
>   id?: number | null,
>   date?: string | null,
>   status?: successful | refunded | failed | string | null,
>   currency?: string | null,
>   amount?: number | null,
>   fee?: number | null,
>   amount_refunded?: number | null,
>   amount_description?: string | null,
>   name?: string | null,
>   email?: string | null,
>   payment_method?: {
>     type?: string | null,
>     last4?: string | null,
>     exp_month?: number | null,
>     exp_year?: number | null,
>     brand?: string | null
>   } | null,
>   charge_reference?: string | null,
>   customer_id?: number | null,
>   customer_reference?: string | null,
>   invoice_reference?: string | null,
>   custom_fields?: Record<string, {
>     id?: number | null,
>     type?: string | null,
>     response?: string | number | boolean | null | {
>       line1?: string | null,
>       line2?: string | null,
>       city?: string | null,
>       state?: string | null,
>       postal_code?: string | null,
>       country?: string | null
>     } | null
>   }> | null,
>   form_id?: number | null,
>   custom_id?: string | null,
>   checkout?: {
>     amount_due?: number | null,
>     coupon_amount?: number | null,
>     coupon_code?: string | null,
>     date?: string | null,
>     fee?: number | null,
>     subtotal?: number | null,
>     token?: string | null,
>     total?: number | null,
>     trial_period_days?: number | null,
>     upfront_amount?: number | null
>   } | null,
>   coupon?: {
>     code?: string | null,
>     duration?: string | null,
>     amount_off?: number | null,
>     currency?: string | null,
>     percent_off?: number | null,
>     duration_in_months?: number | null,
>     max_redemptions?: number | null,
>     redeem_by?: string | null
>   } | null
> }
> ```

***

### list

`payments.list`

List payments

**Risk:** `read`

```ts theme={null}
await corsair.moonclerk.api.payments.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `count` | `number` | No | — |
| `offset` | `number` | No | — |
| `form_id` | `number` | No | — |
| `customer_id` | `number` | No | — |
| `date_from` | `string` | No | — |
| `date_to` | `string` | No | — |
| `status` | `successful \| refunded \| failed` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `payments` | `object[]` | Yes | — |

> [accordion] payments full type
>
> ```ts theme={null}
> {
>   id?: number | null,
>   date?: string | null,
>   status?: successful | refunded | failed | string | null,
>   currency?: string | null,
>   amount?: number | null,
>   fee?: number | null,
>   amount_refunded?: number | null,
>   amount_description?: string | null,
>   name?: string | null,
>   email?: string | null,
>   payment_method?: {
>     type?: string | null,
>     last4?: string | null,
>     exp_month?: number | null,
>     exp_year?: number | null,
>     brand?: string | null
>   } | null,
>   charge_reference?: string | null,
>   customer_id?: number | null,
>   customer_reference?: string | null,
>   invoice_reference?: string | null,
>   custom_fields?: Record<string, {
>     id?: number | null,
>     type?: string | null,
>     response?: string | number | boolean | null | {
>       line1?: string | null,
>       line2?: string | null,
>       city?: string | null,
>       state?: string | null,
>       postal_code?: string | null,
>       country?: string | null
>     } | null
>   }> | null,
>   form_id?: number | null,
>   custom_id?: string | null,
>   checkout?: {
>     amount_due?: number | null,
>     coupon_amount?: number | null,
>     coupon_code?: string | null,
>     date?: string | null,
>     fee?: number | null,
>     subtotal?: number | null,
>     token?: string | null,
>     total?: number | null,
>     trial_period_days?: number | null,
>     upfront_amount?: number | null
>   } | null,
>   coupon?: {
>     code?: string | null,
>     duration?: string | null,
>     amount_off?: number | null,
>     currency?: string | null,
>     percent_off?: number | null,
>     duration_in_months?: number | null,
>     max_redemptions?: number | null,
>     redeem_by?: string | null
>   } | null
> }[]
> ```

***


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.