Skip to end of banner
Go to start of banner

Account Access Consents v2.0.0-rc1

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Version History

Version 1 Current »

Version Control

VersionDateAuthorComments
1.0.001 March 2019Payments NZ API Working GroupBaseline specification for Account Requests Resource
v2.0-draft1
 

Updates:

  • Renamed account-requests to account-access-consents (aligned with OBIE v3.1.2)
  • Updated AccountRequestId to ConsentId (aligned with OBIE v3.1.2)
  • Updated consent elements to sit within a Consent object (to align all other consent resources)
  • In 19890264 table - have updated "Idempotent" column to "Idempotency Key" (aligned with OBIE v3.1.2)
  • Standardised language for 19890264 (to align all other consent resources)
  • Updated 19890264 and clarified triggers for all Status changes, and tightened language
  • Updated 19890264 for consistency

Added:

Errata:

  • Removed legacy references to "ReadProducts" permission code enumeration
v2.0-draft2 Gavin Wong (Unlicensed)

Updates:

Errata:

  • Typos
v2.0-draft3 Gavin Wong (Unlicensed)

Updates:

  • Updated class name for Status field from OBExternalRequestStatus1Code to OBExternalConsentStatus1Code

Errata:

  • Typos

Definition

The account-access-consent resource represents a consent that has been agreed between the Customer and the Third Party for the Third Party to access a Customer's account information with an API Provider.

The Status of the account-access-consent represents the authentication and authorisation stage with the API Provider.

Endpoints

ResourceEndpointMandatory?ScopeGrant TypeIdempotency KeyParametersRequest ObjectResponse Object
account-access-consentsPOST /account-access-consentsMandatorythird_party_client_credentialClient CredentialsNo
NZReadAccessConsent1NZReadAccessConsentResponse1
account-access-consentsGET /account-access-consents/{ConsentId}Mandatorythird_party_client_credentialClient CredentialsNo

NZReadAccessConsentResponse1
account-access-consentsDELETE /account-access-consents/{ConsentId}Mandatorythird_party_client_credentialClient CredentialsNo


POST /account-access-consents

The API endpoint allows a Third Party to ask an API Provider to create a new account-access-consent resource.

  • The Third Party does this with the POST /account-access-consents action.
  • The Third Party must have an access token issued by the API Provider using a client credentials grant.
  • The API endpoint allows the Third Party to send a copy of the consent (between Customer and Third Party) to the API Provider.
  • The API Provider creates the account-access-consent resource and responds with a unique ConsentId to refer to the resource.
  • At the point the consent resource is created, the consent has not been authorised.
  • The account-access-consent resource is only valid for 24 hours if not authorised by the Customer. 
  • An API Provider may delete the account-access-consent resource 24 hours after creation if not authorised by the Customer or, if authorised by the Customer, 24 hours after the specified expiry date.

Flow

The Third Party uses the ConsentId to initiate an authorisation flow (as described in the Security Profile).

As part of the authorisation flow:

  • The API Provider authenticates the Customer.
  • The API Provider plays back the consent (registered by the Third Party) back to the Customer - to get consent authorisation. The Customer may accept or reject the consent in its entirety (but not selectively).
  • The API Provider presents the Customer a list of accounts that will be linked to the account-access-consent from which the Customer may select one or many.
  • There is no functionality for a Third Party to pre-select a set of accounts that will be linked as part of the consent.
  • The Customer must consent to at least one account or the API Provider rejects the request with a Rejected status.

Once these steps are complete, the consent is considered to have been authorised by the Customer and the Status is updated to "Authorised".

Status

The Status is "AwaitingAuthorisation" immediately after the account access consent has been created.

GET /account-access-consents/{ConsentId}

The API endpoint allows a Third Party to optionally retrieve an account-access-consent resource that they have created with an API Provider, to check its status. 
  • The Third Party must have an access token issued by the API Provider using a client credentials grant.

Status

The available status codes for the account access consent resource are:

  • AwaitingAuthorisation
  • Rejected
  • Authorised
  • Revoked

DELETE /account-access-consents/{ConsentId}

The API endpoint allows a Third Party to delete the account-access-consent with the API Provider

  • This is done by making a call to DELETE the account-access-consent resource.
  • The Third Party must have an access token issued by the API Provider using a client credentials grant.
  • The Third Party must delete the account-access-consent resource, if the Customer revokes consent to data access with the Third Party.

State Model

