Initiate Checkout
curl --request POST \
--url https://api.bkey.id/v1/checkout/initiate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"merchantName": "<string>",
"merchantDomain": "<string>",
"checkoutUrl": "<string>",
"amount": 2,
"lineItems": [
{
"title": "<string>",
"quantity": 2,
"price": 1
}
],
"currency": "USD",
"expiresInSecs": 600
}
'import requests
url = "https://api.bkey.id/v1/checkout/initiate"
payload = {
"merchantName": "<string>",
"merchantDomain": "<string>",
"checkoutUrl": "<string>",
"amount": 2,
"lineItems": [
{
"title": "<string>",
"quantity": 2,
"price": 1
}
],
"currency": "USD",
"expiresInSecs": 600
}
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({
merchantName: '<string>',
merchantDomain: '<string>',
checkoutUrl: '<string>',
amount: 2,
lineItems: [{title: '<string>', quantity: 2, price: 1}],
currency: 'USD',
expiresInSecs: 600
})
};
fetch('https://api.bkey.id/v1/checkout/initiate', 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.bkey.id/v1/checkout/initiate",
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([
'merchantName' => '<string>',
'merchantDomain' => '<string>',
'checkoutUrl' => '<string>',
'amount' => 2,
'lineItems' => [
[
'title' => '<string>',
'quantity' => 2,
'price' => 1
]
],
'currency' => 'USD',
'expiresInSecs' => 600
]),
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.bkey.id/v1/checkout/initiate"
payload := strings.NewReader("{\n \"merchantName\": \"<string>\",\n \"merchantDomain\": \"<string>\",\n \"checkoutUrl\": \"<string>\",\n \"amount\": 2,\n \"lineItems\": [\n {\n \"title\": \"<string>\",\n \"quantity\": 2,\n \"price\": 1\n }\n ],\n \"currency\": \"USD\",\n \"expiresInSecs\": 600\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.bkey.id/v1/checkout/initiate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"merchantName\": \"<string>\",\n \"merchantDomain\": \"<string>\",\n \"checkoutUrl\": \"<string>\",\n \"amount\": 2,\n \"lineItems\": [\n {\n \"title\": \"<string>\",\n \"quantity\": 2,\n \"price\": 1\n }\n ],\n \"currency\": \"USD\",\n \"expiresInSecs\": 600\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bkey.id/v1/checkout/initiate")
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 \"merchantName\": \"<string>\",\n \"merchantDomain\": \"<string>\",\n \"checkoutUrl\": \"<string>\",\n \"amount\": 2,\n \"lineItems\": [\n {\n \"title\": \"<string>\",\n \"quantity\": 2,\n \"price\": 1\n }\n ],\n \"currency\": \"USD\",\n \"expiresInSecs\": 600\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"checkoutRequest": {
"id": "<string>",
"status": "<string>",
"challengeHex": "<string>",
"expiresAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"sptId": "<string>",
"paymentIntentId": "<string>"
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>"
}
}Checkout
Initiate Checkout
Agent initiates a checkout (purchase). Sends a push notification to the user for biometric approval of the payment amount + merchant. When invoked with a CIBA-approved token (approve:payment scope), the payment is auto-approved without a second push.
POST
/
v1
/
checkout
/
initiate
Initiate Checkout
curl --request POST \
--url https://api.bkey.id/v1/checkout/initiate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"merchantName": "<string>",
"merchantDomain": "<string>",
"checkoutUrl": "<string>",
"amount": 2,
"lineItems": [
{
"title": "<string>",
"quantity": 2,
"price": 1
}
],
"currency": "USD",
"expiresInSecs": 600
}
'import requests
url = "https://api.bkey.id/v1/checkout/initiate"
payload = {
"merchantName": "<string>",
"merchantDomain": "<string>",
"checkoutUrl": "<string>",
"amount": 2,
"lineItems": [
{
"title": "<string>",
"quantity": 2,
"price": 1
}
],
"currency": "USD",
"expiresInSecs": 600
}
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({
merchantName: '<string>',
merchantDomain: '<string>',
checkoutUrl: '<string>',
amount: 2,
lineItems: [{title: '<string>', quantity: 2, price: 1}],
currency: 'USD',
expiresInSecs: 600
})
};
fetch('https://api.bkey.id/v1/checkout/initiate', 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.bkey.id/v1/checkout/initiate",
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([
'merchantName' => '<string>',
'merchantDomain' => '<string>',
'checkoutUrl' => '<string>',
'amount' => 2,
'lineItems' => [
[
'title' => '<string>',
'quantity' => 2,
'price' => 1
]
],
'currency' => 'USD',
'expiresInSecs' => 600
]),
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.bkey.id/v1/checkout/initiate"
payload := strings.NewReader("{\n \"merchantName\": \"<string>\",\n \"merchantDomain\": \"<string>\",\n \"checkoutUrl\": \"<string>\",\n \"amount\": 2,\n \"lineItems\": [\n {\n \"title\": \"<string>\",\n \"quantity\": 2,\n \"price\": 1\n }\n ],\n \"currency\": \"USD\",\n \"expiresInSecs\": 600\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.bkey.id/v1/checkout/initiate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"merchantName\": \"<string>\",\n \"merchantDomain\": \"<string>\",\n \"checkoutUrl\": \"<string>\",\n \"amount\": 2,\n \"lineItems\": [\n {\n \"title\": \"<string>\",\n \"quantity\": 2,\n \"price\": 1\n }\n ],\n \"currency\": \"USD\",\n \"expiresInSecs\": 600\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bkey.id/v1/checkout/initiate")
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 \"merchantName\": \"<string>\",\n \"merchantDomain\": \"<string>\",\n \"checkoutUrl\": \"<string>\",\n \"amount\": 2,\n \"lineItems\": [\n {\n \"title\": \"<string>\",\n \"quantity\": 2,\n \"price\": 1\n }\n ],\n \"currency\": \"USD\",\n \"expiresInSecs\": 600\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"checkoutRequest": {
"id": "<string>",
"status": "<string>",
"challengeHex": "<string>",
"expiresAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"sptId": "<string>",
"paymentIntentId": "<string>"
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>"
}
}Authorizations
EdDSA-signed JWT obtained via OAuth 2.1 client_credentials or CIBA
Body
application/json
Required string length:
1 - 256Required string length:
1 - 512Maximum string length:
2048Required range:
x >= 1Required array length:
1 - 50 elementsShow child attributes
Show child attributes
Required string length:
3Required range:
60 <= x <= 3600⌘I