SDK reference · Node SDK

prov.authorize.assessments.reportOutcome

prov.authorize.assessments.reportOutcome in Node SDK. Report what happened to the order after its decision (free).

Signature

prov.authorize.assessments.reportOutcome(id: string, params: ReportOutcomeParams): Promise<OrderOutcome>

Parameters

idstringRequired
paramsReportOutcomeParamsRequired

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

Promise<OrderOutcome> The recorded outcome.

HTTP operation

POST /v1/authorize/checkout_assessments/{id}/outcome: Report an order's outcome

Errors

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();

Was this page helpful? Send us feedback

LLM? Read llms.txt.