Create Investment Application
curl --request POST \
--url https://test-investment-products-service.fincode.software/api/v1/user/apply \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: <x-auth-token>' \
--header 'platform: <platform>' \
--header 'uuid: <uuid>' \
--header 'x-idempotency-key: <x-idempotency-key>' \
--data '
{
"investmentProductId": "<string>",
"numberOfUnitsToPurchase": 123,
"userWalletId": "<string>",
"customerId": "<string>",
"customerName": "<string>"
}
'import requests
url = "https://test-investment-products-service.fincode.software/api/v1/user/apply"
payload = {
"investmentProductId": "<string>",
"numberOfUnitsToPurchase": 123,
"userWalletId": "<string>",
"customerId": "<string>",
"customerName": "<string>"
}
headers = {
"platform": "<platform>",
"uuid": "<uuid>",
"X-Auth-Token": "<x-auth-token>",
"x-idempotency-key": "<x-idempotency-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
platform: '<platform>',
uuid: '<uuid>',
'X-Auth-Token': '<x-auth-token>',
'x-idempotency-key': '<x-idempotency-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
investmentProductId: '<string>',
numberOfUnitsToPurchase: 123,
userWalletId: '<string>',
customerId: '<string>',
customerName: '<string>'
})
};
fetch('https://test-investment-products-service.fincode.software/api/v1/user/apply', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://test-investment-products-service.fincode.software/api/v1/user/apply",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'investmentProductId' => '<string>',
'numberOfUnitsToPurchase' => 123,
'userWalletId' => '<string>',
'customerId' => '<string>',
'customerName' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Auth-Token: <x-auth-token>",
"platform: <platform>",
"uuid: <uuid>",
"x-idempotency-key: <x-idempotency-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://test-investment-products-service.fincode.software/api/v1/user/apply"
payload := strings.NewReader("{\n \"investmentProductId\": \"<string>\",\n \"numberOfUnitsToPurchase\": 123,\n \"userWalletId\": \"<string>\",\n \"customerId\": \"<string>\",\n \"customerName\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("platform", "<platform>")
req.Header.Add("uuid", "<uuid>")
req.Header.Add("X-Auth-Token", "<x-auth-token>")
req.Header.Add("x-idempotency-key", "<x-idempotency-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://test-investment-products-service.fincode.software/api/v1/user/apply")
.header("platform", "<platform>")
.header("uuid", "<uuid>")
.header("X-Auth-Token", "<x-auth-token>")
.header("x-idempotency-key", "<x-idempotency-key>")
.header("Content-Type", "application/json")
.body("{\n \"investmentProductId\": \"<string>\",\n \"numberOfUnitsToPurchase\": 123,\n \"userWalletId\": \"<string>\",\n \"customerId\": \"<string>\",\n \"customerName\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://test-investment-products-service.fincode.software/api/v1/user/apply")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["platform"] = '<platform>'
request["uuid"] = '<uuid>'
request["X-Auth-Token"] = '<x-auth-token>'
request["x-idempotency-key"] = '<x-idempotency-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"investmentProductId\": \"<string>\",\n \"numberOfUnitsToPurchase\": 123,\n \"userWalletId\": \"<string>\",\n \"customerId\": \"<string>\",\n \"customerName\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyAPI Endpoints
Create Investment Application
Creates a new investment application for a customer.
POST
/
apply
Create Investment Application
curl --request POST \
--url https://test-investment-products-service.fincode.software/api/v1/user/apply \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: <x-auth-token>' \
--header 'platform: <platform>' \
--header 'uuid: <uuid>' \
--header 'x-idempotency-key: <x-idempotency-key>' \
--data '
{
"investmentProductId": "<string>",
"numberOfUnitsToPurchase": 123,
"userWalletId": "<string>",
"customerId": "<string>",
"customerName": "<string>"
}
'import requests
url = "https://test-investment-products-service.fincode.software/api/v1/user/apply"
payload = {
"investmentProductId": "<string>",
"numberOfUnitsToPurchase": 123,
"userWalletId": "<string>",
"customerId": "<string>",
"customerName": "<string>"
}
headers = {
"platform": "<platform>",
"uuid": "<uuid>",
"X-Auth-Token": "<x-auth-token>",
"x-idempotency-key": "<x-idempotency-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
platform: '<platform>',
uuid: '<uuid>',
'X-Auth-Token': '<x-auth-token>',
'x-idempotency-key': '<x-idempotency-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
investmentProductId: '<string>',
numberOfUnitsToPurchase: 123,
userWalletId: '<string>',
customerId: '<string>',
customerName: '<string>'
})
};
fetch('https://test-investment-products-service.fincode.software/api/v1/user/apply', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://test-investment-products-service.fincode.software/api/v1/user/apply",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'investmentProductId' => '<string>',
'numberOfUnitsToPurchase' => 123,
'userWalletId' => '<string>',
'customerId' => '<string>',
'customerName' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Auth-Token: <x-auth-token>",
"platform: <platform>",
"uuid: <uuid>",
"x-idempotency-key: <x-idempotency-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://test-investment-products-service.fincode.software/api/v1/user/apply"
payload := strings.NewReader("{\n \"investmentProductId\": \"<string>\",\n \"numberOfUnitsToPurchase\": 123,\n \"userWalletId\": \"<string>\",\n \"customerId\": \"<string>\",\n \"customerName\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("platform", "<platform>")
req.Header.Add("uuid", "<uuid>")
req.Header.Add("X-Auth-Token", "<x-auth-token>")
req.Header.Add("x-idempotency-key", "<x-idempotency-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://test-investment-products-service.fincode.software/api/v1/user/apply")
.header("platform", "<platform>")
.header("uuid", "<uuid>")
.header("X-Auth-Token", "<x-auth-token>")
.header("x-idempotency-key", "<x-idempotency-key>")
.header("Content-Type", "application/json")
.body("{\n \"investmentProductId\": \"<string>\",\n \"numberOfUnitsToPurchase\": 123,\n \"userWalletId\": \"<string>\",\n \"customerId\": \"<string>\",\n \"customerName\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://test-investment-products-service.fincode.software/api/v1/user/apply")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["platform"] = '<platform>'
request["uuid"] = '<uuid>'
request["X-Auth-Token"] = '<x-auth-token>'
request["x-idempotency-key"] = '<x-idempotency-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"investmentProductId\": \"<string>\",\n \"numberOfUnitsToPurchase\": 123,\n \"userWalletId\": \"<string>\",\n \"customerId\": \"<string>\",\n \"customerName\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyCreates a new investment application allowing customers to invest in a specific investment product with a specified number of units.
Request Headers
Request Body
Code Examples
curl --location --request POST 'https://test-investment-products-service.fincode.software/api/v1/user/apply' \
--header 'X-Auth-Token: YOUR_JWT_ACCESS_TOKEN' \
--header 'x-idempotency-key: unique-key-12345' \
--header 'x-fapi-auth-date: 2024-01-15T10:30:00Z' \
--header 'x-fapi-customer-ip-address: 192.168.1.1' \
--header 'x-fapi-interaction-id: interaction-12345' \
--header 'Content-Type: application/json' \
--data '{
"investmentProductId": "123e4567-e89b-12d3-a456-426614174000",
"numberOfUnitsToPurchase": 100,
"userWalletId": "123e4567-e89b-12d3-a456-426614174001",
"customerId": "123e4567-e89b-12d3-a456-426614174002",
"customerName": "John Doe"
}'
const axios = require('axios');
const BASE_URL = 'https://test-investment-products-service.fincode.software/api/v1/user';
async function createInvestmentApplication(accessToken, applicationData) {
try {
const response = await axios.post(
`${BASE_URL}/apply`,
{
investmentProductId: applicationData.investmentProductId,
numberOfUnitsToPurchase: applicationData.numberOfUnitsToPurchase,
userWalletId: applicationData.userWalletId,
customerId: applicationData.customerId,
customerName: applicationData.customerName,
},
{
headers: {
'X-Auth-Token': accessToken,
'x-idempotency-key': `key-${Date.now()}`,
'x-fapi-auth-date': new Date().toISOString(),
'x-fapi-customer-ip-address': '192.168.1.1',
'x-fapi-interaction-id': `interaction-${Date.now()}`,
'Content-Type': 'application/json',
},
}
);
return response.data.data;
} catch (error) {
console.error(
'Failed to create investment application:',
error.response?.data || error.message
);
throw error;
}
}
