openapi: 3.0.1
info:
title: Token.io's Open Banking API for TPPs Account on File Payments v2 API
description: '<b>Token.io''s Open Banking API</b><br/><br/>Token.io Support: <a href="https://support.token.io" target="_blank">support.token.io</a><br/><br/>The Token.io Open Banking API enables you to connect securely with banks for a range of services.<br/><br/> Using our API you can: <ul><li>provide authorized access to an authenticated user''s account information</li><li>get information on specific banks</li><li>initiate authorization with a user-selected bank</li><li>initate and track single immediate payments and future dated payments</li><li>use variable recurring payments (VRP) to grant long-held consents to Payment Initiation Service Providers (PISPs) to initiate series of payments from users'' bank accounts</li><li>carry out settlements, payments and refunds using our settlement accounts</li></ul><br/>For more information see our <a href="https://developer.token.io/token_rest_api_doc/content/e-rest/dashboard-intro.htm" target="_blank">developer documentation</a>.'
version: ''
servers:
- url: https://api.token.io
tags:
- name: Payments v2
description: Creates and initiates a single immediate payment or a future-dated payment. Also supports initiating a Variable Recurring Payment (VRP) using an existing VRP mandate that has been created and authorised via the `/vrp-consent` endpoint.
paths:
/v2/payments:
post:
tags:
- Payments v2
summary: Initiate a payment
description: 'The `POST /v2/payments` endpoint enables you to initiate a payment with a bank.<br/><br/>Once the payment has been initiated, the end user needs to authenticate themselves with their bank.<br/><br/><b>Check payment status:</b><br/><ol><li>If the status in the initiation response is `INITIATION_PENDING_REDIRECT_AUTH` or `INITIATION_PENDING_REDIRECT_HP`, redirect the user to the redirect url found in the authentication payload of the payment, to authenticate at the bank or at Token.io''s Hosted Pages.</li><br/><li>If the status in the initiation response is `INITIATION_PENDING_REDIRECT_PBL`, redirect the user to the payment link (redirect URL) found in the authentication payload. The user will be taken to Token.io’s Hosted Pages, where any missing information (such as amount or reference) can be provided before proceeding with payment authentication.</li><br/><li>If the status in the initiation response is `INITIATION_PENDING_EMBEDDED_AUTH`, collect the requested data listed in the authentication payload of the payment and use the `POST /v2/payments/{paymentId}/embedded-auth` endpoint to provide the requested field values.</li><br/><li>If the status in the initiation response is `INITIATION_PENDING`, Token.io needs more time to process this request with the bank. In the case of a successful scenario, the status will be updated to `INITIATION_PENDING_REDIRECT_AUTH`, `INITIATION_PENDING_EMBEDDED_AUTH` or `INITIATION_PENDING_DECOUPLED_AUTH` when the authentication details are ready. The update can be checked by the `GET /v2/payments/{paymentId}` endpoint or received via a webhook (see <a href="https://developer.token.io/token_rest_api_doc/content/e-rest/webhooks.htm" target="_blank">Webhooks</a>).</li><br/><li>If the status is `INITIATION_PENDING_DECOUPLED_AUTH`, the bank has requested a decoupled authentication from the user and Token.io is awaiting the result. No further action is required.</li></ol><br/><b>`request-timeout` header:</b><br/><br/>Banks may take some time to respond when a request is made. Therefore, Token.io recommends that you set a `request-timeout` header in your API-only `POST /v2/payments` requests to match the timeout of your client and avoid `DEADLINE_EXCEEDED` errors. If this is set, Token.io sends a response when this timeout period has passed and will update payment status as soon as the bank has responded.<br/>The following example demonstrates what happens when you set a timeout of 10 seconds and the call to the bank takes 15 seconds:<br/><br/><ol><li>The TPP makes a `POST /v2/payments` call.</li><br/><li>Token.io creates a resource with the status `INITIATION_PENDING`.</li><br/><li>Token.io starts the call to the bank.</li><br/><li>After 10 seconds from (1): Token.io returns the payment status `INITIATION_PENDING`.</li><br/><li>After 15 seconds from (3): Token.io receives a response from the bank and changes the status to, for example, `INITIATION_PENDING_REDIRECT_AUTH`. The update will be sent in a webhook, if TPP is subscribed for webhooks.</li><br/><li>The TPP makes the `GET /v2/payments/{id}` call and receives the payment with the status `INITIATION_PENDING_REDIRECT_AUTH`.</li></ol>'
operationId: InitiatePayment
parameters:
- name: request-timeout
in: header
description: Sets the number of elapsed seconds until Token.io sends the response back, even if the call is not finished by that time (in which case the call will be completed asynchronously).
schema:
type: integer
required: false
example: 10
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/v2_payments_body'
required: true
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/PaymentResponse'
'400':
description: The client specified an invalid argument
content:
application/json:
schema:
$ref: '#/components/schemas/inline_response_400_2'
'401':
description: The authorization information is missing or invalid
content:
application/json:
schema:
$ref: '#/components/schemas/inline_response_401'
'403':
description: Permission to access this endpoint is denied
content:
application/json:
schema:
$ref: '#/components/schemas/inline_response_403'
'500':
description: An unexpected or internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/inline_response_500'
deprecated: false
security:
- Bearer: []
- BasicAuth: []
x-hideTryItPanel: true
get:
tags:
- Payments v2
summary: Get payments
description: The `GET /v2/payments` endpoint provides you with a list of payments and their details.
operationId: GetPayments
parameters:
- name: limit
in: query
description: The maximum number of records to return.
required: true
style: form
explode: true
schema:
maximum: 200
minimum: 1
type: integer
format: int32
example: 10
- name: offset
in: query
description: The offset from the previous page.
required: false
style: form
explode: true
schema:
type: string
example: LerV6Jmex
- name: ids
in: query
description: Filters payments by their ids - returns only payments with ids listed in this parameter.
required: false
style: form
explode: true
schema:
type: array
items:
type: string
example:
- pm2:4QExXrhKTxfShBdcTeqFabqJJhUF:2gFUX1NDgpN
- pm2:N5cJDFsQzVca3Qvr8kQocgEnjgX:2gFUX1NEdYA
- name: invertIds
in: query
description: Invert ids query - returns only payments with ids not listed in the ids parameter.
required: false
style: form
explode: true
schema:
type: boolean
example: false
- name: statuses
in: query
description: Filters payments by their statuses - returns only payments with statuses listed in this parameter. For VRP payments (when type=VARIABLE_RECURRING_PAYMENT), only the following PaymentStatus values are supported:<br/>• INITIATION_PENDING<br/>• INITIATION_PROCESSING<br/>• INITIATION_COMPLETED<br/>• INITIATION_REJECTED<br/>• INITIATION_REJECTED_INSUFFICIENT_FUNDS<br/>• INITIATION_FAILED<br/>• INITIATION_NO_FINAL_STATUS_AVAILABLE<br/>Using unsupported statuses for VRP payments will result in an error.<br/><br/>For single immediate payments, all PaymentStatus values are supported.
required: false
style: form
explode: true
schema:
type: array
items:
$ref: '#/components/schemas/PaymentStatus'
example:
- INITIATION_COMPLETED
- INITIATION_REJECTED
- name: invertStatuses
in: query
description: Invert statuses query - returns only payments with statuses not listed in the statuses parameter.
required: false
style: form
explode: true
schema:
type: boolean
example: true
- name: createdAfter
in: query
description: Returns only payments created after this time (in <a href="https://www.iso.org/iso-8601-date-and-time-format.html" target="_blank">ISO 8601</a> format).
required: false
style: form
explode: true
schema:
type: string
example: '2022-04-05T17:00:00.000Z'
- name: createdBefore
in: query
description: Returns only payments created before this time (in <a href="https://www.iso.org/iso-8601-date-and-time-format.html" target="_blank">ISO 8601</a> format).
required: false
style: form
explode: true
schema:
type: string
example: '2022-04-05T17:00:00.000Z'
- name: refIds
in: query
description: Filters payments by their `refId` values - returns only payments with `refIds` listed in this parameter.
required: false
style: form
explode: true
schema:
type: array
items:
type: string
example:
- ShBdcTeqFabqJJhUF
- N5cJDFsQzVca3Q
- name: onBehalfOfId
in: query
description: Filters payments by the `onBehalfOfId` value - returns only payments with the `onBehalfOfId` value specified in this parameter. This field is mandatory for unregulated TPPs.
required: false
style: form
explode: true
schema:
type: string
example: c5a863bc-86f2-4418-a26f-25b24c7983c7
- name: refundStatuses
in: query
description: Filters payments by their refund status values - returns only payments with refund statuses listed in this parameter. Not supported for Vrp.
required: false
style: form
explode: true
schema:
type: array
items:
$ref: '#/components/schemas/PaymentRefundStatus'
example:
- PARTIAL
- NONE
- name: partial
in: query
description: Returns payments in a partial format - with only id and status fields populated.
required: false
style: form
explode: true
schema:
type: boolean
example: true
- name: externalPsuReference
in: query
required: false
style: form
explode: true
schema:
$ref: '#/components/schemas/ExternalPsuReference'
- name: type
in: query
description: Filter by payment type - single immediate or variable recurring payment. Defaults to SINGLE_IMMEDIATE_PAYMENT if not specified.
required: false
schema:
title: PaymentType
type: string
items:
type: string
example: SINGLE_IMMEDIATE_PAYMENT
enum:
- SINGLE_IMMEDIATE_PAYMENT
- VARIABLE_RECURRING_PAYMENT
- name: vrpConsentId
in: query
description: Filter by Vrp consent id value. Only applied if type is VARIABLE_RECURRING_PAYMENT.
required: false
style: form
explode: true
schema:
type: string
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/PaymentsResponse'
'400':
description: The client specified an invalid argument.
content:
application/json:
schema:
$ref: '#/components/schemas/FieldError'
'401':
description: The authorization information is missing or invalid
content:
application/json:
schema:
$ref: '#/components/schemas/inline_response_401'
'500':
description: An unexpected or internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/inline_response_500'
deprecated: false
security:
- Bearer: []
- BasicAuth: []
x-hideTryItPanel: true
/v2/payments/{paymentId}:
get:
tags:
- Payments v2
summary: Get a payment
description: The `GET /v2/payments/{paymentId}` endpoint provides you with details of an individual payment and checks the payment status for the next step, if any.
operationId: GetPayment
parameters:
- name: request-timeout
in: header
description: Sets the number of elapsed seconds until Token.io sends the response back, even if the call is not finished by that time (in which case the call will be completed asynchronously).
schema:
type: integer
required: false
example: 10
- name: paymentId
description: The payment id.
in: path
required: true
style: simple
explode: false
schema:
type: string
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/PaymentResponse'
'401':
description: The authorization information is missing or invalid
content:
application/json:
schema:
$ref: '#/components/schemas/inline_response_401'
'404':
description: The requested entity, such as a payment, was not found
content:
application/json:
schema:
$ref: '#/components/schemas/inline_response_404'
'500':
description: An unexpected or internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/inline_response_500'
deprecated: false
security:
- Bearer: []
- BasicAuth: []
x-hideTryItPanel: true
/v2/payments/{paymentId}/embedded-auth:
post:
tags:
- Payments v2
summary: Provide information for embedded authentication
description: The `POST /v2/payments/{paymentId}/embedded-auth` endpoint provides you with the requested information when the payment status is `INITIATION_PENDING_EMBEDDED_AUTH`. The requested information can be found in the authentication field of the payment. <br/> <br/> It's possible that some banks might request the user's input multiple times. In this case you might need to call this endpoint again for a new field set.
operationId: ProvideEmbeddedFields
x-internal: true
parameters:
- name: request-timeout
in: header
description: Sets the number of elapsed seconds until Token.io sends the response back, even if the call is not finished by that time (in which case the call will be completed asynchronously).
schema:
type: integer
required: false
example: 10
- name: paymentId
in: path
description: The payment id.
required: true
style: simple
explode: false
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/paymentIdEmbeddedAuthBody'
required: true
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/PaymentResponse'
'400':
description: The client specified an invalid argument.
content:
application/json:
schema:
$ref: '#/components/schemas/inline_response_400_4'
'401':
description: The authorization information is missing or invalid
content:
application/json:
schema:
$ref: '#/components/schemas/inline_response_401'
'403':
description: Permission to access this endpoint is denied
content:
application/json:
schema:
$ref: '#/components/schemas/inline_response_403'
'404':
description: The requested entity, such as a payment, was not found
content:
application/json:
schema:
$ref: '#/components/schemas/inline_response_404'
'500':
description: An unexpected or internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/inline_response_500'
deprecated: false
security:
- Bearer: []
- BasicAuth: []
x-hideTryItPanel: true
/qr-code:
get:
tags:
- Payments v2
summary: Generate QR code
description: The `GET /qr-code` endpoint generates a QR code in fixed SVG format (240x240 px). This allows TPPs to programmatically obtain a scannable QR code .
operationId: GetQrCode
parameters:
- name: data
description: The encoded URL to use while generating the QR code. The link must be URL encoded.
in: query
required: true
schema:
type: string
responses:
'200':
description: QR code successfully generated
content:
image/svg+xml:
schema:
type: string
description: The QR code in SVG format.
example: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"240\" height=\"240\" viewBox=\"0 0 240 240\">\n <!-- more SVG content here -->\n</svg>\n"
'400':
description: The client specified an invalid argument (e.g., size too small)
content:
application/json:
schema:
$ref: '#/components/schemas/inline_response_400'
'401':
description: The authorization information is missing or invalid
content:
application/json:
schema:
$ref: '#/components/schemas/inline_response_401'
'403':
description: Permission to access this endpoint is denied
content:
application/json:
schema:
$ref: '#/components/schemas/inline_response_403'
'404':
description: The requested payment was not found or does not have a link
content:
application/json:
schema:
$ref: '#/components/schemas/inline_response_404'
'500':
description: An unexpected or internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/inline_response_500'
deprecated: false
security:
- Bearer: []
- BasicAuth: []
x-hideTryItPanel: true
components:
schemas:
ElixirAccountDebtor:
title: ElixirAccount
oneOf:
- $ref: '#/components/schemas/PLIbanAccount'
description: The Elixir debtor account details.
remittanceInformationSecondary:
type: string
description: The secondary field for remittance information. The information supplied should enable the reconciliation of an entry in an unstructured form. Depending on the payment network, information from this field may or may not be included in the bank statement and reconciliation file. <br/>We recommend that the `remittanceInformationSecondary` field should not contain special characters (the allowed characters are the 26-letter Latin alphabet, the numerical digits from 0-9 and the hyphen '-') as banks may remove these when sending this field to the beneficiary. This field should not exceed 140 characters in length.
example: Secondary remittance information.
PaymentNotFoundError:
required:
- paymentId
type: object
properties:
errorCode:
example: NOT_FOUND
paymentId:
type: string
description: The requested entity, the `paymentID`, was not found.
example: pm2:12345abcd:abcde
description: 'The error object returned when given payment cannot be found: ResourceNotFound.'
allOf:
- $ref: '#/components/schemas/ErrorWithCode'
callbackUrl:
type: string
description: The TPP's url that Token.io calls back to. This url should not be under the token.io domain and must be https/SSL secure.
example: https://tpp.com/callback
inline_response_500:
properties:
error:
allOf:
- type: object
properties:
errorCode:
type: string
description: This is a textual error code categorising the error.
example: InternalServerError
- $ref: '#/components/schemas/ServerError'
PLIbanAccount:
title: PLIbanAccount
required:
- iban
type: object
properties:
iban:
type: string
description: The International Bank Account Number, used when sending interbank transfers or wiring money from one bank to another, especially across international borders. It consists of a two-letter country code followed by two check digits and up to thirty-five alphanumeric characters.
example: GB29NWBK60161331926819
bic:
type: string
description: The Business Identifier Code (BIC), <a href="https://www.iso.org/standard/84108.html" target="_blank">ISO 9362</a>, 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
description: Polish account details where the iban is required and the bic is optional.
TokenizedAccountIdentifier:
type: object
properties:
tokenizedAccountId:
type: string
description: Account on File identifier.
required:
- tokenizedAccountId
additionalProperties: false
PLAccount:
title: PLAccount
required:
- accountNumber
type: object
properties:
accountNumber:
type: string
description: The payee's Elixir-registered bank account number.
example: FRAX82783423
bic:
type: string
description: The Business Identifier Code (BIC), <a href="https://www.iso.org/standard/84108.html" target="_blank">ISO 9362</a>, is the 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 can be either 8 or 11 characters long.
example: BOFIIE2D
description: Polish account details where the account number is required and the bic is optional.
pispConsentAccepted:
type: boolean
description: This flag indicates whether the user has granted consent for the payment in the TPP's user interface.
example: false
default: false
PaymentContextCode:
type: string
description: This field describes the context of the payment context. This field is an <a href="https://www.openbanking.org.uk" target="_blank">OBIE</a> standard and also maps to <a href="https://bankio.at/openbanking/knowledge-base/NextGenPSD2" target="_blank">NextGenPsd2</a>'s `purposeCode` and `categoryPurposeCode` fields. We recommend that the TPP populates this field.
example: PISP_PAYEE
enum:
- INVALID_PAYMENT_CONTEXT_CODE
- BILLING_GOODS_AND_SERVICES_IN_ADVANCE
- BILLING_GOODS_AND_SERVICES_IN_ARREARS
- PISP_PAYEE
- ECOMMERCE_MERCHANT_INITIATED_PAYMENT
- FACE_TO_FACE_POINT_OF_SALE
- TRANSFER_TO_SELF
- TRANSFER_TO_THIRD_PARTY
RawDebtorInformation:
description: Raw debtor information. The account information (one of) is required.
allOf:
- oneOf:
- $ref: '#/components/schemas/SepaAccount'
- $ref: '#/components/schemas/SepaInstantAccount'
- $ref: '#/components/schemas/FasterPaymentsAccount'
- $ref: '#/components/schemas/ElixirAccountDebtor'
- $ref: '#/components/schemas/EUDomesticNonEuroAccountDebtor'
- $ref: '#/components/schemas/EUDomesticNonEuroInstantAccountDebtor'
- $ref: '#/components/schemas/BankGiroAccount'
- $ref: '#/components/schemas/PlusGiroAccount'
- type: object
required:
- name
properties:
name:
type: string
description: The debtor’s account owner name.
ultimateDebtorName:
type: string
description: The ultimate debtor’s name.
address:
$ref: '#/components/schemas/Address'
inline_response_400:
type: object
properties:
error:
$ref: '#/components/schemas/Error'
inline_response_400_4:
required:
- error
type: object
properties:
error:
oneOf:
- $ref: '#/components/schemas/FieldError'
- $ref: '#/components/schemas/TokenBankError'
ServerError:
type: object
properties:
message:
type: string
description: A description of the error.
example: This is a description of the error.
tokenTraceId:
type: string
description: The trace identifier for the given call.
example: '5678912345'
description: '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"`.'
allOf:
- $ref: '#/components/schemas/ErrorWithCode'
Address:
type: object
properties:
addressLine:
type: array
items:
type: string
example: The Coach House
streetName:
type: string
description: Street number
example: 221B
buildingNumber:
type: string
description: Building number
example: 2C
postCode:
type: string
description: Post Code
example: TR26 1EZ
townName:
type: string
description: Town name
example: Saint Ives
state:
type: string
description: State
example: Cornwall
district:
type: string
description: The district.
country:
type: string
description: Two-letter country code in upper case (ISO 3166-1 alpha-2).
example: GB
description: Address
Error:
type: object
properties:
message:
type: string
description: A description of the error.
example: This is a description of the error.
tokenTraceId:
type: string
description: The trace identifier for the given call.
example: '5678912345'
description: The request does not have valid authentication credentials needed to perform the operation.
EUDomesticNonEuroInstantAccountDebtor:
title: EUDomesticNonEuroInstantAccount
oneOf:
- $ref: '#/components/schemas/EUIbanAccount'
- $ref: '#/components/schemas/BbanAccount'
- $ref: '#/components/schemas/ClearingNumberAccount'
description: The instant payment system within a European country using that country's non-Euro domestic currency. An IBAN account will require an iban and an optional bic, a BBAN account will require a bban and an optional bic, a Clearing Number account will require a bban and a clearingNumber.
refId:
type: string
description: The TPP-generated reference identifier for the token. This is not to be confused with the `requestId`. The `refId` maps to the `tppRefId` in the bank's `consentRequest`. This is needed to match/verify the originating token request with the bank's consent request. <br/>We recommend that the `refId` should not contain special characters (the allowed characters are the 26-letter Latin alphabet, the numerical digits from 0-9 and the hyphen '-'). This field should not exceed 18 characters in length.
example: 9htio4a1sp2akdr1aa
RefundAccount:
description: The account to which the refund should be sent.
allOf:
- oneOf:
- $ref: '#/components/schemas/SepaInstantAccount'
- $ref: '#/components/schemas/SepaAccount'
- $ref: '#/components/schemas/FasterPaymentsAccount'
- type: object
properties:
name:
type: string
description: The name of the account owner.
example: John Smith
v2_payments_body:
required:
- initiation
type: object
properties:
initiation:
$ref: '#/components/schemas/PaymentInitiation'
pispConsentAccepted:
$ref: '#/components/schemas/pispConsentAccepted'
initialEmbeddedAuth:
type: object
properties: {}
additionalProperties:
type: string
description: This field provides a map of the initial embedded authentication fields, with their values. The list of the required initial credentials can be found in the bank metadata. Please use the id of each field as a key in the map. <br/><br/> Using this field is optional. Even if a bank requires initial embedded authentication fields, you may choose not to populate the `initialEmbeddedAuth` field. In this case you'll be able to provide these fields later in the flow as part of an embedded authentication step.
example:
username: John Smith
remittanceInformationPrimary:
type: string
description: The primary field for remittance information. This should contain a reference, as assigned by the creditor, to unambiguously refer to the payment transactions under this consent. The value of this field should appear on the bank statement and reconciliation file, irrespective of the payment network being used. <br/>We recommend that the `remittanceInformationPrimary` field should not contain special characters (the allowed characters are the 26-letter Latin alphabet, the numerical digits from 0-9 and the hyphen '-') as banks may remove these when sending this field to the beneficiary. This field should not exceed 35 characters in length (18 characters for UK Faster Payments).
example: Sweepco
FieldError:
title: FieldError
required:
- paths
type: object
properties:
paths:
type: array
description: A list of paths to the problematic fields.
items:
type: string
description: A reference to the JSON path of the field that caused the error.
example: initiation.refId
description: 'An error object providing details about an error caused by a particular field or fields in the request. Possible error code values include: <br/><br/> <b>Field.NotUnique</b> - The field value should be unique, but it isn''t.<br/><br/> <b>Field.Expected</b> - A field is expected/required but is missing altogether. <br/><br/> <b>Field.Inv
# --- truncated at 32 KB (86 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/token-io/refs/heads/main/openapi/token-io-payments-v2-api-openapi.yml