@lap v0.3
# Machine-readable API spec. Each @endpoint block is one API call.
@api Account and Transaction API Specification
@base /open-banking/v4.0/aisp
@version 4.0.0
@auth OAuth2 | OAuth2
@common_fields {Authorization: str, x-fapi-auth-date: str, x-fapi-customer-ip-address: str, x-fapi-interaction-id: str, x-customer-user-agent: str}
@endpoints 29
@hint download_for_search
@toc account-access-consents(3), accounts(16), balances(1), beneficiaries(1), direct-debits(1), offers(1), party(1), products(1), scheduled-payments(1), standing-orders(1), statements(1), transactions(1)

@group account-access-consents
@endpoint POST /account-access-consents
@required {Data: map{Permissions!: [str], ExpirationDateTime: str(date-time), TransactionFromDateTime: str(date-time), TransactionToDateTime: str(date-time)}, Risk: map}
@returns(201) {Data: map{ConsentId: str, CreationDateTime: str(date-time), Status: str, StatusReason: [map], StatusUpdateDateTime: str(date-time), Permissions: [str], ExpirationDateTime: str(date-time), TransactionFromDateTime: str(date-time), TransactionToDateTime: str(date-time)}, Risk: map, Links: map{Self: str(uri), First: str(uri), Prev: str(uri), Next: str(uri), Last: str(uri)}, Meta: map{TotalPages: int(int32), FirstAvailableDateTime: str(date-time), LastAvailableDateTime: str(date-time)}}
@errors {400, 401, 403, 405, 406, 415, 429, 500}

@endpoint GET /account-access-consents/{ConsentId}
@required {ConsentId: str}
@returns(200) {Data: map{ConsentId: str, CreationDateTime: str(date-time), Status: str, StatusReason: [map], StatusUpdateDateTime: str(date-time), Permissions: [str], ExpirationDateTime: str(date-time), TransactionFromDateTime: str(date-time), TransactionToDateTime: str(date-time)}, Risk: map, Links: map{Self: str(uri), First: str(uri), Prev: str(uri), Next: str(uri), Last: str(uri)}, Meta: map{TotalPages: int(int32), FirstAvailableDateTime: str(date-time), LastAvailableDateTime: str(date-time)}}
@errors {400, 401, 403, 405, 406, 429, 500}

@endpoint DELETE /account-access-consents/{ConsentId}
@required {ConsentId: str}
@returns(204)
@errors {400, 401, 403, 405, 406, 429, 500}

@endgroup

@group accounts
@endpoint GET /accounts
@returns(200) {Data: map{Account: [map]}, Links: map{Self: str(uri), First: str(uri), Prev: str(uri), Next: str(uri), Last: str(uri)}, Meta: map{TotalPages: int(int32), FirstAvailableDateTime: str(date-time), LastAvailableDateTime: str(date-time)}}
@errors {400, 401, 403, 405, 406, 429, 500}

@endpoint GET /accounts/{AccountId}
@required {AccountId: str}
@returns(200) {Data: map{Account: [map]}, Links: map{Self: str(uri), First: str(uri), Prev: str(uri), Next: str(uri), Last: str(uri)}, Meta: map{TotalPages: int(int32), FirstAvailableDateTime: str(date-time), LastAvailableDateTime: str(date-time)}}
@errors {400, 401, 403, 405, 406, 429, 500}

@endpoint GET /accounts/{AccountId}/balances
@required {AccountId: str}
@returns(200) {Data: map{Balance: [map], TotalValue: map{Amount: str, Currency: str}}, Links: map{Self: str(uri), First: str(uri), Prev: str(uri), Next: str(uri), Last: str(uri)}, Meta: map{TotalPages: int(int32), FirstAvailableDateTime: str(date-time), LastAvailableDateTime: str(date-time)}}
@errors {400, 401, 403, 405, 406, 429, 500}

@endpoint GET /accounts/{AccountId}/beneficiaries
@required {AccountId: str}
@returns(200) {Data: map{Beneficiary: [map]}, Links: map{Self: str(uri), First: str(uri), Prev: str(uri), Next: str(uri), Last: str(uri)}, Meta: map{TotalPages: int(int32), FirstAvailableDateTime: str(date-time), LastAvailableDateTime: str(date-time)}}
@errors {400, 401, 403, 404, 405, 406, 429, 500}

@endpoint GET /accounts/{AccountId}/direct-debits
@required {AccountId: str}
@returns(200) {Data: map{DirectDebit: [map]}, Links: map{Self: str(uri), First: str(uri), Prev: str(uri), Next: str(uri), Last: str(uri)}, Meta: map{TotalPages: int(int32), FirstAvailableDateTime: str(date-time), LastAvailableDateTime: str(date-time)}}
@errors {400, 401, 403, 404, 405, 406, 429, 500}

@endpoint GET /accounts/{AccountId}/offers
@required {AccountId: str}
@returns(200) {Data: map{Offer: [map]}, Links: map{Self: str(uri), First: str(uri), Prev: str(uri), Next: str(uri), Last: str(uri)}, Meta: map{TotalPages: int(int32), FirstAvailableDateTime: str(date-time), LastAvailableDateTime: str(date-time)}}
@errors {400, 401, 403, 404, 405, 406, 429, 500}