The state model for the account-access-consent resource follows a long lived consent state model.

  • When the Third Party creates the account-access-consent resource with the API Provider, the Status of the account-access-consent resource will be set to "AwaitingAuthorisation".
  • When the Customer authorises the account-access-consent resource with the API Provider, the Status of the account-access-consent resource will be updated with "Authorised".
  • If the Customer rejects the consent or the account-access-consent has failed some other API Provider validation, the Status of the account-access-consent resource will be set to "Rejected".
  • If the Customer revokes the account-access-consent in the "Authorised" Status with the API Provider, the Status of the account-access-consent resource will be set to "Revoked".

Diagram

This is the state diagram for the status of the account-access-consent resource.

Definitions


StatusStatus Description
1AwaitingAuthorisation

The consent resource is awaiting Customer authorisation.

  • This is an initial state.
2Rejected

The consent resource has been rejected.

  • This is a terminal state.
  • Does not distinguish between failure reasons - e.g. authorisation failed or bank rejected. 
3Authorised 

The consent resource has been successfully authorised.

  • This is an intermediate state.
4Revoked

The consent resource has been revoked via the API Provider interface.

  • This is a terminal state.

Data Model

Account Access Consent - Request

The NZReadAccessConsent1 object will be used for the call to:

  • POST /account-access-consents

UML Diagram

Notes

  • The fields in the NZReadAccessConsent1 object are also described in the Consent Elements in the Account and Transaction Information page.

Data Dictionary

NameOccurrenceXPathEnhancedDefinitionClassCodes
NZReadAccessConsent1
NZReadAccessConsent1
NZReadAccessConsent1
Data1..1NZReadAccessConsent1/Data
NZReadDataAccessConsent1
Consent1..1NZReadAccessConsent1/Data/ConsentThe Consent payload is sent by the Third Party to the API Provider. It is used to request account access for the Customer.NZAccessConsent1
Permissions1..nNZReadAccessConsent1/Data/Consent/PermissionsSpecifies the Open Banking account request types. This is a list of the data clusters being consented by the Customer, and requested for authorisation with the API Provider.OBExternalPermissions1CodeReadAccountsBasic
ReadAccountsDetail
ReadBalances
ReadBeneficiariesBasic
ReadBeneficiariesDetail
ReadDirectDebits
ReadOffers
ReadPAN
ReadParty
ReadPartyAuthUser
ReadScheduledPaymentsBasic
ReadScheduledPaymentsDetail
ReadStandingOrdersBasic
ReadStandingOrdersDetail
ReadStatementsBasic
ReadStatementsDetail
ReadTransactionsBasic
ReadTransactionsCredits
ReadTransactionsDebits
ReadTransactionsDetail
ExpirationDateTime0..1NZReadAccessConsent1/Data/Consent/ExpirationDateTimeSpecified date and time the permissions will expire.
If this is not populated, the permissions will be open ended.
ISODateTime
TransactionFromDateTime0..1NZReadAccessConsent1/Data/Consent/TransactionFromDateTimeSpecified start date and time for the transaction query period.
If this is not populated, the start date will be open ended, and data will be returned from the earliest available transaction.
ISODateTime
TransactionToDateTime0..1NZReadAccessConsent1/Data/Consent/TransactionToDateTimeSpecified end date and time for the transaction query period.
If this is not populated, the end date will be open ended, and data will be returned to the latest available transaction.
ISODateTime
Risk1..1NZReadAccessConsent1/RiskThe Risk section is sent by the initiating party to the API Provider. It is used to specify additional details for risk scoring.NZRisk1

Account Access Consent - Response

The NZReadAccessConsentResponse1 object will be used for the call to:

  • GET /account-access-consents/{ConsentId}

and response to:

  • POST /account-access-consents

UML Diagram

Notes

  • The NZReadAccessConsentResponse1 object contains the same information as the NZReadAccessConsent1 - but with additional fields:
    • ConsentId - to uniquely identify the account-access-consent resource
    • CreationDateTime
    • Status
    • StatusUpdateDateTime

Data Dictionary

NameOccurrenceXPathEnhancedDefinitionClassCodes
NZReadAccessConsentResponse1
NZReadAccessConsentResponse1NZReadAccessConsentResponse1

Data1..1NZReadAccessConsentResponse1/DataNZReadDataAccessConsentResponse1

