Fetchify Documentation

website·Indexed 34 days ago

https://docs.fetchify.com/

Developer resources for Fetchify's address auto-complete and validation services. Includes guides for the JSON API (UK Postcode Lookup, Address Plus, Bank and Email Validation), a JavaScript library for address auto-complete, and integration guides for platforms like Shopify, BigCommerce, nopCommerce, OpenCart, and Zapier.

Tokens
39.5K
Snippets
160
Records
238
Agent score
55%

What's inside Fetchify

  1. Overview of Address Plus API capabilities

    The Address Plus API provides access to regular Royal Mail postal addresses, including coordinates for each address. It also supports Local authority BS7666 addresses and addresses with multiple occupants.

    Usage Warning: Some requests are free and others are chargeable. Free requests are intended to be used in combination with a subsequent chargeable request. Using free requests without a succeeding chargeable request is considered improper use and may lead to account suspension.

  2. Fetchify Dynamics 365 Plugin Capabilities

    The Microsoft Dynamics 365 plugin provides the following validation and lookup tools:

    • Address Auto-Complete: Global address lookup for over 240 countries.
    • Postcode Lookup: UK-specific lookup.
    • Phone Validation: Global validation.
    • Email Validation: Global validation.
    • Bank Validation: UK-specific validation.
  3. Integrate Crafty Clicks with Salesforce using the Browser Extension

    The Crafty Clicks browser extension is compatible with Salesforce, enabling easy integration with Salesforce address forms without requiring additional software beyond the extension itself. Installation is available for Google Chrome and Mozilla Firefox.
  4. Integrate Crafty Clicks with Xero using the Browser Extension

    The Crafty Clicks browser extension is compatible with Xero, enabling easy integration with Xero address forms. The only requirement for this integration is the installation of the browser extension. It is available for Google Chrome and Mozilla Firefox.
  5. Common use cases for the Embedded Tech API

    The Embedded Tech API is designed for partner automation, specifically for:

    • Automatically provisioning Fetchify accounts during customer sign-up on a partner platform.
    • Syncing client account and contact details into internal billing or admin tools.
    • Monitoring client usage, account status, and credit consumption via custom dashboards.
    • Automating credit pack top-ups based on specific usage thresholds.
  6. Retrieve detailed bank branch information

    The extra object in the API response provides comprehensive details about the bank office associated with the sort code, including full address lines, telephone numbers, and location names.
    "extra": {
        "branchName": "string",
        "addressLine1": "string",
        "addressLine2": "string",
        "addressLine3": "string",
        "addressLine4": "string",
        "addressTown": "string",
        "addressCounty": "string",
        "postCodeOutcode": "string",
        "postCodeIncode": "string",
        "telephone1Area": "string",
        "telephone1Number": "string",
        "telephone2Area": "string",
        "telephone2Number": "string",
        "mainBranchSortCode": "string",
        "branchTypeIndicator": "string"
    }
  7. Integrate Crafty Clicks with NetSuite using the Browser Extension

    The Crafty Clicks browser extension is compatible with NetSuite, enabling easy integration with NetSuite address forms. No additional software or complex setup is required beyond installing the browser extension for your specific browser (Google Chrome or Mozilla Firefox).
  8. Manually integrate Fetchify address lookup into Zen Cart templates

    For modified Zen Cart installations, follow these steps to manually integrate the address lookup functionality.

    1. File Setup: Create the directory includes/modules/craftyclicks and copy the following files into it:

    • crafty_html_output.php
    • crafty_postcode_busy.gif
    • crafty_postcode.class.js
    • button_find_address.gif

    2. Authentication: Open /includes/modules/craftyclicks/crafty_html_output.php and replace xxxxx-xxxxx-xxxxx-xxxxx with your actual access token.

    3. Template Integration: Apply the following changes to your template files (replace YOURTEMPLATE with your actual template directory):

    • Address Book Details (includes/templates/YOURTEMPLATE/templates/tpl_modules_address_book_details.php)
    • Checkout New Address (includes/templates/YOURTEMPLATE/templates/tpl_modules_checkout_new_address.php)
    • Create Account (includes/templates/YOURTEMPLATE/templates/tpl_modules_create_account.php)

    For each of these files:

    • Add the script requirement at the top (around line 13).
    • Append . '  ' . tep_crafty_button_add(1) to the postcode input field logic.
    • Insert the result display span <span id="crafty_postcode_result_display">&nbsp;</span> after the <br class="clearBoth" /> tag.
    • Add the country handler <? echo tep_crafty_country_handler(1); ?> at the bottom of the file.
    // Top of template file
    <?php
    require(DIR_WS_MODULES.'craftyclicks/crafty_html_output.php');
    echo tep_crafty_script_add('addressbook', 1); // Use 'checkout_address' or 'create_account' accordingly
    ?>
    
    // Postcode field modification
    <?php echo zen_draw_input_field('postcode', ..., ' id="postcode"') . (zen_not_null(ENTRY_POST_CODE_TEXT) ? '<span class="alert">' . ENTRY_POST_CODE_TEXT . '</span>': ''). '&nbsp;&nbsp;' . tep_crafty_button_add(1); ?>
    
    // Result display
    <span id="crafty_postcode_result_display">&nbsp;</span>
    <br class="clearBoth" />
    
    // Bottom of file
    <? echo tep_crafty_country_handler(1); ?>
  9. Instantiate and configure the CraftyPostcode object

    Create a lookup instance using the CraftyPostcodeCreate() function. Use the .set(key, value) method to configure the object, starting with your required access_token. If multiple lookup forms are needed on a single page, instantiate separate objects for each.
    <script>
        // Single instance
        var cp_obj = CraftyPostcodeCreate();
        cp_obj.set("access_token", "xxxxx-xxxxx-xxxxx-xxxxx");
    
        // For multiple lookups, create multiple objects
        var cp_obj_2 = CraftyPostcodeCreate();
        cp_obj_2.set("access_token", "xxxxx-xxxxx-xxxxx-xxxxx");
    </script>
  10. Install Fetchify Address Auto-Complete or Postcode Lookup in nopCommerce

    To integrate Fetchify address lookup (Global Auto-Complete or UK Postcode Lookup) into nopCommerce address forms, follow these steps:

    1. Download: Obtain the plugin files from the Fetchify plugins page.
    2. Authentication: Open nopcommerce_crafty_clicks.js and replace the placeholder xxxxx-xxxxx-xxxxx-xxxxx on line 19 with your actual Fetchify access token.
    3. Deployment: Upload nopcommerce_crafty_clicks.js and crafty_postcode_busy.gif to your web server.
    4. Implementation: Add a reference to the nopcommerce_crafty_clicks.js file within any .cshtml files that render postal address forms.
  11. Implement UK Postcode Lookup using the Crafty Postcode JS library

    To add UK Postcode Lookup to an HTML address form, download the 'Generic Java Script Class' (crafty_clicks_js_class_v4_9_2.zip) and upload crafty_postcode.class.js to your webserver. The implementation requires referencing the script, creating an HTML form with specific input fields, and configuring a JavaScript object to map those fields to the lookup service.
    <!-- 1. Reference the JS library -->
    <script src="crafty_postcode.class.js"></script>
    
    <!-- 2. Create the HTML form -->
    <form method="post" name="address">
       Postcode:<br/>
       <input type="text" name="postcode"/>&nbsp;&nbsp;&nbsp;
       <button type="button" onclick="cp_obj.doLookup()">Find Address</button><br/>
       <span id="crafty_postcode_result_display">&nbsp;</span><br/>
       Company:<br/>
       <input type="text" name="companyname"/><br/>
       Address:<br/>
       <input type="text" name="address1"/><br/>
       <input type="text" name="address2"/><br/>
       <input type="text" name="address3"/><br/>
       Town:<br/>
       <input type="text" name="town"/><br/>
    </form>
    
    <!-- 3. Configure the JS object -->
    <script>
       var cp_obj = CraftyPostcodeCreate();
       cp_obj.set("access_token", "xxxxx-xxxxx-xxxxx-xxxxx"); // Replace with your token
       cp_obj.set("result_elem_id", "crafty_postcode_result_display");
       cp_obj.set("form", "address");
       cp_obj.set("elem_company"  , "companyname");
       cp_obj.set("elem_street1"  , "address1");
       cp_obj.set("elem_street2"  , "address2");
       cp_obj.set("elem_street3"  , "address3");
       cp_obj.set("elem_town"     , "town");
       cp_obj.set("elem_postcode" , "postcode");
    </script>
  12. Add the Email Address Validation app block to checkout

    To add email validation to your Shopify checkout:

    1. In the Theme Editor, select Add app block.
    2. Select the Email Address Validation app block.
    3. Configure the block settings.
    4. Click Save in the top right of the editor.