ParaSwift exposes methods on ParaManager, ParaHeadlessOnRampCheckout (with the optional ParaSwiftMeld module), and an onRampEvents AsyncStream for hosted provider checkouts, headless Coinbase Apple Pay orders, headless Brale ACH bank transfers, and routed headless card and Apple Pay checkouts.
Providers, enabled networks, allowed assets, Apple Pay domains, and Brale Plaid mobile OAuth settings are configured per API key in the Developer Portal. Set those up first in Set Up Fiat Onramps.
Discover Providers and Assets
Read your key’s configuration and catalog items before rendering buy or sell options.getOnRampConfig returns feature flags, your default asset, and inline Apple Pay providers enabled for your key, while getOnRampCatalog returns paginated asset implementations and provider limits.
RampCatalog.swift
Hosted Checkout (Buy and Off-Ramp)
Hosted checkout supports card and bank orders across Stripe, MoonPay, Ramp Network, Coinbase (Widget), Transak, and Banxa, as well as off-ramp sales (SELL) for supported providers. Create an order with createHostedOnRampOrder, launch the returned portal URL with launchOnRampPortal (backed by ASWebAuthenticationSession), and inspect the flat order state with getOnRampOrder.
- Buy (On-Ramp)
- Sell (Off-Ramp)
Create a
.buy order for a provider supporting isBuy, launch the hosted portal, and inspect the flat order when control returns to your app.HostedBuy.swift
Initialize
ParaManager(environment:apiKey:appScheme:) with your registered custom URL scheme (or rely on the bundle identifier fallback) so launchOnRampPortal can return to your app automatically. When running an off-ramp (type: .sell), broadcast the seller’s deposit via sendOffRampDeposit whenever callback.rawStatus == "deposit_required" and orderResult.pendingDeposit is present.Coinbase Apple Pay (Headless, iOS)
Coinbase headless guest checkout displays a native Apple Pay payment page inside aWKWebView hosted on your verified merchant domain.
Method Sequence
- Optionally call
checkCoinbaseOnrampLimits(_:)andcreateCoinbaseOnrampLimitUpgrade(_:)to check guest checkout limits and openupgradeUrlin a browser orWKWebViewwhenlimits.upgradeable == trueand remaining capacity is below the order amount. - Call
createCoinbaseOnrampOrder(_:)withisQuote: trueto fetch a quote, then withisQuote: false(ornil) to create the order and receivepaymentLink.urlandpurchaseId. - Load
paymentLink.urlin aWKWebViewso the user can authorize Apple Pay, parsing WebView events withParaManager.parseCoinbaseApplePayEvent(_:origin:allowedOrigins:). - Call
settleCoinbaseOnrampPurchase(purchaseId:walletId:)after payment completes (onramp_api.polling_successoronramp_api.commit_success) or on dismissal to confirm settlement (server-side settlement is idempotent and queries Coinbase directly).
CoinbaseApplePay.swift
userPhoneNumber and userEmail are placeholders for the buyer’s verified contact details. In production, the server validates both against the user’s verified Para records. Listen for onramp_api.polling_success or onramp_api.commit_success with ParaManager.parseCoinbaseApplePayEvent(_:origin:allowedOrigins:) and call settleCoinbaseOnrampPurchase after payment completes (server-side settlement is idempotent and queries Coinbase directly, so calling on dismissal is also safe).Order States and Partner Events
- Order states: Real orders track through
ParaOnRampPurchaseStatuscases.initiated,.finished,.cancelled,.failed, or.unknown(String). Quotes (isQuote: true) do not persist an order row. - Partner events:
paraManager.onRampEventsyields.launched(ParaOnRampEventPayload)whencreateCoinbaseOnrampOrdercreates a real order and.completed(ParaOnRampEventPayload)whensettleCoinbaseOnrampPurchaseconfirms.finished. Server webhooks emitonramp.completedandonramp.cancelled.
When
domain is omitted on iOS, Para uses the first allowlisted Apple Pay domain configured on your API key in the Developer Portal. On non-production API keys, orders run in Coinbase sandbox mode (?useApplePaySandbox=true) and simulate immediate settlement.Brale ACH (Pay by Bank, Headless)
Brale ACH lets U.S. users fund an EVM or Solana wallet from a bank account using Plaid Link iOS (LinkKit) and ParaManager’s Brale checkout methods. createBraleAchCheckout(_:) sets platform to "ios" automatically when you leave it nil.
Method Sequence
- Call
createBraleAchCheckout(_:)withwalletIdandamountUsd(plus optionalcustomer: ParaBraleAchCustomer(legalName:)andassetImplementationId). - Inspect
checkout.nextAction:"launch_plaid": Open Plaid Link iOS usingcheckout.plaidLinkToken, then calllinkBraleAchBank(checkoutId:publicToken:)."confirm_deposit": Showcheckout.savedBank.
- Call
getBraleAchAuthorization(amountLabel:bankLabel:)and display the returnedtextto the user before requesting consent. - Call
submitBraleAchDeposit(checkoutId:authorizationTextVersion:)to authorize the debit and launch the order. - Check progress with
getBraleAchCheckout(checkoutId:)orlistBraleAchTransfers().
BraleAchFlow.swift
Order States and Partner Events
- Checkout stages and
nextAction: A checkout transitions acrossstage"link_required"(nextAction:"launch_plaid"),"linked"(nextAction:"confirm_deposit"), and"submitted"(nextAction:"wait"). - Brale transfer and order states:
braleStatusreports"pending","compliance review","processing","complete","canceled","failed","refunding", or"refunded". Transfers in"compliance review"keep the checkout (stage:"submitted",nextAction:"wait") and order (.initiated) open until settled.finishedor failed.cancelled. - Partner events:
paraManager.onRampEventsyields.launched(ParaOnRampEventPayload)whensubmitBraleAchDepositruns. ACH settlement takes 1 to 3 business days and.completeddoes not emit over the bridge stream; listen foronramp.completedon your backend instead.
Headless Card, Apple Pay & Reusable KYC
UseParaHeadlessOnRampCheckout (ObservableObject) with the optional ParaSwiftMeld Swift Package library product (ParaHeadlessOnRampPaymentView, linked in Xcode alongside ParaSwift when needed) to run routed headless card and Apple Pay checkouts in SwiftUI. Keeping ParaSwiftMeld separate ensures apps that only use hosted or Brale/Coinbase flows do not link Meld’s native payment dependencies. Headless card and Apple Pay orders are currently fulfilled through .banxa; pass applePay: ParaHeadlessOnRampApplePayRequest(...) when presenting an .applePay order. Pair getKycStatus(), createKycSession(), and shareKyc(_:) (for .banxa or .transak) when checkout.step == .verificationRequired.
HeadlessCheckoutView.swift
createHeadlessOnRampOrder does not emit .launched or .completed on paraManager.onRampEvents. ParaHeadlessOnRampCheckout polls getOnRampOrder after submission, and server webhooks (onramp.completed and onramp.cancelled) remain authoritative.
Listen for SDK Events and Test Mode
ConsumeparaManager.onRampEvents in a background Task to react to lifecycle transitions emitted by the SDK. Both .launched and .completed deliver a ParaOnRampEventPayload aligned with the onramp.completed webhook payload.
RampEvents.swift
Test mode is controlled by your API key’s environment (Beta runs in test mode; production rejects
testMode: true). In test mode, Brale ACH orders deliver SBC on Sepolia, Base Sepolia, Avalanche Fuji, or Solana Devnet (Optimism has no ACH test network), and Coinbase Apple Pay orders simulate settlement immediately.