Getting Started with Finix Libraries and SDKs
A brief overview of the steps you take to initialize Finix's SDKs.
This quick start gets your environment set up quickly to start your integration into Finix. This entails:
- Generate an API key
- Install the relevant Finix library
- Initialize your dev environment
- Run your first API call.
Before you begin
You should have an account with Finix and can login to sandbox.
Step 1: Generate an API Key
Login to the dashboard and navigate to Developers > API Key.
This screen shows you your API Keys. Click on "Create an API Key" and follow the steps to create an API Key
Now copy the username and password and store them securely.
Step 2: Install Finix Library
Finix offers API Libraries for Java, Python, NodeJs, and PHP.
Initialize Java library
The Finix Library supports Java 1.8+.
If using maven, add the following to your project's pom.xml
<dependency>
<groupId>com.finix</groupId>
<artifactId>finix-java</artifactId>
<version>0.0.1</version>
</dependency>
For Gradle, add the following to your project's build.gradle.
implementation 'com.finix:finix-java:0.0.1'
Initialize Python library
The Finix Library supports Python 3.6+.
Install the library using PyPi.
pip install --upgrade finix
Initialize TypeScript library
The Finix Library supports Node.js 16+r.
Install the library using NPM.
npm install --save @finix-payments/finix
Step 3: Initialize dev environment.
With an API key and installed library, you can start coding. To begin, initialize the client in your project
import com.finix.finix-java.FinixClient;
import com.x.finix-java.model.*
finixClient= new FinixClient("USsRhsHYZGBPnQw8CByJyEQW","8a14c2f9-d94b-4c72-8f5c-a62908e5b30e", Environment.SANDBOX);
// For Java you need to set the API Version
finixClient.addDefaultHeader("Finix-Version","2022-02-01");
import finix
from finix.configuration import Environment, Configuration
from finix.models import *
# finix.models is intended for wildcard import, feel safe to import all predefined models at once
config = Configuration(
username = 'ENTER_YOUR_USERNAME',
password = 'ENTER_YOUR_PASSWORD',
environment = Environment.SANDBOX
)
client = finix.FinixClient(config)
import {Client, Environment, Models} from '@finix-payments/finix';
const userName = 'USsRhsHYZGBPnQw8CByJyEQW';
const password = '8a14c2f9-d94b-4c72-8f5c-a62908e5b30e';
const client = new Client(userName, password, Environment.Sandbox);
Step 4: Run your first API call.
With the library initialized, you can test it out with an initial API call. Let's create a simple Identity
since it is the root of many flows in finix.
CreateIdentityRequest createIdentityRequest =
Identity identity = finixClient.Identities.create(CreateIdentityRequest
.builder()
.entity()
.firstName("Jane")
.lastName("Doe")
.email("user@example.com")
.build()
.build()
);
identity = client.identities.create(create_identities_request = CreateIdentitiesRequest(
first_name="Jane",
last_name="Doe",
email="user@example.com"
))
const createIdentityRequest: Models.CreateIdentityRequest = {
entity: {
phone: "7145677613",
firstName: "Jane",
lastName: "Doe",
email: "user@example.com"
}
}
const identity = await client.Identities.create(createIdentityRequest);
Next Steps
With your local environment set up, you can integration into Finix. Check out our integration overview for a wholistic view of the Finix integration.