Skip to main content
POST
/
create_checkout
Create a Checkout Session for this order
curl --request POST \
  --url https://ringup.dev/api/tools/create_checkout \
  --header 'Content-Type: application/json' \
  --header 'X-Caller-Number: <x-caller-number>' \
  --header 'X-Ringup-Merchant: <x-ringup-merchant>' \
  --data '
{
  "amount_cents": 8500
}
'
import requests

url = "https://ringup.dev/api/tools/create_checkout"

payload = { "amount_cents": 8500 }
headers = {
"X-Caller-Number": "<x-caller-number>",
"X-Ringup-Merchant": "<x-ringup-merchant>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {
'X-Caller-Number': '<x-caller-number>',
'X-Ringup-Merchant': '<x-ringup-merchant>',
'Content-Type': 'application/json'
},
body: JSON.stringify({amount_cents: 8500})
};

fetch('https://ringup.dev/api/tools/create_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://ringup.dev/api/tools/create_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([
'amount_cents' => 8500
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Caller-Number: <x-caller-number>",
"X-Ringup-Merchant: <x-ringup-merchant>"
],
]);

$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://ringup.dev/api/tools/create_checkout"

payload := strings.NewReader("{\n \"amount_cents\": 8500\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("X-Caller-Number", "<x-caller-number>")
req.Header.Add("X-Ringup-Merchant", "<x-ringup-merchant>")
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://ringup.dev/api/tools/create_checkout")
.header("X-Caller-Number", "<x-caller-number>")
.header("X-Ringup-Merchant", "<x-ringup-merchant>")
.header("Content-Type", "application/json")
.body("{\n \"amount_cents\": 8500\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://ringup.dev/api/tools/create_checkout")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["X-Caller-Number"] = '<x-caller-number>'
request["X-Ringup-Merchant"] = '<x-ringup-merchant>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount_cents\": 8500\n}"

response = http.request(request)
puts response.read_body
{
  "id": "cs_x9f2",
  "payment_required": "required",
  "reason": "amount over $50 requires payment before the call ends"
}

Headers

X-Caller-Number
string
required

The caller's phone number in E.164, templated from the platform's caller-ID variable. Never model-generated.

Example:

"+14155550142"

X-Ringup-Merchant
string
required

The dialed number in E.164 (resolved to a merchant server-side) or an explicit merchant id.

Example:

"tonys-pizza"

X-Call-Id
string

The platform's call id. Used for charge idempotency: retries within a call can never double-charge.

Body

application/json
amount_cents
number

The purchase amount in cents.

Response

200 - application/json

The policy decision for this purchase.

id
string

The Checkout Session id (cs_...).

payment_required
enum<string>

required: payment must complete before the call ends. optional: offer once, never block. none: do not offer payment at all; proceed as the business's normal flow.

Available options:
required,
optional,
none
reason
string

One sentence written for the model, telling the payment step how to behave.