curl --request POST \
--url https://api.sapiom.ai/v1/transactions/{transactionId}/ucp/checkout/cancel \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'x-api-key: <api-key>'import requests
url = "https://api.sapiom.ai/v1/transactions/{transactionId}/ucp/checkout/cancel"
headers = {
"Idempotency-Key": "<idempotency-key>",
"x-api-key": "<api-key>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Idempotency-Key': '<idempotency-key>', 'x-api-key': '<api-key>'}
};
fetch('https://api.sapiom.ai/v1/transactions/{transactionId}/ucp/checkout/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.sapiom.ai/v1/transactions/{transactionId}/ucp/checkout/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Idempotency-Key: <idempotency-key>",
"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/cancel"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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.post("https://api.sapiom.ai/v1/transactions/{transactionId}/ucp/checkout/cancel")
.header("Idempotency-Key", "<idempotency-key>")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sapiom.ai/v1/transactions/{transactionId}/ucp/checkout/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"checkout": {},
"session": {},
"governance": {},
"payment": {},
"nextAction": {},
"version": "<string>"
}Cancel the checkout
Cancels at the merchant and closes the governing transaction. Cancelling a cancelled checkout is a no-op. Requires a buyer key.
curl --request POST \
--url https://api.sapiom.ai/v1/transactions/{transactionId}/ucp/checkout/cancel \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'x-api-key: <api-key>'import requests
url = "https://api.sapiom.ai/v1/transactions/{transactionId}/ucp/checkout/cancel"
headers = {
"Idempotency-Key": "<idempotency-key>",
"x-api-key": "<api-key>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Idempotency-Key': '<idempotency-key>', 'x-api-key': '<api-key>'}
};
fetch('https://api.sapiom.ai/v1/transactions/{transactionId}/ucp/checkout/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.sapiom.ai/v1/transactions/{transactionId}/ucp/checkout/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Idempotency-Key: <idempotency-key>",
"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/cancel"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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.post("https://api.sapiom.ai/v1/transactions/{transactionId}/ucp/checkout/cancel")
.header("Idempotency-Key", "<idempotency-key>")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sapiom.ai/v1/transactions/{transactionId}/ucp/checkout/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
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.
Headers
Unique per logical operation, at most 255 characters. Replaying a key replays the same merchant request; a replay refused with 409 sends nothing.
Path Parameters
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