curl --request POST \
--url https://api.boxrouter.ai/api/v1/credits/purchases/{purchase_id}/cancel \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"cancel_url": "https://boxrouter.ai/credits"
}
'import requests
url = "https://api.boxrouter.ai/api/v1/credits/purchases/{purchase_id}/cancel"
payload = { "cancel_url": "https://boxrouter.ai/credits" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({cancel_url: 'https://boxrouter.ai/credits'})
};
fetch('https://api.boxrouter.ai/api/v1/credits/purchases/{purchase_id}/cancel', 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.boxrouter.ai/api/v1/credits/purchases/{purchase_id}/cancel",
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' => 'https://boxrouter.ai/credits'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.boxrouter.ai/api/v1/credits/purchases/{purchase_id}/cancel"
payload := strings.NewReader("{\n \"cancel_url\": \"https://boxrouter.ai/credits\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.boxrouter.ai/api/v1/credits/purchases/{purchase_id}/cancel")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"cancel_url\": \"https://boxrouter.ai/credits\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.boxrouter.ai/api/v1/credits/purchases/{purchase_id}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"cancel_url\": \"https://boxrouter.ai/credits\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"status": "<string>",
"amount_minor": 2,
"currency": "usd",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"fee_minor": 1,
"total_minor": 2,
"method": "checkout",
"failure_reason": "<string>",
"adjustments": [
{
"kind": "refund",
"amount_minor": 123,
"created_at": "2023-11-07T05:31:56Z"
}
],
"invoice": {
"number": "<string>",
"pdf_url": "<string>",
"hosted_url": "<string>"
},
"receipt_url": "<string>",
"refund": {
"state": "available",
"disabled_reason": "window_closed",
"refundable_until": "2023-11-07T05:31:56Z",
"fee_minor": 1,
"latest_refund": {
"id": "<string>",
"status": "pending",
"unused": 1,
"total": 1,
"fee": 1,
"card": {
"type": "card",
"brand": "<string>",
"last4": "<string>"
},
"requested_at": "2023-11-07T05:31:56Z"
}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"outcome": "not_started",
"retry": "safe",
"retry_after_seconds": 1,
"details": {
"selection_version": 1,
"considered": 1,
"excluded": [
{
"provider": "<string>"
}
],
"closest": {},
"nearest": [
{}
],
"requirement": "<string>",
"purchase_id": "<string>",
"preview": {
"unused": 1,
"held_excluded": 1,
"fee": 1,
"principal": 1,
"tax": 1,
"total": 1,
"card": {
"brand": "<string>",
"last4": "<string>",
"type": "card",
"email": "jsmith@example.com"
}
},
"quote": {
"amount": 2,
"tax": 1,
"total": 2,
"address_required": true,
"fee_minor": 1,
"missing": [
"<string>"
]
},
"redemption": {
"code": "<string>",
"amount_nanodollars": "<string>",
"description": "<string>",
"redeemed_at": "2023-11-07T05:31:56Z"
},
"scope": "workspace",
"period": "total",
"limit_nanodollars": 2,
"requested_nanodollars": 2,
"sign_in_method": "<string>",
"masked_email": "<string>",
"failure_reason": "<string>",
"names": [
"<string>"
],
"fields": [
"preferences.order"
],
"volume_id": "<string>",
"writer_sandbox_id": "<string>",
"checkpoint": 2,
"limit_bytes": 1,
"observed_bytes": 1,
"mismatch": {
"field": "image",
"recorded": "<string>",
"requested": "<string>"
},
"volume_phase": "check",
"phase": "code",
"command": "<string>",
"exit_code": 123,
"stderr_tail": "<string>",
"stdout_tail": "<string>",
"agent": "<string>",
"port": 32768,
"revoked": true,
"preview_id": "<string>",
"url": "<string>"
},
"doc_url": "<string>",
"fix": "<string>",
"operation_id": "<string>",
"provider": "<string>",
"native_code": "<string>",
"native_status": 123,
"native_message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"outcome": "not_started",
"retry": "safe",
"retry_after_seconds": 1,
"details": {
"selection_version": 1,
"considered": 1,
"excluded": [
{
"provider": "<string>"
}
],
"closest": {},
"nearest": [
{}
],
"requirement": "<string>",
"purchase_id": "<string>",
"preview": {
"unused": 1,
"held_excluded": 1,
"fee": 1,
"principal": 1,
"tax": 1,
"total": 1,
"card": {
"brand": "<string>",
"last4": "<string>",
"type": "card",
"email": "jsmith@example.com"
}
},
"quote": {
"amount": 2,
"tax": 1,
"total": 2,
"address_required": true,
"fee_minor": 1,
"missing": [
"<string>"
]
},
"redemption": {
"code": "<string>",
"amount_nanodollars": "<string>",
"description": "<string>",
"redeemed_at": "2023-11-07T05:31:56Z"
},
"scope": "workspace",
"period": "total",
"limit_nanodollars": 2,
"requested_nanodollars": 2,
"sign_in_method": "<string>",
"masked_email": "<string>",
"failure_reason": "<string>",
"names": [
"<string>"
],
"fields": [
"preferences.order"
],
"volume_id": "<string>",
"writer_sandbox_id": "<string>",
"checkpoint": 2,
"limit_bytes": 1,
"observed_bytes": 1,
"mismatch": {
"field": "image",
"recorded": "<string>",
"requested": "<string>"
},
"volume_phase": "check",
"phase": "code",
"command": "<string>",
"exit_code": 123,
"stderr_tail": "<string>",
"stdout_tail": "<string>",
"agent": "<string>",
"port": 32768,
"revoked": true,
"preview_id": "<string>",
"url": "<string>"
},
"doc_url": "<string>",
"fix": "<string>",
"operation_id": "<string>",
"provider": "<string>",
"native_code": "<string>",
"native_status": 123,
"native_message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"outcome": "not_started",
"retry": "safe",
"retry_after_seconds": 1,
"details": {
"selection_version": 1,
"considered": 1,
"excluded": [
{
"provider": "<string>"
}
],
"closest": {},
"nearest": [
{}
],
"requirement": "<string>",
"purchase_id": "<string>",
"preview": {
"unused": 1,
"held_excluded": 1,
"fee": 1,
"principal": 1,
"tax": 1,
"total": 1,
"card": {
"brand": "<string>",
"last4": "<string>",
"type": "card",
"email": "jsmith@example.com"
}
},
"quote": {
"amount": 2,
"tax": 1,
"total": 2,
"address_required": true,
"fee_minor": 1,
"missing": [
"<string>"
]
},
"redemption": {
"code": "<string>",
"amount_nanodollars": "<string>",
"description": "<string>",
"redeemed_at": "2023-11-07T05:31:56Z"
},
"scope": "workspace",
"period": "total",
"limit_nanodollars": 2,
"requested_nanodollars": 2,
"sign_in_method": "<string>",
"masked_email": "<string>",
"failure_reason": "<string>",
"names": [
"<string>"
],
"fields": [
"preferences.order"
],
"volume_id": "<string>",
"writer_sandbox_id": "<string>",
"checkpoint": 2,
"limit_bytes": 1,
"observed_bytes": 1,
"mismatch": {
"field": "image",
"recorded": "<string>",
"requested": "<string>"
},
"volume_phase": "check",
"phase": "code",
"command": "<string>",
"exit_code": 123,
"stderr_tail": "<string>",
"stdout_tail": "<string>",
"agent": "<string>",
"port": 32768,
"revoked": true,
"preview_id": "<string>",
"url": "<string>"
},
"doc_url": "<string>",
"fix": "<string>",
"operation_id": "<string>",
"provider": "<string>",
"native_code": "<string>",
"native_status": 123,
"native_message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"outcome": "not_started",
"retry": "safe",
"retry_after_seconds": 1,
"details": {
"selection_version": 1,
"considered": 1,
"excluded": [
{
"provider": "<string>"
}
],
"closest": {},
"nearest": [
{}
],
"requirement": "<string>",
"purchase_id": "<string>",
"preview": {
"unused": 1,
"held_excluded": 1,
"fee": 1,
"principal": 1,
"tax": 1,
"total": 1,
"card": {
"brand": "<string>",
"last4": "<string>",
"type": "card",
"email": "jsmith@example.com"
}
},
"quote": {
"amount": 2,
"tax": 1,
"total": 2,
"address_required": true,
"fee_minor": 1,
"missing": [
"<string>"
]
},
"redemption": {
"code": "<string>",
"amount_nanodollars": "<string>",
"description": "<string>",
"redeemed_at": "2023-11-07T05:31:56Z"
},
"scope": "workspace",
"period": "total",
"limit_nanodollars": 2,
"requested_nanodollars": 2,
"sign_in_method": "<string>",
"masked_email": "<string>",
"failure_reason": "<string>",
"names": [
"<string>"
],
"fields": [
"preferences.order"
],
"volume_id": "<string>",
"writer_sandbox_id": "<string>",
"checkpoint": 2,
"limit_bytes": 1,
"observed_bytes": 1,
"mismatch": {
"field": "image",
"recorded": "<string>",
"requested": "<string>"
},
"volume_phase": "check",
"phase": "code",
"command": "<string>",
"exit_code": 123,
"stderr_tail": "<string>",
"stdout_tail": "<string>",
"agent": "<string>",
"port": 32768,
"revoked": true,
"preview_id": "<string>",
"url": "<string>"
},
"doc_url": "<string>",
"fix": "<string>",
"operation_id": "<string>",
"provider": "<string>",
"native_code": "<string>",
"native_status": 123,
"native_message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"outcome": "not_started",
"retry": "safe",
"retry_after_seconds": 1,
"details": {
"selection_version": 1,
"considered": 1,
"excluded": [
{
"provider": "<string>"
}
],
"closest": {},
"nearest": [
{}
],
"requirement": "<string>",
"purchase_id": "<string>",
"preview": {
"unused": 1,
"held_excluded": 1,
"fee": 1,
"principal": 1,
"tax": 1,
"total": 1,
"card": {
"brand": "<string>",
"last4": "<string>",
"type": "card",
"email": "jsmith@example.com"
}
},
"quote": {
"amount": 2,
"tax": 1,
"total": 2,
"address_required": true,
"fee_minor": 1,
"missing": [
"<string>"
]
},
"redemption": {
"code": "<string>",
"amount_nanodollars": "<string>",
"description": "<string>",
"redeemed_at": "2023-11-07T05:31:56Z"
},
"scope": "workspace",
"period": "total",
"limit_nanodollars": 2,
"requested_nanodollars": 2,
"sign_in_method": "<string>",
"masked_email": "<string>",
"failure_reason": "<string>",
"names": [
"<string>"
],
"fields": [
"preferences.order"
],
"volume_id": "<string>",
"writer_sandbox_id": "<string>",
"checkpoint": 2,
"limit_bytes": 1,
"observed_bytes": 1,
"mismatch": {
"field": "image",
"recorded": "<string>",
"requested": "<string>"
},
"volume_phase": "check",
"phase": "code",
"command": "<string>",
"exit_code": 123,
"stderr_tail": "<string>",
"stdout_tail": "<string>",
"agent": "<string>",
"port": 32768,
"revoked": true,
"preview_id": "<string>",
"url": "<string>"
},
"doc_url": "<string>",
"fix": "<string>",
"operation_id": "<string>",
"provider": "<string>",
"native_code": "<string>",
"native_status": 123,
"native_message": "<string>"
}
}Close an Unpaid Checkout Session
Expires a known open Checkout session for this workspace-owned purchase. A completed payment is reconciled and remains confirmed. If Checkout creation had an unknown outcome and no session ID was recorded, the same stable Stripe idempotency key recovers that request before BoxRouter expires the session. Repeating this request is safe. The request needs no body: the return URLs are optional and unused when closing a purchase.
curl --request POST \
--url https://api.boxrouter.ai/api/v1/credits/purchases/{purchase_id}/cancel \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"cancel_url": "https://boxrouter.ai/credits"
}
'import requests
url = "https://api.boxrouter.ai/api/v1/credits/purchases/{purchase_id}/cancel"
payload = { "cancel_url": "https://boxrouter.ai/credits" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({cancel_url: 'https://boxrouter.ai/credits'})
};
fetch('https://api.boxrouter.ai/api/v1/credits/purchases/{purchase_id}/cancel', 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.boxrouter.ai/api/v1/credits/purchases/{purchase_id}/cancel",
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' => 'https://boxrouter.ai/credits'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.boxrouter.ai/api/v1/credits/purchases/{purchase_id}/cancel"
payload := strings.NewReader("{\n \"cancel_url\": \"https://boxrouter.ai/credits\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.boxrouter.ai/api/v1/credits/purchases/{purchase_id}/cancel")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"cancel_url\": \"https://boxrouter.ai/credits\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.boxrouter.ai/api/v1/credits/purchases/{purchase_id}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"cancel_url\": \"https://boxrouter.ai/credits\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"status": "<string>",
"amount_minor": 2,
"currency": "usd",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"fee_minor": 1,
"total_minor": 2,
"method": "checkout",
"failure_reason": "<string>",
"adjustments": [
{
"kind": "refund",
"amount_minor": 123,
"created_at": "2023-11-07T05:31:56Z"
}
],
"invoice": {
"number": "<string>",
"pdf_url": "<string>",
"hosted_url": "<string>"
},
"receipt_url": "<string>",
"refund": {
"state": "available",
"disabled_reason": "window_closed",
"refundable_until": "2023-11-07T05:31:56Z",
"fee_minor": 1,
"latest_refund": {
"id": "<string>",
"status": "pending",
"unused": 1,
"total": 1,
"fee": 1,
"card": {
"type": "card",
"brand": "<string>",
"last4": "<string>"
},
"requested_at": "2023-11-07T05:31:56Z"
}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"outcome": "not_started",
"retry": "safe",
"retry_after_seconds": 1,
"details": {
"selection_version": 1,
"considered": 1,
"excluded": [
{
"provider": "<string>"
}
],
"closest": {},
"nearest": [
{}
],
"requirement": "<string>",
"purchase_id": "<string>",
"preview": {
"unused": 1,
"held_excluded": 1,
"fee": 1,
"principal": 1,
"tax": 1,
"total": 1,
"card": {
"brand": "<string>",
"last4": "<string>",
"type": "card",
"email": "jsmith@example.com"
}
},
"quote": {
"amount": 2,
"tax": 1,
"total": 2,
"address_required": true,
"fee_minor": 1,
"missing": [
"<string>"
]
},
"redemption": {
"code": "<string>",
"amount_nanodollars": "<string>",
"description": "<string>",
"redeemed_at": "2023-11-07T05:31:56Z"
},
"scope": "workspace",
"period": "total",
"limit_nanodollars": 2,
"requested_nanodollars": 2,
"sign_in_method": "<string>",
"masked_email": "<string>",
"failure_reason": "<string>",
"names": [
"<string>"
],
"fields": [
"preferences.order"
],
"volume_id": "<string>",
"writer_sandbox_id": "<string>",
"checkpoint": 2,
"limit_bytes": 1,
"observed_bytes": 1,
"mismatch": {
"field": "image",
"recorded": "<string>",
"requested": "<string>"
},
"volume_phase": "check",
"phase": "code",
"command": "<string>",
"exit_code": 123,
"stderr_tail": "<string>",
"stdout_tail": "<string>",
"agent": "<string>",
"port": 32768,
"revoked": true,
"preview_id": "<string>",
"url": "<string>"
},
"doc_url": "<string>",
"fix": "<string>",
"operation_id": "<string>",
"provider": "<string>",
"native_code": "<string>",
"native_status": 123,
"native_message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"outcome": "not_started",
"retry": "safe",
"retry_after_seconds": 1,
"details": {
"selection_version": 1,
"considered": 1,
"excluded": [
{
"provider": "<string>"
}
],
"closest": {},
"nearest": [
{}
],
"requirement": "<string>",
"purchase_id": "<string>",
"preview": {
"unused": 1,
"held_excluded": 1,
"fee": 1,
"principal": 1,
"tax": 1,
"total": 1,
"card": {
"brand": "<string>",
"last4": "<string>",
"type": "card",
"email": "jsmith@example.com"
}
},
"quote": {
"amount": 2,
"tax": 1,
"total": 2,
"address_required": true,
"fee_minor": 1,
"missing": [
"<string>"
]
},
"redemption": {
"code": "<string>",
"amount_nanodollars": "<string>",
"description": "<string>",
"redeemed_at": "2023-11-07T05:31:56Z"
},
"scope": "workspace",
"period": "total",
"limit_nanodollars": 2,
"requested_nanodollars": 2,
"sign_in_method": "<string>",
"masked_email": "<string>",
"failure_reason": "<string>",
"names": [
"<string>"
],
"fields": [
"preferences.order"
],
"volume_id": "<string>",
"writer_sandbox_id": "<string>",
"checkpoint": 2,
"limit_bytes": 1,
"observed_bytes": 1,
"mismatch": {
"field": "image",
"recorded": "<string>",
"requested": "<string>"
},
"volume_phase": "check",
"phase": "code",
"command": "<string>",
"exit_code": 123,
"stderr_tail": "<string>",
"stdout_tail": "<string>",
"agent": "<string>",
"port": 32768,
"revoked": true,
"preview_id": "<string>",
"url": "<string>"
},
"doc_url": "<string>",
"fix": "<string>",
"operation_id": "<string>",
"provider": "<string>",
"native_code": "<string>",
"native_status": 123,
"native_message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"outcome": "not_started",
"retry": "safe",
"retry_after_seconds": 1,
"details": {
"selection_version": 1,
"considered": 1,
"excluded": [
{
"provider": "<string>"
}
],
"closest": {},
"nearest": [
{}
],
"requirement": "<string>",
"purchase_id": "<string>",
"preview": {
"unused": 1,
"held_excluded": 1,
"fee": 1,
"principal": 1,
"tax": 1,
"total": 1,
"card": {
"brand": "<string>",
"last4": "<string>",
"type": "card",
"email": "jsmith@example.com"
}
},
"quote": {
"amount": 2,
"tax": 1,
"total": 2,
"address_required": true,
"fee_minor": 1,
"missing": [
"<string>"
]
},
"redemption": {
"code": "<string>",
"amount_nanodollars": "<string>",
"description": "<string>",
"redeemed_at": "2023-11-07T05:31:56Z"
},
"scope": "workspace",
"period": "total",
"limit_nanodollars": 2,
"requested_nanodollars": 2,
"sign_in_method": "<string>",
"masked_email": "<string>",
"failure_reason": "<string>",
"names": [
"<string>"
],
"fields": [
"preferences.order"
],
"volume_id": "<string>",
"writer_sandbox_id": "<string>",
"checkpoint": 2,
"limit_bytes": 1,
"observed_bytes": 1,
"mismatch": {
"field": "image",
"recorded": "<string>",
"requested": "<string>"
},
"volume_phase": "check",
"phase": "code",
"command": "<string>",
"exit_code": 123,
"stderr_tail": "<string>",
"stdout_tail": "<string>",
"agent": "<string>",
"port": 32768,
"revoked": true,
"preview_id": "<string>",
"url": "<string>"
},
"doc_url": "<string>",
"fix": "<string>",
"operation_id": "<string>",
"provider": "<string>",
"native_code": "<string>",
"native_status": 123,
"native_message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"outcome": "not_started",
"retry": "safe",
"retry_after_seconds": 1,
"details": {
"selection_version": 1,
"considered": 1,
"excluded": [
{
"provider": "<string>"
}
],
"closest": {},
"nearest": [
{}
],
"requirement": "<string>",
"purchase_id": "<string>",
"preview": {
"unused": 1,
"held_excluded": 1,
"fee": 1,
"principal": 1,
"tax": 1,
"total": 1,
"card": {
"brand": "<string>",
"last4": "<string>",
"type": "card",
"email": "jsmith@example.com"
}
},
"quote": {
"amount": 2,
"tax": 1,
"total": 2,
"address_required": true,
"fee_minor": 1,
"missing": [
"<string>"
]
},
"redemption": {
"code": "<string>",
"amount_nanodollars": "<string>",
"description": "<string>",
"redeemed_at": "2023-11-07T05:31:56Z"
},
"scope": "workspace",
"period": "total",
"limit_nanodollars": 2,
"requested_nanodollars": 2,
"sign_in_method": "<string>",
"masked_email": "<string>",
"failure_reason": "<string>",
"names": [
"<string>"
],
"fields": [
"preferences.order"
],
"volume_id": "<string>",
"writer_sandbox_id": "<string>",
"checkpoint": 2,
"limit_bytes": 1,
"observed_bytes": 1,
"mismatch": {
"field": "image",
"recorded": "<string>",
"requested": "<string>"
},
"volume_phase": "check",
"phase": "code",
"command": "<string>",
"exit_code": 123,
"stderr_tail": "<string>",
"stdout_tail": "<string>",
"agent": "<string>",
"port": 32768,
"revoked": true,
"preview_id": "<string>",
"url": "<string>"
},
"doc_url": "<string>",
"fix": "<string>",
"operation_id": "<string>",
"provider": "<string>",
"native_code": "<string>",
"native_status": 123,
"native_message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"outcome": "not_started",
"retry": "safe",
"retry_after_seconds": 1,
"details": {
"selection_version": 1,
"considered": 1,
"excluded": [
{
"provider": "<string>"
}
],
"closest": {},
"nearest": [
{}
],
"requirement": "<string>",
"purchase_id": "<string>",
"preview": {
"unused": 1,
"held_excluded": 1,
"fee": 1,
"principal": 1,
"tax": 1,
"total": 1,
"card": {
"brand": "<string>",
"last4": "<string>",
"type": "card",
"email": "jsmith@example.com"
}
},
"quote": {
"amount": 2,
"tax": 1,
"total": 2,
"address_required": true,
"fee_minor": 1,
"missing": [
"<string>"
]
},
"redemption": {
"code": "<string>",
"amount_nanodollars": "<string>",
"description": "<string>",
"redeemed_at": "2023-11-07T05:31:56Z"
},
"scope": "workspace",
"period": "total",
"limit_nanodollars": 2,
"requested_nanodollars": 2,
"sign_in_method": "<string>",
"masked_email": "<string>",
"failure_reason": "<string>",
"names": [
"<string>"
],
"fields": [
"preferences.order"
],
"volume_id": "<string>",
"writer_sandbox_id": "<string>",
"checkpoint": 2,
"limit_bytes": 1,
"observed_bytes": 1,
"mismatch": {
"field": "image",
"recorded": "<string>",
"requested": "<string>"
},
"volume_phase": "check",
"phase": "code",
"command": "<string>",
"exit_code": 123,
"stderr_tail": "<string>",
"stdout_tail": "<string>",
"agent": "<string>",
"port": 32768,
"revoked": true,
"preview_id": "<string>",
"url": "<string>"
},
"doc_url": "<string>",
"fix": "<string>",
"operation_id": "<string>",
"provider": "<string>",
"native_code": "<string>",
"native_status": 123,
"native_message": "<string>"
}
}Authorizations
Path Parameters
Body
Response
Current purchase state after attempting to close Checkout.
pending until the payment provider's verified notification arrives; confirmed once the payment has been verified; canceled when an unpaid Checkout session expires; failed when a saved-card attempt is definitively declined. Later refunds and disputes are separate adjustments and do not change this status. Clients must handle unknown values explicitly.