Open a Stripe onramp session
curl --request POST \
--url https://api.calmtreasury.xyz/v1/stripe/session \
--header 'Content-Type: application/json' \
--header 'x-calm-publishable-key: <api-key>' \
--data '
{
"crypto_customer_id": "<string>",
"payment_token": "<string>",
"wallet": "<string>",
"destination_amount": "<string>",
"source_amount": "<string>",
"source_currency": "USD"
}
'import requests
url = "https://api.calmtreasury.xyz/v1/stripe/session"
payload = {
"crypto_customer_id": "<string>",
"payment_token": "<string>",
"wallet": "<string>",
"destination_amount": "<string>",
"source_amount": "<string>",
"source_currency": "USD"
}
headers = {
"x-calm-publishable-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-calm-publishable-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
crypto_customer_id: '<string>',
payment_token: '<string>',
wallet: '<string>',
destination_amount: '<string>',
source_amount: '<string>',
source_currency: 'USD'
})
};
fetch('https://api.calmtreasury.xyz/v1/stripe/session', 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.calmtreasury.xyz/v1/stripe/session",
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([
'crypto_customer_id' => '<string>',
'payment_token' => '<string>',
'wallet' => '<string>',
'destination_amount' => '<string>',
'source_amount' => '<string>',
'source_currency' => 'USD'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-calm-publishable-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.calmtreasury.xyz/v1/stripe/session"
payload := strings.NewReader("{\n \"crypto_customer_id\": \"<string>\",\n \"payment_token\": \"<string>\",\n \"wallet\": \"<string>\",\n \"destination_amount\": \"<string>\",\n \"source_amount\": \"<string>\",\n \"source_currency\": \"USD\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-calm-publishable-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.calmtreasury.xyz/v1/stripe/session")
.header("x-calm-publishable-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"crypto_customer_id\": \"<string>\",\n \"payment_token\": \"<string>\",\n \"wallet\": \"<string>\",\n \"destination_amount\": \"<string>\",\n \"source_amount\": \"<string>\",\n \"source_currency\": \"USD\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.calmtreasury.xyz/v1/stripe/session")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-calm-publishable-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"crypto_customer_id\": \"<string>\",\n \"payment_token\": \"<string>\",\n \"wallet\": \"<string>\",\n \"destination_amount\": \"<string>\",\n \"source_amount\": \"<string>\",\n \"source_currency\": \"USD\"\n}"
response = http.request(request)
puts response.read_body{
"destination_amount": "<string>",
"order_id": "<string>",
"quote_expires_at": 123,
"session_id": "<string>",
"source_amount": "<string>",
"status": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Stripe
Open a Stripe onramp session
Open the onramp session the rest of the flow runs against.
POST
/
v1
/
stripe
/
session
Open a Stripe onramp session
curl --request POST \
--url https://api.calmtreasury.xyz/v1/stripe/session \
--header 'Content-Type: application/json' \
--header 'x-calm-publishable-key: <api-key>' \
--data '
{
"crypto_customer_id": "<string>",
"payment_token": "<string>",
"wallet": "<string>",
"destination_amount": "<string>",
"source_amount": "<string>",
"source_currency": "USD"
}
'import requests
url = "https://api.calmtreasury.xyz/v1/stripe/session"
payload = {
"crypto_customer_id": "<string>",
"payment_token": "<string>",
"wallet": "<string>",
"destination_amount": "<string>",
"source_amount": "<string>",
"source_currency": "USD"
}
headers = {
"x-calm-publishable-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-calm-publishable-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
crypto_customer_id: '<string>',
payment_token: '<string>',
wallet: '<string>',
destination_amount: '<string>',
source_amount: '<string>',
source_currency: 'USD'
})
};
fetch('https://api.calmtreasury.xyz/v1/stripe/session', 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.calmtreasury.xyz/v1/stripe/session",
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([
'crypto_customer_id' => '<string>',
'payment_token' => '<string>',
'wallet' => '<string>',
'destination_amount' => '<string>',
'source_amount' => '<string>',
'source_currency' => 'USD'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-calm-publishable-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.calmtreasury.xyz/v1/stripe/session"
payload := strings.NewReader("{\n \"crypto_customer_id\": \"<string>\",\n \"payment_token\": \"<string>\",\n \"wallet\": \"<string>\",\n \"destination_amount\": \"<string>\",\n \"source_amount\": \"<string>\",\n \"source_currency\": \"USD\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-calm-publishable-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.calmtreasury.xyz/v1/stripe/session")
.header("x-calm-publishable-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"crypto_customer_id\": \"<string>\",\n \"payment_token\": \"<string>\",\n \"wallet\": \"<string>\",\n \"destination_amount\": \"<string>\",\n \"source_amount\": \"<string>\",\n \"source_currency\": \"USD\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.calmtreasury.xyz/v1/stripe/session")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-calm-publishable-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"crypto_customer_id\": \"<string>\",\n \"payment_token\": \"<string>\",\n \"wallet\": \"<string>\",\n \"destination_amount\": \"<string>\",\n \"source_amount\": \"<string>\",\n \"source_currency\": \"USD\"\n}"
response = http.request(request)
puts response.read_body{
"destination_amount": "<string>",
"order_id": "<string>",
"quote_expires_at": 123,
"session_id": "<string>",
"source_amount": "<string>",
"status": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Opens the onramp session that the rest of the flow runs against. Returns
Stripe’s
session_id for the client SDK’s performCheckout, plus a Calm
order_id to poll at Get a Stripe onramp order.Authorizations
Publishable key identifying the calling app.
Body
application/json
Minimum string length:
1Available options:
1, 8453, 999, 1337, 4326, 143, 137, 42161 Available options:
USDC, USDm, AUSD, USDC.e Minimum string length:
1Pattern:
^0x[a-fA-F0-9]{40}$Pattern:
^\d+(\.\d+)?$Pattern:
^\d+(\.\d+)?$Allowed value:
"USD"