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
Field | Type | Description |
---|---|---|
consentId | string | Unique consent returned from the bank |
Attributes
Field | Type | Description |
---|---|---|
bankId | integer | Unique identifier for the bank |
code | string | Temporary code to be exchanged for access token with the bank |
id_token | string | Base64 encoded JSON for verifying state and token’s validity |
state | string | Base64 encoded JSON containing information about the original request to persist the state throughout the user journey |
state->nonce | string | String value used to associate a client session with an ID Token, and to mitigate replay attacks (for internal use) |
state->reRed | string | Redirect URL |
state->accReq | string | tomato pay consentId |
state->bId | integer | bankId (Unique identifier for the bank) |
state->consentId | string | bank consentId |
Success
204 No content
Error Messages
Condition | Response Status | Response Body |
---|---|---|
Invalid bankId | 403 Forbidden | |
Invalid consentId | 404 Not Found | |
No code | 400 Bad Request | {“error”: “Missing/Invalid code”} |
No state | 400 Bad Request | {“error”: “Missing/Invalid state} |
No id_token | 400 Bad Request | {“error”: “Missing/Invalid id_token”} |
Invalid state | 400 Bad Request | {“error”: “Missing/Invalid state”} |
consentId is not in AwaitingAuthorisation status | 400 Bad Request | {“error”: “Missing/Invalid Status”} |
Invalid id_token | 400 Bad Request | |
Bank errors | 502 Bad Gateway | {“error”: “Bank error”} |
Request Body
{"bankId"=>"6", "code"=>"code", "id_token"=>"id_token", "state"=>"state"}
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
Content-Type | string | ||
X-Api-Key | string | ||
X-Partner-Id | string | ||
Authorization | string | ||
X-Company-Id | string |