SDK reference · Python SDK

prov.authorize.checkout_approvals.spc_challenge

prov.authorize.checkout_approvals.spc_challenge in Python SDK. A single-use Secure Payment Confirmation challenge bound to this exact cart.

Signature

prov.authorize.checkout_approvals.spc_challenge(cart: dict[str, Any]) -> Any

Parameters

cartdict[str, Any]Required

Request fields

cartobjectRequired
An order, exactly as you pass it to checkoutBinding. The rich fields (binding v2) are optional; a cart without them keeps its hash.
Show child attributes
order_idstringRequired
Your order ID.
totalintegerRequired
The total in minor units: lines plus adjustments.
currencystringRequired
ISO 4217 code.
merchant_idstringRequired
Your merchant ID.
originstringRequired
Your store's origin, such as https://harborbean.example.
fulfillment_digeststring
A digest of the full delivery address.
itemsarray of objects
The cart lines (20 at most with the rich fields).
Show child attributes
skustringRequired
The SKU.
namestringRequired
The item name.
quantityintegerRequired
How many.
unit_amountintegerRequired
Price each, in minor units.
variantarray of objects
Up to 3 { name, value } pairs, such as Size: M.
Show child attributes
namestring
The option name.
valuestring
The chosen value.
image_urlstring
A picture of the item: https, on your origin. Display only. We keep a copy when the approval is created; the approval page shows it, and the approval email shows the first item's picture.
urlstring
The item's page: https, on your origin (the image_url rule). Display only and not part of the signed cart: the approval page links the item to it, opened in a new tab. The page keeps your line order.
service_periodobject
The dates of the service this line buys (hotel nights, a flight, a rental), in the place's own local time (binding v3: a cart with it hashes as binding_version: 3). Bound exactly as given. A grant's service_window is checked against it, and the approval page shows it.
Show child attributes
startstringRequired
A date (2027-03-12) or a date-time with an offset (2027-03-12T15:00:00+00:00).
endstringRequired
The same form, on or after start's date. For lodging, the check-out date.
adjustmentsarray of objects
Shipping, tax, discount and fee lines (discounts negative).
Show child attributes
kindenumRequired
The kind of line. One of shipping, tax, discount, fee.
labelstringRequired
What the page shows.
amountintegerRequired
Minor units; negative for a discount.
fulfillmentobject
The delivery method and estimate.
Show child attributes
method_labelstring
The method, such as Standard shipping.
estimate_fromstring
The earliest delivery date.
estimate_tostring
The latest delivery date.
return_policy_urlstring
Your return policy: https, on your origin.
merchantobject
What you declare about your store, as a 3-D Secure authentication request carries it (binding v3: a cart with it hashes as binding_version: 3). Bound into the payload hash. A grant's kinds of merchant and countries are checked against it, and everywhere it shows it reads as declared.
Show child attributes
mccstring
Your acquirer-assigned merchant category code (7011).
countrystring
Your ISO 3166-1 numeric country code (620 for Portugal).

Returns

Any The challenge.

HTTP operation

POST /v1/authorize/checkout_approvals/spc_challenge: Create an SPC challenge for a cart

Errors

Example

const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/checkout_approvals/spc_challenge`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_ent_E7nT2vQ9bW4mK8sYd3cFjLh6gAe1pR5x", "Content-Type": "application/json" },
  body: JSON.stringify({
    "cart": {
      "order_id": "ord_8812",
      "total": 3800,
      "currency": "USD",
      "merchant_id": "harborbean",
      "origin": "https://harborbean.example",
      "items": [
        {
          "sku": "hb-1",
          "name": "House Blend, 1 lb",
          "quantity": 2,
          "unit_amount": 1900
        }
      ]
    }
  }),
})).json();

Was this page helpful? Send us feedback

LLM? Read llms.txt.