Authorise Payment

POST {{base_url}}/banking/v2/pay/domestic/consents/:consentId

Authorise Payment

Before the payment can be initiated, the payment request needs to be approved.

Before calling this endpoint, authentication needs to be created in order to retrieve the authentication URL (authUrl) for the bank.

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

The payment request will be completed once the user successfully signs in. You will be redirected back to your redirect field in the initial POST request body.

Path variables

FieldTypeDescription
consentIdstringUnique identifier for the consent

Request

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

Attributes

FieldTypeDescription
idstringUnique identifier for the payment
consentIdstringUnique identifier for the consent
companyIdstringUnique identifier for the company
creditorJSON objectCreditor information
creditor -> schemenamestringIBAN or Account and sort code
creditor -> identificationstringCreditor's account details
creditor -> namestringCreditor name
amountintegerPayment amount
currencystringAccount currency
referencestringTransaction reference
typestringPayment type {DOMESTIC}
creationDatedatetimeDate and time of the transaction
remittanceInfostringPartner Id is sent as remittance information in order to reconcile the payment with AIS transaction

Error Messages

ConditionResponse StatusResponse Body
Invalid bankId403 Forbidden
No code400 Bad Request{“error”: “Missing/Invalid bank 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”}
Invalid id_token400 Bad Request{“error”: “Open ID token verification failed”}
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

RESPONSES

status: Created

{"id":"paymentId1234","consentId":"consentId3456","bankId":6,"companyId":"companyId1234","type":"DOMESTIC","status":"PENDING","amount":"25.00","currency":"GBP","reference":"reference","creditor":{"schemeName":"UK.OBIE.SortCodeAccountNumber","identification":"11223301234567","name":"Creditor name"},"creationDate":"2020-10-27T10:02:37Z","remittanceInfo":"partnerId1243"}