@endpoint GET /accounts/{AccountId}/parties
@required {AccountId: str}
@returns(200) {Data: map{Party: [map]}, Links: map{Self: str(uri), First: str(uri), Prev: str(uri), Next: str(uri), Last: str(uri)}, Meta: map{TotalPages: int(int32), FirstAvailableDateTime: str(date-time), LastAvailableDateTime: str(date-time)}}
@errors {400, 401, 403, 404, 405, 406, 429, 500}

@endpoint GET /accounts/{AccountId}/party
@required {AccountId: str}
@returns(200) {Data: map{Party: map{PartyId: str, PartyNumber: str, PartyType: str, Name: str, FullLegalName: str, LegalStructure: str, LEI: str, BeneficialOwnership: bool, AccountRole: str, EmailAddress: str, Phone: str, Mobile: str, Relationships: map{Account: map}, Address: [map]}}, Links: map{Self: str(uri), First: str(uri), Prev: str(uri), Next: str(uri), Last: str(uri)}, Meta: map{TotalPages: int(int32), FirstAvailableDateTime: str(date-time), LastAvailableDateTime: str(date-time)}}
@errors {400, 401, 403, 404, 405, 406, 429, 500}

@endpoint GET /accounts/{AccountId}/product
@required {AccountId: str}
@returns(200) {Data: map{Product: [map]}, Links: map{Self: str(uri), First: str(uri), Prev: str(uri), Next: str(uri), Last: str(uri)}, Meta: map{TotalPages: int(int32), FirstAvailableDateTime: str(date-time), LastAvailableDateTime: str(date-time)}}
@errors {400, 401, 403, 404, 405, 406, 429, 500}

@endpoint GET /accounts/{AccountId}/scheduled-payments
@required {AccountId: str}
@returns(200) {Data: map{ScheduledPayment: [map]}, Links: map{Self: str(uri), First: str(uri), Prev: str(uri), Next: str(uri), Last: str(uri)}, Meta: map{TotalPages: int(int32), FirstAvailableDateTime: str(date-time), LastAvailableDateTime: str(date-time)}}
@errors {400, 401, 403, 404, 405, 406, 429, 500}

@endpoint GET /accounts/{AccountId}/standing-orders
@required {AccountId: str}
@returns(200) {Data: map{StandingOrder: [map]}, Links: map{Self: str(uri), First: str(uri), Prev: str(uri), Next: str(uri), Last: str(uri)}, Meta: map{TotalPages: int(int32), FirstAvailableDateTime: str(date-time), LastAvailableDateTime: str(date-time)}}
@errors {400, 401, 403, 404, 405, 406, 429, 500}

@endpoint GET /accounts/{AccountId}/statements
@required {AccountId: str}
@optional {fromStatementDateTime: str(date-time), toStatementDateTime: str(date-time)}
@returns(200) {Data: map{Statement: [map]}, Links: map{Self: str(uri), First: str(uri), Prev: str(uri), Next: str(uri), Last: str(uri)}, Meta: map{TotalPages: int(int32), FirstAvailableDateTime: str(date-time), LastAvailableDateTime: str(date-time)}}
@errors {400, 401, 403, 404, 405, 406, 429, 500}

@endpoint GET /accounts/{AccountId}/statements/{StatementId}
@required {StatementId: str, AccountId: str}
@returns(200) {Data: map{Statement: [map]}, Links: map{Self: str(uri), First: str(uri), Prev: str(uri), Next: str(uri), Last: str(uri)}, Meta: map{TotalPages: int(int32), FirstAvailableDateTime: str(date-time), LastAvailableDateTime: str(date-time)}}
@errors {400, 401, 403, 404, 405, 406, 429, 500}

@endpoint GET /accounts/{AccountId}/statements/{StatementId}/file
@required {StatementId: str, AccountId: str}
@returns(200)
@errors {400, 401, 403, 404, 405, 406, 429, 500}

@endpoint GET /accounts/{AccountId}/statements/{StatementId}/transactions
@required {StatementId: str, AccountId: str}
@returns(200) {Data: map{Transaction: [map]}, Links: map{Self: str(uri), First: str(uri), Prev: str(uri), Next: str(uri), Last: str(uri)}, Meta: map{TotalPages: int(int32), FirstAvailableDateTime: str(date-time), LastAvailableDateTime: str(date-time)}}
@errors {400, 401, 403, 404, 405, 406, 429, 500}

@endpoint GET /accounts/{AccountId}/transactions
@required {AccountId: str}
@optional {fromBookingDateTime: str(date-time), toBookingDateTime: str(date-time)}
@returns(200) {Data: map{Transaction: [map]}, Links: map{Self: str(uri), First: str(uri), Prev: str(uri), Next: str(uri), Last: str(uri)}, Meta: map{TotalPages: int(int32), FirstAvailableDateTime: str(date-time), LastAvailableDateTime: str(date-time)}}
@errors {400, 401, 403, 405, 406, 429, 500}

