OleqPay Docs
Checkout

API reference

Types and exports for @oleq-ai/pay.

@oleq-ai/pay

import {
  OleqPayCheckout,
  OleqPayCheckoutError,
  type CheckoutPayload,
  type CheckoutEvent,
  type OleqPayCheckoutOptions,
  type OpenOptions,
  type OleqPayCheckoutErrorCode,
} from '@oleq-ai/pay';

CheckoutPayload

FieldRequiredNotes
apikeyyesPublic key only (≥10 chars, not sk_…)
amountyesNumber or numeric string, must be > 0
orderidyesString or number
referenceyesNon-empty string
callbackurlnoMust be a valid URL when set
returnurlnoMust be a valid URL when set

OpenOptions

{
  onSuccess?: (event: { type: 'oleqpay:success'; vreference: string; amount?: string }) => void;
  onError?: (event: { type: 'oleqpay:failed'; vreference?: string; message?: string }) => void;
  onClose?: () => void;
}

@oleq-ai/pay/react

import {
  useOleqPayCheckout,
  type UseOleqPayCheckoutOptions,
  type OleqPayCheckoutResult,
} from '@oleq-ai/pay/react';

@oleq-ai/pay/nest

import {
  OleqPayCheckoutModule,
  createOleqPayCheckout,
  OLEQPAY_CHECKOUT_OPTIONS,
  type OleqPayCheckoutModuleOptions,
  type OleqPayCheckoutModuleAsyncOptions,
} from '@oleq-ai/pay/nest';

On this page