Put Bank Consent (by id)

PUT {{base_url}}/banking/v2/consents/:consentId

Before connecting to the bank, authentication needs to be created in order to retrieve the sign in URL (signinUrl) for the bank. Calling this endpoint adds a bank account for companyId and bankId and redirects to the URL specified.

Now, your application will need to redirect a user to the signinUrl location for them to sign in through their bank account.

After the user successfully signs in, they will be redirected back to your redirect field in the initial POST request body, alongside query params in the url including code, id_token, and state.

Path variables

FieldTypeDescription
consentIdstringUnique consent returned from the bank

Attributes

FieldTypeDescription
bankIdintegerUnique identifier for the bank
codestringTemporary code to be exchanged for access token with the bank
id_tokenstringBase64 encoded JSON for verifying state and token’s validity
statestringBase64 encoded JSON containing information about the original request to persist the state throughout the user journey
state->noncestringString value used to associate a client session with an ID Token, and to mitigate replay attacks (for internal use)
state->reRedstringRedirect URL
state->accReqstringtomato pay consentId
state->bIdintegerbankId (Unique identifier for the bank)
state->consentIdstringbank consentId

Success

204 No content

Error Messages

ConditionResponse StatusResponse Body
Invalid bankId403 Forbidden
Invalid consentId404 Not Found
No code400 Bad Request{“error”: “Missing/Invalid code”}
No state400 Bad Request{“error”: “Missing/Invalid state}
No id_token400 Bad Request{“error”: “Missing/Invalid id_token”}
Invalid state400 Bad Request{“error”: “Missing/Invalid state”}
consentId is not in AwaitingAuthorisation status400 Bad Request{“error”: “Missing/Invalid Status”}
Invalid id_token400 Bad Request
Bank errors502 Bad Gateway{“error”: “Bank error”}

Request Body

{"bankId"=>"6", "code"=>"code", "id_token"=>"id_token", "state"=>"state"}

HEADERS

KeyDatatypeRequiredDescription
Content-Typestring
X-Api-Keystring
X-Partner-Idstring
Authorizationstring
X-Company-Idstring