JavaScript
import CheckoutIntents from 'checkout-intents';
const client = new CheckoutIntents({
apiKey: process.env['CHECKOUT_INTENTS_API_KEY'], // This is the default and can be omitted
});
const paymentGatewaySession = await client.paymentGateways.createSession('basis-theory');
console.log(paymentGatewaySession.container);import os
from checkout_intents import CheckoutIntents
client = CheckoutIntents(
api_key=os.environ.get("CHECKOUT_INTENTS_API_KEY"), # This is the default and can be omitted
)
payment_gateway_session = client.payment_gateways.create_session(
"basis-theory",
)
print(payment_gateway_session.container)package com.rye.example;
import com.rye.client.CheckoutIntentsClient;
import com.rye.client.okhttp.CheckoutIntentsOkHttpClient;
import com.rye.models.paymentgateways.PaymentGateway;
import com.rye.models.paymentgateways.PaymentGatewayCreateSessionParams;
import com.rye.models.paymentgateways.PaymentGatewaySession;
public final class Main {
private Main() {}
public static void main(String[] args) {
CheckoutIntentsClient client = CheckoutIntentsOkHttpClient.fromEnv();
PaymentGatewaySession paymentGatewaySession = client.paymentGateways().createSession(PaymentGateway.BASIS_THEORY);
}
}curl https://staging.api.rye.com/api/v1/payment-gateways/$GATEWAY/session \
-X POST \
-H "Authorization: Bearer $CHECKOUT_INTENTS_API_KEY"<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://staging.api.rye.com/api/v1/payment-gateways/{gateway}/session",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: <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://staging.api.rye.com/api/v1/payment-gateways/{gateway}/session"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}require 'uri'
require 'net/http'
url = URI("https://staging.api.rye.com/api/v1/payment-gateways/{gateway}/session")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"container": "<string>",
"sessionKey": "<string>",
"gateway": "basis_theory"
}{
"name": "<string>",
"message": "<string>",
"stack": "<string>"
}{
"name": "<string>",
"message": "<string>",
"stack": "<string>"
}{
"name": "<string>",
"message": "<string>",
"stack": "<string>"
}Payment Gateways
Create payment gateway session
Create a payment gateway session for client-side card tokenization.
Returns short-lived credentials scoped to the authenticated developer. Use the credentials with the corresponding gateway’s client-side SDK to tokenize a card. Tokens created this way are locked to the developer’s container and cannot be used by other developers.
POST
/
api
/
v1
/
payment-gateways
/
{gateway}
/
session
JavaScript
import CheckoutIntents from 'checkout-intents';
const client = new CheckoutIntents({
apiKey: process.env['CHECKOUT_INTENTS_API_KEY'], // This is the default and can be omitted
});
const paymentGatewaySession = await client.paymentGateways.createSession('basis-theory');
console.log(paymentGatewaySession.container);import os
from checkout_intents import CheckoutIntents
client = CheckoutIntents(
api_key=os.environ.get("CHECKOUT_INTENTS_API_KEY"), # This is the default and can be omitted
)
payment_gateway_session = client.payment_gateways.create_session(
"basis-theory",
)
print(payment_gateway_session.container)package com.rye.example;
import com.rye.client.CheckoutIntentsClient;
import com.rye.client.okhttp.CheckoutIntentsOkHttpClient;
import com.rye.models.paymentgateways.PaymentGateway;
import com.rye.models.paymentgateways.PaymentGatewayCreateSessionParams;
import com.rye.models.paymentgateways.PaymentGatewaySession;
public final class Main {
private Main() {}
public static void main(String[] args) {
CheckoutIntentsClient client = CheckoutIntentsOkHttpClient.fromEnv();
PaymentGatewaySession paymentGatewaySession = client.paymentGateways().createSession(PaymentGateway.BASIS_THEORY);
}
}curl https://staging.api.rye.com/api/v1/payment-gateways/$GATEWAY/session \
-X POST \
-H "Authorization: Bearer $CHECKOUT_INTENTS_API_KEY"<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://staging.api.rye.com/api/v1/payment-gateways/{gateway}/session",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: <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://staging.api.rye.com/api/v1/payment-gateways/{gateway}/session"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}require 'uri'
require 'net/http'
url = URI("https://staging.api.rye.com/api/v1/payment-gateways/{gateway}/session")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"container": "<string>",
"sessionKey": "<string>",
"gateway": "basis_theory"
}{
"name": "<string>",
"message": "<string>",
"stack": "<string>"
}{
"name": "<string>",
"message": "<string>",
"stack": "<string>"
}{
"name": "<string>",
"message": "<string>",
"stack": "<string>"
}Authorizations
Rye API key
Path Parameters
The payment gateway to create a session for
Available options:
basis-theory Was this page helpful?
⌘I

