curl --request POST \
--url https://api.yorlet.com/v1/checkout_sessions \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"description": "<string>",
"currency": "gbp",
"customer": "<string>",
"subscription_data": {
"add_invoice_items": [
{
"amount": 123,
"currency": "<string>",
"description": "<string>",
"tax_percent": 50,
"metadata": {},
"price": "<string>",
"tax_rate": "<string>",
"transfer_destination": "<string>",
"unit": "<string>"
}
],
"billing_anchor": 123,
"billing_anchor_config": {
"day_of_month": 16
},
"coupon": "<string>",
"custom_fields": [
{
"name": "<string>",
"value": "<string>"
}
],
"days_before_collection": 3,
"days_until_due": 1,
"description": "<string>",
"end_date": 123,
"end_date_config": {
"day": 16,
"month": 6,
"year": 123
},
"metadata": {},
"phases": [
{
"start_date": 123,
"items": [
{
"price_data": {
"amount": 123,
"currency": "<string>",
"tax_percent": 123
},
"description": "<string>",
"metadata": {},
"price": "<string>",
"schedule": [
{
"amount": 123,
"effective_at": 123
}
],
"tax_rate": "<string>",
"transfer_destination": "<string>",
"unit": "<string>"
}
]
}
],
"start_date": 123,
"start_date_config": {
"day": 16,
"month": 6,
"year": 123
},
"application": "<string>",
"interval_count": 123,
"invoice_settings": {
"custom_fields": [
{
"name": "<string>",
"value": "<string>"
}
]
},
"items": [
{
"price_data": {
"amount": 123,
"currency": "<string>",
"tax_percent": 123
},
"description": "<string>",
"metadata": {},
"price": "<string>",
"schedule": [
{
"amount": 123,
"effective_at": 123
}
],
"tax_rate": "<string>",
"transfer_destination": "<string>",
"unit": "<string>"
}
],
"use_future_billing_date": true
},
"metadata": {},
"payment_method_types": [],
"consent_collection": {
"terms_of_service": false
},
"custom_text": {},
"return_url": "<string>",
"send_email": true
}
'import requests
url = "https://api.yorlet.com/v1/checkout_sessions"
payload = {
"description": "<string>",
"currency": "gbp",
"customer": "<string>",
"subscription_data": {
"add_invoice_items": [
{
"amount": 123,
"currency": "<string>",
"description": "<string>",
"tax_percent": 50,
"metadata": {},
"price": "<string>",
"tax_rate": "<string>",
"transfer_destination": "<string>",
"unit": "<string>"
}
],
"billing_anchor": 123,
"billing_anchor_config": { "day_of_month": 16 },
"coupon": "<string>",
"custom_fields": [
{
"name": "<string>",
"value": "<string>"
}
],
"days_before_collection": 3,
"days_until_due": 1,
"description": "<string>",
"end_date": 123,
"end_date_config": {
"day": 16,
"month": 6,
"year": 123
},
"metadata": {},
"phases": [
{
"start_date": 123,
"items": [
{
"price_data": {
"amount": 123,
"currency": "<string>",
"tax_percent": 123
},
"description": "<string>",
"metadata": {},
"price": "<string>",
"schedule": [
{
"amount": 123,
"effective_at": 123
}
],
"tax_rate": "<string>",
"transfer_destination": "<string>",
"unit": "<string>"
}
]
}
],
"start_date": 123,
"start_date_config": {
"day": 16,
"month": 6,
"year": 123
},
"application": "<string>",
"interval_count": 123,
"invoice_settings": { "custom_fields": [
{
"name": "<string>",
"value": "<string>"
}
] },
"items": [
{
"price_data": {
"amount": 123,
"currency": "<string>",
"tax_percent": 123
},
"description": "<string>",
"metadata": {},
"price": "<string>",
"schedule": [
{
"amount": 123,
"effective_at": 123
}
],
"tax_rate": "<string>",
"transfer_destination": "<string>",
"unit": "<string>"
}
],
"use_future_billing_date": True
},
"metadata": {},
"payment_method_types": [],
"consent_collection": { "terms_of_service": False },
"custom_text": {},
"return_url": "<string>",
"send_email": True
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
description: '<string>',
currency: 'gbp',
customer: '<string>',
subscription_data: {
add_invoice_items: [
{
amount: 123,
currency: '<string>',
description: '<string>',
tax_percent: 50,
metadata: {},
price: '<string>',
tax_rate: '<string>',
transfer_destination: '<string>',
unit: '<string>'
}
],
billing_anchor: 123,
billing_anchor_config: {day_of_month: 16},
coupon: '<string>',
custom_fields: [{name: '<string>', value: '<string>'}],
days_before_collection: 3,
days_until_due: 1,
description: '<string>',
end_date: 123,
end_date_config: {day: 16, month: 6, year: 123},
metadata: {},
phases: [
{
start_date: 123,
items: [
{
price_data: {amount: 123, currency: '<string>', tax_percent: 123},
description: '<string>',
metadata: {},
price: '<string>',
schedule: [{amount: 123, effective_at: 123}],
tax_rate: '<string>',
transfer_destination: '<string>',
unit: '<string>'
}
]
}
],
start_date: 123,
start_date_config: {day: 16, month: 6, year: 123},
application: '<string>',
interval_count: 123,
invoice_settings: {custom_fields: [{name: '<string>', value: '<string>'}]},
items: [
{
price_data: {amount: 123, currency: '<string>', tax_percent: 123},
description: '<string>',
metadata: {},
price: '<string>',
schedule: [{amount: 123, effective_at: 123}],
tax_rate: '<string>',
transfer_destination: '<string>',
unit: '<string>'
}
],
use_future_billing_date: true
},
metadata: {},
payment_method_types: [],
consent_collection: {terms_of_service: false},
custom_text: {},
return_url: '<string>',
send_email: true
})
};
fetch('https://api.yorlet.com/v1/checkout_sessions', 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.yorlet.com/v1/checkout_sessions",
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([
'description' => '<string>',
'currency' => 'gbp',
'customer' => '<string>',
'subscription_data' => [
'add_invoice_items' => [
[
'amount' => 123,
'currency' => '<string>',
'description' => '<string>',
'tax_percent' => 50,
'metadata' => [
],
'price' => '<string>',
'tax_rate' => '<string>',
'transfer_destination' => '<string>',
'unit' => '<string>'
]
],
'billing_anchor' => 123,
'billing_anchor_config' => [
'day_of_month' => 16
],
'coupon' => '<string>',
'custom_fields' => [
[
'name' => '<string>',
'value' => '<string>'
]
],
'days_before_collection' => 3,
'days_until_due' => 1,
'description' => '<string>',
'end_date' => 123,
'end_date_config' => [
'day' => 16,
'month' => 6,
'year' => 123
],
'metadata' => [
],
'phases' => [
[
'start_date' => 123,
'items' => [
[
'price_data' => [
'amount' => 123,
'currency' => '<string>',
'tax_percent' => 123
],
'description' => '<string>',
'metadata' => [
],
'price' => '<string>',
'schedule' => [
[
'amount' => 123,
'effective_at' => 123
]
],
'tax_rate' => '<string>',
'transfer_destination' => '<string>',
'unit' => '<string>'
]
]
]
],
'start_date' => 123,
'start_date_config' => [
'day' => 16,
'month' => 6,
'year' => 123
],
'application' => '<string>',
'interval_count' => 123,
'invoice_settings' => [
'custom_fields' => [
[
'name' => '<string>',
'value' => '<string>'
]
]
],
'items' => [
[
'price_data' => [
'amount' => 123,
'currency' => '<string>',
'tax_percent' => 123
],
'description' => '<string>',
'metadata' => [
],
'price' => '<string>',
'schedule' => [
[
'amount' => 123,
'effective_at' => 123
]
],
'tax_rate' => '<string>',
'transfer_destination' => '<string>',
'unit' => '<string>'
]
],
'use_future_billing_date' => true
],
'metadata' => [
],
'payment_method_types' => [
],
'consent_collection' => [
'terms_of_service' => false
],
'custom_text' => [
],
'return_url' => '<string>',
'send_email' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$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.yorlet.com/v1/checkout_sessions"
payload := strings.NewReader("{\n \"description\": \"<string>\",\n \"currency\": \"gbp\",\n \"customer\": \"<string>\",\n \"subscription_data\": {\n \"add_invoice_items\": [\n {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"description\": \"<string>\",\n \"tax_percent\": 50,\n \"metadata\": {},\n \"price\": \"<string>\",\n \"tax_rate\": \"<string>\",\n \"transfer_destination\": \"<string>\",\n \"unit\": \"<string>\"\n }\n ],\n \"billing_anchor\": 123,\n \"billing_anchor_config\": {\n \"day_of_month\": 16\n },\n \"coupon\": \"<string>\",\n \"custom_fields\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"days_before_collection\": 3,\n \"days_until_due\": 1,\n \"description\": \"<string>\",\n \"end_date\": 123,\n \"end_date_config\": {\n \"day\": 16,\n \"month\": 6,\n \"year\": 123\n },\n \"metadata\": {},\n \"phases\": [\n {\n \"start_date\": 123,\n \"items\": [\n {\n \"price_data\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"tax_percent\": 123\n },\n \"description\": \"<string>\",\n \"metadata\": {},\n \"price\": \"<string>\",\n \"schedule\": [\n {\n \"amount\": 123,\n \"effective_at\": 123\n }\n ],\n \"tax_rate\": \"<string>\",\n \"transfer_destination\": \"<string>\",\n \"unit\": \"<string>\"\n }\n ]\n }\n ],\n \"start_date\": 123,\n \"start_date_config\": {\n \"day\": 16,\n \"month\": 6,\n \"year\": 123\n },\n \"application\": \"<string>\",\n \"interval_count\": 123,\n \"invoice_settings\": {\n \"custom_fields\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n },\n \"items\": [\n {\n \"price_data\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"tax_percent\": 123\n },\n \"description\": \"<string>\",\n \"metadata\": {},\n \"price\": \"<string>\",\n \"schedule\": [\n {\n \"amount\": 123,\n \"effective_at\": 123\n }\n ],\n \"tax_rate\": \"<string>\",\n \"transfer_destination\": \"<string>\",\n \"unit\": \"<string>\"\n }\n ],\n \"use_future_billing_date\": true\n },\n \"metadata\": {},\n \"payment_method_types\": [],\n \"consent_collection\": {\n \"terms_of_service\": false\n },\n \"custom_text\": {},\n \"return_url\": \"<string>\",\n \"send_email\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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.yorlet.com/v1/checkout_sessions")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"<string>\",\n \"currency\": \"gbp\",\n \"customer\": \"<string>\",\n \"subscription_data\": {\n \"add_invoice_items\": [\n {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"description\": \"<string>\",\n \"tax_percent\": 50,\n \"metadata\": {},\n \"price\": \"<string>\",\n \"tax_rate\": \"<string>\",\n \"transfer_destination\": \"<string>\",\n \"unit\": \"<string>\"\n }\n ],\n \"billing_anchor\": 123,\n \"billing_anchor_config\": {\n \"day_of_month\": 16\n },\n \"coupon\": \"<string>\",\n \"custom_fields\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"days_before_collection\": 3,\n \"days_until_due\": 1,\n \"description\": \"<string>\",\n \"end_date\": 123,\n \"end_date_config\": {\n \"day\": 16,\n \"month\": 6,\n \"year\": 123\n },\n \"metadata\": {},\n \"phases\": [\n {\n \"start_date\": 123,\n \"items\": [\n {\n \"price_data\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"tax_percent\": 123\n },\n \"description\": \"<string>\",\n \"metadata\": {},\n \"price\": \"<string>\",\n \"schedule\": [\n {\n \"amount\": 123,\n \"effective_at\": 123\n }\n ],\n \"tax_rate\": \"<string>\",\n \"transfer_destination\": \"<string>\",\n \"unit\": \"<string>\"\n }\n ]\n }\n ],\n \"start_date\": 123,\n \"start_date_config\": {\n \"day\": 16,\n \"month\": 6,\n \"year\": 123\n },\n \"application\": \"<string>\",\n \"interval_count\": 123,\n \"invoice_settings\": {\n \"custom_fields\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n },\n \"items\": [\n {\n \"price_data\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"tax_percent\": 123\n },\n \"description\": \"<string>\",\n \"metadata\": {},\n \"price\": \"<string>\",\n \"schedule\": [\n {\n \"amount\": 123,\n \"effective_at\": 123\n }\n ],\n \"tax_rate\": \"<string>\",\n \"transfer_destination\": \"<string>\",\n \"unit\": \"<string>\"\n }\n ],\n \"use_future_billing_date\": true\n },\n \"metadata\": {},\n \"payment_method_types\": [],\n \"consent_collection\": {\n \"terms_of_service\": false\n },\n \"custom_text\": {},\n \"return_url\": \"<string>\",\n \"send_email\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.yorlet.com/v1/checkout_sessions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"description\": \"<string>\",\n \"currency\": \"gbp\",\n \"customer\": \"<string>\",\n \"subscription_data\": {\n \"add_invoice_items\": [\n {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"description\": \"<string>\",\n \"tax_percent\": 50,\n \"metadata\": {},\n \"price\": \"<string>\",\n \"tax_rate\": \"<string>\",\n \"transfer_destination\": \"<string>\",\n \"unit\": \"<string>\"\n }\n ],\n \"billing_anchor\": 123,\n \"billing_anchor_config\": {\n \"day_of_month\": 16\n },\n \"coupon\": \"<string>\",\n \"custom_fields\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"days_before_collection\": 3,\n \"days_until_due\": 1,\n \"description\": \"<string>\",\n \"end_date\": 123,\n \"end_date_config\": {\n \"day\": 16,\n \"month\": 6,\n \"year\": 123\n },\n \"metadata\": {},\n \"phases\": [\n {\n \"start_date\": 123,\n \"items\": [\n {\n \"price_data\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"tax_percent\": 123\n },\n \"description\": \"<string>\",\n \"metadata\": {},\n \"price\": \"<string>\",\n \"schedule\": [\n {\n \"amount\": 123,\n \"effective_at\": 123\n }\n ],\n \"tax_rate\": \"<string>\",\n \"transfer_destination\": \"<string>\",\n \"unit\": \"<string>\"\n }\n ]\n }\n ],\n \"start_date\": 123,\n \"start_date_config\": {\n \"day\": 16,\n \"month\": 6,\n \"year\": 123\n },\n \"application\": \"<string>\",\n \"interval_count\": 123,\n \"invoice_settings\": {\n \"custom_fields\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n },\n \"items\": [\n {\n \"price_data\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"tax_percent\": 123\n },\n \"description\": \"<string>\",\n \"metadata\": {},\n \"price\": \"<string>\",\n \"schedule\": [\n {\n \"amount\": 123,\n \"effective_at\": 123\n }\n ],\n \"tax_rate\": \"<string>\",\n \"transfer_destination\": \"<string>\",\n \"unit\": \"<string>\"\n }\n ],\n \"use_future_billing_date\": true\n },\n \"metadata\": {},\n \"payment_method_types\": [],\n \"consent_collection\": {\n \"terms_of_service\": false\n },\n \"custom_text\": {},\n \"return_url\": \"<string>\",\n \"send_email\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"created": 123,
"object": "checkout_session",
"completed_at": 123,
"consent_collection": {
"terms_of_service": true
},
"custom_text": {
"terms_of_service": {
"message": "<string>"
}
},
"currency": "gbp",
"customer": "<string>",
"default_payment_method": "<string>",
"description": "<string>",
"payment_method_types": [
"<string>"
],
"return_url": "<string>",
"subscription_data": {
"add_invoice_items": [
{
"amount": 123,
"currency": "<string>",
"description": "<string>",
"tax_percent": 50,
"metadata": {},
"price": "<string>",
"tax_rate": "<string>",
"transfer_destination": "<string>",
"unit": "<string>"
}
],
"billing_anchor": 123,
"billing_anchor_config": {
"day_of_month": 16
},
"coupon": "<string>",
"custom_fields": [
{
"name": "<string>",
"value": "<string>"
}
],
"days_before_collection": 3,
"days_until_due": 1,
"description": "<string>",
"end_date": 123,
"end_date_config": {
"day": 16,
"month": 6,
"year": 123
},
"metadata": {},
"phases": [
{
"start_date": 123,
"items": [
{
"price_data": {
"amount": 123,
"currency": "<string>",
"tax_percent": 123
},
"description": "<string>",
"metadata": {},
"price": "<string>",
"schedule": [
{
"amount": 123,
"effective_at": 123,
"effective_at_config": {
"day": 16,
"month": 6,
"year": 123
}
}
],
"tax_rate": "<string>",
"transfer_destination": "<string>",
"unit": "<string>"
}
]
}
],
"start_date": 123,
"start_date_config": {
"day": 16,
"month": 6,
"year": 123
},
"application": "<string>",
"interval_count": 123,
"invoice_settings": {
"custom_fields": [
{
"name": "<string>",
"value": "<string>"
}
]
},
"items": [
{
"price_data": {
"amount": 123,
"currency": "<string>",
"tax_percent": 123
},
"description": "<string>",
"metadata": {},
"price": "<string>",
"schedule": [
{
"amount": 123,
"effective_at": 123,
"effective_at_config": {
"day": 16,
"month": 6,
"year": 123
}
}
],
"tax_rate": "<string>",
"transfer_destination": "<string>",
"unit": "<string>"
}
],
"use_future_billing_date": true
},
"subscription": "<string>",
"url": "<string>",
"account": "<string>",
"deleted": false,
"merchant": {
"business_name": "<string>",
"color": "<string>",
"country": "<string>",
"display_name": "<string>",
"icon": "<string>",
"id": "<string>",
"support_email": "<string>",
"support_phone": "<string>",
"support_website": "<string>",
"terms_of_service_url": "<string>"
},
"metadata": {}
}Create a checkout session
Creates a new checkout session.
curl --request POST \
--url https://api.yorlet.com/v1/checkout_sessions \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"description": "<string>",
"currency": "gbp",
"customer": "<string>",
"subscription_data": {
"add_invoice_items": [
{
"amount": 123,
"currency": "<string>",
"description": "<string>",
"tax_percent": 50,
"metadata": {},
"price": "<string>",
"tax_rate": "<string>",
"transfer_destination": "<string>",
"unit": "<string>"
}
],
"billing_anchor": 123,
"billing_anchor_config": {
"day_of_month": 16
},
"coupon": "<string>",
"custom_fields": [
{
"name": "<string>",
"value": "<string>"
}
],
"days_before_collection": 3,
"days_until_due": 1,
"description": "<string>",
"end_date": 123,
"end_date_config": {
"day": 16,
"month": 6,
"year": 123
},
"metadata": {},
"phases": [
{
"start_date": 123,
"items": [
{
"price_data": {
"amount": 123,
"currency": "<string>",
"tax_percent": 123
},
"description": "<string>",
"metadata": {},
"price": "<string>",
"schedule": [
{
"amount": 123,
"effective_at": 123
}
],
"tax_rate": "<string>",
"transfer_destination": "<string>",
"unit": "<string>"
}
]
}
],
"start_date": 123,
"start_date_config": {
"day": 16,
"month": 6,
"year": 123
},
"application": "<string>",
"interval_count": 123,
"invoice_settings": {
"custom_fields": [
{
"name": "<string>",
"value": "<string>"
}
]
},
"items": [
{
"price_data": {
"amount": 123,
"currency": "<string>",
"tax_percent": 123
},
"description": "<string>",
"metadata": {},
"price": "<string>",
"schedule": [
{
"amount": 123,
"effective_at": 123
}
],
"tax_rate": "<string>",
"transfer_destination": "<string>",
"unit": "<string>"
}
],
"use_future_billing_date": true
},
"metadata": {},
"payment_method_types": [],
"consent_collection": {
"terms_of_service": false
},
"custom_text": {},
"return_url": "<string>",
"send_email": true
}
'import requests
url = "https://api.yorlet.com/v1/checkout_sessions"
payload = {
"description": "<string>",
"currency": "gbp",
"customer": "<string>",
"subscription_data": {
"add_invoice_items": [
{
"amount": 123,
"currency": "<string>",
"description": "<string>",
"tax_percent": 50,
"metadata": {},
"price": "<string>",
"tax_rate": "<string>",
"transfer_destination": "<string>",
"unit": "<string>"
}
],
"billing_anchor": 123,
"billing_anchor_config": { "day_of_month": 16 },
"coupon": "<string>",
"custom_fields": [
{
"name": "<string>",
"value": "<string>"
}
],
"days_before_collection": 3,
"days_until_due": 1,
"description": "<string>",
"end_date": 123,
"end_date_config": {
"day": 16,
"month": 6,
"year": 123
},
"metadata": {},
"phases": [
{
"start_date": 123,
"items": [
{
"price_data": {
"amount": 123,
"currency": "<string>",
"tax_percent": 123
},
"description": "<string>",
"metadata": {},
"price": "<string>",
"schedule": [
{
"amount": 123,
"effective_at": 123
}
],
"tax_rate": "<string>",
"transfer_destination": "<string>",
"unit": "<string>"
}
]
}
],
"start_date": 123,
"start_date_config": {
"day": 16,
"month": 6,
"year": 123
},
"application": "<string>",
"interval_count": 123,
"invoice_settings": { "custom_fields": [
{
"name": "<string>",
"value": "<string>"
}
] },
"items": [
{
"price_data": {
"amount": 123,
"currency": "<string>",
"tax_percent": 123
},
"description": "<string>",
"metadata": {},
"price": "<string>",
"schedule": [
{
"amount": 123,
"effective_at": 123
}
],
"tax_rate": "<string>",
"transfer_destination": "<string>",
"unit": "<string>"
}
],
"use_future_billing_date": True
},
"metadata": {},
"payment_method_types": [],
"consent_collection": { "terms_of_service": False },
"custom_text": {},
"return_url": "<string>",
"send_email": True
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
description: '<string>',
currency: 'gbp',
customer: '<string>',
subscription_data: {
add_invoice_items: [
{
amount: 123,
currency: '<string>',
description: '<string>',
tax_percent: 50,
metadata: {},
price: '<string>',
tax_rate: '<string>',
transfer_destination: '<string>',
unit: '<string>'
}
],
billing_anchor: 123,
billing_anchor_config: {day_of_month: 16},
coupon: '<string>',
custom_fields: [{name: '<string>', value: '<string>'}],
days_before_collection: 3,
days_until_due: 1,
description: '<string>',
end_date: 123,
end_date_config: {day: 16, month: 6, year: 123},
metadata: {},
phases: [
{
start_date: 123,
items: [
{
price_data: {amount: 123, currency: '<string>', tax_percent: 123},
description: '<string>',
metadata: {},
price: '<string>',
schedule: [{amount: 123, effective_at: 123}],
tax_rate: '<string>',
transfer_destination: '<string>',
unit: '<string>'
}
]
}
],
start_date: 123,
start_date_config: {day: 16, month: 6, year: 123},
application: '<string>',
interval_count: 123,
invoice_settings: {custom_fields: [{name: '<string>', value: '<string>'}]},
items: [
{
price_data: {amount: 123, currency: '<string>', tax_percent: 123},
description: '<string>',
metadata: {},
price: '<string>',
schedule: [{amount: 123, effective_at: 123}],
tax_rate: '<string>',
transfer_destination: '<string>',
unit: '<string>'
}
],
use_future_billing_date: true
},
metadata: {},
payment_method_types: [],
consent_collection: {terms_of_service: false},
custom_text: {},
return_url: '<string>',
send_email: true
})
};
fetch('https://api.yorlet.com/v1/checkout_sessions', 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.yorlet.com/v1/checkout_sessions",
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([
'description' => '<string>',
'currency' => 'gbp',
'customer' => '<string>',
'subscription_data' => [
'add_invoice_items' => [
[
'amount' => 123,
'currency' => '<string>',
'description' => '<string>',
'tax_percent' => 50,
'metadata' => [
],
'price' => '<string>',
'tax_rate' => '<string>',
'transfer_destination' => '<string>',
'unit' => '<string>'
]
],
'billing_anchor' => 123,
'billing_anchor_config' => [
'day_of_month' => 16
],
'coupon' => '<string>',
'custom_fields' => [
[
'name' => '<string>',
'value' => '<string>'
]
],
'days_before_collection' => 3,
'days_until_due' => 1,
'description' => '<string>',
'end_date' => 123,
'end_date_config' => [
'day' => 16,
'month' => 6,
'year' => 123
],
'metadata' => [
],
'phases' => [
[
'start_date' => 123,
'items' => [
[
'price_data' => [
'amount' => 123,
'currency' => '<string>',
'tax_percent' => 123
],
'description' => '<string>',
'metadata' => [
],
'price' => '<string>',
'schedule' => [
[
'amount' => 123,
'effective_at' => 123
]
],
'tax_rate' => '<string>',
'transfer_destination' => '<string>',
'unit' => '<string>'
]
]
]
],
'start_date' => 123,
'start_date_config' => [
'day' => 16,
'month' => 6,
'year' => 123
],
'application' => '<string>',
'interval_count' => 123,
'invoice_settings' => [
'custom_fields' => [
[
'name' => '<string>',
'value' => '<string>'
]
]
],
'items' => [
[
'price_data' => [
'amount' => 123,
'currency' => '<string>',
'tax_percent' => 123
],
'description' => '<string>',
'metadata' => [
],
'price' => '<string>',
'schedule' => [
[
'amount' => 123,
'effective_at' => 123
]
],
'tax_rate' => '<string>',
'transfer_destination' => '<string>',
'unit' => '<string>'
]
],
'use_future_billing_date' => true
],
'metadata' => [
],
'payment_method_types' => [
],
'consent_collection' => [
'terms_of_service' => false
],
'custom_text' => [
],
'return_url' => '<string>',
'send_email' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$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.yorlet.com/v1/checkout_sessions"
payload := strings.NewReader("{\n \"description\": \"<string>\",\n \"currency\": \"gbp\",\n \"customer\": \"<string>\",\n \"subscription_data\": {\n \"add_invoice_items\": [\n {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"description\": \"<string>\",\n \"tax_percent\": 50,\n \"metadata\": {},\n \"price\": \"<string>\",\n \"tax_rate\": \"<string>\",\n \"transfer_destination\": \"<string>\",\n \"unit\": \"<string>\"\n }\n ],\n \"billing_anchor\": 123,\n \"billing_anchor_config\": {\n \"day_of_month\": 16\n },\n \"coupon\": \"<string>\",\n \"custom_fields\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"days_before_collection\": 3,\n \"days_until_due\": 1,\n \"description\": \"<string>\",\n \"end_date\": 123,\n \"end_date_config\": {\n \"day\": 16,\n \"month\": 6,\n \"year\": 123\n },\n \"metadata\": {},\n \"phases\": [\n {\n \"start_date\": 123,\n \"items\": [\n {\n \"price_data\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"tax_percent\": 123\n },\n \"description\": \"<string>\",\n \"metadata\": {},\n \"price\": \"<string>\",\n \"schedule\": [\n {\n \"amount\": 123,\n \"effective_at\": 123\n }\n ],\n \"tax_rate\": \"<string>\",\n \"transfer_destination\": \"<string>\",\n \"unit\": \"<string>\"\n }\n ]\n }\n ],\n \"start_date\": 123,\n \"start_date_config\": {\n \"day\": 16,\n \"month\": 6,\n \"year\": 123\n },\n \"application\": \"<string>\",\n \"interval_count\": 123,\n \"invoice_settings\": {\n \"custom_fields\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n },\n \"items\": [\n {\n \"price_data\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"tax_percent\": 123\n },\n \"description\": \"<string>\",\n \"metadata\": {},\n \"price\": \"<string>\",\n \"schedule\": [\n {\n \"amount\": 123,\n \"effective_at\": 123\n }\n ],\n \"tax_rate\": \"<string>\",\n \"transfer_destination\": \"<string>\",\n \"unit\": \"<string>\"\n }\n ],\n \"use_future_billing_date\": true\n },\n \"metadata\": {},\n \"payment_method_types\": [],\n \"consent_collection\": {\n \"terms_of_service\": false\n },\n \"custom_text\": {},\n \"return_url\": \"<string>\",\n \"send_email\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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.yorlet.com/v1/checkout_sessions")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"<string>\",\n \"currency\": \"gbp\",\n \"customer\": \"<string>\",\n \"subscription_data\": {\n \"add_invoice_items\": [\n {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"description\": \"<string>\",\n \"tax_percent\": 50,\n \"metadata\": {},\n \"price\": \"<string>\",\n \"tax_rate\": \"<string>\",\n \"transfer_destination\": \"<string>\",\n \"unit\": \"<string>\"\n }\n ],\n \"billing_anchor\": 123,\n \"billing_anchor_config\": {\n \"day_of_month\": 16\n },\n \"coupon\": \"<string>\",\n \"custom_fields\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"days_before_collection\": 3,\n \"days_until_due\": 1,\n \"description\": \"<string>\",\n \"end_date\": 123,\n \"end_date_config\": {\n \"day\": 16,\n \"month\": 6,\n \"year\": 123\n },\n \"metadata\": {},\n \"phases\": [\n {\n \"start_date\": 123,\n \"items\": [\n {\n \"price_data\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"tax_percent\": 123\n },\n \"description\": \"<string>\",\n \"metadata\": {},\n \"price\": \"<string>\",\n \"schedule\": [\n {\n \"amount\": 123,\n \"effective_at\": 123\n }\n ],\n \"tax_rate\": \"<string>\",\n \"transfer_destination\": \"<string>\",\n \"unit\": \"<string>\"\n }\n ]\n }\n ],\n \"start_date\": 123,\n \"start_date_config\": {\n \"day\": 16,\n \"month\": 6,\n \"year\": 123\n },\n \"application\": \"<string>\",\n \"interval_count\": 123,\n \"invoice_settings\": {\n \"custom_fields\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n },\n \"items\": [\n {\n \"price_data\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"tax_percent\": 123\n },\n \"description\": \"<string>\",\n \"metadata\": {},\n \"price\": \"<string>\",\n \"schedule\": [\n {\n \"amount\": 123,\n \"effective_at\": 123\n }\n ],\n \"tax_rate\": \"<string>\",\n \"transfer_destination\": \"<string>\",\n \"unit\": \"<string>\"\n }\n ],\n \"use_future_billing_date\": true\n },\n \"metadata\": {},\n \"payment_method_types\": [],\n \"consent_collection\": {\n \"terms_of_service\": false\n },\n \"custom_text\": {},\n \"return_url\": \"<string>\",\n \"send_email\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.yorlet.com/v1/checkout_sessions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"description\": \"<string>\",\n \"currency\": \"gbp\",\n \"customer\": \"<string>\",\n \"subscription_data\": {\n \"add_invoice_items\": [\n {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"description\": \"<string>\",\n \"tax_percent\": 50,\n \"metadata\": {},\n \"price\": \"<string>\",\n \"tax_rate\": \"<string>\",\n \"transfer_destination\": \"<string>\",\n \"unit\": \"<string>\"\n }\n ],\n \"billing_anchor\": 123,\n \"billing_anchor_config\": {\n \"day_of_month\": 16\n },\n \"coupon\": \"<string>\",\n \"custom_fields\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"days_before_collection\": 3,\n \"days_until_due\": 1,\n \"description\": \"<string>\",\n \"end_date\": 123,\n \"end_date_config\": {\n \"day\": 16,\n \"month\": 6,\n \"year\": 123\n },\n \"metadata\": {},\n \"phases\": [\n {\n \"start_date\": 123,\n \"items\": [\n {\n \"price_data\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"tax_percent\": 123\n },\n \"description\": \"<string>\",\n \"metadata\": {},\n \"price\": \"<string>\",\n \"schedule\": [\n {\n \"amount\": 123,\n \"effective_at\": 123\n }\n ],\n \"tax_rate\": \"<string>\",\n \"transfer_destination\": \"<string>\",\n \"unit\": \"<string>\"\n }\n ]\n }\n ],\n \"start_date\": 123,\n \"start_date_config\": {\n \"day\": 16,\n \"month\": 6,\n \"year\": 123\n },\n \"application\": \"<string>\",\n \"interval_count\": 123,\n \"invoice_settings\": {\n \"custom_fields\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n },\n \"items\": [\n {\n \"price_data\": {\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"tax_percent\": 123\n },\n \"description\": \"<string>\",\n \"metadata\": {},\n \"price\": \"<string>\",\n \"schedule\": [\n {\n \"amount\": 123,\n \"effective_at\": 123\n }\n ],\n \"tax_rate\": \"<string>\",\n \"transfer_destination\": \"<string>\",\n \"unit\": \"<string>\"\n }\n ],\n \"use_future_billing_date\": true\n },\n \"metadata\": {},\n \"payment_method_types\": [],\n \"consent_collection\": {\n \"terms_of_service\": false\n },\n \"custom_text\": {},\n \"return_url\": \"<string>\",\n \"send_email\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"created": 123,
"object": "checkout_session",
"completed_at": 123,
"consent_collection": {
"terms_of_service": true
},
"custom_text": {
"terms_of_service": {
"message": "<string>"
}
},
"currency": "gbp",
"customer": "<string>",
"default_payment_method": "<string>",
"description": "<string>",
"payment_method_types": [
"<string>"
],
"return_url": "<string>",
"subscription_data": {
"add_invoice_items": [
{
"amount": 123,
"currency": "<string>",
"description": "<string>",
"tax_percent": 50,
"metadata": {},
"price": "<string>",
"tax_rate": "<string>",
"transfer_destination": "<string>",
"unit": "<string>"
}
],
"billing_anchor": 123,
"billing_anchor_config": {
"day_of_month": 16
},
"coupon": "<string>",
"custom_fields": [
{
"name": "<string>",
"value": "<string>"
}
],
"days_before_collection": 3,
"days_until_due": 1,
"description": "<string>",
"end_date": 123,
"end_date_config": {
"day": 16,
"month": 6,
"year": 123
},
"metadata": {},
"phases": [
{
"start_date": 123,
"items": [
{
"price_data": {
"amount": 123,
"currency": "<string>",
"tax_percent": 123
},
"description": "<string>",
"metadata": {},
"price": "<string>",
"schedule": [
{
"amount": 123,
"effective_at": 123,
"effective_at_config": {
"day": 16,
"month": 6,
"year": 123
}
}
],
"tax_rate": "<string>",
"transfer_destination": "<string>",
"unit": "<string>"
}
]
}
],
"start_date": 123,
"start_date_config": {
"day": 16,
"month": 6,
"year": 123
},
"application": "<string>",
"interval_count": 123,
"invoice_settings": {
"custom_fields": [
{
"name": "<string>",
"value": "<string>"
}
]
},
"items": [
{
"price_data": {
"amount": 123,
"currency": "<string>",
"tax_percent": 123
},
"description": "<string>",
"metadata": {},
"price": "<string>",
"schedule": [
{
"amount": 123,
"effective_at": 123,
"effective_at_config": {
"day": 16,
"month": 6,
"year": 123
}
}
],
"tax_rate": "<string>",
"transfer_destination": "<string>",
"unit": "<string>"
}
],
"use_future_billing_date": true
},
"subscription": "<string>",
"url": "<string>",
"account": "<string>",
"deleted": false,
"merchant": {
"business_name": "<string>",
"color": "<string>",
"country": "<string>",
"display_name": "<string>",
"icon": "<string>",
"id": "<string>",
"support_email": "<string>",
"support_phone": "<string>",
"support_website": "<string>",
"terms_of_service_url": "<string>"
},
"metadata": {}
}Authorizations
API Key authentication. Use "Bearer YOUR_API_KEY".
Body
The description of the checkout session. This will be displayed to the customer.
The currency to use for the checkout session.
gbp, usd, eur, sek "gbp"
The ID of the customer to use for the checkout session.
The subscription data hash.
Show child attributes
Show child attributes
Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
Show child attributes
Show child attributes
The payment method types allowed for this checkout session.
1autogiro, bacs_debit, card, card_present, bank_transfer, direct_transfer, gbp_credit_transfer, pay_by_bank, sepa_debit The consent collection object.
Show child attributes
Show child attributes
The custom text object. Used to override the default text for a checkout session.
Show child attributes
Show child attributes
The URL to return to after the checkout session is complete.
Whether to send an email to the customer with a link to the checkout session.
Response
Returns the checkout session object if the request succeeded.
Unique identifier for the object.
Time at which the object was created. Measured in seconds since the Unix epoch.
checkout_session The time at which the checkout session was completed.
Configuration for collecting consent during the checkout session.
Show child attributes
Show child attributes
Custom text to display on the checkout session.
Show child attributes
Show child attributes
Three-letter ISO currency code, in lowercase. Must be a supported currency.
gbp, usd, eur, sek "gbp"
The customer the checkout session is for.
The default payment method selected during the checkout session.
The description of the checkout session. This will be displayed to the customer.
The payment method types allowed for this checkout session.
The URL to return to after the checkout session is complete.
The status of the checkout session.
canceled, expired, open, complete The subscription data used to create the subscription on checkout completion.
Show child attributes
Show child attributes
The subscription created by the checkout session, if any.
The hosted URL of the checkout session.
The account that the object belongs to. Only returned if the request is made with a valid Yorlet-Context header.
Only returned if the object has been deleted.
Information about the merchant operating the checkout session.
Show child attributes
Show child attributes
Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
Show child attributes
Show child attributes
Was this page helpful?