Profiles
Profiles are any entity that you want to transact with in OpenTransact.
Data Types
ProfileResponse
Key | Value |
---|---|
type | profiles |
id | UUID |
Attributes | |
owner | Person or Organization |
metadata | Metadata |
created-at | Timestamp |
updated-at | Timestamp |
Relationships | |
application | ApplicationRelationship |
addresses | AddressRelationship |
phone_numbers | PhoneNumberRelationship |
default_phone_number | PhoneNumberRelationship |
email_addresses | EmailAddressRelationship |
default_email_address | EmailAddressRelationship |
ProfileResponse Example
{
"data": {
"id": "4c72784e-fb2a-4858-8067-95b6e36d54c0",
"type": "profiles",
"attributes": {
"owner": {
"type": "people",
"first-name": "John",
"last-name": "Doe"
},
"metadata": {
"key": "value"
},
"created-at": "2022-06-21T23:34:04Z",
"updated-at": "2022-06-21T23:34:04Z"
},
"relationships": {
"application": {
"data": {
"id": "4c72784e-fb2a-4858-8067-95b6e36d54c0",
"type": "applications"
}
},
"addresses": {
"data": [
{
"id": "4c72784e-fb2a-4858-8067-95b6e36d54c0",
"type": "addresses"
}
]
},
"phone_numbers": {
"data": [
{
"id": "4c72784e-fb2a-4858-8067-95b6e36d54c0",
"type": "phone-numbers"
}
]
},
"default_phone_number": {
"data": {
"id": "4c72784e-fb2a-4858-8067-95b6e36d54c0",
"type": "phone-numbers"
}
},
"email_addresses": {
"data": [
{
"id": "4c72784e-fb2a-4858-8067-95b6e36d54c0",
"type": "email-addresses"
}
]
},
"default_email_address": {
"data": {
"id": "4c72784e-fb2a-4858-8067-95b6e36d54c0",
"type": "email-addresses"
}
}
}
}
}
CreateProfileRequest
Key | Value | |
---|---|---|
type | profiles | Required |
Attributes | ||
owner | Person or Organization | Required |
metadata | Metadata | |
Relationships | ||
application | ApplicationRelationship | Required |
CreateProfile Request Example
{
"type": "profiles",
"owner": {
"type": "people",
"first-name": "John",
"last-name": "Doe"
},
"application": {
"data": {
"type": "applications",
"id": "{APPLICATION_ID}"
}
}
}
UpdateProfileRequest
Key | Value | |
---|---|---|
type | profiles | Required |
Attributes | ||
owner | Person or Organization | |
metadata | Metadata | |
Relationships | ||
application | ApplicationRelationship | Required |
default_email_address | EmailAddressRelationship | |
default_phone_number | PhoneNumberRelationship |
UpdateProfile Request Example
{
"type": "profiles",
"owner": {
"type": "people",
"first-name": "James",
"last-name": "Smith"
},
"application": {
"data": {
"type": "applications",
"id": "{APPLICATION_ID}"
}
}
}
Person
Person Example
{
"type": "people",
"first-name": "John",
"last-name": "Doe"
}
Organization
organization-type
must be one of the following: c-corp
, s-corp
, llc
, partnership
, or other
.
Organization Example
{
"type": "organizations",
"name": "Acme Corporation",
"organization-type": "c-corp"
}
GET/v1/profiles
List Profiles
This endpoint retrieves a paginated list of Profiles.
This endpoint returns an array of ProfileResponse 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
GET
/v1/profiles curl --request GET \
--url 'https://api.opentransact.com/v1/profiles' \
--header 'Authorization: Bearer {API_KEY}'
Response
{
"data": [
{
"id": "4c72784e-fb2a-4858-8067-95b6e36d54c0",
"type": "profiles",
"attributes": {
"owner": {
"type": "people",
"first-name": "John",
"last-name": "Doe"
},
"metadata": {
"key": "value"
}
},
"relationships": {
"application": {
"data": {
"id": "4c72784e-fb2a-4858-8067-95b6e36d54c0",
"type": "applications"
}
}
}
},
... // more profiles
],
"meta": {
"page-count": 1,
"current-page": 1,
"count": 1
},
"links": {
"self": "https://api.opentransact.com/v1/profiles?page%5Bnumber%5D=1&page%5Bsize%5D=10",
"first": "https://api.opentransact.com/v1/profiles?page%5Bnumber%5D=1&page%5Bsize%5D=10",
"last": "https://api.opentransact.com/v1/profiles?page%5Bnumber%5D=1&page%5Bsize%5D=10"
}
}
POST/v1/profiles
Create a Profile
This endpoint creates a new Profile.
This endpoint accepts a CreateProfileRequest object and returns a ProfileResponse object.
Request
POST
/v1/profiles curl --request POST \
--url https://api.opentransact.com/v1/profiles \
--header 'Authorization: Bearer {API_KEY}' \
--header 'Content-Type: application/vnd.api+json' \
--data '{
"data": {
"type": "profiles",
"attributes": {
"owner": {
"type": "people",
"first-name": "Test",
"last-name": "User"
},
"metadata": {
}
},
"relationships": {
"application": {
"data": {
"id": "{APPLICATION_ID}",
"type": "applications"
}
}
}
}
}'
Response
{
"data": {
"id": "4c72784e-fb2a-4858-8067-95b6e36d54c0",
"type": "profiles",
"attributes": {
"owner": {
"type": "people",
"first-name": "Test",
"last-name": "User"
},
"metadata": {}
},
"relationships": {
"application": {
"data": {
"id": "{APPLICATION_ID}",
"type": "applications"
}
}
}
}
}
GET/v1/profiles/:id
Show a Profile
This endpoint retrieves a Profile by providing its ID.
This endpoint returns a ProfileResponse object.
Request
GET
/v1/profiles/4c72784e-fb2a-4858-8067-95b6e36d54c0 curl --request GET \
--url https://api.opentransact.com/v1/profiles/4c72784e-fb2a-4858-8067-95b6e36d54c0 \
--header 'Authorization: Bearer {API_KEY}'
Response
{
"data": {
"id": "4c72784e-fb2a-4858-8067-95b6e36d54c0",
"type": "profiles",
"attributes": {
"owner": {
"type": "people",
"first-name": "Test",
"last-name": "User"
},
"metadata": {}
},
"relationships": {
"application": {
"data": {
"id": "{APPLICATION_ID}",
"type": "applications"
}
}
}
}
}
PUT/v1/profiles/:id
Update a Profile
This endpoint performs an update on a Profile.
This endpoint accepts an UpdateProfileRequest object and returns a ProfileResponse object.
Request
PUT
/v1/profiles/4c72784e-fb2a-4858-8067-95b6e36d54c0 curl --request PUT \
--url https://api.opentransact.com/v1/profiles/bfae5aa9-039d-43b0-ad89-a096b4e54614 \
--header 'Authorization: Bearer {API_KEY}' \
--header 'Content-Type: application/vnd.api+json' \
--data '{
"data": {
"type": "profiles",
"id": "bfae5aa9-039d-43b0-ad89-a096b4e54614",
"attributes": {
"owner": {
"type": "people",
"first-name": "John",
"last-name": "Smith"
}
},
"relationships": {
"application": {
"data": {
"id": "e1e3a176-dd00-4ac2-8be0-489dcd6c634f",
"type": "applications"
}
}
}
}
}'
Response
{
"data": {
"id": "bfae5aa9-039d-43b0-ad89-a096b4e54614",
"type": "profiles",
"attributes": {
"owner": {
"type": "people",
"first-name": "John",
"last-name": "Smith"
}
},
"relationships": {
"application": {
"data": {
"id": "{APPLICATION_ID}",
"type": "applications"
}
}
}
}
}