Migration Guide for Pre-approval API /applications
to /mortgage/2.0
This is a quick guide for changes in the Preapproval API and how to migrate to the new API.
Please note that there is no sandbox environment available for the Pre-approval API yet.
Please refer the api spec for details:
pre-approval api spec
Changelog
Major change in the new API is that the base url has changed from https://api.sbab.se/partner/applications
to https://api.sbab.se/partner/mortgage/2.0
.
The url changes for the endpoints are as follows:
Preapproval API flow
This is a quick guide for the Preapproval API flow.
-
Call
POST
https://api.sbab.se/partner/mortgage/2.0/pre-approval to generate pre-approval offer. -
Call
POST
https://api.sbab.se/partner/mortgage/2.0/pre-approval/{id}/acceptance to accept pre-approval offer variantwith
orwithout
unsecured loan.- Response body:
AcceptPreApprovalResponseV2
:{ "status": "AWAITING_ACCEPTANCE", "signing_process": { "participants": [ { "personal_number": "198410160595", "id": "b9052a54-7e40-11ee-b962-0242ac120002" }, { "personal_number": "196407166815", "id": "8be4a061-7a05-4499-8396-020806b92ee2" } ] }, "expiry_date": "2024-04-23T15:00:00Z" }
- Note down
signing_process.participants[n].id
values from thesigning_process.participants
list. Ex.b9052a54-7e40-11ee-b962-0242ac120002
and8be4a061-7a05-4499-8396-020806b92ee2
above respectively.
- Response body:
-
Call signing api for each participant id to start signing for respective applicant.
Refer Signing API for details.
Request bodyStartSigningRequest
:{ "participant_id": "b9052a54-7e40-11ee-b962-0242ac120002" }
OR
Request body
StartPhoneSigningRequest
:{ "participant_id": "8be4a061-7a05-4499-8396-020806b92ee2", "call_initiator": "RP" }
-
Call
GET
https://api.sbab.se/partner/mortgage/2.0/pre-approval/{id}/status to get the complete status of the pre-approval.
Response body:PreApprovalStatusDataV2
:{ "signing_process": { "participants": [ { "personal_number": "198410160595", "id": "b9052a54-7e40-11ee-b962-0242ac120002", "signed": true, "signed_at": "2024-04-08T14:07:17Z" }, { "personal_number": "196407166815", "id": "8be4a061-7a05-4499-8396-020806b92ee2", "signed": false } ] }, "status": { "type": "SIGNING_ONGOING" }, "expiry_date": "2024-04-23T15:00:00Z" }
-
Once all the applicants have signed, the application will be submitted for further processing.
-
Call
GET
https://api.sbab.se/partner/mortgage/2.0/pre-approval/{id}/status to get the status andcustomer_service_reference
for the application.
Response body:PreApprovalStatusDataV2
:{ "signing_process": { "participants": [ { "personal_number": "198410160595", "id": "b9052a54-7e40-11ee-b962-0242ac120002", "signed": true, "signed_at": "2024-04-08T14:07:17Z" }, { "personal_number": "196407166815", "id": "8be4a061-7a05-4499-8396-020806b92ee2", "signed": true, "signed_at": "2024-04-08T14:09:17Z" } ] }, "customer_service_reference": "5060803", "status": { "type": "PROCESSING" }, "expiry_date": "2024-04-23T15:00:00Z" }
-
The application will be subsequently processed by the credit handling system and the status will be updated to
APPROVED
orREJECTED
.
Signing API
The new signing API replaces the signature
endpoint POST
https://api.sbab.se/partner/applications/{id}/pre-approval/applicants/{applicant-id}/signature
.
The new signing API has following endpoints:
endpoint url | description |
---|---|
POST https://api.sbab.se/partner/signing/1.0/start | Initiate signing for a signing process participant using autostart_token or qr_string |
POST https://api.sbab.se/partner/signing/1.0/start/phone | Initiate signing for a signing process participant if you are in a call with the client |
POST https://api.sbab.se/partner/signing/1.0/collect | Collect the status of the signing or get a new qr_string |
POST https://api.sbab.se/partner/signing/1.0/cancel | Cancel the signing, (Available, but not needed for a successful signing flow) |
Signing API flow
1. Initiate signing for a participant using any one of the following 3 methods
- BankID app on the same device using
autostart_token
.- Use
POST
https://api.sbab.se/partner/signing/1.0/start
to start signing for an applicant.
Use thesigning_process.participants[n].id
value from thePreApprovalStatusDataV2
response forparticipant_id
.
Request bodyStartSigningRequest
:This will return the{ "participant_id": "b9052a54-7e40-11ee-b962-0242ac120002" }
autostart_token
andqr_string
which should be used to start signing.
Response bodyStartSigningResponse
:{ "autostart_token": "41d9be69-7686-4ac4-94b4-7e78cc6f598b", "qr_string": "bankid.2e42ad1d-9867-4fe7-8480-3f749cd8d3a4.0.f13fd02ee9c9380c56920ab77ac2a578663f0745be33d7a89eda6d2bfb241438" }
- The BankID app should be launched using this url format.
bankid://autostarttoken=<autostart_token>&redirect=null
Ex.bankid://autostarttoken=41d9be69-7686-4ac4-94b4-7e78cc6f598b&redirect=null
- The user can sign using the BankID app.
- Use
OR
- BankID app on another device using the
qr_string
.- Use
POST
https://api.sbab.se/partner/signing/1.0/start
to start signing for an applicant.
Use thesigning_process.participants[n].id
value from thePreApprovalStatusDataV2
response forparticipant_id
.
Request bodyStartSigningRequest
:This will return the{ "participant_id": "b9052a54-7e40-11ee-b962-0242ac120002" }
autostart_token
andqr_string
which should be used to start signing.
Response bodyStartSigningResponse
:{ "autostart_token": "41d9be69-7686-4ac4-94b4-7e78cc6f598b", "qr_string": "bankid.2e42ad1d-9867-4fe7-8480-3f749cd8d3a4.0.f13fd02ee9c9380c56920ab77ac2a578663f0745be33d7a89eda6d2bfb241438" }
- The QR code should be displayed to the user to scan using the BankID app on another device.
- Use
OR
- On a phone call with the customer using
start/phone
endpoint.- Use
POST
https://api.sbab.se/partner/signing/1.0/start/phone
if you are in a call with the client.
Use thesigning_process.participants[n].id
value from thePreApprovalStatusDataV2
response forparticipant_id
.
Usecall_initiator
asRP
if you are initiating the call. If the customer initiates the call, usecall_initiator
asUSER
.
Request bodyStartPhoneSigningRequest
:Response status code:{ "participant_id": "8be4a061-7a05-4499-8396-020806b92ee2", "call_initiator": "RP" }
204
- This will automatically launch the BankID app on the user's device.
- The user will get a notification to confirm that they are currently in a call with the partner.
- Once the user confirms, they can sign through the BankID app.
- Use
2. Use the signing/collect
endpoint to obtain the status of the signing or get a new qr_string
This endpoint should be used to display information about the signing for the user.
Refer our documentation for more details: Signing API
- Use
POST
https://api.sbab.se/partner/signing/1.0/collect to get the status of the signing or get a newqr_string
.
Use thesigning_process.participants[n].id
value from thePreApprovalStatusDataV2
response forparticipant_id
.
Request bodyCollectSigningRequest
:Response body{ "participant_id": "b9052a54-7e40-11ee-b962-0242ac120002" }
CollectSigningResponse
:{ "status": "INITIATED", "hint_code": "OUTSTANDING_TRANSACTION", "qr_string": "bankid.67df3917-fa0d-44e5-b327-edcc928297f8.0.dc69358e712458a66a7525beef148ae8526b1c71610eff2c16cdffb4cdac9bf8" }
- Display the QR code to the user to scan using the BankID app.
- OR use the
status
andhint_code
to check the status of the signing.
Refer our documentation for more details: Signing API
signing/cancel
endpoint
Use POST
https://api.sbab.se/partner/signing/1.0/cancel to cancel the signing.
Use the signing_process.participants[n].id
value from the PreApprovalStatusDataV2
response for participant_id
.
Request body CancelSigningRequest
:
{
"participant_id": "b9052a54-7e40-11ee-b962-0242ac120002"
}
Response status code: 204