Checkout Sessions
curl --request POST \
--url https://win.oneshotagent.com/acp/checkout_sessionsimport requests
url = "https://win.oneshotagent.com/acp/checkout_sessions"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://win.oneshotagent.com/acp/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://win.oneshotagent.com/acp/checkout_sessions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$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://win.oneshotagent.com/acp/checkout_sessions"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://win.oneshotagent.com/acp/checkout_sessions")
.asString();require 'uri'
require 'net/http'
url = URI("https://win.oneshotagent.com/acp/checkout_sessions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyStripe ACP
Checkout Sessions
Create, update, complete, and cancel ACP checkout sessions
POST
/
acp
/
checkout_sessions
Checkout Sessions
curl --request POST \
--url https://win.oneshotagent.com/acp/checkout_sessionsimport requests
url = "https://win.oneshotagent.com/acp/checkout_sessions"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://win.oneshotagent.com/acp/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://win.oneshotagent.com/acp/checkout_sessions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$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://win.oneshotagent.com/acp/checkout_sessions"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://win.oneshotagent.com/acp/checkout_sessions")
.asString();require 'uri'
require 'net/http'
url = URI("https://win.oneshotagent.com/acp/checkout_sessions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyA checkout session prices one tool call, takes payment, and runs the tool. Create it, update it if the input changes, then complete or cancel it within 30 minutes. Completing it returns a
A completed session includes an
A missing session returns
request_id you poll for results.
Paid endpoints accept optional
memo (≤ 1000 chars) and decisionContext (object) body fields, stored on the receipt. See Audit Trail.Session lifecycle
A new session isready_for_payment. completed and canceled are terminal: no update, complete or cancel after either. Sessions expire after 30 minutes; an expired session cannot be completed or updated.
Create session
curl -X POST https://win.oneshotagent.com/acp/checkout_sessions \
-H "Authorization: Bearer $ACP_TOKEN" \
-H "API-Version: 2026-01-30" \
-H "Content-Type: application/json" \
-d '{
"line_items": [{
"item": {
"id": "oneshot-research",
"metadata": {
"topic": "AI agent protocols 2026"
}
}
}],
"buyer": {
"email": "[email protected]",
"name": "My Agent"
},
"idempotency_key": "unique-key-123"
}'
| Field | Type | Required | Description |
|---|---|---|---|
line_items | array | Yes | One item |
line_items[].item.id | string | Yes | Product ID from the manifest |
line_items[].item.metadata | object | Yes | Input matching the product’s input_schema |
buyer.email | string | No | |
buyer.name | string | No | |
idempotency_key | string | No | A session with the same key is returned (200) instead of created (201) |
Response (201)
{
"id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"status": "ready_for_payment",
"line_items": [{
"item": {
"id": "oneshot-research",
"metadata": { "topic": "AI agent protocols 2026" }
},
"amount": {
"unit_amount": 10,
"currency": "usd"
}
}],
"buyer": {
"email": "[email protected]",
"name": "My Agent"
},
"fulfillment": { "type": "digital" },
"payment_handlers": [{
"id": "stripe_spt",
"type": "shared_payment_token",
"provider": "stripe"
}],
"created_at": "2026-03-15T10:00:00.000Z",
"expires_at": "2026-03-15T10:30:00.000Z"
}
Retrieve session
curl https://win.oneshotagent.com/acp/checkout_sessions/{session_id} \
-H "Authorization: Bearer $ACP_TOKEN" \
-H "API-Version: 2026-01-30"
order:
{
"id": "f47ac10b-...",
"status": "completed",
"order": {
"id": "ord_f47ac10b",
"status": "processing",
"permalink_url": "https://win.oneshotagent.com/v1/requests/..."
}
}
Update session
Sendbuyer, line_items, or both, while status is ready_for_payment. Changing item.id to another product updates the price.
curl -X POST https://win.oneshotagent.com/acp/checkout_sessions/{session_id} \
-H "Authorization: Bearer $ACP_TOKEN" \
-H "API-Version: 2026-01-30" \
-H "Content-Type: application/json" \
-d '{
"buyer": { "email": "[email protected]" },
"line_items": [{
"item": {
"id": "oneshot-email",
"metadata": {
"from_address": "[email protected]",
"to_address": "[email protected]",
"subject": "Hello",
"body": "Hi there"
}
}
}]
}'
Complete session
Charges a Stripe SharedPaymentToken and starts the tool. PollGET /v1/requests/{request_id} with the returned request_id.
curl -X POST https://win.oneshotagent.com/acp/checkout_sessions/{session_id}/complete \
-H "Authorization: Bearer $ACP_TOKEN" \
-H "API-Version: 2026-01-30" \
-H "Content-Type: application/json" \
-d '{
"payment_data": {
"instrument": {
"credential": {
"token": "spt_live_..."
}
}
}
}'
Response (200)
{
"id": "f47ac10b-...",
"status": "completed",
"order": {
"id": "ord_f47ac10b",
"status": "processing",
"request_id": "job_01HX...",
"permalink_url": "https://win.oneshotagent.com/v1/requests/job_01HX..."
}
}
Errors
Checkorder.status even on HTTP 200: if payment succeeds but the tool fails, the response has status: "completed" and order.status: "failed", with error_code and a generic error.
Errors carry a machine-readable code and a generic message. Branch on code:
| Code | Meaning |
|---|---|
payment | Payment could not be processed |
validation | Request parameters are invalid |
internal | An internal operation failed |
upstream | A required service is unavailable, timed out, or rate limited |
{
"type": "payment_error",
"code": "payment",
"message": "Payment could not be processed. Check your payment method and try again."
}
404 with type: "not_found" and no code.
| Status | Reason |
|---|---|
| 400 | Session not ready_for_payment, missing SharedPaymentToken, or expired |
| 402 | Stripe payment failed |
| 404 | Session not found |
| 502 | A required service, or Stripe, was unavailable, timed out, or rate limited (code: upstream) |
Cancel session
Allowed while status isready_for_payment or not_ready_for_payment.
curl -X POST https://win.oneshotagent.com/acp/checkout_sessions/{session_id}/cancel \
-H "Authorization: Bearer $ACP_TOKEN" \
-H "API-Version: 2026-01-30"
{
"id": "f47ac10b-...",
"status": "canceled"
}