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
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
Key | Value | |
---|---|---|
type | addresses | Required |
Attributes | ||
street1 | String | Required |
street2 | String | |
zipcode | String | Required |
locality | String | Required |
sub-locality | String | |
region | String | Required |
country* | String | Required |
Relationships | ||
owner | OwnerRelationship | Required |
country
attribute must be a valid 2 Character ISO-3166 Country Code, see: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
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"
}
}
}
}
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
- Name
created_between
- Type
- object
- Description
- See documentation for filtering by timestamps.
- Name
updated_between
- Type
- object
- Description
- See documentation for filtering by timestamps.
- Name
metadata
- Type
- object
- Description
- See documentation for filtering by metadata.
- Name
page
- Type
- object
- Description
- See documentation for pagination.
Request
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"
}
}
Create an Address
This endpoint creates a new Address.
This endpoint accepts an AddressRequest object and returns an AddressResponse object.
Request
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"
}
}
}
}
}
Show an Address
This endpoint retreives the details of an Address by its ID.
This endpoint returns an AddressResponse object.
Request
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"
}
}
}
}
}