PHP code example of kintsugi-tax / tax-platform-sdk

1. Go to this page and download the library: Download kintsugi-tax/tax-platform-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/ */

    

kintsugi-tax / tax-platform-sdk example snippets


declare(strict_types=1);

 KintsugiTax\SDK\Models\Components;

$sdk = SDK\SDK::builder()
    ->setSecurity(
        '<YOUR_API_KEY_HERE>'
    )
    ->build();

$request = new Components\AddressBase(
    phone: '555-123-4567',
    street1: '1600 Amphitheatre Parkway',
    street2: 'Building 40',
    city: 'Mountain View',
    county: 'Santa Clara',
    state: 'CA',
    postalCode: '94043',
    country: Components\CountryCodeEnum::Us,
    fullAddress: '1600 Amphitheatre Parkway, Mountain View, CA 94043',
);

$response = $sdk->addressValidation->search(
    request: $request
);

if ($response->response200SearchV1AddressValidationSearchPost !== null) {
    // handle response
}

declare(strict_types=1);

 KintsugiTax\SDK\Models\Components;

$sdk = SDK\SDK::builder()
    ->setSecurity(
        '<YOUR_API_KEY_HERE>'
    )
    ->build();

$request = new Components\AddressBase(
    phone: '555-123-4567',
    street1: '1600 Amphitheatre Parkway',
    street2: 'Building 40',
    city: 'Mountain View',
    county: 'Santa Clara',
    state: 'CA',
    postalCode: '94043',
    country: Components\CountryCodeEnum::Us,
    fullAddress: '1600 Amphitheatre Parkway, Mountain View, CA 94043',
);

$response = $sdk->addressValidation->search(
    request: $request
);

if ($response->response200SearchV1AddressValidationSearchPost !== null) {
    // handle response
}

declare(strict_types=1);

 KintsugiTax\SDK\Models\Components;
use KintsugiTax\SDK\Models\Errors;

$sdk = SDK\SDK::builder()
    ->setSecurity(
        '<YOUR_API_KEY_HERE>'
    )
    ->build();

try {
    $request = new Components\AddressBase(
        phone: '555-123-4567',
        street1: '1600 Amphitheatre Parkway',
        street2: 'Building 40',
        city: 'Mountain View',
        county: 'Santa Clara',
        state: 'CA',
        postalCode: '94043',
        country: Components\CountryCodeEnum::Us,
        fullAddress: '1600 Amphitheatre Parkway, Mountain View, CA 94043',
    );

    $response = $sdk->addressValidation->search(
        request: $request
    );

    if ($response->response200SearchV1AddressValidationSearchPost !== null) {
        // handle response
    }
} catch (Errors\ErrorResponseThrowable $e) {
    // handle $e->$container data
    throw $e;
} catch (Errors\BackendSrcAddressValidationResponsesValidationErrorResponseThrowable $e) {
    // handle $e->$container data
    throw $e;
} catch (Errors\ErrorResponseThrowable $e) {
    // handle $e->$container data
    throw $e;
} catch (Errors\APIException $e) {
    // handle default exception
    throw $e;
}

declare(strict_types=1);

 KintsugiTax\SDK\Models\Components;

$sdk = SDK\SDK::builder()
    ->setServerURL('https://api.trykintsugi.com')
    ->setSecurity(
        '<YOUR_API_KEY_HERE>'
    )
    ->build();

$request = new Components\AddressBase(
    phone: '555-123-4567',
    street1: '1600 Amphitheatre Parkway',
    street2: 'Building 40',
    city: 'Mountain View',
    county: 'Santa Clara',
    state: 'CA',
    postalCode: '94043',
    country: Components\CountryCodeEnum::Us,
    fullAddress: '1600 Amphitheatre Parkway, Mountain View, CA 94043',
);

$response = $sdk->addressValidation->search(
    request: $request
);

if ($response->response200SearchV1AddressValidationSearchPost !== null) {
    // handle response
}