Addresses

OpenTransact allows you to store addresses and attach them to related objects like accounts, profiles, and more. Many processing systems will require you to provide an address for KYC/AML compliance, or for tax compliance, so storing this data in the API may be required for your use case.

Data Types

AddressResponse

KeyValue
typeaddresses
idUUID
Attributes
street1String
street2String
zipcodeString
localityString
sub-localityString
regionString
countryString
metadataMetadata
created-atTimestamp
updated-atTimestamp
Relationships
ownerOwnerRelationship

Example AddressResponse

{
  "type": "addresses",
  "id": "4c72784e-fb2a-4858-8067-95b6e36d54c0",
  "attributes": {
    "street1": "123 Main St",
    "street2": "Apt 4B",
    "zipcode": "10001",
    "locality": "New York",
    "sub-locality": "Manhattan",
    "region": "NY",
    "country": "US",
    "metadata": {},
    "created-at": "2022-06-21T23:34:04Z",
    "updated-at": "2022-06-21T23:34:04Z"
  },
  "relationships": {
    "owner": {
      "data": {
        "type": "profiles",
        "id": "4c72784e-fb2a-4858-8067-95b6e36d54c0"
      }
    }
  }
}

AddressRequest

KeyValue
typeaddresses
Required
Attributes
street1String
Required
street2String
zipcodeString
Required
localityString
Required
sub-localityString
regionString
Required
country*String
Required
Relationships
ownerOwnerRelationship
Required

Example AddressRequest

{
  "type": "addresses",
  "attributes": {
    "street1": "123 Main St",
    "street2": "Apt 4B",
    "zipcode": "10001",
    "locality": "New York",
    "sub-locality": "Manhattan",
    "region": "NY",
    "country": "US"
  },
  "relationships": {
    "owner": {
      "data": {
        "type": "profiles",
        "id": "4c72784e-fb2a-4858-8067-95b6e36d54c0"
      }
    }
  }
}

GET/v1/addresses

List Addresses

This endpoint retrieves a paginated list of Addresses. By default, a maximum of thirty Addresses are shown per page.

This endpoint returns an array of AddressResponse objects.

Filters

Request

GET
/v1/addresses
    curl --request GET \
      --url 'https://api.opentransact.com/v1/addresses' \
      --header 'Authorization: Basic {API_KEY}'

Response

{
  "data": [
    {
      "type": "addresses",
      "id": "4c72784e-fb2a-4858-8067-95b6e36d54c0",
      "attributes": {
        "street1": "123 Main St",
        "street2": "Apt 4B",
        "zipcode": "10001",
        "locality": "New York",
        "sub-locality": "Manhattan",
        "region": "NY",
        "country": "US"
      },
      "relationships": {
        "owner": {
          "data": {
            "type": "profiles",
            "id": "4c72784e-fb2a-4858-8067-95b6e36d54c0"
          }
        }
      }
    },
    ... // 29 more
  ],
  "meta": {
    "current-page": 1,
    "page-count": 2,
    "count": 38
  },
  "links": {
    "self": "https://api.opentransact.com/v1/addresses?page%5Bnumber%5D=1&page%5Bsize%5D=30",
    "first": "https://api.opentransact.com/v1/addresses?page%5Bnumber%5D=1&page%5Bsize%5D=30",
    "next": "https://api.opentransact.com/v1/addresses?page%5Bnumber%5D=2&page%5Bsize%5D=30",
    "last": "https://api.opentransact.com/v1/addresses?page%5Bnumber%5D=2&page%5Bsize%5D=30"
  }
}

POST/v1/addresses

Create an Address

This endpoint creates a new Address.

This endpoint accepts an AddressRequest object and returns an AddressResponse object.

Request

POST
/v1/addresses
  curl --request POST \
        --url https://api.opentransact.com/v1/addresses \
        --header 'Authorization: Basic {API_KEY}' \
        --header 'Content-Type: application/vnd.api+json' \
        --data '{
                  "data":{
                    "type": "addresses",
                    "attributes": {
                      "street1": "111 PEACHTREE PLACE",
                      "locality": "Atlanta",
                      "region": "GA",
                      "country": "US",
                      "zipcode": "30345"
                    },
                    "relationships": {
                      "owner": {
                        "data": {
                          "type": "profiles",
                          "id": "{PROFILE_ID}"
                        }
                      }
                    }
                  }
                }'

Response

{
  "data": {
    "type": "addresses",
    "id": "4c72784e-fb2a-4858-8067-95b6e36d54c0",
    "attributes": {
      "street1": "111 PEACHTREE PL",
      "locality": "Atlanta",
      "region": "GA",
      "country": "US",
      "zipcode": "30345"
    },
    "relationships": {
      "owner": {
        "data": {
          "type": "profiles",
          "id": "4c72784e-fb2a-4858-8067-95b6e36d54c0"
        }
      }
    }
  }
}

GET/v1/addresses/:id

Show an Address

This endpoint retreives the details of an Address by its ID.

This endpoint returns an AddressResponse object.

Request

GET
/v1/addresses/4c72784e-fb2a-4858-8067-95b6e36d54c0
  curl --request GET \
        --url 'https://api.opentransact.com/v1/addresses/4c72784e-fb2a-4858-8067-95b6e36d54c0' \
        --header 'Authorization: Basic {API_KEY}'

Response

{
  "data": {
    "type": "addresses",
    "id": "4c72784e-fb2a-4858-8067-95b6e36d54c0",
    "attributes": {
      "street1": "111 PEACHTREE PL",
      "locality": "Atlanta",
      "region": "GA",
      "country": "US",
      "zipcode": "30345",
      "created-at": "2024-02-29T19:33:45.000Z",
      "updated-at": "2024-02-29T19:33:45.000Z"
    },
    "relationships": {
      "owner": {
        "data": {
          "type": "profiles",
          "id": "4c72784e-fb2a-4858-8067-95b6e36d54c0"
        }
      }
    } 
  }
}

Was this page helpful?