# Get account information

The GET /accounts/{accountId} endpoint retrieves the information for a specific bank account.

Endpoint: GET /accounts/{accountId}
Security: Bearer, BasicAuth

## Header parameters:

  - `on-behalf-of` (string, required)
    The tokenId represents the consent granted by the user (PSU).
    Example: "ta:3eYPU1BEKKunfmYgQuSKXFCeo851C5Y3XiZW3XA465TU:5zKtXEAq"

  - `token-customer-ip-address` (string)
    The user's IP address if the user is currently logged in with the TPP. If the customer  IP address is supplied (recommended), it is inferred that the user is present during the session (i.e., the request is user-initiated; adding a customer-initiated = true header makes this explicit). For AIS calls, if the customer's IP address is not provided in the request, the bank assumes it is a TPP-initiated request and may limit the TPP to 4 TPP-initiated access attempts within a given 24-hour period.
    Example: "172.16.254.1"

## Path parameters:

  - `accountId` (string)
    The system-generated, unique bank account id, which specifies the account for which the information is requested.
    Example: "a:8DbPteGnytmMbKXdnWTReeRB6cYWKXZ84JgLTBC7fKL4:5zKcENpV"

## Response 200 fields (application/json):

  - `account` (object)
    Contains information about the requested bank account.

  - `account.accountDetails` (object)
    Contains the details needed to identify, correlate and validate the bank account.

  - `account.accountDetails.accountHolderName` (string)
    The name of the account holder/owner.
    Example: "John Arthur Smith"

  - `account.accountDetails.bic` (string)
    The Business Identifier Code (BIC), ISO 9362, is the SWIFT Address assigned to a bank in order to send automated payments quickly and accurately to the banks concerned. It uniquely identifies the name and country, (and sometimes the branch) of the bank involved. BICs are often called SWIFT Codes and can be either 8 or 11 characters long."
    Example: "BOFIIE2D"

  - `account.accountDetails.identifier` (string, required)
    The type of accountIdentifier being used, e.g., bban, gbDomestic, iban, msisdn, pan or token. The identifier is displayed if an account is returned by the bank.
    Example: "iban"

  - `account.accountDetails.accountIdentifiers` (array, required)
    The account numbers and other strings that identify this as a unique bank account. The accountidentifiers are displayed if an account is returned by the bank

  - `account.accountDetails.metadata` (array)
    Additional fields returned by the bank in response to your particular request. The presence and type of metadata are dependent on the bank and generally comprise additional information about the account or the transaction pertinent to your specific use case. You define how this information is used when included in the bank's response.

  - `account.accountDetails.ProviderAccountDetails` (object)
    Specific information regarding the bank required by the respective Open Banking API standard adopted (CMA9, NextGenPSD2, PolishAPI, or STET).

  - `account.accountDetails.status` (string)
    Specifies the bank-defined status of the account (open, closed, active, inactive, etc.)
    Example: "Active"

  - `account.accountDetails.type` (array, required)
    Specifies the type of account. The type is displayed if an account is returned by the bank
    Enum: "INVALID", "OTHER", "CHECKING", "SAVINGS", "LOAN", "CARD"

  - `account.accountDetails.currency` (string)
    The ISO 4217 three letter currency code. The currency is displayed if an account is returned by the bank
    Example: "EUR"

  - `account.accountFeatures` (object)
    Open Banking features supported for this account.

  - `account.accountFeatures.supportsInformation` (boolean)
    An account available for AIS operations.

  - `account.accountFeatures.supportsReceivePayment` (boolean)
    An account that can receive money transfers.

  - `account.accountFeatures.supportsSendPayment` (boolean)
    An account that can send money transfers.

  - `account.bankId` (string, required)
    The Token.io id of the bank where the consent is created. This field is required if the customer is not using Token.io's Hosted Pages for bank selection, i.e., API-only integration when EMBEDDED_HOSTED_PAGES is selected in flowType, or Hosted Pages embedded (modal) integration.
    Example: "ob-modelo"

  - `account.id` (string, required)
    The system-generated, unique identifier for this account.
    Example: "a:8DbPteGnytmMbKXdnWTReeRB6cYWKXZ84JgLTBC7fKL4:5zKcENpV"

  - `account.isLocked` (boolean)
    All services are locked out for this account if isLocked = true. This setting is only used in conjunction with the legacy Token.io mobile app. The account will be locked if, for example, the user has lost their phone. Instead of removing the account, Token.io locks it so that the user can still see the account after recovery. A re-linking is enforced before the account can be used again.

  - `account.name` (string)
    The unique name of this account.
    Example: "John A Smith"

