SDK reference · Python SDK
prov.authorize.assessments.report_outcome
prov.authorize.assessments.report_outcome in Python SDK. Report what happened to the order after its decision (free): chargeback, fraud, refund_abuse or legitimate.
Signature
prov.authorize.assessments.report_outcome(assessment_id: str, outcome: str, note: Optional[str] = …) -> AnyParameters
assessment_idstrRequiredoutcomestrRequirednoteOptional[str]
Request fields
idstringpathRequired- The checkout assessment's ID (
cas_). outcomeenumRequired- What happened to the order. One of
chargeback,fraud,refund_abuse,legitimate. notestring- A note for your team. Leave out customer details.
Returns
Any The recorded outcome.
HTTP operation
POST /v1/authorize/checkout_assessments/{id}/outcome: Report an order's outcome
Errors
- authentication_required
- insufficient_scope
- manage_policies_required
- parameter_invalid
- rate_limit_exceeded
- resource_missing
Example
const step1 = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/checkout_assessments`, {
method: "POST",
headers: { Authorization: "Bearer prv_test_ent_E7nT2vQ9bW4mK8sYd3cFjLh6gAe1pR5x", "Content-Type": "application/json" },
body: JSON.stringify({
"cart": {
"order_id": "ord_8813",
"total": 3800,
"currency": "USD",
"merchant_id": "harborbean",
"origin": "https://harborbean.example",
"items": [
{
"sku": "mug-sage",
"name": "Stoneware mug",
"quantity": 2,
"unit_amount": 1900
}
]
}
}),
})).json();
const assessmentId = step1.id;
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/checkout_assessments/${assessmentId}/outcome`, {
method: "POST",
headers: { Authorization: "Bearer prv_test_ent_E7nT2vQ9bW4mK8sYd3cFjLh6gAe1pR5x", "Content-Type": "application/json" },
body: JSON.stringify({ "outcome": "chargeback", "note": "Card holder disputed the charge" }),
})).json();import os
import httpx
api = os.environ["PROVENANCE_API"]
step1 = httpx.post(f"{api}/v1/authorize/checkout_assessments", headers={"Authorization": "Bearer prv_test_ent_E7nT2vQ9bW4mK8sYd3cFjLh6gAe1pR5x"}, json={
"cart": {
"order_id": "ord_8813",
"total": 3800,
"currency": "USD",
"merchant_id": "harborbean",
"origin": "https://harborbean.example",
"items": [
{
"sku": "mug-sage",
"name": "Stoneware mug",
"quantity": 2,
"unit_amount": 1900
}
]
}
}).json()
assessment_id = step1["id"]
data = httpx.post(f"{api}/v1/authorize/checkout_assessments/{assessment_id}/outcome", headers={"Authorization": "Bearer prv_test_ent_E7nT2vQ9bW4mK8sYd3cFjLh6gAe1pR5x"}, json={
"outcome": "chargeback",
"note": "Card holder disputed the charge"
}).json()