FigoAILabs API Documentation
    • Quickstart
    • Website Plugin
    • Mobile Plugin
    • Rate Limits & Pricing
    • FigoAI MCP Server Guide
    • FigoChat SDK
    • Figo Snap and Pay SDK
    • APIs
      • Chat Assistant API
        POST
      • Image Assistant API
        POST
      • Text To Speech API
        POST
      • Speech To Text API
        POST
      • Guardrails API
        POST
      • CV Scoring API
        POST
      • Web Search API
        POST
      • Sentiment Analysis API
        POST
      • Message Context API
        POST
      • Image Analyzer API
        POST
      • Upload Files With OCR
        POST
      • Extract Bank Account From Image
        POST
      • Check Assistant Health
        GET
    • Schemas
      • Sample Schemas
        • Pet
        • Category
        • Tag
      • Schemas
        • ApiKeyRequest
        • Assignee
        • AssistantRequest
        • AssistantTrainingRequest
        • AssistantTrainingRequestByUrl
        • CVScoringRequest
        • Cf
        • Change
        • ChangePasswordRequest
        • ChangePlanRequest
        • ChatRequest
        • ChatUser
        • CompanyEntityCreateRequest
        • CompanyEntityUpdateRequest
        • CompanyPreferenceUpdateRequest
        • ConfirmPasswordRequest
        • Contact
        • CreateUserRequest
        • CustomFields
        • CustomerContact
        • DescAttachment
        • Entry
        • FAQ
        • FBEntry
        • FBMessage
        • FBMessaging
        • FBRecipient
        • FBSendMessage
        • FBSender
        • FacebookReceiveMessageRequest
        • FacebookSendMessageRequest
        • FacebookSetupRequest
        • GoogleSignInRequest
        • GuardrailForAssistantRequest
        • GuardrailRequest
        • HallucinationTrack
        • IGEntry
        • IGMessage
        • IGMessaging
        • IGRecipient
        • IGSendMessage
        • IGSender
        • ImageChatRequest
        • ImageDefaultChatRequest
        • InstagramReceiveMessageRequest
        • InstagramSendMessageRequest
        • InstagramSetupRequest
        • LLMPoolRequest
        • LLMRequest
        • LayoutDetails
        • Message
        • MessageRequest
        • MessageRequestForWebSearch
        • Metadata
        • Payload
        • Profile
        • RefreshTokenRequest
        • RemitaPersonalSignInRequest
        • RemitaSignInRequest
        • RequestOTPRequest
        • ResetPasswordRequest
        • SaveAssistantFAQByTextRequest
        • SaveAssistantFAQByUrlRequest
        • SaveAssistantFAQRequest
        • SaveToolingAgentMapRequest
        • SaveToolingAgentRequest
        • SentimentValidationRequest
        • SignInRequest
        • SignUpRequest
        • TWDirectMessageEvent
        • TWMessageCreate
        • TWMessageData
        • TWTarget
        • TeamsLoginRequest
        • Text
        • TextToSpeechRequest
        • TransactionInitializeRequest
        • TwitterReceiveMessageRequest
        • TwitterSendMessageRequest
        • TwitterSetupRequest
        • UpdateAssistantFAQRequest
        • UpdateUserRequest
        • ValidateOTPRequest
        • Value
        • VerifyEmailRequest
        • WhatsAppReceiveMessageRequest
        • WhatsAppSendMessageRequest
        • WhatsAppSetupRequest
        • ZohoCreateTicketRequest
        • ZohoReceiveMessageRequest
        • ZohoReplyTicketRequest
        • ZohoSetupRequest
      • AssistantHealthResponse
      • FileUploadResponse
      • BankAccountExtractRequest
      • RateLimitResponse
      • BankAccountExtractResult
      • RawFile
      • LLMImage
      • StandardResponse

    Figo Snap and Pay SDK

    Figo Snap & Pay SDK: Integration Guide#

    Figo Snap & Pay opens a camera screen, reads an invoice, receipt or account details, and returns the payment details as JSON:
    {
      "bankCode": "058",
      "accountNumber": "0123456789",
      "amount": "12900.00",
      "narration": "Website redesign",
      "bankName": "GUARANTY TRUST BANK PLC",
      "source": "local",
      "confidence": 1.0,
      "rawText": "…",
      "error": null,
      "modelUsed": true
    }
    Images are read on the device first. If the device can't read them confidently, Figo reads them instead (source: "remote").
    PlatformPackage
    Androidai.figolabs:figo-snap-and-pay
    iOSFigoSnapAndPay (CocoaPods)
    React Native (0.77+, new architecture)@figolabs/figo-snap-and-pay
    Flutterfigo_snap_and_pay

    1. What you need#

    License key (snp-…), issued by Figo.
    Figo key (figoApiKey) from the Figo dashboard, for the same company as the license.
    Devices: Android 8.0+, iOS 15+.
    Optional: a hosted on-device model file (see section 7).

    2. Install#

    Android
    Camera and internet permissions are added for you.
    iOS
    Add NSCameraUsageDescription to Info.plist.
    React Native
    With Expo (development build, not Expo Go), add the plugin to app.json:
    { "expo": { "plugins": [["@figolabs/figo-snap-and-pay", { "cameraPermission": "Scan invoices to pay them." }]] } }
    Flutter
    Add NSCameraUsageDescription to ios/Runner/Info.plist, set platform :ios, '15.0' in the Podfile, and set minSdkVersion 26 on Android.

    3. Initialize#

    Call initialize once, for example after sign-in. It checks the license and returns who it is licensed to. If it fails, don't continue: show the error message.
    Kotlin
    Swift
    React Native
    const license = await FigoSnapAndPay.initialize({ licenseKey, figoApiKey });
    Flutter
    license is { companyName, expiryDate }, with expiryDate like 14-Nov-2026.
    OptionDefaultDescription
    licenseKeyrequiredYour Snap & Pay license key.
    figoApiKeyrequiredYour Figo key.
    modeautoauto: device first, then Figo. localOnly: device only. remoteOnly: Figo only.
    minConfidence0.7Device results below this are sent to Figo (auto mode).
    modelUrl–URL of the on-device model file (section 7).
    modelSha256–Checksum of the model file.
    wifiOnlyDownloadtrueDownload the model only on Wi-Fi.

    4. Scan#

    scan() opens the camera screen and returns the result.
    Kotlin
    Java: use initializeAsync(...) and scanAsync(...), which take a callback.
    Swift
    SwiftUI: FigoSnapCameraScreen { result in … } in a .fullScreenCover.
    React Native
    try {
      const result = await FigoSnapAndPay.scan({ primaryColor: '#FF6B00' });
    } catch (e) {
      if (e instanceof FigoSnapError && e.code === 'CANCELLED') return;
    }
    Flutter
    Scan optionDefaultDescription
    titleScan to payScreen title.
    primaryColorblueBrand color, #RRGGBB.
    allowGallerytrueAllow picking a photo from the gallery.
    confirmBeforeExtracttrueShow Retake / Use photo before reading.
    autoCapturetrueTake the photo once an account number is in view.

    Embedded camera#

    To place the camera inside your own screen:
    PlatformComponent
    AndroidFigoSnapCameraView(context, options)
    iOSFigoSnapCameraView(options:)
    React Native<FigoSnapCamera style={{ flex: 1 }} onResult={…} onError={…} />
    FlutterFigoSnapCamera(onResult: …, onError: …)

    5. Read an existing image#

    PlatformBase64URL
    KotlinextractBankAccount(base64)extractBankAccountFromUrl(url)
    SwiftextractBankAccount(base64:)extractBankAccount(url:)
    React NativeextractFromBase64(base64)extractFromUrl(url)
    FlutterextractFromBase64(base64) / extractFromBytes(bytes)extractFromUrl(url)
    Supported: JPEG, PNG, GIF and WebP, up to 10 MB.

    6. Result#

    FieldDescription
    bankCodeBank code, or null.
    bankNameBank name for bankCode.
    accountNumber10-digit account number, or null.
    amountAmount to pay, digits only (e.g. "12900.00"), or null.
    narrationShort payment description, or null.
    sourcelocal (read on the device) or remote (read by Figo).
    confidence0–1.
    modelUsedtrue if the on-device model's answer was used.
    rawTextText read on the device.
    errorSet only when Figo couldn't be reached and the device result is returned instead.
    Always let the user confirm the details before paying.

    7. On-device model (optional)#

    The on-device model improves on-device reading and enables prompt(). Without it, the SDK still works, but more images are read by Figo.
    1.
    Host a Gemma 3 1B (instruction-tuned, int4) MediaPipe .task file with a 4096-token context, about 550 MB.
    2.
    Pass its URL as modelUrl, and optionally its SHA-256 as modelSha256.
    3.
    Download it once, for example from a settings screen:
    const status = await FigoSnapAndPay.modelStatus(); // notConfigured | notDownloaded | downloading | ready | unsupported
    await FigoSnapAndPay.prepareModel((p) => setProgress(p)); // 0..1
    The model needs about 4 GB of RAM. On smaller devices, modelStatus() is unsupported.

    Prompt#

    const { text } = await FigoSnapAndPay.prompt('Summarise this invoice in one line: …', { system: 'Be brief.' });
    prompt() runs only on the device. It fails with MODEL_UNAVAILABLE if no model is ready.

    8. Licensing#

    When it's checked: at initialize. A valid result is kept in memory for 24 hours.
    Expired or invalid: every call fails, and the camera screen shows the message.
    Offline: if the license hasn't been checked in the last 24 hours, calls fail until the device is back online.
    Footer: the camera screen shows "Licensed to {companyName}".

    9. Errors#

    CodeMeaning
    LICENSE_INVALIDUnknown or disabled license, or a license for a different company from the Figo key.
    LICENSE_EXPIREDThe license has expired.
    CONFIGMissing or invalid initialize options.
    NOT_INITIALIZEDinitialize was not called.
    CANCELLEDThe user closed the camera.
    CAMERA_PERMISSION_DENIEDCamera access was denied.
    INVALID_IMAGE / IMAGE_TOO_LARGEUnsupported image, or over 10 MB.
    NO_DATANo payment details found.
    MODEL_UNAVAILABLEThe on-device model can't run.
    AUTHInvalid or expired Figo key, or not enough credits.
    PLAN_LIMITThe Figo plan doesn't include this feature.
    RATE_LIMITEDToo many requests. Retry later.
    NETWORKNo connection.
    SERVERUnexpected error. Retry.
    Security: both keys ship inside your app. Use keys made for this SDK, and rotate them if they leak.
    Modified at 2026-11-14 19:52:08
    Previous
    FigoChat SDK
    Next
    Chat Assistant API
    Built with