Verify Addresses

Author:

verify-address@0.3.2 Clause ^0.21.0 8b810ed3a1e7ceb4b4ef54ea30a6323924c54602e8eeb5d784e1d6c6c3f5437b

Verify a US street address

Download Archive Download Compiled Archive Open in Template Studio

Introduction

A template to verify US street addresses.

Request

For example, POSTing the following data (specifying just the primary line and zip code):

{
  "$class": "io.clause.verify.address.VerificationRequest",
  "inputPrimaryLine": "940 Pearl Street",
  "inputSecondaryLine": "",
  "inputCity": "",
  "inputState": "",
  "inputZipCode": "80302",
  "primaryLine": "940 Pearl Street",
  "secondaryLine": "",
  "lastLine": "BOULDER, CO, 80302",
  "city": "BOULDER",
  "stateCode": "CO",
  "zipCode": "80302",
  "deliverability": "deliverable"
}

Will respond with the last line of the postal address and set the verifiedString property to indicate that the street address is valid.

Response

{
    "$class": "io.clause.verify.address.VerificationResponse",
    "primaryLine": "940 Pearl Street",
    "secondaryLine": "",
    "lastLine": "BOULDER, CO, 80302",
    "city": "BOULDER",
    "stateCode": "CO",
    "zipCode": "80302",
    "deliverability": "deliverable",
    "deliverable": true,
    "verifiedString": "✓ VALID",
    "userMessage": "",
    "timestamp": "2020-10-24T14:37:16.519Z"
  }

Template Text

The undersigned grants authorization to use automated services to verify address details.

The undersigned grants authorization to use automated services to verify address details.
The undersigned grants authorization to use automated services to verify address details.
{
    "$class": "io.clause.verify.address.VerifyAddressTemplate"
}

Template Model

namespace io.clause.verify.address

import org.accordproject.cicero.contract.* from https://models.accordproject.org/cicero/contract.cto
import org.accordproject.cicero.runtime.* from https://models.accordproject.org/cicero/runtime.cto

asset VerifyAddressTemplate extends AccordClause {
}

transaction VerificationRequest extends Request {
  o String inputPrimaryLine
  o String inputSecondaryLine
  o String inputCity
  o String inputState
  o String inputZipCode
  o String primaryLine
  o String secondaryLine
  o String lastLine
  o String city
  o String stateCode
  o String zipCode
  o String deliverability
  }

transaction VerificationResponse extends Response {
  o String primaryLine
  o String secondaryLine
  o String lastLine
  o String city
  o String stateCode
  o String zipCode  
  o String deliverability
  o Boolean deliverable
  o String verifiedString
  o String userMessage
}

Model Dependencies

State Types

Type Sample JSON
org.accordproject.cicero.contract.AccordContractState
{
    "$class": "org.accordproject.cicero.contract.AccordContractState",
    "stateId": "ae326771-66fd-11eb-8233-bd4dc9046649"
}

Request Types

Type Sample JSON
io.clause.verify.address.VerificationRequest
{
    "$class": "io.clause.verify.address.VerificationRequest",
    "inputPrimaryLine": "Sint occaecat.",
    "inputSecondaryLine": "Labore labore voluptate amet.",
    "inputCity": "Lorem magna est deserunt cillum.",
    "inputState": "Ea irure.",
    "inputZipCode": "Enim ea est cillum sit.",
    "primaryLine": "Consequat voluptate velit anim nulla.",
    "secondaryLine": "Elit.",
    "lastLine": "Consectetur in irure dolor.",
    "city": "Non.",
    "stateCode": "Lorem labore ipsum elit.",
    "zipCode": "Qui et elit ad consequat.",
    "deliverability": "Ipsum minim.",
    "transactionId": "ae324060-66fd-11eb-8233-bd4dc9046649",
    "timestamp": "2021-02-04T15:28:50.022+00:00"
}

Response Types

Type Sample JSON
io.clause.verify.address.VerificationResponse
{
    "$class": "io.clause.verify.address.VerificationResponse",
    "primaryLine": "Anim sunt amet.",
    "secondaryLine": "Labore ut enim commodo.",
    "lastLine": "Amet ipsum.",
    "city": "Elit dolor nulla ad.",
    "stateCode": "Qui laboris ipsum sint Lorem.",
    "zipCode": "Consequat enim non reprehenderit.",
    "deliverability": "Cupidatat enim minim incididunt.",
    "deliverable": false,
    "verifiedString": "Duis amet commodo non.",
    "userMessage": "Ea ut.",
    "transactionId": "ae326770-66fd-11eb-8233-bd4dc9046649",
    "timestamp": "2021-02-04T15:28:50.023+00:00"
}

Events Types

Type Sample JSON
org.accordproject.base.Event
{
    "abstract": "this is an abstract type"
}

Technical Integration

Please refer to the Clause Developer Portal for details and examples of how to integrate a call to a Clause template into your application.