ConsentId1..1NZReadAccessConsentResponse1/Data/ConsentIdUnique identification as assigned to identify the account request resource.Max128Text
Status1..1NZReadAccessConsentResponse1/Data/StatusSpecifies the status of the account request resource.OBExternalConsentStatus1CodeAuthorised
AwaitingAuthorisation
Rejected
Revoked
CreationDateTime1..1NZReadAccessConsentResponse1/Data/CreationDateTimeDate and time at which the resource was created.ISODateTime
StatusUpdateDateTime1..1NZReadAccessConsentResponse1/Data/StatusUpdateDateTimeDate and time at which the resource status was updated.ISODateTime
Consent1..1NZReadAccessConsentResponse1/Data/ConsentThe Consent payload is sent by the Third Party to the API Provider. It is used to request account access for the Customer.NZAccessConsent1
Permissions1..nNZReadAccessConsentResponse1/Data/Consent/PermissionsSpecifies the Open Banking account request types. This is a list of the data clusters being consented by the Customer, and requested for authorisation with the API Provider.OBExternalPermissions1CodeReadAccountsBasic
ReadAccountsDetail
ReadBalances
ReadBeneficiariesBasic
ReadBeneficiariesDetail
ReadDirectDebits
ReadOffers
ReadPAN
ReadParty
ReadPartyAuthUser
ReadScheduledPaymentsBasic
ReadScheduledPaymentsDetail
ReadStandingOrdersBasic
ReadStandingOrdersDetail
ReadStatementsBasic
ReadStatementsDetail
ReadTransactionsBasic
ReadTransactionsCredits
ReadTransactionsDebits
ReadTransactionsDetail
ExpirationDateTime0..1NZReadAccessConsentResponse1/Data/Consent/ExpirationDateTimeSpecified date and time the permissions will expire.
If this is not populated, the permissions will be open ended.
ISODateTime
TransactionFromDateTime0..1NZReadAccessConsentResponse1/Data/Consent/TransactionFromDateTimeSpecified start date and time for the transaction query period.
If this is not populated, the start date will be open ended, and data will be returned from the earliest available transaction.
ISODateTime
TransactionToDateTime0..1NZReadAccessConsentResponse1/Data/Consent/TransactionToDateTimeSpecified end date and time for the transaction query period.
If this is not populated, the end date will be open ended, and data will be returned to the latest available transaction.
ISODateTime
Risk1..1NZReadAccessConsentResponse1/RiskThe Risk section is sent by the initiating party to the API Provider. It is used to specify additional details for risk scoring.NZRisk1

Enumerations

This section gives the definitions for enumerations used.

Code ClassName Definition 
OBExternalPermissions1CodeReadAccountsBasicPermission to read basic account information.
OBExternalPermissions1CodeReadAccountsDetailAccess to additional elements in the account payload.
OBExternalPermissions1CodeReadBalancesPermission to read all balance information.
OBExternalPermissions1CodeReadBeneficiariesBasicAbility to read basic beneficiary details
OBExternalPermissions1CodeReadBeneficiariesDetailAbility to read account identification details for the beneficiary
OBExternalPermissions1CodeReadDirectDebitsAbility to read all direct debit information
OBExternalPermissions1CodeReadOffersAbility to read all offer information
OBExternalPermissions1CodeReadPANRequest to access PAN in the clear across the available endpoints. If this permission code is not in the account-request, the Third Party will receive a masked PAN.While a Third Party may request to access PAN in the clear, an API Provider may still respond with a masked PAN if the API Provider takes a legal view to respond with only the masked PAN.
OBExternalPermissions1CodeReadPartyAbility to read party information on the account owner.
OBExternalPermissions1CodeReadPartyAuthUserAbility to read party information on the user logged in.
OBExternalPermissions1CodeReadScheduledPaymentsBasicAbility to read basic statement details
OBExternalPermissions1CodeReadScheduledPaymentsDetailAbility to read account identification details for beneficiary of the scheduled payment
OBExternalPermissions1CodeReadStandingOrdersBasicAbility to read basic standing order information
OBExternalPermissions1CodeReadStandingOrdersDetailAbility to read account identification details for beneficiary of the standing order
OBExternalPermissions1CodeReadStatementsBasicAbility to read basic statement details
OBExternalPermissions1CodeReadStatementsDetailAbility to read statement data elements which may leak other information about the account
OBExternalPermissions1CodeReadTransactionsBasicAbility to read basic transaction information
OBExternalPermissions1CodeReadTransactionsCreditsAbility to read only credit transactions
OBExternalPermissions1CodeReadTransactionsDebitsAbility to read only debit transactions
OBExternalPermissions1CodeReadTransactionsDetailAbility to read transaction data elements which may hold silent party details
OBExternalRequestStatus1CodeAuthorisedThe account access consent has been successfully authorised.
OBExternalRequestStatus1CodeAwaitingAuthorisationThe account access consent is awaiting further authorisation.
OBExternalRequestStatus1CodeRejectedThe account access consent has been rejected.
OBExternalRequestStatus1CodeRevokedThe account access consent has been revoked via the API Provider interface.

