Skip to main content
POST
/
stripe
/
checkout
Create Stripe Checkout Session
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": "<string>",
  "isometric_terms_and_conditions_accepted": true,
  "quantity_kg": 123,
  "success_url": "<string>",
  "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": "<string>",
"isometric_terms_and_conditions_accepted": True,
"quantity_kg": 123,
"success_url": "<string>",
"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: '<string>',
isometric_terms_and_conditions_accepted: true,
quantity_kg: 123,
success_url: '<string>',
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' => '<string>',
'isometric_terms_and_conditions_accepted' => true,
'quantity_kg' => 123,
'success_url' => '<string>',
'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\": \"<string>\",\n \"isometric_terms_and_conditions_accepted\": true,\n \"quantity_kg\": 123,\n \"success_url\": \"<string>\",\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\": \"<string>\",\n \"isometric_terms_and_conditions_accepted\": true,\n \"quantity_kg\": 123,\n \"success_url\": \"<string>\",\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\": \"<string>\",\n \"isometric_terms_and_conditions_accepted\": true,\n \"quantity_kg\": 123,\n \"success_url\": \"<string>\",\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

Authorization
string
header
required

A JWT Bearer token header for authentication and authorization, in the format Authorization: Bearer <token>

Headers

x-client-secret
string
required

A secret token identifying the client connecting to the API

Example:

"Syou3EZiO5vuMEgNyBeA8cjEMYOnQDwP"

Body

application/json
cancel_url
string
required

The URL to redirect customer to after a cancelled or failed payment

Example:

"https://example.com/cancel"

frequency
enum<string>
required

The frequency of the subscription

Available options:
one_time,
monthly,
yearly
Example:

"monthly"

isometric_terms_and_conditions_accepted
boolean
required

Whether the user has accepted the Isometric terms and conditions; the request will fail if this is not set to true

Example:

true

quantity_kg
integer
required

The quantity of credits to purchase, in kilograms. This field can handle bigint values.

Example:

1000

success_url
string
required

The URL to redirect customer to after a successful payment

Example:

"https://example.com/success"

supplier_terms_and_conditions_accepted
boolean
required

Whether the user has accepted the supplier terms and conditions; the request will fail if this is not set to true

Example:

true

customer_email
string | null

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.

Example:

"test@example.com"

Response

Successful Response

redirect_url
string
required