# Code examples

Source: https://developer.avalara.com/products/ecm/integration-guides/document-management/klv4791613795801/

Guide: Exemption Certificate Management (ECM)

# Code examples

Explore JavaScript code examples for Avalara CertExpress, including integration with HTML and CSS.

The following code has been written in core JavaScript for compatibility purposes, and includes an example for use with HTML and CSS.

Note

-   You can reverse-engineer this logic into any scripting language.

-   CertExpress expects you to pass the parameters correctly, regardless of the language used.

**Example post sample**

```
https://app.certexpress.com?name=Test%20Name&address_line1=1300%20East%20Central&address_line2=&city=San%20Francisco&state=California&country=United%20States&zip=12345&phone_number=555-555-5555&fax_number=444-444-4444&email=contactinfo@mycompany.com
```

**JavaScript code**

```
function init_certexpress() {
  seller = new Object();
  seller.name = 'Test Name';
  seller.address_line1 = '1300 East Central';
  seller.address_line2 = '';
  seller.city = 'San Francisco';
  seller.state = 'California';
  seller.country = 'United States';
  seller.zip = '12345';
  seller.phone_number = '555-555-5555';
  seller.fax_number = '444-444-4444';
  seller.email = 'contactinfo@mycompany.com';  var params = "";
  for (var key in seller) {
    if (params != "") {
      params += "&";
    }
    params += key + "=" + encodeURIComponent(seller[key]);
  }  var link = 'https://app.certexpress.com?'+params;
  window.open(link, '_blank');
}
```

**Example in context**

```

      function init_certexpress() {
        seller = new Object();
        seller.name = &#39;Test Name&#39;;
        seller.address_line1 = &#39;1300 East Central&#39;;
        seller.address_line2 = &#39;&#39;;
        seller.city = &#39;San Francisco&#39;;
        seller.state = &#39;California&#39;;
        seller.country = &#39;United States&#39;;
        seller.zip = &#39;12345&#39;;
        seller.phone_number = &#39;555-555-5555&#39;;
        seller.fax_number = &#39;444-444-4444&#39;;
        seller.email = &#39;contactinfo@mycompany.com&#39;;
        var params = &quot;&quot;;
        for (var key in seller) {
          if (params != &quot;&quot;) {
            params += &quot;&amp;&quot;;
          }
          params += key + &quot;=&quot; + encodeURIComponent(seller[key]);
        }
        var link = &#39;https://app.certexpress.com?&#39; + params;
        window.open(link, &#39;_blank&#39;);
      }

      #certexpress_btn {
        background-color: #FF6600;
        border-radius: 4 px;
        padding: 7 px 24 px;
        color: white;
        font-size: 13 px;
        font-weight: bold;
        font-family: &quot;Source Sans Pro&quot;, sans-serif;
        min-height: 36 px;
        line-height: 36 px;
        letter-spacing: 0.010 em;
        border: 0;
      }
      #certexpress_btn: hover {
        background-color: #E65000;
      }
       Create Tax Exemption with Avalara CertExpress 
```