> ## 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.

# Typy a enumy

> Exportované modely požadavků/odpovědí a enumy GoPay SDK.

# Typy a enumy

<Info>
  Typy importujte pomocí `import type { … }` — při kompilaci zmizí a neovlivní runtime bundle.
</Info>

Balíček exportuje typované modely a enumy pro bezpečnost při kompilaci.

## Import typů

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

## Import enumů

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

## Konfigurace

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

## Platební požadavky

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

## Platební odpovědi

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

## Výpisy

* `AccountStatementRequest`
* `AccountStatementResponse`

## Platební metody

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

## Chyby

* `GoPayFieldError`
* `GoPayErrorBody`
* `GoPayErrorResponse`
* `GoPayApiError` (třída)
* `GoPayConfigError` (třída)

## Token a transport

* `TokenCache` (rozhraní)
* `OAuthToken`
* `OAuthTokenResponse`
* `HttpTransport`
* `HttpTransportRequest`
* `HttpMethod`
* `ContentType`

## Hlavní enumy a konstanty

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

## Praktický vzor

```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);
```
