Account Fields
Account fields are information attached to an account and defined by the account types. Detailed field information is returned by querying the details of an account type (get detailed metadata of an account type).
This page covers Account Fields — the credential/configuration inputs an account type defines for account
creation (this section). A transaction also carries its own, separate fields object with account-type-specific
data (e.g. uniqueId, customerName) — see Interpreting transactions
for that concept instead.
The fields are used to provide access credentials or an OAuth reference during account creation (create an account). The values of some fields are generated and are available to the end user after the account is created (e.g. mail address for File based Accounts). For existing accounts, the values of the fields are returned by the get account API call.
The account fields shown when querying information about an account type can differ from the account fields of an existing account of the same account type! A field that is writable during account creation might be read-only after the account was created (e.g. start-date).
Example
The example shows the required Date field start-date that must be provided during account creation. The provided value must not be before minValue and not after maxValue.
Account Type Details
GET /partner/v2/accounttypes/example HTTP/1.1
Host: sandbox.paydata-api.com
Authorization: Bearer {PartnerToken}
{
"id": "example",
"name": "Example Account Type",
"accountFields": [
{
"id": "start-date",
"name": "Transaction start date",
"shortDescription": "Retrieves only transactions starting after the specified date.",
"description": "Retrieves only transactions starting after the specified date from the PSP.",
"required": true,
"type": "Date",
"generated": false,
"readOnly": false,
"defaultValue": "2023-08-27T12:11:55.9131080Z",
"values": [],
"minValue": "1998-09-28T15:01:42.9276676Z",
"maxValue": "2023-09-28T15:01:42.9276682Z",
"requiredFields": []
}
]
}
Account Creation
POST /partner/v2/accounts HTTP/1.1
Host: sandbox.paydata-api.com
Authorization: Bearer {UserToken}
Content-Type: application/json
{
"accountTypeId": "example",
"name": "Example",
"accountFields": {
"start-date": "2023-09-01"
}
}
{
"id": "j2r27hmn61",
"accountTypeId": "example",
"name": "Example",
"status": "Idle",
"elementStatistics": {
"count": 0,
"first": null,
"last": null
},
"accountFields": {
"start-date": "2023-09-01T00:00:00.0000000Z"
}
}
Types of fields
There are several different types of fields for storing different information.
| Type | Description | Examples |
|---|---|---|
Auth | Reference for the OAuth flow created using CreateOauthRedirectUrl | 593800E2-63D2-43BE-9BF1-EB111DA46E2E |
Checkbox | A true or false value. | true, false, 1, 0 |
Date | A date (with optional time). The value is assumed to be in UTC and must be between in the range minValue to maxValue. | 2023-09-24, 2023-09-24T12:34:56Z |
File | Plain text or base64 encoded contents of a file. Separate from Text to allow user interfaces to show a file chooser. | SGVsbG8gV29ybGQhCg== |
Password | Password or token for authentication with the PSP. | mySecret123! |
Selection | A specific value from the list of allowed values returned with the field. Check accountFields.values. | amazon.de |
Text | A string value like a username, mail or shop address. | myUsername, info@example.com, store.myshopify.com |
TextLine | Text (description) that should be displayed to the user. Used for disclaimers required by some PSPs. | "By continuing, you accept the PSP's terms and conditions." |
URL | A valid URL (e.g. API endpoint of the PSP). | https://psp.example.com/api/v2 |
OAuth
An account type with a field of Type = Auth uses OAuth to connect to the PSP. See
OAuth Authorization for the full request/response
flow, and Collecting fields alongside OAuth
for what an account type's other required fields' requiredDuringAuth flag means and when each one needs to
be supplied.