Create Consent

Create an account information consent resource at the ASPSP to allow access to accounts specified in the request.

Endpoint

POST /v1/consents

Query Parameters

No query parameters.

Request Headers

AttributeTypeConditionDescription
X-Request-IDStringMandatoryID of the request, unique to the call, as determined by the initiating party (TPP).
AuthorizationStringMandatoryThe oAuth2 Bearer token obtained from the SCA performed prior to this request.
API-KeyStringMandatoryConsumer key available on the developers portal.
TPP-Redirect-URIStringMandatoryURI of the TPP, where the transaction flow shall be redirected after a Redirect.

Request Body

No request body.

Response

HTTP Response Code: 201 (Created)

Response Headers

AttributeTypeConditionDescription
X-Request-IDUUIDMandatoryID of the request, unique to the call, as determined by the initiating party (TPP).

Response Body

AttributeTypeConditionDescription
consent StatusConsent StatusMandatoryAuthentication status of the consent.
consentIdStringMandatoryIdentification of the consent resource as used in the API structure.
_linksArrayMandatoryA list of hyperlinks to be recognized by the TPP.
psuMessageStringOptionalMessages to be displayed to the PSU.

Example

Request

curl -X POST \
https://mp-psd2-api.mypos.com/v1/consents \
-H 'API-Key: aGDmxHAmpMWUL1txqCsjEcOS' \
-H 'Authorization: Bearer oqeeWzoYfqkf1RsfyaB3hyNiLvY7GNAV6Kta7sGa9X' \
-H 'TPP-Redirect-URI: https://test.com' \
-H 'X-Request-ID: a552babc-7081-44e7-9361-61eb17e0bfd9'

Response

{
    "consentId": "a0a0733f-ec20-4186-b883-25419485b337",
    "consentStatus": "Received",
    "_links": {
        "self": {
            "href": "v1/consents/a0a0733f-ec20-4186-b883-25419485b337"
        },
        "scaStatus": {
            "href": "v1/consents/a0a0733f-ec20-4186-b883-25419485b337/status"
        },
        "scaOAuth": {
            "href": "https://www.mypos.com?open_bank_consent_id=a0a0733f-ec20-4186-b883-25419485b337"
        }
    }
}