List checkout sessions
curl --request GET \
--url https://api.usewarp.net/v1/checkout/sessions \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.usewarp.net/v1/checkout/sessions"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.usewarp.net/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.usewarp.net/v1/checkout/sessions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.usewarp.net/v1/checkout/sessions"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.usewarp.net/v1/checkout/sessions")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.usewarp.net/v1/checkout/sessions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"object": "list",
"data": [
{
"id": "ps_8f14e45fceea167a5a36dedd4bea2543",
"object": "checkout.session",
"amount_usd": "49.99",
"currency": "USD",
"description": "<string>",
"metadata": {},
"status": "pending",
"network": "mainnet",
"return_url": "<string>",
"cancel_url": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"checkout_url": "https://checkout.usewarp.net/session/ps_8f14e45fceea167a5a36dedd4bea2543",
"payment": {
"chain": "base",
"token": "USDC",
"tx_hash": "0x5f2c...",
"amount": "49.99",
"confirmations": 123,
"completed_at": "2023-11-07T05:31:56Z"
}
}
],
"has_more": true
}{
"error": {
"code": "invalid_request",
"message": "amount_usd: Number must be greater than 0"
}
}{
"error": {
"code": "unauthorized",
"message": "Invalid API key"
}
}{
"error": {
"code": "rate_limited",
"message": "Too many requests. Retry after the window resets."
}
}Checkout sessions
List checkout sessions
Lists your project’s checkout sessions. Use starting_after with the last id from the previous page to paginate.
GET
/
v1
/
checkout
/
sessions
List checkout sessions
curl --request GET \
--url https://api.usewarp.net/v1/checkout/sessions \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.usewarp.net/v1/checkout/sessions"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.usewarp.net/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.usewarp.net/v1/checkout/sessions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.usewarp.net/v1/checkout/sessions"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.usewarp.net/v1/checkout/sessions")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.usewarp.net/v1/checkout/sessions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"object": "list",
"data": [
{
"id": "ps_8f14e45fceea167a5a36dedd4bea2543",
"object": "checkout.session",
"amount_usd": "49.99",
"currency": "USD",
"description": "<string>",
"metadata": {},
"status": "pending",
"network": "mainnet",
"return_url": "<string>",
"cancel_url": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"checkout_url": "https://checkout.usewarp.net/session/ps_8f14e45fceea167a5a36dedd4bea2543",
"payment": {
"chain": "base",
"token": "USDC",
"tx_hash": "0x5f2c...",
"amount": "49.99",
"confirmations": 123,
"completed_at": "2023-11-07T05:31:56Z"
}
}
],
"has_more": true
}{
"error": {
"code": "invalid_request",
"message": "amount_usd: Number must be greater than 0"
}
}{
"error": {
"code": "unauthorized",
"message": "Invalid API key"
}
}{
"error": {
"code": "rate_limited",
"message": "Too many requests. Retry after the window resets."
}
}Authorizations
Your project secret key: sk_test_... (testnet) or sk_live_... (mainnet). Use it only on your server.
Query Parameters
Only return sessions with this status.
pending: waiting for payment. processing: a transaction was submitted and is being verified. completed: payment verified. failed: verification failed. expired: no payment within 30 minutes.
Available options:
pending, processing, completed, failed, expired Number of sessions to return (1-100).
Required range:
1 <= x <= 100Cursor for pagination: the id of the last session from the previous page.
Was this page helpful?