curl --request GET \
--url https://api.sapiom.ai/v1/transactions/{transactionId}/ucp/checkout \
--header 'x-api-key: <api-key>'import requests
url = "https://api.sapiom.ai/v1/transactions/{transactionId}/ucp/checkout"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.sapiom.ai/v1/transactions/{transactionId}/ucp/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://api.sapiom.ai/v1/transactions/{transactionId}/ucp/checkout",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$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.sapiom.ai/v1/transactions/{transactionId}/ucp/checkout"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
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.sapiom.ai/v1/transactions/{transactionId}/ucp/checkout")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sapiom.ai/v1/transactions/{transactionId}/ucp/checkout")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"checkout": {},
"session": {},
"governance": {},
"payment": {},
"nextAction": {},
"version": "<string>"
}Get the checkout
Hands any newer merchant evidence to governance first, then returns the checkout, session, governance, payment, and nextAction: what the agent should do next. With maxWaitSeconds, waits for something to act on: until nextAction is not wait, or, with since, until the envelope version differs from it. The wait only reads stored state, and stops if the client goes away. Requires a buyer key.
curl --request GET \
--url https://api.sapiom.ai/v1/transactions/{transactionId}/ucp/checkout \
--header 'x-api-key: <api-key>'import requests
url = "https://api.sapiom.ai/v1/transactions/{transactionId}/ucp/checkout"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.sapiom.ai/v1/transactions/{transactionId}/ucp/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://api.sapiom.ai/v1/transactions/{transactionId}/ucp/checkout",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$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.sapiom.ai/v1/transactions/{transactionId}/ucp/checkout"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
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.sapiom.ai/v1/transactions/{transactionId}/ucp/checkout")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sapiom.ai/v1/transactions/{transactionId}/ucp/checkout")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"checkout": {},
"session": {},
"governance": {},
"payment": {},
"nextAction": {},
"version": "<string>"
}Authorizations
Your platform key for buyer management, or a buyer key for everything else.
Path Parameters
Query Parameters
Wait up to this many seconds (0 to 25) for something to act on. Default 0.
A previous envelope's version: with maxWaitSeconds, answer as soon as the envelope changes from it
Response
Latest merchant checkout accepted as evidence: status, currency, totals, line items, fulfillment methods (destinations, and per group the delivery options with id, title, description, carrier, fulfillment times and totals, as the merchant sent them), messages and expiry. continueUrl is withheld until authorized
State, merchant origin, negotiated version, transport and derived completion path
Decision (pending | waiting_approval | authorized | denied | closed), revision, reasons, whether it covers the latest evidence, and the blocker (total_unknown | unsupported_currency | merchant_change_unconfirmed | zero_total | too_many_line_items) when the latest evidence cannot be governed
On a checkout funded by the tenant's card: the current revision's payment status (none | pending | authorized | failed | cancelled …), amount, card, typed denial (card_unavailable | no_card_route | verification_required | allowance_insufficient), and the placeholder card to submit once continue_url is released
What the agent should do next: wait (governing | paying | merchant, with retryAfterSeconds), refresh (with retryAfterSeconds), update (the merchant messages an update can fix), revise (governance reasons), requires_action (a person must act: kind approval | security_code | allowance_verification | escalation, with url (null until there is a page for it), expiresAt, the card payment denial and the merchant messages), hand_off (continueUrl, and any messages a person must act on), blocked (unsupported_currency | zero_total | too_many_line_items | merchant_unrecoverable | no_continue_url | payment_ended), done, or closed (buyer_canceled or confirmation_expired reason and a message when the transaction confirmation ended)
Changes when anything an agent acts on changes; pass it as since to wait for a change