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

# Client methods

> Complete reference for all public GoPayClient methods.

# Client methods

<Note>
  This page is a **concise map** from SDK methods to HTTP endpoints. For request/response types and enums, see [Types and enums](/api-reference/types-and-enums).
</Note>

All methods below are available on `GoPayClient`, created via `createGoPayClient(...)`.

```ts theme={null}
import { createGoPayClient } from 'gopay-sdk';
```

## Payments

### `createPayment(payment)`

* **Endpoint:** `POST /payments/payment`
* **Returns:** `Promise<PaymentResponse>`
* **Behavior:** applies defaults for:
  * `target` -> `{ type: 'ACCOUNT', goid: <configured-goid> }`
  * `lang` -> configured client language

### `getPayment(paymentId)`

* **Endpoint:** `GET /payments/payment/{id}`
* **Returns:** `Promise<PaymentResponse>`

### `refundPayment(paymentId, { amount })`

* **Endpoint:** `POST /payments/payment/{id}/refund`
* **Content-Type:** `application/x-www-form-urlencoded`
* **Returns:** `Promise<PaymentOperationResponse>`

### `getPaymentRefunds(paymentId)`

* **Endpoint:** `GET /payments/payment/{id}/refunds`
* **Returns:** `Promise<RefundHistoryItem[]>`

## Recurrence and preauthorization

### `createRecurrence(paymentId, request)`

* **Endpoint:** `POST /payments/payment/{id}/create-recurrence`
* **Returns:** `Promise<PaymentResponse>`

### `voidRecurrence(paymentId)`

* **Endpoint:** `POST /payments/payment/{id}/void-recurrence`
* **Returns:** `Promise<PaymentOperationResponse>`

### `captureAuthorization(paymentId)`

* **Endpoint:** `POST /payments/payment/{id}/capture`
* **Returns:** `Promise<PaymentOperationResponse>`

### `captureAuthorizationPartial(paymentId, request)`

* **Endpoint:** `POST /payments/payment/{id}/capture`
* **Returns:** `Promise<PaymentOperationResponse>`

### `voidAuthorization(paymentId)`

* **Endpoint:** `POST /payments/payment/{id}/void-authorization`
* **Returns:** `Promise<PaymentOperationResponse>`

## Cards

### `getCardDetails(cardId)`

* **Endpoint:** `GET /payments/cards/{card_id}`
* **Returns:** `Promise<CardDetailsResponse>`

### `deleteCard(cardId)`

* **Endpoint:** `DELETE /payments/cards/{card_id}`
* **Returns:** `Promise<void>`
* **Expected status:** `204 No Content`

## Payment methods

### `getPaymentInstruments(goid, currency)`

* **Endpoint:** `GET /eshops/eshop/{goid}/payment-instruments/{currency}`
* **Returns:** `Promise<PaymentInstrumentsResponse>`

### `getPaymentInstrumentsAll(goid)`

* **Endpoint:** `GET /eshops/eshop/{goid}/payment-instruments`
* **Returns:** `Promise<PaymentInstrumentsAllResponse>`

## Account statements

### `getAccountStatement(request)`

* **Endpoint:** `POST /accounts/account-statement`
* **Returns:** `Promise<AccountStatementResponse>`
* **Response shape:**

```ts theme={null}
type AccountStatementResponse = {
  data: ArrayBuffer;
  contentType: string | null;
  contentDisposition: string | null;
  toText(encoding?: string): string;
};
```

## Utility

### `getEmbedJsUrl()`

* Returns embed script URL for the configured gateway:
  * sandbox -> `https://gw.sandbox.gopay.com/gp-gw/js/embed.js`
  * production -> `https://gate.gopay.cz/gp-gw/js/embed.js`
