Statements v3.0.1
- 1 Version Control
- 2 Definition
- 3 Endpoints
- 4 Data Model
- 4.1 UML Diagram
- 4.1.1 OBStatement1
- 4.1.2 OBReadStatement1
- 4.1.3 OBReadStatement2
- 4.2 Notes
- 4.3 Filtering
- 4.3.1 Filtering Examples
- 4.4 Permission Codes
- 4.5 Data Dictionary
- 4.5.1 OBStatement1
- 4.5.2 OBReadStatement1
- 4.5.3 OBReadStatement2
- 4.6 Enumerations
- 4.1 UML Diagram
- 5 Usage Examples
- 5.1 Specific Account
- 5.1.1 Request
- 5.1.1.1 Get Account Statements Request
- 5.1.2 Response
- 5.1.2.1 Get Account Statements Response
- 5.1.1 Request
- 5.2 Bulk
- 5.2.1 Request
- 5.2.1.1 Get Statements Request
- 5.2.2 Response
- 5.2.2.1 Get Statements Response
- 5.2.1 Request
- 5.1 Specific Account
Version Control
Version | Date | Author | Comments |
|---|---|---|---|
3.0.0-draft1 | May 3, 2022 | Payments NZ API Working Group | Baseline |
3.0.0-draft1
| Jun 26, 2022
| @Gavin Wong (Unlicensed)
| Updates to Accounts:
|
3.0.0-draft2 | Jan 17, 2023 | @Nigel Somerfield | Baseline for v3.0.0-draft2 |
3.0.0-draft2 | Apr 6, 2023 | @Nigel Somerfield | Updated length of resource Id fields from 40 to 128 characters as agreed in https://paymentsnz.atlassian.net/wiki/spaces/PaymentsDirectionAPIStandardsDevelopment/pages/1610940428 |
3.0.0-rc1 | May 5, 2023 | @Nigel Somerfield | Baselined for release candidate 1 Updated PhoneNumber (used in Phone and Mobile date fields) regular expression as per https://paymentsnz.atlassian.net/wiki/spaces/PaymentsDirectionAPIStandardsDevelopment/pages/1616445441 |
3.0.0-rc1 | Jun 16, 2023 | @Nigel Somerfield | Corrected Account examples to match the enumerated values for |
3.0.0-rc2 | Sep 12, 2023 | @Nigel Somerfield | Baseline for v3.0.0-rc2 |
3.0.0-rc2 | Sep 25, 2023 | @Nigel Somerfield | Updated:
|
3.0.0-rc2 | Oct 9, 2023 | @Nigel Somerfield | Updated:
|
3.0.0 | Nov 13, 2023 | @Nigel Somerfield | Version 3.0.0 baseline release |
3.0.0 | Jan 31, 2024 | @Nigel Somerfield | Updated to reflect OpenAPI release in Github (pull request merge) |
3.0.1 | Jun 6, 2024 | @Nigel Somerfield | Patch update to clarify the explanation of BookingDateTime:
was replaced with:
|
Definition
A resource that describes summary details for an account statement period.
For a specific date range - an account (AccountId) may have no statements, or may have multiple statements.
The /statements endpoint (if implemented by the API Provider) must return all statements within the requested date range for all accounts selected during the authorisation of the account-access-consent.
If a Third Party would like to access a specific statement (StatementId) to retrieve a formal statement download or transactions for a specific statement - the Third Party must specify the account (the AccountId) via the URI request path - i.e., via:
GET /accounts/{AccountId}/statements/{StatementId}/file - to download the statement
GET /accounts/{AccountId}/statements/{StatementId}/transactions - to return the transactions relating to a statement
Endpoints
Resource | Endpoint | Mandatory? | Scope | Grant Type | Idempotency Key | Parameters | Request Object | Response Object |
|---|---|---|---|---|---|---|---|---|
statements | GET /accounts/{AccountId}/statements | Mandatory | accounts | Redirect Flow; or Decoupled Flow | No | Pagination Filtering | OBReadStatement1 | |
statements | GET /accounts/{AccountId}/statements/{StatementId} | Mandatory | accounts | Redirect Flow; or Decoupled Flow | No |
| OBReadStatement2 | |
statements | GET /accounts/{AccountId}/statements/{StatementId}/file | Mandatory | accounts | Redirect Flow; or Decoupled Flow | No | |||
transactions | GET /accounts/{AccountId}/statements/{StatementId}/transactions | Mandatory | accounts | Redirect Flow; or Decoupled Flow | No | Pagination Filtering | OBReadTransaction2 | |
statements | GET /statements | Optional | account | Redirect Flow; or Decoupled Flow | No | Pagination Filtering | OBReadStatement1 |
GET /accounts/{AccountId}/statements
The API endpoint allows a Third Party to retrieve the statements for a specific account identified by AccountId.
The Third Party must have an access token issued by the API Provider using an authorization flow (either redirect flow or decoupled flow).
GET /accounts/{AccountId}/statements/{StatementId}
The API endpoint allows a Third Party to retrieve a specific statement identified by StatementId and specific account identified by AccountId.
The Third Party must have an access token issued by the API Provider using an authorization flow (either redirect flow or decoupled flow).
GET /accounts/{AccountId}/statements/{StatementId}/file
The API endpoint allows a Third Party to retrieve a non-json representation of a specific statement identified by StatementId for a specific account identified by AccountId.
The Third Party must have an access token issued by the API Provider using an authorization flow (either redirect flow or decoupled flow).
GET /accounts/{AccountId}/statements/{StatementId}/transactions
The API endpoint allows a Third Party to retrieve the transactions for a specific statement identified by StatementId and specific account identified by AccountId.
The Third Party must have an access token issued by the API Provider using an authorization flow (either redirect flow or decoupled flow).
This retrieves the transactions that appear on the selected statement identified by StatementId.
The data model for the returned objects is documented in the transactions resource.
GET /statements
The API endpoint allows a Third Party to retrieve statements in bulk, if an API Provider has implemented the bulk retrieval endpoints.
The Third Party must have an access token issued by the API Provider using an authorization flow (either redirect flow or decoupled flow).
This will retrieve the statements for all accounts linked to the account-access-consent.
Data Model
The OBReadStatement1 object will be used for the call to:
GET /statements
GET /accounts/{AccountId}/statements
The OBReadStatement2 object will be used for the call to:
GET /accounts/{AccountId}/statements/{StatementId}
Both OBReadStatement1 and OBReadStatement2 use the OBStatement1 class. However, the OBReadStatement2 has a single OBStatement1 object within the Data object; whereas the OBReadStatement1 object allows for an array of OBStatement1 objects.
The call to
GET /accounts/{AccountId}/statements/{StatementId}/file
will return unstructured data in binary (e.g., pdf, doc) or text (e.g., csv) formats. The format of the data will be specified in the Accept header by the Third Party.
The OBReadTransactions2 object (documented in the transactions resource) will be used the call to:
GET /accounts/{AccountId}/statements/{StatementId}/transactions
UML Diagram
OBStatement1
OBReadStatement1
OBReadStatement2
Notes
The statements resource must only be used for data that can be returned for a statement period.
Filtering
Limited support for filtering is provided on the statements and statements/{StatementId}/transactions resources.
Name | Occurrence | Enhanced Definition | Class |
|---|---|---|---|
fromStatementDateTime | 0..1 | Specifies start date and time for filtering of the Statements on the Statement/StartDateTime field. | ISODateTime |
toStatementDateTime | 0..1 | Specifies end date and time for filtering of the Statements on the Statement/EndDateTimefield. | ISODateTime |
fromBookingDateTime | 0..1 | Specifies start date and time for filtering of the Transactions for a given Statement. Filtering is performed on the Transaction/BookingDateTime field. Note that only Transactions whose BookingDateTime falls within the period of the Statement are returned. | ISODateTime |
toBookingDateTime | 0..1 | Specifies end date and time for filtering of the Transactions for a given Statement. Filtering is performed on the Transaction/BookingDateTime field. Note that only Transactions whose BookingDateTime falls within the period of the Statement are returned. | ISODateTime |
The API Provider must treat the following as valid input:
Non-working days (e.g. a Sunday or a Public holiday) or any other days on which no transactions are recorded
Dates that fall outside the range for which transaction information is provided through APIs
Dates that fall outside the range for which a consent authorisation is available
Timezone may be included in the filter request - but must be ignored by the API Provider
In the above situations, the API Provider must return statements where the StartDateTime and EndDateTime are both between the fromStatementDateTime and toStatementDateTime parameters.
Additionally, when filtering Transactions for a Statement, the API Provider must treat the following as valid input:
Transaction filter dates that fall outside the Statement as defined by StartDateTime and EndDateTime
Filtering Examples
// All statements from 1st Jan, 2015
GET /statements?fromStatementDateTime=2015-01-01T00:00:00
// All statements in 2016
GET /statements?fromStatementDateTime=2016-01-01T00:00:00&toStatementDateTime=2016-12-31T23:59:59
// All statements in a specific account up to 31-Mar-2017
GET /accounts/1/statements?toStatementDateTime=2017-03-31T23:59:59
// Filter Transactions for given Statement, 3 days from 3rd August 2023
GET /accounts/1/statements/123?fromBookingDateTime=2023-08-03T00:00:00&toBookingDateTime=2023-08-05T23:59:59Permission Codes
The resource response differs depending on the permissions (ReadStatementsBasic and ReadStatementsDetail) used to access resource (the OBReadStatement1 object). In the event the resource is accessed with both ReadStatementsBasic and ReadStatementsDetail, the most detailed level (ReadStatementsDetail) must be used.
These objects must not be returned without the ReadStatementsDetail permission:
OBStatement1/StatementAmount
Calls to GET /accounts/{AccountId}/statements/{StatementId}/file
If the ReadStatementsDetail is granted by the Customer:
OBStatement1/StatementAmount may be returned if applicable to the statement and API Provider (0..n)
For the call to GET /accounts/{AccountId}/statements/{StatementId}/transactions:
TheReadTransactionsBasic or ReadTransactionsDetail (in addition to the appropriate ReadTransactionsCredits and/or ReadTransactionsDebits) permission codes will be required. The API Provider must apply the same access to GET /accounts/{AccountId}/statements/{StatementId}/transactions as GET /accounts/{AccountId}/transactions
Data Dictionary
OBStatement1
Name | Occurrence | XPath | EnhancedDefinition | Class | Codes | Pattern |
|---|---|---|---|---|---|---|
OBStatement1 | OBStatement1 | Provides further details on a statement resource. | OBStatement1 | |||
AccountId | 1..1 | OBStatement1/AccountId | A unique and immutable identifier used to identify the account resource. This identifier has no meaning to the account owner. | Max128Text | ||
StatementId | 0..1 | OBStatement1/StatementId | Unique identifier for the statement resource within an servicing institution. This identifier is both unique and immutable. | Max128Text | ||
StatementReference | 0..1 | OBStatement1/StatementReference | Unique reference for the statement. This reference may be optionally populated if available. | Max35Text | ||
Type | 1..1 | OBStatement1/Type | Statement type, in a coded form. | OBExternalStatementType1Code | AccountClosure | |
StartDateTime | 1..1 | OBStatement1/StartDateTime | Date and time at which the statement period starts. | ISODateTime | ||
EndDateTime | 1..1 | OBStatement1/EndDateTime | Date and time at which the statement period ends. | ISODateTime | ||
CreationDateTime | 1..1 | OBStatement1/CreationDateTime | Date and time at which the resource was created. | ISODateTime | ||
StatementDescription | 0..n | OBStatement1/StatementDescription | Other descriptions that may be available for the statement resource. | Max500Text | ||
StatementBenefit | 0..n | OBStatement1/StatementBenefit | Set of elements used to provide details of a benefit or reward amount for the statement resource. | OBStatementBenefit1 | ||
Type | 1..1 | OBStatement1/StatementBenefit/Type | Benefit type, in a coded form. | OBExternalStatementBenefitType1Code | Cashback | |
Amount | 1..1 | OBStatement1/StatementBenefit/Amount | Amount of money associated with the statement benefit type. | OBActiveOrHistoricCurrencyAndAmount | ||
Amount | 1..1 | OBStatement1/StatementBenefit/Amount/Amount | A number of monetary units specified in an active currency where the unit of currency is explicit and compliant with ISO 4217. | ActiveCurrencyAndAmount_SimpleType | ^\d{1,13}\.\d{1,5}$ | |
Currency | 1..1 | OBStatement1/StatementBenefit/Amount/Currency | A code allocated to a currency by a Maintenance Agency under an international identification scheme, as described in the latest edition of the international standard ISO 4217 "Codes for the representation of currencies and funds". | ActiveOrHistoricCurrencyCode | ^[A-Z]{3,3}$ | |
StatementFee | 0..n | OBStatement1/StatementFee | Set of elements used to provide details of a fee for the statement resource. | OBStatementFee1 | ||
CreditDebitIndicator | 1..1 | OBStatement1/StatementFee/CreditDebitIndicator | Indicates whether the amount is a credit or a debit. | OBCreditDebitCode | Credit | |
Type | 1..1 | OBStatement1/StatementFee/Type | Fee type, in a coded form. | OBExternalStatementFeeType1Code | Annual | |
Amount | 1..1 | OBStatement1/StatementFee/Amount | Amount of money associated with the statement fee type. | OBActiveOrHistoricCurrencyAndAmount | ||
Amount | 1..1 | OBStatement1/StatementFee/Amount/Amount | A number of monetary units specified in an active currency where the unit of currency is explicit and compliant with ISO 4217. | ActiveCurrencyAndAmount_SimpleType | ^\d{1,13}\.\d{1,5}$ | |
Currency | 1..1 | OBStatement1/StatementFee/Amount/Currency | A code allocated to a currency by a Maintenance Agency under an international identification scheme, as described in the latest edition of the international standard ISO 4217 "Codes for the representation of currencies and funds". | ActiveOrHistoricCurrencyCode | ^[A-Z]{3,3}$ | |
StatementInterest | 0..n |