Getting Started
This guide helps you set up and test your system integration with the SalesFinance Order API. This includes authentication, environment setup, and any other prerequisites needed to make your very first API call.
We recommend completing all integration and testing in the Test environment before moving to production.
1. Set Up Your Test Account
To begin, contact your Svea representative to start an integration project. After doing so, we'll provide you with the following:
- Test Environment Credentials: You'll receive the
client_idandclient_secretkeys for the Test environment. Be sure to store these securely.
Note on Terminology: The
client_idused for authentication identifies the Integrator (Client Credentials). This is entirely separate from theclientIdobject field which identifies a specific Merchant resource.
- Dedicated Support Channel: We'll invite you to a chat channel dedicated to your integration project for real-time support.
- Test SMS Numbers: To test SMS notifications, we will provide you a short list of fake phone numbers. You'll need to associate each one with an email address to receive SMS messages as emails.
- Callback URLs: To ensure callbacks function correctly, you'll need to submit the callback URLs you plan to use in both the Test and Production environments for our IP whitelisting.
The Test environment does not use real personal identity numbers, phone numbers, or BankID authentication. This is to ensure a secure testing process.
2. Exploring the API and User Interactions
The easiest way to get familiar with the API is by using the Swagger documentation.
API Exploration
First, call the authentication endpoint to get a temporary access token. Use the "Bearer " prefix followed by your access token to authorize your requests in Swagger.
- View your clients by calling the List Clients endpoint to see the clients set up for your account. You typically will be set up with a few differently configured test clients for testing different scenarios, for example different limits for automatic approvals, and different campaigns.
- View available campaigns per client by calling the List Campaigns endpoint.
- Create a Test Order: Use the Create Order endpoint to create a new loan application.
- For the
amountparameter, you must use an amount that is valid for at least one of your available campaigns. - For the
nationalIdparameter, you can download a list of test personal identity numbers for Sweden from Skatteverket. - For the
phoneNumber, use one of the fake numbers you provided to receive the SMS invitation as an email. - Tip: Set
selectableCampaignstonullto show all available campaigns to the applicant. - Note: To start, you can set a dummy URL for the
callbackUrlparameter. You don't need to implement a callback listener right away to test the API.
- For the
- Complete the User Workflow: Follow the invitation link you received via email. Since BankID is emulated, you'll manually enter the test applicant's personal identity number to proceed.
- Track Order Status: Use the Get Order endpoint to monitor how the order
Statusis updated as the applicant workflow progresses. - Listen for Callbacks: Ensure your system can listen for event callbacks. While all callbacks inform you of an order's progress, a few require your system to perform a specific action in response.
3. Implementation and Go-Live
Once your implementation and system testing are complete, you can request your production credentials if you haven't already.
To switch to the Production environment:
- Update Endpoints: Change your API and authentication endpoints to point to the production environment.
- Update Callback URLs: Switch your callback base address to the production URL.
- Use Real Data: Start using actual phone numbers and personal identity numbers for live transactions.