Skip to main content

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 sales representative to start an integration project. After doing so, we'll provide you with the following:

  • Test Environment Credentials: You'll receive the client_id and client_secret keys for the Test environment. Be sure to store these securely.
  • Test persons: We'll provide you with a list of test persons to use in different scenarios, such as:
    • persons with different credit scores
    • person on blocked-list, like Politically Exposed Person (PEP)
    • person having other active Svea engagements.
  • 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, provide us with a short list of fake phone numbers, each with an associated email address. This allows you 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 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 "Bearer " followed by your access token to authorize your requests in Swagger.

  1. View your clients by calling the GetClients 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, different campaigns, and different delivery approval workflows.
  2. View available campaigns per client by calling the Get campaigns endpoint.

Testing User Workflows

  1. Create a Test Order: Use the CreateOrder endpoint to create a new loan application.
    • For the amount parameter, you must use an amount that is valid for at least one of your available campaigns.
    • For the nationalId parameter, 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 selectableCampaigns to null to show all available campaigns to the user.
    • Note: To start, you can set a dummy URL for the callbackUrl parameter. You don't need to implement a callback listener right away to test the API.
  2. 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.
  3. Track Order Status: Use the GetOrder endpoint to monitor how the order Status is updated as the user workflow progresses.
  4. Listen for Callbacks: Ensure your system can listen for event callbacks. While they all inform you of an order's progress, a few also require your system to perform a specific action in response.

Suggested Scenarios to Test

Test ScenarioExpected Outcome
Call CreateOrder with Amount above campaigns' limits.You will receive a 400 Bad Request response.
Call CreateOrder with high credit score person (happy flow).After applicant's login, order should go to status Approved and applicant should receive a notification about signing the application.
Call CreateOrder with low credit score person.Order should go to status UnderReview.
Call CreateOrder with blocked person.Order should go to status Rejected.
Call CaptureOrder to approve merchant's delivery.Use allowed person and allowed amount. Order should go to CaptureRequested or Captured depending on the client's set up.
Credit officer requires a co-applicant.Main applicant should receive an SMS about co-applicant needed.
Credit officer lowers ApprovedAmountMerchant should receive an OrderUpdateAmount.
Call CaptureOrder while Amount is above ApprovedAmount.You should receive a 400 Bad Request response.
Call UpdateAmount to change applied AmountYou should see the updated applied Amount in the order.

3. Implementation and Go-Live

Once your implementation and system testing are complete, 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 real phone numbers and personal identity numbers for live transactions.