Прескокни до содржината

SDK API референца

Објавено издание: SDK 0.1.3 е јавно достапен на npm. Инсталацијата не активира серверски функции.

Јавно достапната верзија 0.1.3 ги опфаќа: @kordiva/sdk, @kordiva/checkout и @kordiva/react. Користете @kordiva/sdk во Node серверски код за овластени Store API повици; двата прелистувачки помошника не даваат платежно овластување или Store API пристап.

Сите патеки се од конфигурираниот API origin. SDK го враќа data и фрла исчистен KordivaError при неуспех.

МетодАдресаРезултат
products.list(query?, options?)GET /public/catalog/stores/:storeId/productsProductPage: items, total, limit, offset
products.get(productId, options?)GET иста основа /products/:productIdProduct
categories.list(options?)GET иста основа /categoriesCategoryDetail[]
attributes.list(options?)GET иста основа /attributesAttribute[]
shippingMethods.list(options?)GET иста основа /shipping-methodsShippingMethod[], Business употреба
checkout.createHosted(input, options?)POST иста основа /checkout-sessionsLIVE CheckoutSession
checkout.createTest(input, options?)POST иста основа /test-checkoutTEST { environment, url }
payments.confirm(query, options?)GET иста основа /payment-confirmationsLIVE PaymentConfirmation
subscriptions.get(id, options?)GET /business/v1/stores/:storeId/subscriptions/:idBusinessSubscription
subscriptions.list(query?, options?)GET /business/v1/stores/:storeId/subscriptionsSubscriptionPage
checkout.createSubscription(input, options?)POST /business/v1/stores/:storeId/subscription-checkoutsLIVE Business SubscriptionCheckout

HostedCheckoutInput бара 1–50 lineItems и idempotencyKey од 8–128 знаци. Секоја ставка бара UUID и целобројна количина 1–50; UUID на варијанта е изборен. Изборни полиња: checkoutLanguage (mk/en), orderRef, customerRef (1–128 знаци), HTTPS successUrl/returnUrl, expiresInMinutes (5–120, серверски стандард 30).

Потврда бара барем session UUID, orderRef или idempotencyKey. Претпочитајте session UUID. Статуси се paid, pending, expired; читајте isPaid и одделете подобност за исполнување. Повторен одговор може да нема orderRef/customerRef: тие се изборни во SDK типот.

RequestOptions прифаќа signal. Прелистувачкиот пакет дава checkoutHref(handoff, allowedOrigins, options?) и redirectToCheckout(handoff, allowedOrigins, navigate?, options?). CheckoutButton прима onCheckout, allowedOrigins, onError и изборни children/pendingLabel/disabled/className/navigate/checkoutOptions. Нема јавен метод за клучеви, рефундации или исплати.

Поврзани водичи

Дел „Поврзани водичи“

SDK · Checkout · Безбедност · API

subscriptions.get/list are store/environment-scoped reads; checkout.createSubscription creates a LIVE recurring checkout from a CMS recurring Checkout Link. No public subscription change/cancel or refund mutation is exported. Subscription amounts are integer minor units with uppercase ISO currency, separate from catalog decimals. See filters, identity and checkout inputs.

@kordiva/sdk/merchant-webhooks exports verifyMerchantWebhook for Business HMAC lifecycle events; @kordiva/sdk/webhooks remains the separate P-256 agentic order verifier. See Business events and raw-body verification. Business refunds use supported merchant controls, not an SDK refund method.