Submitting A Bank Statement
To submit a bank statement, you will make this request:
Request
Method: POST
Endpoint: api/v1/credit-assessment/submit
Headers :
{
"apiKey" : [YOUR APP API_KEY],
"apiSecret" : [YOUR APP API_SECRET],
"Content-Type": "multipart/form-data"
}
Body :
{
"file" : [YOUR BANK STATEMENT FILE],
"password" : [BANK STATEMENT PASSWORD],
"title" : [TITLE OF THE SUBMISSION E.G USER'S FULLNAME],
"bvn" : [BVN OF THE USER]
}
Example:
- JS
- PHP
- Python
- Ruby
- Java
- GO
const axios = require("axios");
const fs = require("fs");
const FormData = require("form-data");
const form = new FormData();
form.append("file", fs.createReadStream("[YOUR BANK STATEMENT FILE]"));
form.append("password", "[BANK STATEMENT PASSWORD]");
form.append("title", "[TITLE OF THE SUBMISSION E.G USER'S FULLNAME]");
form.append("bvn", "[BVN OF THE USER]");
const options = {
method: "POST",
url: "https://sigmaprod.sabipay.com/ap1/v1/credit-assessment/submit",
headers: {
apiKey: "[YOUR APP API_KEY]",
apiSecret: "[YOUR APP API_SECRET]",
...form.getHeaders(),
},
data: form,
};
axios
.request(options)
.then(function (response) {
console.log(response.data);
})
.catch(function (error) {
console.error(error);
});
$curl = curl_init();
$file = fopen('[YOUR BANK STATEMENT FILE]', 'r');
curl_setopt_array($curl, [
CURLOPT_URL => "https://sigmaprod.sabipay.com/ap1/v1/credit-assessment/submit",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => [
"file" => $file,
"password" => "[BANK STATEMENT PASSWORD]",
"title" => "[TITLE OF THE SUBMISSION E.G USER'S FULLNAME]",
"bvn" => "[BVN OF THE USER]"
],
CURLOPT_HTTPHEADER => [
"apiKey: [YOUR APP API_KEY]",
"apiSecret: [YOUR APP API_SECRET]",
"Content-Type: multipart/form-data"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
fclose($file);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
curl_close($curl);
import requests
from requests_toolbelt.multipart.encoder import MultipartEncoder
url = "https://sigmaprod.sabipay.com/ap1/v1/credit-assessment/submit"
# Define form data
form = MultipartEncoder(
fields={
"file": ("[YOUR BANK STATEMENT FILE]", open("[YOUR BANK STATEMENT FILE]", "rb"), "application/octet-stream"),
"password": "[BANK STATEMENT PASSWORD]",
"title": "[TITLE OF THE SUBMISSION E.G USER'S FULLNAME]",
"bvn": "[BVN OF THE USER]"
}
)
headers = {
"apiKey": "[YOUR APP API_KEY]",
"apiSecret": "[YOUR APP API_SECRET]",
"Content-Type": form.content_type
}
response = requests.post(url, data=form, headers=headers)
print(response.text)
require 'net/http'
require 'net/http/post/multipart'
url = URI("https://sigmaprod.sabipay.com/ap1/v1/credit-assessment/submit")
# Define form data
file = File.open("[YOUR BANK STATEMENT FILE]", "r")
form_data = {
file: UploadIO.new(file, "application/octet-stream", "[YOUR BANK STATEMENT FILE]"),
password: "[BANK STATEMENT PASSWORD]",
title: "[TITLE OF THE SUBMISSION E.G USER'S FULLNAME]",
bvn: "[BVN OF THE USER]"
}
request = Net::HTTP::Post::Multipart.new(url, form_data)
request["apiKey"] = "[YOUR APP API_KEY]"
request["apiSecret"] = "[YOUR APP API_SECRET]"
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
response = http.request(request)
puts response.read_body
import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;
public class Main {
public static void main(String[] args) {
try {
// Define file path and other parameters
String filePath = "[YOUR BANK STATEMENT FILE]";
String password = "[BANK STATEMENT PASSWORD]";
String title = "[TITLE OF THE SUBMISSION E.G USER'S FULLNAME]";
String bvn = "[BVN OF THE USER]";
String apiKey = "[YOUR APP API_KEY]";
String apiSecret = "[YOUR APP API_SECRET]";
String url = "https://sigmaprod.sabipay.com/ap1/v1/credit-assessment/submit";
// Create form data
String boundary = Long.toHexString(System.currentTimeMillis());
String CRLF = "\r\n"; // Line separator required by multipart/form-data.
URL submitURL = new URL(url);
HttpURLConnection connection = (HttpURLConnection) submitURL.openConnection();
connection.setRequestMethod("POST");
connection.setRequestProperty("Content-Type", "multipart/form-data; boundary=" + boundary);
connection.setRequestProperty("apiKey", apiKey);
connection.setRequestProperty("apiSecret", apiSecret);
connection.setDoOutput(true);
try (
OutputStream output = connection.getOutputStream();
PrintWriter writer = new PrintWriter(new OutputStreamWriter(output, "UTF-8"), true);
FileInputStream inputStream = new FileInputStream(filePath);
BufferedInputStream bufferedInputStream = new BufferedInputStream(inputStream)
) {
// Write file data
writer.append("--" + boundary).append(CRLF);
writer.append("Content-Disposition: form-data; name=\"file\"; filename=\"" + filePath + "\"").append(CRLF);
writer.append("Content-Type: application/octet-stream").append(CRLF);
writer.append(CRLF).flush();
byte[] buffer = new byte[8192];
int bytesRead;
while ((bytesRead = bufferedInputStream.read(buffer)) != -1) {
output.write(buffer, 0, bytesRead);
}
output.flush();
writer.append(CRLF).flush();
// Write other parameters
writer.append("--" + boundary).append(CRLF);
writer.append("Content-Disposition: form-data; name=\"password\"").append(CRLF);
writer.append(CRLF);
writer.append(password).append(CRLF).flush();
writer.append("--" + boundary).append(CRLF);
writer.append("Content-Disposition: form-data; name=\"title\"").append(CRLF);
writer.append(CRLF);
writer.append(title).append(CRLF).flush();
writer.append("--" + boundary).append(CRLF);
writer.append("Content-Disposition: form-data; name=\"bvn\"").append(CRLF);
writer.append(CRLF);
writer.append(bvn).append(CRLF).flush();
// End of multipart/form-data.
writer.append("--" + boundary + "--").append(CRLF).flush();
}
// Get response
int responseCode = connection.getResponseCode();
BufferedReader reader;
if (responseCode == HttpURLConnection.HTTP_OK) {
reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
} else {
reader = new BufferedReader(new InputStreamReader(connection.getErrorStream()));
}
String line;
StringBuilder response = new StringBuilder();
while ((line = reader.readLine()) != null) {
response.append(line);
}
reader.close();
// Output response
System.out.println(response.toString());
// Close connection
connection.disconnect();
} catch (IOException e) {
e.printStackTrace();
}
}
}
package main
import (
"bytes"
"fmt"
"io"
"mime/multipart"
"net/http"
"os"
)
func main() {
// Define file path and other parameters
filePath := "[YOUR BANK STATEMENT FILE]"
password := "[BANK STATEMENT PASSWORD]"
title := "[TITLE OF THE SUBMISSION E.G USER'S FULLNAME]"
bvn := "[BVN OF THE USER]"
apiKey := "[YOUR APP API_KEY]"
apiSecret := "[YOUR APP API_SECRET]"
url := "https://sigmaprod.sabipay.com/ap1/v1/credit-assessment/submit"
// Create multipart form data
body := &bytes.Buffer{}
writer := multipart.NewWriter(body)
// Add file
file, err := os.Open(filePath)
if err != nil {
fmt.Println("Error opening file:", err)
return
}
defer file.Close()
part, err := writer.CreateFormFile("file", filePath)
if err != nil {
fmt.Println("Error creating form file:", err)
return
}
_, err = io.Copy(part, file)
if err != nil {
fmt.Println("Error copying file data:", err)
return
}
// Add other parameters
_ = writer.WriteField("password", password)
_ = writer.WriteField("title", title)
_ = writer.WriteField("bvn", bvn)
err = writer.Close()
if err != nil {
fmt.Println("Error closing writer:", err)
return
}
// Create request
req, err := http.NewRequest("POST", url, body)
if err != nil {
fmt.Println("Error creating request:", err)
return
}
req.Header.Set("Content-Type", writer.FormDataContentType())
req.Header.Set("apiKey", apiKey)
req.Header.Set("apiSecret", apiSecret)
// Send request
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
fmt.Println("Error sending request:", err)
return
}
defer resp.Body.Close()
// Read response
respBody, err := io.ReadAll(resp.Body)
if err != nil {
fmt.Println("Error reading response body:", err)
return
}
// Print response
fmt.Println(string(respBody))
}
Parameter | Type | Description |
---|---|---|
file (required) | blob | This is the bank statement PDF file to be uploaded. The uploaded file must be accessible when submitting the URL to Sigma. |
title (required) | String | The name of the submission. For example: the account holder’s name or an ID from your records. |
bvn (optional) | Number | The Bank Verification Number of the owner of the bank statement. |
password (optional) | String | If your bank statement is locked with a password, use this field to provide the password to unlock the file. |
Responses
See Response Section to view all expected responses