SDK reference · Python SDK

prov.mandate.assessments.receipt

prov.mandate.assessments.receipt in Python SDK. The signed receipt for a decision, as the one receipt envelope: {object: "receipt", id, claims, token, verify_url}.

Signature

prov.mandate.assessments.receipt(decision_id: str) -> Any

Parameters

decision_idstrRequired

Request fields

idstringpathRequired
The object's ID.
formatenumquery
json (the default) or pdf for a one-page PDF. One of json, pdf.

Returns

Any The receipt, as JSON or a PDF.

HTTP operation

GET /v1/mandate/assessments/{id}/receipt: Get a decision receipt

Errors

Example

const step1 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/intents`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "action_description": "Pay invoice INV-2041: $1,850.00 to Brindlecote Supplies",
    "action_payload": {
      "amount": 1850,
      "payee": "acct_brindlecote_supplies"
    },
    "agent_session_id": "sess_ledger_1",
    "device_id": "dev_00000000000000000000000000000001"
  }),
})).json();
const intentToken = step1.intent_token;
const step2 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/assessments`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "intent_token": intentToken,
    "action_description": "Pay invoice INV-2041: $1,850.00 to Brindlecote Supplies",
    "action_payload": {
      "amount": 18500,
      "payee": "acct_attacker"
    }
  }),
})).json();
const step3 = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/assessments?session=sess_ledger_1&limit=1`, {
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" },
})).json();
const decisionId = step3.data[0].id;
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/assessments/${decisionId}/receipt`, {
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5" },
})).json();

Was this page helpful? Send us feedback

LLM? Read llms.txt.