Usage Examples

Create Account Access Consent

This is an example of an account access consent with limited permissions - viewing account details and querying the balance.

Request

POST Account Requests Request
POST /account-access-consents HTTP/1.1
Authorization: Bearer 2YotnFZFEjr1zCsicMWpAA
x-fapi-auth-date: Sun, 10 Sep 2017 19:43:31 UTC
x-fapi-customer-ip-address: 104.25.212.99
x-fapi-interaction-id: 93bac548-d2de-4546-b106-880a5018460d
Content-Type: application/json
Accept: application/json
 
{  
    "Data":{  
        "Consent":{  
            "Permissions":[  
                "ReadAccountsDetail",
                "ReadBalances"
            ],
            "ExpirationDateTime":"2017-05-02T00:00:00+00:00"
        }
    },
    "Risk":{}
}

Response

POST Account Requests Response
HTTP/1.1 201 Created
x-fapi-interaction-id: 93bac548-d2de-4546-b106-880a5018460d
Content-Type: application/json
 
{  
    "Data":{  
        "ConsentId":"88379",
        "Status":"AwaitingAuthorisation",
        "CreationDateTime":"2017-05-02T00:00:00+00:00",
        "StatusUpdateDateTime":"2017-05-02T00:00:00+00:00",
        "Consent":{  
            "Permissions":[  
                "ReadAccountsDetail",
                "ReadBalances"
            ],
            "ExpirationDateTime":"2017-08-02T00:00:00+00:00"
        }
    },
    "Risk":{},
    "Links":{  
        "Self":"https://examplebank.api.co.nz/open-banking-nz/v2.0/account-access-consents/88379"
    },
    "Meta":{  
        "TotalPages":1
    }
}

Status - AwaitingAuthorisation

This is an example of a GET request which is made before the account access consent resource is authorised. 

Request

GET Account Requests Request
GET /account-access-consents/88379 HTTP/1.1
Authorization: Bearer 2YotnFZFEjr1zCsicMWpAA
x-fapi-auth-date: Sun, 10 Sep 2017 19:43:31 UTC
x-fapi-customer-ip-address: 104.25.212.99
x-fapi-interaction-id: 93bac548-d2de-4546-b106-880a5018460d
Accept: application/json

Response

GET Account Requests Response
HTTP/1.1 200 OK
x-fapi-interaction-id: 93bac548-d2de-4546-b106-880a5018460d
Content-Type: application/json 

{  
    "Data":{  
        "ConsentId":"88379",
        "CreationDateTime":"2017-05-02T00:00:00+00:00",
        "Status":"AwaitingAuthorisation",
        "CreationDateTime":"2017-05-02T00:00:00+00:00",
        "StatusUpdateDateTime":"2017-05-02T00:00:00+00:00",
        "Consent":{  
            "Permissions":[  
                "ReadAccountsDetail",
                "ReadBalances"
            ],
            "ExpirationDateTime":"2017-08-02T00:00:00+00:00"
        }
    },
    "Risk":{},
    "Links":{  
        "Self":"https://examplebank.api.co.nz/open-banking-nz/v2.0/account-access-consents/88379"
    },
    "Meta":{  
        "TotalPages":1
    }
}

Status - Authorised

This is an example of a GET request which is made after the account access consent resource is authorised.

Request

GET Account Requests Request
GET /account-access-consents/88379 HTTP/1.1
Authorization: Bearer 2YotnFZFEjr1zCsicMWpAA
x-fapi-auth-date: Sun, 10 Sep 2017 19:43:31 UTC
x-fapi-customer-ip-address: 104.25.212.99
x-fapi-interaction-id: 93bac548-d2de-4546-b106-880a5018460d
Accept: application/json

Response

GET Account Requests Response
HTTP/1.1 200 OK
x-fapi-interaction-id: 93bac548-d2de-4546-b106-880a5018460d
Content-Type: application/json 

