Skip to main content

SDKs introduction

Swirepay SDK documentation is split the same way as the rest of the platform: Payment Center (money you receive) and Transfer Center (payables, contacts, and payouts). Start here to choose a surface, then follow the pages in the sidebar.

Three custom elements are available today:

  • <swirepay-checkout> (Payment Center) — hosts every payment method your checkout session allows—Card, Pay by Bank (ACH), Apple Pay, Google Pay, and PayPal—inside a PCI-isolated iframe.
  • <swirepay-contact-onboarding> (Transfer Center) — collects a customer's contact details, address, and a linked bank account.
  • <swirepay-transfer-center> (Transfer Center) — moves money from an account to a fixed recipient contact.

How the web SDK fits in

Every element follows the same two-sided shape:

  1. Your backend calls POST /v3/checkout-session with your secret key and a scope specific to the element you're integrating (payment/order for <swirepay-checkout>, transfer for the other two), and gets back a secure token (entity.encryption).
  2. Your frontend mounts the element, sets secureToken (and other props) as JavaScript properties, and registers successCallback / errorCallback.

What the mint response identifies beyond the token differs by element: <swirepay-checkout> also returns a paymentSessionGid, <swirepay-transfer-center> a transferSessionGid — both worth recording so you can reconcile the result later. <swirepay-contact-onboarding> returns no session id at all; there's no ongoing session to track. Which payment methods appear in <swirepay-checkout> is controlled by the paymentType array on its checkout session, not by mounting separate components. See each element's own SDK setup & flow page (linked below) for its exact props, mount flow, and payload shapes.

successCallback is a best-effort, client-side signal for <swirepay-checkout> and <swirepay-transfer-center> — configure a webhook in the merchant dashboard and treat server-to-server events as the source of truth when you mark a payment or transfer as settled. <swirepay-contact-onboarding> has no equivalent webhook: it has no ongoing status to reconcile after the fact, since successCallback firing already means the contact/funding-source records were created.

Payment Center

Payment Center SDK guides cover inbound checkout—the payments your customers make.

Supported methods in the web SDK:

  • Card — card number, expiry, CVC, billing address, and saved-card flows
  • ACH — Pay by Bank via Plaid, including ACH transfer types
  • Apple Pay — Apple Pay express button and payment sheet
  • PayPal — PayPal popup / redirect checkout
  • Google Pay — Google Pay express button and payment sheet

Start with SDK setup & flow →

Transfer Center

Transfer Center SDK guides cover outbound money movement and the contacts you send it to. Two elements are available:

  • Contact Onboarding<swirepay-contact-onboarding> collects a customer's contact details, address, and a linked bank account (via Plaid for US, manual routing details for India)
  • Swirepay Transfer Center<swirepay-transfer-center> moves money from an account to a fixed recipient contact, including sender-scoped transfers with OTP confirmation

Vendor bills, internal transfers, and notifications are not yet covered by the SDK — use the Transfer Center API guides for those REST flows.