SDK Reference
Load (with version pinning):
<script src="https://app.payshare.nz/api/integration-sdk?id=YOUR_INTEGRATION_ID&v=v1.0.0"></script>
Omit &v=v1.0.0 to use latest (not recommended for production).
PayShare.init(config)
integrationId(string, required) — From PayShare Admin.- Other options (e.g. branding) — See Admin / integration config.
PayShare.open(options)
amount(number, required) — Total to split (from your checkout).currency(string, optional) — DefaultNZD.orderId/metadata(optional) — Your order reference.successUrl/cancelUrl(optional) — Override redirects if allowed.
Returns a Promise (resolve on success; reject on cancel/error). Use for "Pay with PayShare" buttons; pass the cart/order total as amount.
Important: Session creation for the hosted redirect flow is via API (POST /api/v1/payments/sessions), not only via the SDK. The SDK is for opening the flow with a given amount (and optional modal/popup behaviour where supported).
Version: PayShare.version, PayShare.apiVersion (e.g. v1.0.0, v1).
See: Quickstart · API Reference