Skip to main content

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).

Not the same as Transaction Fields

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.

info

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 /accounttypes/example
GetAccountType
GET /partner/v2/accounttypes/example HTTP/1.1
Host: sandbox.paydata-api.com
Authorization: Bearer {PartnerToken}
Response — HTTP/1.1 200
{
"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 /accounts
CreateAccount
POST /partner/v2/accounts HTTP/1.1
Host: sandbox.paydata-api.com
Authorization: Bearer {UserToken}
Content-Type: application/json
Request Body
{
"accountTypeId": "example",
"name": "Example",
"accountFields": {
"start-date": "2023-09-01"
}
}
Response — HTTP/1.1 200
{
"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.

TypeDescriptionExamples
AuthReference for the OAuth flow created using CreateOauthRedirectUrl593800E2-63D2-43BE-9BF1-EB111DA46E2E
CheckboxA true or false value.true, false, 1, 0
DateA 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
FilePlain text or base64 encoded contents of a file. Separate from Text to allow user interfaces to show a file chooser.SGVsbG8gV29ybGQhCg==
PasswordPassword or token for authentication with the PSP.mySecret123!
SelectionA specific value from the list of allowed values returned with the field. Check accountFields.values.amazon.de
TextA string value like a username, mail or shop address.myUsername, info@example.com, store.myshopify.com
TextLineText (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."
URLA 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.