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

# Types and enums

> Reference for exported GoPay SDK request/response models and enums.

# Types and enums

<Info>
  Prefer **importing types** with `import type { … }` so they erase at compile time and don’t affect your runtime bundle.
</Info>

The package exports typed models and constant-based enums to keep your integration compile-time safe.

## Importing types

```ts theme={null}
import type { CreatePaymentRequest, PaymentResponse, TokenCache } from 'gopay-sdk';
```

## Importing enums

```ts theme={null}
import { Currency, Language, PaymentStatus, TokenScope } from 'gopay-sdk';
```

## Configuration types

* `CreateGoPayClientConfig`
* `GoPayClientOptions`
* `GoPayClientConfigInput`
* `GoPayClientConfigNormalized`

## Core payment request types

* `CreatePaymentRequest`
* `CreateRecurrenceRequest`
* `CaptureAuthorizationPartialRequest`
* `RefundPaymentRequest`

## Core payment response types

* `PaymentResponse`
* `PaymentOperationResponse`
* `RefundHistoryItem`
* `CardDetailsResponse`

## Statement types

* `AccountStatementRequest`
* `AccountStatementResponse`

## Payment methods types

* `PaymentInstrumentsResponse`
* `PaymentInstrumentsAllResponse`
* `PaymentMethodGroups`

## Error types

* `GoPayFieldError`
* `GoPayErrorBody`
* `GoPayErrorResponse`
* `GoPayApiError` (class)
* `GoPayConfigError` (class)

## Token and transport abstractions

* `TokenCache` (interface)
* `OAuthToken`
* `OAuthTokenResponse`
* `HttpTransport`
* `HttpTransportRequest`
* `HttpMethod`
* `ContentType`

## Main enums and constants

* `Currency`
* `Language`
* `TokenScope`
* `PaymentInstrument`
* `PaymentMethodGroup`
* `PaymentStatus`
* `PaymentSubStatusValues`
* `RefundState`
* `RecurrenceCycle`
* `RecurrenceState`
* `PreauthorizationState`
* `StatementFormat`
* `BankSwiftCode`
* `ErrorScope`
* `ErrorCodeValues`

## Practical typing pattern

```ts theme={null}
import {
  Currency,
  type CreatePaymentRequest,
  type PaymentResponse,
  createGoPayClient,
} from 'gopay-sdk';

const request: CreatePaymentRequest = {
  amount: 10000,
  currency: Currency.CZK,
  order_number: 'ORD-typed-1',
  payer: {
    contact: { email: 'john.doe@example.com' },
  },
  callback: {
    return_url: 'https://example.com/return',
    notification_url: 'https://example.com/notify',
  },
};

const client = createGoPayClient({
  goid: 8123456789,
  clientId: process.env.GOPAY_CLIENT_ID!,
  clientSecret: process.env.GOPAY_CLIENT_SECRET!,
  gatewayUrl: 'https://gw.sandbox.gopay.com/api',
});

const payment: PaymentResponse = await client.createPayment(request);
console.log(payment.id);
```
