SDK reference · Python SDK
prov.mandate.grants.external_handoff
prov.mandate.grants.external_handoff in Python SDK. An external hand-off as the account reads it (pending, minted with the grant's id, or declined).
Signature
prov.mandate.grants.external_handoff(handoff_id: str) -> AnyParameters
handoff_idstrRequired
Request fields
idstringpathRequired- The hand-off's ID (
xho_).
Returns
Any The hand-off.
HTTP operation
GET /v1/mandate/external_handoffs/{id}: Retrieve an external hand-off
Errors
Example
const step1 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/grants`, {
method: "POST",
headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
body: JSON.stringify({
"device_id": "dev_00000000000000000000000000000001",
"purpose": "Book Maya's Lisbon trip",
"constraints": {
"max_amount": 1200,
"budget_amount": 2400,
"budget_window": "month",
"currency": "USD",
"expires_at": "2027-12-31T23:59:59Z"
}
}),
})).json();
const mandateId = step1.id;
const step2 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/grants/${mandateId}/delegate`, {
method: "POST",
headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
body: JSON.stringify({
"agent_session_id": "sess_valet_flights_1",
"purpose": "Hold seat 14C on TP1351",
"constraints": {
"max_amount": 600,
"budget_amount": 600
},
"receiver": {
"kind": "key",
"name": "SkyDesk Seats",
"origin": "https://seats.skydesk.example"
},
"holder_key": {
"kty": "EC",
"crv": "P-256",
"x": "NeVHu4qeD40iEEgSDcTm26Y0xApkjq41T6BuENVl0js",
"y": "qS59-GAPcl0bJ-yYFvPJA3omsU9DJFedMw4rou5cXo8"
}
}),
})).json();
const handoffId = step2.id;
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/external_handoffs/${handoffId}`, {
headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" },
})).json();import os
import httpx
api = os.environ["PROVENANCE_API"]
step1 = httpx.post(f"{api}/v1/mandate/grants", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
"device_id": "dev_00000000000000000000000000000001",
"purpose": "Book Maya's Lisbon trip",
"constraints": {
"max_amount": 1200,
"budget_amount": 2400,
"budget_window": "month",
"currency": "USD",
"expires_at": "2027-12-31T23:59:59Z"
}
}).json()
mandate_id = step1["id"]
step2 = httpx.post(f"{api}/v1/mandate/grants/{mandate_id}/delegate", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
"agent_session_id": "sess_valet_flights_1",
"purpose": "Hold seat 14C on TP1351",
"constraints": {
"max_amount": 600,
"budget_amount": 600
},
"receiver": {
"kind": "key",
"name": "SkyDesk Seats",
"origin": "https://seats.skydesk.example"
},
"holder_key": {
"kty": "EC",
"crv": "P-256",
"x": "NeVHu4qeD40iEEgSDcTm26Y0xApkjq41T6BuENVl0js",
"y": "qS59-GAPcl0bJ-yYFvPJA3omsU9DJFedMw4rou5cXo8"
}
}).json()
handoff_id = step2["id"]
data = httpx.get(f"{api}/v1/mandate/external_handoffs/{handoff_id}", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}).json()