Profiles

Profiles are any entity that you want to transact with in OpenTransact.

Data Types

ProfileResponse

KeyValue
typeprofiles
idUUID
Attributes
ownerPerson or Organization
metadataMetadata
created-atTimestamp
updated-atTimestamp
Relationships
applicationApplicationRelationship
addressesAddressRelationship
phone_numbersPhoneNumberRelationship
default_phone_numberPhoneNumberRelationship
email_addressesEmailAddressRelationship
default_email_addressEmailAddressRelationship

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

KeyValue
typeprofiles
Required
Attributes
ownerPerson or Organization
Required
metadataMetadata
Relationships
applicationApplicationRelationship
Required

CreateProfile Request Example

{
  "type": "profiles",
  "owner": {
    "type": "people",
    "first-name": "John",
    "last-name": "Doe"
  },
  "application": {
    "data": {
      "type": "applications",
      "id": "{APPLICATION_ID}"
    }
  }
}

UpdateProfileRequest

KeyValue
typeprofiles
Required
Attributes
ownerPerson or Organization
metadataMetadata
Relationships
applicationApplicationRelationship
Required
default_email_addressEmailAddressRelationship
default_phone_numberPhoneNumberRelationship

UpdateProfile Request Example

{
  "type": "profiles",
  "owner": {
    "type": "people",
    "first-name": "James",
    "last-name": "Smith"
  },
  "application": {
    "data": {
      "type": "applications",
      "id": "{APPLICATION_ID}"
    }
  }
}

Person

KeyValue
typepeople
Required
first-nameString
Required
last-nameString
Required

Person Example

{
  "type": "people",
  "first-name": "John",
  "last-name": "Doe"
}

Organization

KeyValue
typeorganizations
Required
nameString
Required
organization-type*String
Required

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

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"
        }
      }
    }
  }
}

Was this page helpful?