{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-products/hosted-checkout/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["admonition"]},"type":"markdown"},"seo":{"title":"iOS SDK Reference","description":"Official Banxa API documentation – on-ramp and off-ramp transfers with identity verification and compliance.","llmstxt":{"title":"Banxa Developer Documentation","description":"Integrate crypto-fiat exchange with Banxa's licensed infrastructure: payments, KYC, compliance, and settlement handled. 150+ countries, 45 global licences.","details":{"content":"Two integration products: **Banxa Native API** for partners who manage their own KYC and want full UX control (headless, HMAC server-to-server, no Banxa-hosted screens); **Banxa Hosted Checkout** for partners who want Banxa to handle KYC and payments (three paths: Referral URL, API, or React Native SDK). Both use the same sandbox and production environments at `https://api.banxa-sandbox.com` and `https://api.banxa.com`.\n\n## Constraints\n\n- **Authentication**: HMAC credentials must be stored server-side only, never expose in frontend, mobile, or client-side code. HMAC is required for all Native API calls and for KYC sharing in Hosted Checkout; `x-api-key` is used for all other Hosted Checkout endpoints.\n- **`externalCustomerId`**: Required on every buy and sell order. Use a stable opaque identifier, never PII.\n- **`identityReference`**: Must remain constant for the same user across all requests. Must not contain PII. If you attempt to create an identity for an email that already exists, you will receive a 422 / code 81, so retrieve the existing record rather than retrying creation. Use `GET /eapi/v0/identities/{identityReference}?email=user@example.com` to look up the real `identityReference` linked to an email.\n- **`quoteId`**: Only supported by `POST /eapi/v0/ramps` (bank transfer). The React Native SDK and Embedded Payment Button do not accept a `quoteId`, so use indicative pricing (`GET /eapi/v0/price`) for SDK and Embedded Payment Button flows.\n- **Quotes**: Indicative prices are not rate-locked, so refresh close to order creation to minimise rate drift. Locked quotes (`GET /eapi/v0/quote`) expire after approximately 3 minutes and are only valid for bank transfer ramp creation.\n- **Eligibility gate**: Never create a ramp or invoke the SDK when `paymentReady` is `false`. Always check eligibility and satisfy all requirements before payment execution.\n- **Webhooks**: Verify all inbound webhook signatures with HMAC-SHA256 before processing. Return HTTP 200 immediately and process asynchronously.\n- **Product selection**: Banxa Native is for partners who manage their own KYC. Banxa Hosted Checkout is for partners who do not do KYC. These are separate products with separate flows: do not mix endpoints across products.\n- **SDK scope**: The React Native SDK has no `banxa.customerIdentity` module. Identity and KYC are handled through the Native API only. `primerCallbacks` and `primerSettings` are Native context only and must not be referenced in Hosted Checkout integrations.\n- **Payment method naming**: Never use \"eAPI\" or \"EAPI\" as a product name. The correct name is \"Banxa Native API\". The URL path prefix `/eapi/` is correct and should not be changed.\n"}}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"ios-sdk-reference","__idx":0},"children":["iOS SDK Reference"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The Banxa iOS SDK (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["BanxaPaymentSDK"]},") is a headless Swift interface to Banxa Hosted Checkout for native iOS apps. You configure it once and start a payment with a single call. The SDK checks eligibility, creates the order, presents checkout, and reports the outcome on a delegate."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For the end-to-end walkthrough, see the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/hosted-checkout/docs/sdk-integration/ios-sdk-guide"},"children":["iOS SDK Integration Guide"]},"."]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"requirements","__idx":1},"children":["Requirements"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Requirement"},"children":["Requirement"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Version"},"children":["Version"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["iOS"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["13.1 and above"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Xcode"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["16 and above"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Swift"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["6.0 and above"]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The public surface is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["@MainActor"]}," isolated and built on Swift concurrency."]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"installation","__idx":2},"children":["Installation"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"swift-package-manager","__idx":3},"children":["Swift Package Manager"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"dependencies: [\n    .package(url: \"https://github.com/BanxaOfficial/ios-payment-sdk\", from: \"1.0.0\")\n]\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":".target(\n    name: \"YourApp\",\n    dependencies: [\n        .product(name: \"BanxaPaymentSDK\", package: \"ios-payment-sdk\")\n    ]\n)\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"through-xcode","__idx":4},"children":["Through Xcode"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["File, Add Package Dependencies"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Enter the repository URL."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["BanxaPaymentSDK"]}," and add it to your app target."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The SDK transitively pulls in the payment provider SDK. You do not import or reference it directly."]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"configuration","__idx":5},"children":["Configuration"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"import BanxaPaymentSDK\n\nlet config = BanxaConfig(\n    apiKey: \"YOUR_API_KEY\",\n    partnerID: \"your-partner-id\",\n    environment: .sandbox\n)\n\nBanxaPaymentSDK.shared.configure(config: config)\nBanxaPaymentSDK.shared.delegate = self\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"banxaconfig","__idx":6},"children":["BanxaConfig"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Field"},"children":["Field"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Required"},"children":["Required"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["apiKey"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Yes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Your v2 API key from the merchant dashboard."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["partnerID"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Yes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Your partner identifier."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["environment"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Environment"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Yes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":[".sandbox"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":[".production"]},"."]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Requests use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["x-api-key"]}," authentication."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"environments","__idx":7},"children":["Environments"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Environment"},"children":["Environment"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Host"},"children":["Host"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":[".sandbox"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["https://api.banxa-sandbox.com"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":[".production"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["https://api.banxa.com"]}]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The effective base URL is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["<host>/{partnerID}/v2"]},". Sandbox and production credentials are separate and are not interchangeable."]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"startpayment","__idx":8},"children":["startPayment"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"BanxaPaymentSDK.shared.startPayment(request: request, controller: self)\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Parameter"},"children":["Parameter"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["request"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["A ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["CreateOrderRequest"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["controller"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["UIViewController"]}," that hosts the checkout presentation."]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["startPayment"]}," creates the order and presents checkout in a single call. It returns nothing: results arrive on the delegate. Call it when the customer confirms, not in advance, because Banxa checkout must be loaded within one minute of order creation."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Requires a prior ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["configure(config:)"]}," call. Otherwise it fails with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["APIError.sdkNotConfigured"]},"."]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"banxapaymentsdkdelegate","__idx":9},"children":["BanxaPaymentSDKDelegate"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Three methods, each with a default no-op implementation. All callbacks are delivered on the main actor. All callback types are Banxa-owned: you never import or reference the underlying payment provider SDK."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"extension MyViewController: BanxaPaymentSDKDelegate {\n\n    func banxaDidCompleteCheckout(_ result: BanxaCheckoutResult) { }\n\n    func banxaDidFail(error: Error) { }\n\n    func banxaDidDismiss() { }\n}\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Method"},"children":["Method"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Fires when"},"children":["Fires when"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["banxaDidCompleteCheckout(_:)"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The customer completed payment."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["banxaDidFail(error:)"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Any Banxa, network, validation, or checkout failure. Banxa-originated failures are ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["APIError"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["banxaDidDismiss()"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The customer closed checkout without completing."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"banxacheckoutresult","__idx":10},"children":["BanxaCheckoutResult"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Field"},"children":["Field"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Populated when"},"children":["Populated when"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["paymentId"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The native payment sheet was used."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["orderId"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The native payment sheet was used."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["status"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The native payment sheet was used."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["rawQuery"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Banxa checkout was used. Contains the terminal success URL query string."]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The success callback is a UI signal, not the authoritative order state. Confirm the final state from ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/hosted-checkout/docs/transaction-lifecycle/webhooks"},"children":["webhooks"]}," or ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/hosted-checkout/docs/transaction-lifecycle/order-lookup"},"children":["Order Lookup"]}," before you credit a customer."]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"models","__idx":11},"children":["Models"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"createorderrequest","__idx":12},"children":["CreateOrderRequest"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Field"},"children":["Field"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Required"},"children":["Required"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["crypto"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Yes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Crypto asset symbol, for example ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ETH"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["fiat"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Yes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Fiat currency code, for example ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["EUR"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["fiatAmount"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Yes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Fiat amount as a string."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["paymentMethodID"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String?"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Yes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Banxa payment method id, for example ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["debit-credit-card"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["walletAddress"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Yes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Destination wallet address."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["email"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Yes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Customer email address."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["redirectURL"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Yes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["URL Banxa redirects to after checkout."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["id"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String?"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Your order id."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["blockchain"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String?"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Explicit blockchain network."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cryptoAmount"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String?"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Crypto amount when ordering by crypto value."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["walletAddressTag"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String?"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Tag or memo for chains that require it."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["subPartnerID"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String?"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Sub-partner identifier."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["metadata"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String?"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Opaque metadata string."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["externalCustomerID"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String?"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Your stable customer identifier."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["externalOrderID"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String?"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Your order reference."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["discountCode"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String?"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Promotion or discount code."]}]}]}]}]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"warning","name":"paymentMethodID is optional in the type, required in practice"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["paymentMethodID"]}," is declared as an optional in the Swift signature, but Banxa requires a value. Omitting it fails at payment execution rather than at compile time, so the compiler will not catch it for you. Always pass an id returned by ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["fetchPaymentMethods"]},"."]}]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"warning","name":"A missing memo can permanently lose funds"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["XRP, XLM, EOS, and ATOM require a memo or tag. Pass it as ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["walletAddressTag"]},". An order to one of these chains without the memo can be unrecoverable."]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"configuration-endpoints","__idx":13},"children":["Configuration endpoints"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["All configuration calls are ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["async throws"]}," and require a configured SDK with non-blank credentials."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"countries","__idx":14},"children":["Countries"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET /{partnerID}/v2/countries"]},". The list is the same for buy and sell."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"let countries = try await BanxaPaymentSDK.shared.fetchCountries()\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Fields"},"children":["Fields"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Country"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["id"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["description"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["states: [CountryState]?"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["CountryState"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["id"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["description"]}]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"fiats","__idx":15},"children":["Fiats"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET /{partnerID}/v2/fiats/{orderType}"]},"."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"let fiats = try await BanxaPaymentSDK.shared.fetchFiats(orderType: .buy)\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Fields"},"children":["Fields"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["OrderType"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":[".buy"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":[".sell"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Fiat"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["id"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["description?"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["symbol?"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["supportedPaymentMethods: [FiatPaymentMethod]?"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["FiatPaymentMethod"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["id"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["name?"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["minimum?"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["maximum?"]}]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"crypto","__idx":16},"children":["Crypto"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET /{partnerID}/v2/crypto/{orderType}"]},"."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"let assets = try await BanxaPaymentSDK.shared.fetchCrypto(orderType: .buy)\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Fields"},"children":["Fields"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Cryptocurrency"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["id"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["description?"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["blockchains: [CryptoBlockchain]?"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["CryptoBlockchain"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["id"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["description?"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["isDefaultBlockchain?"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["address?"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["network?"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["minimum?"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["unsupportedCountries: [String: [String]]?"]}]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["unsupportedCountries"]},", the key is a country code and the value is the restricted state codes. An empty list means the whole country is restricted."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"payment-methods","__idx":17},"children":["Payment methods"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET /{partnerID}/v2/payment-methods/{orderType}"]},". Optionally filter by fiat."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"let methods = try await BanxaPaymentSDK.shared.fetchPaymentMethods(orderType: .buy)\nlet usdOnly = try await BanxaPaymentSDK.shared.fetchPaymentMethods(orderType: .buy, fiat: \"USD\")\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Fields"},"children":["Fields"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PaymentMethod"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["id"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["name?"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["description?"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["supportedFiats: [String]?"]}]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"quotes","__idx":18},"children":["Quotes"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET /{partnerID}/v2/quotes/{orderType}"]},". Do not cache: call immediately before showing a price."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"let request = QuoteRequest(\n    paymentMethodID: \"debit-credit-card\",\n    crypto: \"ETH\",\n    blockchain: \"ETH\",\n    fiat: \"USD\",\n    fiatAmount: \"200\"\n)\nlet quotes = try await BanxaPaymentSDK.shared.fetchQuotes(orderType: .buy, request: request)\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Fields"},"children":["Fields"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["QuoteRequest"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["paymentMethodID"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["crypto"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["blockchain"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["fiat"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["fiatAmount?"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cryptoAmount?"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["externalCustomerID?"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ipAddress?"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["discountCode?"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Quote"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["paymentMethodID?"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cryptoAmount?"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["fiatAmount?"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["processingFee?"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["networkFee?"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["discount: QuoteDiscount?"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["QuoteDiscount"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["originalQuote: QuoteOriginalAmounts?"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["discountCode?"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["QuoteOriginalAmounts"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["originalCryptoAmount?"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["originalNetworkFee?"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["originalProcessingFee?"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["originalFiatAmount?"]}]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Provide either ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["fiatAmount"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cryptoAmount"]},". If both are set, Banxa uses ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cryptoAmount"]},". Banxa may return a single object or an array when discount codes apply, and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["fetchQuotes"]}," always returns ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["[Quote]"]},"."]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"error-handling","__idx":19},"children":["Error handling"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Failures are surfaced through ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["banxaDidFail(error:)"]}," as ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["APIError"]},". Each case provides a human-readable ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["errorDescription"]},"."]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Case"},"children":["Case"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Meaning"},"children":["Meaning"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":[".invalidURL"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The endpoint URL could not be built."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":[".serverError(Int)"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Non-2xx HTTP response."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":[".unauthorized"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["401"]}," from Banxa. Check ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["apiKey"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":[".decodingFailed(String)"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The response payload failed to decode."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":[".networkUnavailable"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No network connectivity."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":[".missingCredentials([String])"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["apiKey"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["partnerID"]}," was blank in ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["BanxaConfig"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":[".sdkNotConfigured"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["startPayment"]}," was called before ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["configure(config:)"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":[".unknown(String)"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Any other unexpected error."]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Show user-facing messages only from validated error fields. Do not expose raw error strings that may include internal detail."]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"url-scheme","__idx":20},"children":["URL scheme"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Register a URL scheme in your ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Info.plist"]}," and use it for ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["redirectURL"]}," on ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["CreateOrderRequest"]},". This covers 3D Secure returns and the checkout return."]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"not-available-in-the-sdk","__idx":21},"children":["Not available in the SDK"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Capability"},"children":["Capability"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Reason"},"children":["Reason"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Alternative"},"children":["Alternative"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Order lookup by id or customer"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Not exposed"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/hosted-checkout/docs/transaction-lifecycle/order-lookup"},"children":["Order Lookup"]}," via the API"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Full order list across all customers"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Not exposed"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET /{partnerRef}/v2/orders"]}," via ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/hosted-checkout/docs/api-integration/api-integration-overview"},"children":["API integration"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["KYC data sharing (Sumsub token share)"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Requires HMAC authentication, which the SDK does not use"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/hosted-checkout/docs/identity-compliance/kyc-sharing"},"children":["KYC Sharing"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Off-ramp (sell) orders"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The SDK covers buy orders only"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/hosted-checkout/docs/api-integration/create-sell-order"},"children":["Create Sell Order"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Payment sheet theming"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Not exposed on iOS"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Available on Android. See ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/hosted-checkout/docs/sdk-integration/android-sdk-reference"},"children":["Android SDK Reference"]}]}]}]}]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"example","__idx":22},"children":["Example"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"import SwiftUI\nimport BanxaPaymentSDK\n\n@main\nstruct DemoApp: App {\n\n    init() {\n        let config = BanxaConfig(\n            apiKey: ProcessInfo.processInfo.environment[\"BANXA_API_KEY\"] ?? \"\",\n            partnerID: \"your-partner-id\",\n            environment: .sandbox\n        )\n        BanxaPaymentSDK.shared.configure(config: config)\n    }\n\n    var body: some Scene {\n        WindowGroup { ContentView() }\n    }\n}\n\nfinal class CheckoutCoordinator: NSObject, BanxaPaymentSDKDelegate {\n\n    override init() {\n        super.init()\n        BanxaPaymentSDK.shared.delegate = self\n    }\n\n    func buy(from controller: UIViewController) {\n        let request = CreateOrderRequest(\n            crypto: \"ETH\",\n            fiat: \"EUR\",\n            fiatAmount: \"40\",\n            walletAddress: \"0x0000000000000000000000000000000000000000\",\n            email: \"user@example.com\",\n            redirectURL: \"your-app-scheme://banxa-return\",\n            paymentMethodID: \"debit-credit-card\"\n        )\n        BanxaPaymentSDK.shared.startPayment(request: request, controller: controller)\n    }\n\n    func banxaDidCompleteCheckout(_ result: BanxaCheckoutResult) {\n        print(\"Payment complete:\", result.paymentId ?? result.rawQuery ?? \"-\")\n    }\n\n    func banxaDidFail(error: Error) {\n        print(\"Payment failed:\", error.localizedDescription)\n    }\n\n    func banxaDidDismiss() {\n        print(\"Customer dismissed checkout\")\n    }\n}\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"payment-methods-and-supported-fiats","__idx":23},"children":["Payment methods and supported fiats"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Availability varies by partner, region, and order type. Treat ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["fetchPaymentMethods"]}," as the source of truth. The table below is a static reference."]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Payment method id"},"children":["Payment method id"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Supported fiats"},"children":["Supported fiats"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["debit-credit-card"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["AED"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ARS"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["AUD"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["BRL"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["CAD"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["CHF"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["CZK"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["DKK"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["EUR"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GBP"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["HKD"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["IDR"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["INR"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["JPY"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["KRW"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["MXN"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["MYR"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["NGN"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["NOK"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["NZD"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PHP"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PLN"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["QAR"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["RUB"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SAR"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SEK"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SGD"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["THB"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["TRY"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["TWD"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["USD"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["VND"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ZAR"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["apple-pay"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["AUD"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["EUR"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GBP"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["USD"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["google-pay"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["AUD"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["EUR"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["USD"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["payid-bank-transfer"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["AUD"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["pix"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["BRL"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["zar-bank-transfer"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ZAR"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["pse"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["COP"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["khipu"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["CLP"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["interac-bank-transfer"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["CAD"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["klarna-paynow"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["EUR"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ideal-bank-transfer"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["AUD"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["EUR"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sepa-bank-transfer"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["EUR"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["gbp-bank-transfer"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GBP"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["spei"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["MXN"]}]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For the full list, see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/hosted-checkout/docs/reference/supported-payment-methods"},"children":["Supported Payment Methods"]},"."]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"next-steps","__idx":24},"children":["Next steps"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/hosted-checkout/docs/sdk-integration/ios-sdk-guide"},"children":["iOS SDK Integration Guide"]},": end-to-end walkthrough."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/hosted-checkout/docs/transaction-lifecycle/webhooks"},"children":["Webhooks"]},": configure webhook notifications."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/hosted-checkout/docs/transaction-lifecycle/order-statuses"},"children":["Order Statuses"]},": full status reference."]}]}]},"headings":[{"value":"iOS SDK Reference","id":"ios-sdk-reference","depth":1},{"value":"Requirements","id":"requirements","depth":2},{"value":"Installation","id":"installation","depth":2},{"value":"Swift Package Manager","id":"swift-package-manager","depth":3},{"value":"Through Xcode","id":"through-xcode","depth":3},{"value":"Configuration","id":"configuration","depth":2},{"value":"BanxaConfig","id":"banxaconfig","depth":3},{"value":"Environments","id":"environments","depth":3},{"value":"startPayment","id":"startpayment","depth":2},{"value":"BanxaPaymentSDKDelegate","id":"banxapaymentsdkdelegate","depth":2},{"value":"BanxaCheckoutResult","id":"banxacheckoutresult","depth":3},{"value":"Models","id":"models","depth":2},{"value":"CreateOrderRequest","id":"createorderrequest","depth":3},{"value":"Configuration endpoints","id":"configuration-endpoints","depth":2},{"value":"Countries","id":"countries","depth":3},{"value":"Fiats","id":"fiats","depth":3},{"value":"Crypto","id":"crypto","depth":3},{"value":"Payment methods","id":"payment-methods","depth":3},{"value":"Quotes","id":"quotes","depth":3},{"value":"Error handling","id":"error-handling","depth":2},{"value":"URL scheme","id":"url-scheme","depth":2},{"value":"Not available in the SDK","id":"not-available-in-the-sdk","depth":2},{"value":"Example","id":"example","depth":2},{"value":"Payment methods and supported fiats","id":"payment-methods-and-supported-fiats","depth":2},{"value":"Next steps","id":"next-steps","depth":2}],"frontmatter":{"title":"iOS SDK Reference | Banxa Docs","description":"Complete reference for the Banxa iOS SDK: configuration, starting a payment, delegate callbacks, configuration endpoints, models, and error handling.","seo":{"title":"iOS SDK Reference"}},"lastModified":"2026-08-12T00:56:59.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/products/hosted-checkout/docs/sdk-integration/ios-sdk-reference","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}