PHP code example of isa-sdk / sdk

1. Go to this page and download the library: Download isa-sdk/sdk library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

isa-sdk / sdk example snippets


use Isa\Sdk\Isa;
use Isa\Sdk\Zyins\Applicant;
use Isa\Sdk\Zyins\Coverage;
use Isa\Sdk\Zyins\Height;
use Isa\Sdk\Zyins\NicotineUsage;
use Isa\Sdk\Zyins\Reference\PrequalifyRequest;
use Isa\Sdk\Zyins\Sex;
use Isa\Sdk\Zyins\Weight;
use Isa\Sdk\Catalog\Products;

$isa = Isa::withBearer();   // reads ISA_TOKEN from env

$request = new PrequalifyRequest(
    applicant: new Applicant(
        dob: '1962-04-18',
        sex: Sex::Male,
        height: Height::fromFeetInches(5, 10),
        weight: Weight::fromPounds(195),
        state: 'NC',
        nicotineUse: NicotineUsage::None,
    ),
    coverage: Coverage::faceValue(25_000),
    products: [Products::fex()->aetnaAccendo()],
);
$result = $isa->zyins->prequalify->run($request);

use Isa\Sdk\Isa;
use Isa\Sdk\Zyins\Applicant;
use Isa\Sdk\Zyins\Coverage;
use Isa\Sdk\Zyins\Height;
use Isa\Sdk\Zyins\NicotineUsage;
use Isa\Sdk\Zyins\Reference\PrequalifyRequest;
use Isa\Sdk\Zyins\Sex;
use Isa\Sdk\Zyins\Weight;
use Isa\Sdk\Catalog\Products;

$isa = Isa::withKeycode(
    keycode: 'SDV-HWH-WDD',
    email:   '[email protected]',
);
$result = $isa->zyins->prequalify->run(new PrequalifyRequest(
    applicant: new Applicant(
        dob: '1962-04-18',
        sex: Sex::Male,
        height: Height::fromFeetInches(5, 10),
        weight: Weight::fromPounds(195),
        state: 'NC',
        nicotineUse: NicotineUsage::None,
    ),
    coverage:  Coverage::faceValue(25_000),
    products:  [Products::fex()->aetnaAccendo()],
));
echo $result->plans[0]->pricing[0]->premium?->amount->display;

use Isa\Sdk\Zyins\Options\BundledApiVersions;

print_r(BundledApiVersions::MAP);
// [
//   'prequalify' => 'v2',
//   'quote'      => 'v2',
//   'datasets'   => 'v2',
//   'reference'  => 'v2',
//   'sessions'   => 'v1',
//   'branding'   => 'v1',
//   'cases'      => 'v1',
// ]

$isa = Isa::withKeycode(
    keycode:    'SDV-HWH-WDD',
    email:      '[email protected]',
    apiVersion: ['quote' => 'v2'],   // pin only quote; everything else bundled
);

$ds = $isa->zyins->datasets->get(ions->match('insulin');
echo $insulin->id, ' ', $insulin->name, ' ', var_export($insulin->isKnown, true);
// med_01KSR2WVAGC05ZGR6FA4QYEB12 INSULIN true

// Symmetric traversal — which conditions is insulin used for?
$usedFor = $insulin->conditions($isa->zyins->reference->sort::MostCommonFirst);
// frequency-ordered array; cond_01KSR2WVAGC05ZGR6FA4QYEA8X first

$novel = $isa->zyins->medications->match('NewExperimental XR 2026');
// $novel->isKnown === false; $novel->inputText === 'NewExperimental XR 2026'

$isa = Isa::withKeycode(
    keycode: $keycode, email: $email,
    caseStorage: new CarrierCaseStorage(),  // optional; default = ZeroKnowledgeCaseStorage
);



use Isa\Sdk\Isa;

function callEverySurface(Isa $isa, $input, $req, $invokeInput, $integrationUuid): void
{
    $isa->zyins->prequalify->run($input);
    $isa->zyins->quote->run($input);
    $isa->zyins->datasets->list();
    // $isa->zyins->referenceData->...   // see ReferenceData service
    // $isa->zyins->usage->...           // see Usage service

    $isa->rapidsign->documents->send($req);
    // $isa->rapidsign->webhooks->verify(...);

    $isa->proxy->call->invoke($integrationUuid, $invokeInput);
    // $isa->proxy->algosure->sign(...);
}

use Isa\Sdk\Zyins\Licenses\CheckInput;
use Isa\Sdk\Zyins\ZyInsClient;

$client = ZyInsClient::withBearer();

$result = $client->license->check(new CheckInput(
    email: '[email protected]',
    keycode: 'ABC-123-XYZ',
));
// $result->status: 'valid' | 'invalid' | 'inactive'

$ready = $client->health->getReadiness();
// $ready->ready: true on every