curl --request POST \
--url https://api.sandbox.isometric.com/registry/v0/stripe/checkout \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-client-secret: <x-client-secret>' \
--data '
{
"cancel_url": "https://example.com/cancel",
"frequency": "monthly",
"isometric_terms_and_conditions_accepted": true,
"quantity_kg": 1000,
"success_url": "https://example.com/success",
"supplier_terms_and_conditions_accepted": true,
"customer_email": "test@example.com"
}
'import requests
url = "https://api.sandbox.isometric.com/registry/v0/stripe/checkout"
payload = {
"cancel_url": "https://example.com/cancel",
"frequency": "monthly",
"isometric_terms_and_conditions_accepted": True,
"quantity_kg": 1000,
"success_url": "https://example.com/success",
"supplier_terms_and_conditions_accepted": True,
"customer_email": "test@example.com"
}
headers = {
"x-client-secret": "<x-client-secret>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-client-secret': '<x-client-secret>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
cancel_url: 'https://example.com/cancel',
frequency: 'monthly',
isometric_terms_and_conditions_accepted: true,
quantity_kg: 1000,
success_url: 'https://example.com/success',
supplier_terms_and_conditions_accepted: true,
customer_email: 'test@example.com'
})
};
fetch('https://api.sandbox.isometric.com/registry/v0/stripe/checkout', 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.isometric.com/registry/v0/stripe/checkout",
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([
'cancel_url' => 'https://example.com/cancel',
'frequency' => 'monthly',
'isometric_terms_and_conditions_accepted' => true,
'quantity_kg' => 1000,
'success_url' => 'https://example.com/success',
'supplier_terms_and_conditions_accepted' => true,
'customer_email' => 'test@example.com'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-client-secret: <x-client-secret>"
],
]);
$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.isometric.com/registry/v0/stripe/checkout"
payload := strings.NewReader("{\n \"cancel_url\": \"https://example.com/cancel\",\n \"frequency\": \"monthly\",\n \"isometric_terms_and_conditions_accepted\": true,\n \"quantity_kg\": 1000,\n \"success_url\": \"https://example.com/success\",\n \"supplier_terms_and_conditions_accepted\": true,\n \"customer_email\": \"test@example.com\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-client-secret", "<x-client-secret>")
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.isometric.com/registry/v0/stripe/checkout")
.header("x-client-secret", "<x-client-secret>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"cancel_url\": \"https://example.com/cancel\",\n \"frequency\": \"monthly\",\n \"isometric_terms_and_conditions_accepted\": true,\n \"quantity_kg\": 1000,\n \"success_url\": \"https://example.com/success\",\n \"supplier_terms_and_conditions_accepted\": true,\n \"customer_email\": \"test@example.com\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.isometric.com/registry/v0/stripe/checkout")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-client-secret"] = '<x-client-secret>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"cancel_url\": \"https://example.com/cancel\",\n \"frequency\": \"monthly\",\n \"isometric_terms_and_conditions_accepted\": true,\n \"quantity_kg\": 1000,\n \"success_url\": \"https://example.com/success\",\n \"supplier_terms_and_conditions_accepted\": true,\n \"customer_email\": \"test@example.com\"\n}"
response = http.request(request)
puts response.read_body{
"redirect_url": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}Create Stripe Checkout Session
Create a Stripe Checkout Session for purchasing credits with Isometric verification.
This endpoint returns a Stripe Checkout URL to redirect the user to for completing the payment.
curl --request POST \
--url https://api.sandbox.isometric.com/registry/v0/stripe/checkout \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-client-secret: <x-client-secret>' \
--data '
{
"cancel_url": "https://example.com/cancel",
"frequency": "monthly",
"isometric_terms_and_conditions_accepted": true,
"quantity_kg": 1000,
"success_url": "https://example.com/success",
"supplier_terms_and_conditions_accepted": true,
"customer_email": "test@example.com"
}
'import requests
url = "https://api.sandbox.isometric.com/registry/v0/stripe/checkout"
payload = {
"cancel_url": "https://example.com/cancel",
"frequency": "monthly",
"isometric_terms_and_conditions_accepted": True,
"quantity_kg": 1000,
"success_url": "https://example.com/success",
"supplier_terms_and_conditions_accepted": True,
"customer_email": "test@example.com"
}
headers = {
"x-client-secret": "<x-client-secret>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-client-secret': '<x-client-secret>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
cancel_url: 'https://example.com/cancel',
frequency: 'monthly',
isometric_terms_and_conditions_accepted: true,
quantity_kg: 1000,
success_url: 'https://example.com/success',
supplier_terms_and_conditions_accepted: true,
customer_email: 'test@example.com'
})
};
fetch('https://api.sandbox.isometric.com/registry/v0/stripe/checkout', 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.isometric.com/registry/v0/stripe/checkout",
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([
'cancel_url' => 'https://example.com/cancel',
'frequency' => 'monthly',
'isometric_terms_and_conditions_accepted' => true,
'quantity_kg' => 1000,
'success_url' => 'https://example.com/success',
'supplier_terms_and_conditions_accepted' => true,
'customer_email' => 'test@example.com'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-client-secret: <x-client-secret>"
],
]);
$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.isometric.com/registry/v0/stripe/checkout"
payload := strings.NewReader("{\n \"cancel_url\": \"https://example.com/cancel\",\n \"frequency\": \"monthly\",\n \"isometric_terms_and_conditions_accepted\": true,\n \"quantity_kg\": 1000,\n \"success_url\": \"https://example.com/success\",\n \"supplier_terms_and_conditions_accepted\": true,\n \"customer_email\": \"test@example.com\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-client-secret", "<x-client-secret>")
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.isometric.com/registry/v0/stripe/checkout")
.header("x-client-secret", "<x-client-secret>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"cancel_url\": \"https://example.com/cancel\",\n \"frequency\": \"monthly\",\n \"isometric_terms_and_conditions_accepted\": true,\n \"quantity_kg\": 1000,\n \"success_url\": \"https://example.com/success\",\n \"supplier_terms_and_conditions_accepted\": true,\n \"customer_email\": \"test@example.com\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.isometric.com/registry/v0/stripe/checkout")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-client-secret"] = '<x-client-secret>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"cancel_url\": \"https://example.com/cancel\",\n \"frequency\": \"monthly\",\n \"isometric_terms_and_conditions_accepted\": true,\n \"quantity_kg\": 1000,\n \"success_url\": \"https://example.com/success\",\n \"supplier_terms_and_conditions_accepted\": true,\n \"customer_email\": \"test@example.com\"\n}"
response = http.request(request)
puts response.read_body{
"redirect_url": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}Authorizations
A JWT Bearer token header for authentication and authorization, in the format Authorization: Bearer <token>
Headers
A secret token identifying the client connecting to the API
"Syou3EZiO5vuMEgNyBeA8cjEMYOnQDwP"
Body
The URL to redirect customer to after a cancelled or failed payment
"https://example.com/cancel"
The frequency of the subscription
one_time, monthly, yearly "monthly"
Whether the user has accepted the Isometric terms and conditions; the request will fail if this is not set to true
true
The quantity of credits to purchase, in kilograms. This field can handle bigint values.
1000
The URL to redirect customer to after a successful payment
"https://example.com/success"
Whether the user has accepted the supplier terms and conditions; the request will fail if this is not set to true
true
The email of the customer to prefill the checkout session with. If not provided, the customer will be prompted to enter their email during checkout.
"test@example.com"
Response
Successful Response
Was this page helpful?