## Response 400 fields (application/json):

  - `error` (object)
    The request does not have valid authentication credentials needed to perform the operation.

  - `error.message` (string)
    A description of the error.
    Example: "This is a description of the error."

  - `error.tokenTraceId` (string)
    The trace identifier for the given call.
    Example: "5678912345"

## Response 401 fields (application/json):

  - `error` (object)
    The request does not have valid authentication credentials needed to perform the operation.

  - `error.message` (string)
    A description of the error.
    Example: "This is a description of the error."

  - `error.tokenTraceId` (string)
    The trace identifier for the given call.
    Example: "5678912345"

## Response 403 fields (application/json):

  - `error` (object, required)
    The error returned when the member is not authorized to perform the given operation: PermissionDenied. This error message will be accompanied by the reason from the bank. Typically this means the access token has expired and the user must re-authenticate with the bank.

  - `error.errorCode` (string, required)
    A textual error code categorising the error.
    Example: "InternalServerError"

  - `error.message` (string, required)
    A description of the error that occurred and a possible way to fix it.
    Example: "This is a description of the error."

  - `error.tokenTraceId` (string)
    The trace identifier for the given call.
    Example: "5678912345"

## Response 404 fields (application/json):

  - `error` (object, required)
    The error object returned when given payment cannot be found: ResourceNotFound.

  - `error.errorCode` (string, required)
    A textual error code categorising the error.
    Example: "InternalServerError"

  - `error.paymentId` (string, required)
    The requested entity, the paymentID, was not found.
    Example: "pm2:12345abcd:abcde"

  - `error.message` (string, required)
    A description of the error that occurred and a possible way to fix it.
    Example: "This is a description of the error."

  - `error.tokenTraceId` (string)
    The trace identifier for the given call.
    Example: "5678912345"

## Response 429 fields (application/json):

  - `error` (object, required)
    Resource exhausted. Too many requests.

  - `error.errorCode` (string, required)
    A textual error code categorising the error.
    Example: "InternalServerError"

  - `error.paymentId` (string, required)
    The maximum number of requests has been reached.
    Example: "Resource exhausted. Check quota."

  - `error.message` (string, required)
    A description of the error that occurred and a possible way to fix it.
    Example: "This is a description of the error."

  - `error.tokenTraceId` (string)
    The trace identifier for the given call.
    Example: "5678912345"

## Response 500 fields (application/json):

  - `error` (object)
    This could refer to either an error by the payment service provider or the bank. When the bank reports a 5xx error, "token-external-error": "true" is set as a header in the HTTP response, indicating that the "internal" error originates from the bank. When one of the payment service providers internal services fails or when the bank reports a 4xx error, this header is not populated. The absence of this response header should be interpreted as "token-external-error": "false".

  - `error.errorCode` (string, required)
    This is a textual error code categorising the error.
    Example: "InternalServerError"

  - `error.message` (string, required)
    A description of the error.
    Example: "This is a description of the error."

  - `error.tokenTraceId` (string)
    The trace identifier for the given call.
    Example: "5678912345"

## Response 501 fields (application/json):

  - `error` (object, required)
    The operation was not implemented, supported or enabled by the bank.

  - `error.errorCode` (string, required)
    A textual error code categorising the error.
    Example: "InternalServerError"

  - `error.paymentId` (string, required)
    The operation was not implemented,supported or enabled by the bank.
    Example: "Not implemented."

  - `error.message` (string, required)
    A description of the error that occurred and a possible way to fix it.
    Example: "This is a description of the error."

  - `error.tokenTraceId` (string)
    The trace identifier for the given call.
    Example: "5678912345"

## Response 503 fields (application/json):

  - `error` (object, required)
    Service is unavailable, likely due to a transient condition; this is usually corrected with a retry.

  - `error.errorCode` (string, required)
    A textual error code categorising the error.
    Example: "InternalServerError"

  - `error.paymentId` (string, required)
    The service is unavailable, likely due to a transient condition; this is usually corrected with a retry.
    Example: "Unavailable"

  - `error.message` (string, required)
    A description of the error that occurred and a possible way to fix it.
    Example: "This is a description of the error."

  - `error.tokenTraceId` (string)
    The trace identifier for the given call.
    Example: "5678912345"

## Response 504 fields (application/json):

  - `error` (object, required)
    The deadline expired before the operation could complete.

  - `error.errorCode` (string, required)
    A textual error code categorising the error.
    Example: "InternalServerError"

  - `error.paymentId` (string, required)
    The deadline expired before the operation could complete.
    Example: "Deadline exceeded."

  - `error.message` (string, required)
    A description of the error that occurred and a possible way to fix it.
    Example: "This is a description of the error."

  - `error.tokenTraceId` (string)
    The trace identifier for the given call.
    Example: "5678912345"


