curl --request POST \
--url https://api.staging.bnplx.io/payments/session_tokens \
--header 'Content-Type: application/json' \
--header 'api-key: <api-key>' \
--data '
{
"payment_id": "<string>",
"client_secret": "<string>",
"merchant_connector_details": {
"creds_identifier": "<string>",
"encoded_data": {
"connector_account_details": {},
"metadata": {}
}
}
}
'import requests
url = "https://api.staging.bnplx.io/payments/session_tokens"
payload = {
"payment_id": "<string>",
"client_secret": "<string>",
"merchant_connector_details": {
"creds_identifier": "<string>",
"encoded_data": {
"connector_account_details": {},
"metadata": {}
}
}
}
headers = {
"api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
payment_id: '<string>',
client_secret: '<string>',
merchant_connector_details: {
creds_identifier: '<string>',
encoded_data: {connector_account_details: {}, metadata: {}}
}
})
};
fetch('https://api.staging.bnplx.io/payments/session_tokens', 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://api.staging.bnplx.io/payments/session_tokens",
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([
'payment_id' => '<string>',
'client_secret' => '<string>',
'merchant_connector_details' => [
'creds_identifier' => '<string>',
'encoded_data' => [
'connector_account_details' => [
],
'metadata' => [
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.staging.bnplx.io/payments/session_tokens"
payload := strings.NewReader("{\n \"payment_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"merchant_connector_details\": {\n \"creds_identifier\": \"<string>\",\n \"encoded_data\": {\n \"connector_account_details\": {},\n \"metadata\": {}\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("api-key", "<api-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://api.staging.bnplx.io/payments/session_tokens")
.header("api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"payment_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"merchant_connector_details\": {\n \"creds_identifier\": \"<string>\",\n \"encoded_data\": {\n \"connector_account_details\": {},\n \"metadata\": {}\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.staging.bnplx.io/payments/session_tokens")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"payment_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"merchant_connector_details\": {\n \"creds_identifier\": \"<string>\",\n \"encoded_data\": {\n \"connector_account_details\": {},\n \"metadata\": {}\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"payment_id": "<string>",
"client_secret": "<string>",
"installment_providers": [
{
"connector": "axytos",
"plans": [
{
"plan_id": "<string>",
"payment_method": "direct_debit",
"duration_months": 1,
"nominal_interest_rate": 123,
"effective_interest_rate": 123,
"first_installment_amount": 123,
"last_installment_amount": 123,
"down_payment_amount": 123,
"total_amount": 123,
"total_interest_amount": 123,
"total_fees_amount": 123
}
]
}
]
}Payments - Session token
Creates a session object or a session token for wallets like Apple Pay, Google Pay, etc. These tokens are used by Green Banana’s SDK to initiate these wallets’ SDK.
curl --request POST \
--url https://api.staging.bnplx.io/payments/session_tokens \
--header 'Content-Type: application/json' \
--header 'api-key: <api-key>' \
--data '
{
"payment_id": "<string>",
"client_secret": "<string>",
"merchant_connector_details": {
"creds_identifier": "<string>",
"encoded_data": {
"connector_account_details": {},
"metadata": {}
}
}
}
'import requests
url = "https://api.staging.bnplx.io/payments/session_tokens"
payload = {
"payment_id": "<string>",
"client_secret": "<string>",
"merchant_connector_details": {
"creds_identifier": "<string>",
"encoded_data": {
"connector_account_details": {},
"metadata": {}
}
}
}
headers = {
"api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
payment_id: '<string>',
client_secret: '<string>',
merchant_connector_details: {
creds_identifier: '<string>',
encoded_data: {connector_account_details: {}, metadata: {}}
}
})
};
fetch('https://api.staging.bnplx.io/payments/session_tokens', 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://api.staging.bnplx.io/payments/session_tokens",
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([
'payment_id' => '<string>',
'client_secret' => '<string>',
'merchant_connector_details' => [
'creds_identifier' => '<string>',
'encoded_data' => [
'connector_account_details' => [
],
'metadata' => [
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.staging.bnplx.io/payments/session_tokens"
payload := strings.NewReader("{\n \"payment_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"merchant_connector_details\": {\n \"creds_identifier\": \"<string>\",\n \"encoded_data\": {\n \"connector_account_details\": {},\n \"metadata\": {}\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("api-key", "<api-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://api.staging.bnplx.io/payments/session_tokens")
.header("api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"payment_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"merchant_connector_details\": {\n \"creds_identifier\": \"<string>\",\n \"encoded_data\": {\n \"connector_account_details\": {},\n \"metadata\": {}\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.staging.bnplx.io/payments/session_tokens")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"payment_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"merchant_connector_details\": {\n \"creds_identifier\": \"<string>\",\n \"encoded_data\": {\n \"connector_account_details\": {},\n \"metadata\": {}\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"payment_id": "<string>",
"client_secret": "<string>",
"installment_providers": [
{
"connector": "axytos",
"plans": [
{
"plan_id": "<string>",
"payment_method": "direct_debit",
"duration_months": 1,
"nominal_interest_rate": 123,
"effective_interest_rate": 123,
"first_installment_amount": 123,
"last_installment_amount": 123,
"down_payment_amount": 123,
"total_amount": 123,
"total_interest_amount": 123,
"total_fees_amount": 123
}
]
}
]
}Authorizations
Publishable keys are a type of keys that can be public and have limited scope of usage.
Body
The identifier for the payment
This is a token which expires after 15 minutes, used from the client to authenticate and create sessions from the SDK
Merchant connector details used to make payments.
Show child attributes
Show child attributes
Response
Payment session object created or session token was retrieved from wallets
The identifier for the payment
This is a token which expires after 15 minutes, used from the client to authenticate and create sessions from the SDK
The list of connectors that provide the installments
Show child attributes
Show child attributes