@endgroup

@group balances
@endpoint GET /balances
@returns(200) {Data: map{Balance: [map], TotalValue: map{Amount: str, Currency: str}}, Links: map{Self: str(uri), First: str(uri), Prev: str(uri), Next: str(uri), Last: str(uri)}, Meta: map{TotalPages: int(int32), FirstAvailableDateTime: str(date-time), LastAvailableDateTime: str(date-time)}}
@errors {400, 401, 403, 404, 405, 406, 429, 500}

@endgroup

@group beneficiaries
@endpoint GET /beneficiaries
@returns(200) {Data: map{Beneficiary: [map]}, Links: map{Self: str(uri), First: str(uri), Prev: str(uri), Next: str(uri), Last: str(uri)}, Meta: map{TotalPages: int(int32), FirstAvailableDateTime: str(date-time), LastAvailableDateTime: str(date-time)}}
@errors {400, 401, 403, 404, 405, 406, 429, 500}

@endgroup

@group direct-debits
@endpoint GET /direct-debits
@returns(200) {Data: map{DirectDebit: [map]}, Links: map{Self: str(uri), First: str(uri), Prev: str(uri), Next: str(uri), Last: str(uri)}, Meta: map{TotalPages: int(int32), FirstAvailableDateTime: str(date-time), LastAvailableDateTime: str(date-time)}}
@errors {400, 401, 403, 404, 405, 406, 429, 500}

@endgroup

@group offers
@endpoint GET /offers
@returns(200) {Data: map{Offer: [map]}, Links: map{Self: str(uri), First: str(uri), Prev: str(uri), Next: str(uri), Last: str(uri)}, Meta: map{TotalPages: int(int32), FirstAvailableDateTime: str(date-time), LastAvailableDateTime: str(date-time)}}
@errors {400, 401, 403, 404, 405, 406, 429, 500}

@endgroup

@group party
@endpoint GET /party
@returns(200) {Data: map{Party: map{PartyId: str, PartyNumber: str, PartyType: str, Name: str, FullLegalName: str, LegalStructure: str, LEI: str, BeneficialOwnership: bool, AccountRole: str, EmailAddress: str, Phone: str, Mobile: str, Relationships: map{Account: map}, Address: [map]}}, Links: map{Self: str(uri), First: str(uri), Prev: str(uri), Next: str(uri), Last: str(uri)}, Meta: map{TotalPages: int(int32), FirstAvailableDateTime: str(date-time), LastAvailableDateTime: str(date-time)}}
@errors {400, 401, 403, 404, 405, 406, 429, 500}

@endgroup

@group products
@endpoint GET /products
@returns(200) {Data: map{Product: [map]}, Links: map{Self: str(uri), First: str(uri), Prev: str(uri), Next: str(uri), Last: str(uri)}, Meta: map{TotalPages: int(int32), FirstAvailableDateTime: str(date-time), LastAvailableDateTime: str(date-time)}}
@errors {400, 401, 403, 404, 405, 406, 429, 500}

@endgroup

@group scheduled-payments
@endpoint GET /scheduled-payments
@returns(200) {Data: map{ScheduledPayment: [map]}, Links: map{Self: str(uri), First: str(uri), Prev: str(uri), Next: str(uri), Last: str(uri)}, Meta: map{TotalPages: int(int32), FirstAvailableDateTime: str(date-time), LastAvailableDateTime: str(date-time)}}
@errors {400, 401, 403, 404, 405, 406, 429, 500}

@endgroup

@group standing-orders
@endpoint GET /standing-orders
@returns(200) {Data: map{StandingOrder: [map]}, Links: map{Self: str(uri), First: str(uri), Prev: str(uri), Next: str(uri), Last: str(uri)}, Meta: map{TotalPages: int(int32), FirstAvailableDateTime: str(date-time), LastAvailableDateTime: str(date-time)}}
@errors {400, 401, 403, 404, 405, 406, 429, 500}

@endgroup

@group statements
@endpoint GET /statements
@optional {fromStatementDateTime: str(date-time), toStatementDateTime: str(date-time)}
@returns(200) {Data: map{Statement: [map]}, Links: map{Self: str(uri), First: str(uri), Prev: str(uri), Next: str(uri), Last: str(uri)}, Meta: map{TotalPages: int(int32), FirstAvailableDateTime: str(date-time), LastAvailableDateTime: str(date-time)}}
@errors {400, 401, 403, 404, 405, 406, 429, 500}

@endgroup

@group transactions
@endpoint GET /transactions
@optional {fromBookingDateTime: str(date-time), toBookingDateTime: str(date-time)}
@returns(200) {Data: map{Transaction: [map]}, Links: map{Self: str(uri), First: str(uri), Prev: str(uri), Next: str(uri), Last: str(uri)}, Meta: map{TotalPages: int(int32), FirstAvailableDateTime: str(date-time), LastAvailableDateTime: str(date-time)}}
@errors {400, 401, 403, 404, 405, 406, 429, 500}

@endgroup

@end