{  
    "Data":{  
        "ConsentId":"88379",
        "CreationDateTime":"2017-05-02T00:00:00+00:00",
        "Status":"Authorised",
        "StatusUpdateDateTime":"2017-05-02T00:05:00+00:00",
        "Consent":{  
            "Permissions":[  
                "ReadAccountsDetail",
                "ReadBalances"
            ],
            "ExpirationDateTime":"2017-08-02T00:00:00+00:00"
        }
    },
    "Risk":{},
    "Links":{
        "Self":"https://examplebank.api.co.nz/open-banking-nz/v2.0/account-access-consents/88379"
    },
    "Meta":{  
        "TotalPages":1
    }
}

Delete Account Access Consent

The DELETE /account-access-consents call allows a Third Party to delete a previously created account access consent (whether it is currently authorised or not). The Customer may want to remove their consent via the Third Party instead of revoking authorisation with the API Provider.

This API call allows the Customer to revoke consent with the Third Party - and for that consent to be reflected in authorisation with the API Provider. The API Provider will remove the consent related to the account access consent which is deleted.

Request

DELETE Account Requests Request
DELETE /account-access-consents/88379 HTTP/1.1
Authorization: Bearer 2YotnFZFEjr1zCsicMWpAA
x-fapi-auth-date: Sun, 10 Sep 2017 19:43:31 UTC
x-fapi-customer-ip-address: 104.25.212.99
x-fapi-interaction-id: 93bac548-d2de-4546-b106-880a5018460d
Accept: application/json

Response

DELETE Accounts Response
HTTP/1.1 204 No Content
x-fapi-interaction-id: 93bac548-d2de-4546-b106-880a5018460d

Create Account Access Consent with All Permissions

This is an example of an account access consent with all available permissions.

Request

POST Account Requests Request
POST /account-access-consents HTTP/1.1
Authorization: Bearer 2YotnFZFEjr1zCsicMWpAA
x-fapi-auth-date: Sun, 10 Sep 2017 19:43:31 UTC
x-fapi-customer-ip-address: 104.25.212.99
x-fapi-interaction-id: 93bac548-d2de-4546-b106-880a5018460d
Content-Type: application/json
Accept: application/json
 
{  
    "Data":{  
        "Consent":{  
            "Permissions":[  
                "ReadAccountsDetail",
                "ReadBalances",
                "ReadBeneficiariesDetail",
                "ReadDirectDebits",
                "ReadStandingOrdersDetail",
                "ReadTransactionsCredits",
                "ReadTransactionsDebits",
                "ReadTransactionsDetail",
                "ReadOffers",
                "ReadPAN",
                "ReadParty",
                "ReadPartyAuthUser",
                "ReadScheduledPaymentsDetail",
                "ReadStatementsDetail"
            ],
            "ExpirationDateTime":"2017-05-02T00:00:00+00:00"
        }
    },
    "Risk":{}
}

Response

POST Account Requests Response
HTTP/1.1 201 Created
x-fapi-interaction-id: 93bac548-d2de-4546-b106-880a5018460d
Content-Type: application/json
 
{  
    "Data":{  
        "ConsentId":"88379",
        "CreationDateTime":"2017-05-02T00:00:00+00:00",
        "Status":"AwaitingAuthorisation",
        "StatusUpdateDateTime":"2017-05-02T00:00:00+00:00",
        "Consent":{  
            "Permissions":[  
                "ReadAccountsDetail",
                "ReadBalances",
                "ReadBeneficiariesDetail",
                "ReadDirectDebits",
                "ReadStandingOrdersDetail",
                "ReadTransactionsCredits",
                "ReadTransactionsDebits",
                "ReadTransactionsDetail",
                "ReadOffers",
                "ReadPAN",
                "ReadParty",
                "ReadPartyAuthUser",
                "ReadScheduledPaymentsDetail",
                "ReadStatementsDetail"
            ],
            "ExpirationDateTime":"2017-08-02T00:00:00+00:00"
        }
    },
    "Risk":{},
    "Links":{  
        "Self":"https://examplebank.api.co.nz/open-banking-nz/v2.0/account-access-consents/88379"
    },
    "Meta":{  
        "TotalPages":1
    }
}
  • No labels

0 Comments

You are not logged in. Any changes you make will be marked as anonymous. You may want to Log In if you already have an account.