curl --request POST \
--url https://api-sandbox.finogates.com/v1/platform/embed-tokens \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"parent_origin": "<string>",
"scope": "add_card",
"card_processing_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"card_holder_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://api-sandbox.finogates.com/v1/platform/embed-tokens"
payload = {
"user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"parent_origin": "<string>",
"scope": "add_card",
"card_processing_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"card_holder_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
user_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
parent_origin: '<string>',
scope: 'add_card',
card_processing_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
card_holder_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://api-sandbox.finogates.com/v1/platform/embed-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-sandbox.finogates.com/v1/platform/embed-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([
'user_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'parent_origin' => '<string>',
'scope' => 'add_card',
'card_processing_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'card_holder_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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-sandbox.finogates.com/v1/platform/embed-tokens"
payload := strings.NewReader("{\n \"user_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"parent_origin\": \"<string>\",\n \"scope\": \"add_card\",\n \"card_processing_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"card_holder_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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-sandbox.finogates.com/v1/platform/embed-tokens")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"user_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"parent_origin\": \"<string>\",\n \"scope\": \"add_card\",\n \"card_processing_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"card_holder_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.finogates.com/v1/platform/embed-tokens")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"user_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"parent_origin\": \"<string>\",\n \"scope\": \"add_card\",\n \"card_processing_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"card_holder_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}"
response = http.request(request)
puts response.read_body{
"status_code": 123,
"data": "<unknown>",
"query_generated_time": 123
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Mint Embed Token
Create a short-lived pass (an “embed token”) that lets one of your users do
one specific job inside a Finogate-hosted page shown on your website. Right
now that job is adding a card (add_card).
The pass lasts about 10 minutes. Take the token we return and load
the page inside an iframe on your site, like this:
<iframe src="{embed_url}#token={token}&mode={mode}"></iframe>
The pass only works for the one user it was created for, and only for that one job — it can’t be used for anything else.
curl --request POST \
--url https://api-sandbox.finogates.com/v1/platform/embed-tokens \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"parent_origin": "<string>",
"scope": "add_card",
"card_processing_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"card_holder_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://api-sandbox.finogates.com/v1/platform/embed-tokens"
payload = {
"user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"parent_origin": "<string>",
"scope": "add_card",
"card_processing_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"card_holder_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
user_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
parent_origin: '<string>',
scope: 'add_card',
card_processing_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
card_holder_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://api-sandbox.finogates.com/v1/platform/embed-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-sandbox.finogates.com/v1/platform/embed-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([
'user_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'parent_origin' => '<string>',
'scope' => 'add_card',
'card_processing_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'card_holder_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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-sandbox.finogates.com/v1/platform/embed-tokens"
payload := strings.NewReader("{\n \"user_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"parent_origin\": \"<string>\",\n \"scope\": \"add_card\",\n \"card_processing_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"card_holder_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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-sandbox.finogates.com/v1/platform/embed-tokens")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"user_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"parent_origin\": \"<string>\",\n \"scope\": \"add_card\",\n \"card_processing_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"card_holder_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.finogates.com/v1/platform/embed-tokens")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"user_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"parent_origin\": \"<string>\",\n \"scope\": \"add_card\",\n \"card_processing_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"card_holder_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}"
response = http.request(request)
puts response.read_body{
"status_code": 123,
"data": "<unknown>",
"query_generated_time": 123
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
The access token received from the authorization server in the OAuth 2.0 flow.
Body
Request body for POST /v1/platform/embed-tokens.
The end-user the iframe will act on behalf of. Must be an end_user belonging to the calling tenant.
The origin of the page that will embed the iframe (e.g. https://app.example.com). Used as the postMessage targetOrigin so success payloads cannot leak to other windows. Must be a bare origin: scheme + host + optional port, no path.
255Which embed surface the token authorises. Today the only supported scope is add_card.
add_card, add_bank, card_payment, card_transfer, verify_card, charge_3ds Optional. Only honored when scope='add_card'. Pins the card to a specific approved card-processing merchant account (the id returned by GET /v1/platform/card-processing/users/{user_id}). Omit to use the user's deterministically selected default merchant.
Optional. Only honored when scope='add_card'. The Finogate user the card belongs to. Use this when user_id is the card-processing merchant owner and many of your end customers add cards under that one merchant. Must be a user of the calling tenant. Omit to default the holder to user_id.
Response
Successful Response
Standard response wrapper for single-object responses and errors.
Generic over the payload type. A route that declares
CommonResponse[SomeModel] gets the real data schema rendered in
OpenAPI/Swagger; a bare CommonResponse leaves data untyped.

