Skip to main content
GET
/
v1
/
policies
/
{policy_id}
/
premiums
cURL
curl --request GET \
  --url https://dev-api-cj-agc-vie.fnstack.dev/v1/policies/{policy_id}/premiums \
  --header 'x-api-key: <api-key>'
import requests

url = "https://dev-api-cj-agc-vie.fnstack.dev/v1/policies/{policy_id}/premiums"

headers = {"x-api-key": "<api-key>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};

fetch('https://dev-api-cj-agc-vie.fnstack.dev/v1/policies/{policy_id}/premiums', 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://dev-api-cj-agc-vie.fnstack.dev/v1/policies/{policy_id}/premiums",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-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"
"net/http"
"io"
)

func main() {

url := "https://dev-api-cj-agc-vie.fnstack.dev/v1/policies/{policy_id}/premiums"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("x-api-key", "<api-key>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://dev-api-cj-agc-vie.fnstack.dev/v1/policies/{policy_id}/premiums")
.header("x-api-key", "<api-key>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://dev-api-cj-agc-vie.fnstack.dev/v1/policies/{policy_id}/premiums")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'

response = http.request(request)
puts response.read_body
[
  {
    "order": 1,
    "status": "PENDING",
    "currency": "XAF",
    "amount_due": 1000,
    "premium_id": "policy_2c1x7V4r47ynM4RABVm1Co0UKkG",
    "period_end": "2024-07-17",
    "amount_paid": 1600,
    "period_start": "2024-06-17",
    "total_amount": 1600,
    "amount_remaining": 1600,
    "description": "<string>"
  }
]
{
"error": "<string>"
}
{
"error": "<string>"
}

Authorizations

x-api-key
string
header
required

Path Parameters

policy_id
string
required
Minimum string length: 1
Example:

"policy_2c1x7V4r47ynM4RABVm1Co0UKkG"

Query Parameters

status
enum<string>
default:PENDING
Available options:
OVERDUE,
PAID,
PARTIALLY_PAID,
PENDING,
SUSPENDED
Example:

"PENDING"

Response

order
number
required
Example:

1

status
enum<string>
required
Available options:
OVERDUE,
PAID,
PARTIALLY_PAID,
PENDING,
SUSPENDED
Example:

"PENDING"

currency
enum<string>
required
Available options:
EUR,
XAF
Example:

"XAF"

amount_due
number
required
Example:

1000

premium_id
string
required
Minimum string length: 1
Example:

"policy_2c1x7V4r47ynM4RABVm1Co0UKkG"

period_end
string
required
Minimum string length: 1
Example:

"2024-07-17"

amount_paid
number
required
Example:

1600

period_start
string
required
Minimum string length: 1
Example:

"2024-06-17"

total_amount
number
required
Example:

1600

amount_remaining
number
required
Example:

1600

description
string