SDK reference · Python SDK
prov.authorize.checkout_approvals.get
prov.authorize.checkout_approvals.get in Python SDK.
Signature
prov.authorize.checkout_approvals.get(approval_id: str) -> AnyParameters
approval_idstrRequired
Request fields
idstringpathRequired- The approval's
coap_ID.
Returns
Any The cart approval.
HTTP operation
GET /v1/authorize/checkout_approvals/{id}: Retrieve a cart approval
Errors
Example
const step1 = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/checkout_approvals`, {
method: "POST",
headers: { Authorization: "Bearer prv_test_ent_E7nT2vQ9bW4mK8sYd3cFjLh6gAe1pR5x", "Content-Type": "application/json" },
body: JSON.stringify({
"cart": {
"order_id": "ord_8816",
"total": 3800,
"currency": "USD",
"merchant_id": "quillstack",
"origin": "https://quillstack.example",
"items": [
{
"sku": "nb-a5",
"name": "Linen notebook, A5",
"quantity": 2,
"unit_amount": 1900
}
]
},
"display": {
"merchant_name": "Quillstack"
},
"retry_url": "https://quillstack.example/checkout",
"billing_address": {
"line1": "18 Harrow Lane",
"city": "Portland",
"region": "OR",
"postal_code": "97205",
"country": "US"
}
}),
})).json();
const coapId = step1.id;
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/checkout_approvals/${coapId}`, {
headers: { Authorization: "Bearer prv_test_ent_E7nT2vQ9bW4mK8sYd3cFjLh6gAe1pR5x" },
})).json();import os
import httpx
api = os.environ["PROVENANCE_API"]
step1 = httpx.post(f"{api}/v1/authorize/checkout_approvals", headers={"Authorization": "Bearer prv_test_ent_E7nT2vQ9bW4mK8sYd3cFjLh6gAe1pR5x"}, json={
"cart": {
"order_id": "ord_8816",
"total": 3800,
"currency": "USD",
"merchant_id": "quillstack",
"origin": "https://quillstack.example",
"items": [
{
"sku": "nb-a5",
"name": "Linen notebook, A5",
"quantity": 2,
"unit_amount": 1900
}
]
},
"display": {
"merchant_name": "Quillstack"
},
"retry_url": "https://quillstack.example/checkout",
"billing_address": {
"line1": "18 Harrow Lane",
"city": "Portland",
"region": "OR",
"postal_code": "97205",
"country": "US"
}
}).json()
coap_id = step1["id"]
data = httpx.get(f"{api}/v1/authorize/checkout_approvals/{coap_id}", headers={"Authorization": "Bearer prv_test_ent_E7nT2vQ9bW4mK8sYd3cFjLh6gAe1pR5x"}).json()