SDK reference · Python SDK
prov.authorize.calls.guest_confirmation
prov.authorize.calls.guest_confirmation in Python SDK. Send a confirmation straight to the guest contact you hold ({"phone":..., "email":...}, one or both).
Signature
prov.authorize.calls.guest_confirmation(check_id: str, description: str, contact: Optional[dict] = …, delivery: Optional[str] = …, channels: Optional[list] = …, follow_up_text: Optional[dict] = …, reminders: Optional[dict] = …, amount: Optional[int] = …, currency: Optional[str] = …, wait: Optional[int] = …) -> AnyParameters
check_idstrRequireddescriptionstrRequiredcontactOptional[dict]deliveryOptional[str]channelsOptional[list]follow_up_textOptional[dict]remindersOptional[dict]amountOptional[int]currencyOptional[str]waitOptional[int]
Request fields
idstringpathRequired- The check's ID (
ccx_). contactobject- The guest's phone, email or both, from your own records. Leave it out for a link only confirmation: nothing is sent and the response carries
approve_urlfor you to pass on.Show child attributes
phonestring- An E.164 phone number (
+14155550132). Spaces are removed; nothing else is guessed. emailstring- An email address, compared in lower case.
text_consentobject- With
phone: your statement that the person at this phone agreed to your texts, recorded with the request (the same record asPOST /v1/account/text_consents). Needs the consent modecompany(409text_consent_mode_mismatchotherwise) and the Pro plan or higher. Read on capture requests, checkout approvals and checkout assessments; refused on an approver invite.Show child attributes
methodenumRequired- How the person agreed. One of
sign_up_form,in_app,in_person,customer_list. obtained_attimestampRequired- When they agreed; not in the future.
evidence_urlstring- An
httpslink to how they agreed. Stored, never fetched.
deliveryenumsend: Provenance sends the request on the channelschannelsallows.self: link only. Nothing is sent and the response returns the link for you to pass on. Left out, a request with no contact is link only and any other takes your account's default (sendout of the box). With a default of link only, a request that gives a contact must saysend. One ofsend,self.channelsarray of enums- Which of Provenance's messages may go, in any order:
app_notification(the person's Provenance app, when the contact matches one person there),emailandtext. Left out, your account's default (all three out of the box). With all three, the person gets the app notification and the email when their contact matches, and the text and the email otherwise; a narrower list sends only what it names (the text goes in the notification's place only withtext, the email beside either only withemail). Each message is reported on its own indeliveries. A list that can reach none of the contacts is refused, as aresmsandapp_push. follow_up_textobject- The follow-up text for this request (or, on
PUT /v1/account/reminders, the default). Each key left out takes your account's saved default; the whole object left out takes all three (on,not_opened, 5 minutes out of the box). On a live deployment it is Pro and above (402 plan_requiredon Free, nothing created or saved); in the sandbox it works on every plan. Refused besidedelivery: "self".Show child attributes
enabledbooleanfalsesends no follow-up text.whenenumnot_opened(the default) ornot_finished. One ofnot_opened,not_finished.after_minutesinteger- A whole number of minutes from 1 to 1440, counted from the notification. On a create it must be shorter than the request's
expires_in(400 parameter_invalidonfollow_up_text.after_minutes); a longer wait from your default is kept, and the text is skipped asexpiredif the request ends first.
remindersobject- This request's automatic reminders, in the shape of one product's schedule in Settings (
schedules.<kind>on/v1/account/reminders):capture_requestfor a capture request,checkout_approvalfor a cart approval (and an assessment's challenge or a guest confirmation),approvalfor a routed approval. Keys left out take your account's saved values, as aPUTto Settings does:afteralone changes the timings of a schedule that is on, andenabled: trueturns it on. The cap, the minimum gap and quiet hours apply as built; an offset at or past the request's expiry is left out. Fixed at create: a later change in Settings leaves the request as it was. Refused besidedelivery: "self".Show child attributes
enabledbooleantruetracks this request on the schedule (Pro and above on a live deployment:402 plan_requiredonreminders.enabledbelow Pro, nothing created; every plan in the sandbox);falsesends it no automatic reminder (one by hand or by API is still allowed).afterarray of strings- Up to three offsets from the request's creation (
10m,24h,3d), increasing, each at least the minimum gap after the one before, at most 7 days. Errors use the Settings messages onreminders.after.
descriptionstringRequired- What the person confirms, shown to them.
amountinteger- An amount to show, in minor units.
currencystring- The three-letter currency code.
waitinteger- Seconds the confirmation stays open. Default 120.
Returns
Any The check, waiting for the person.
HTTP operation
POST /v1/authorize/call_checks/{id}/guest_confirmations: Confirm with the guest
Errors
- parameter_invalid
- parameter_missing
- authentication_required
- insufficient_scope
- resource_missing
- customer_routing_not_allowed
- trial_ended
- rate_limit_exceeded
- calls_not_configured
Example
const step1 = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/call_checks`, {
method: "POST",
headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
body: JSON.stringify({ "from": "+14155550177", "to": "+14155550123", "code": "123456" }),
})).json();
const checkId = step1.id;
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/authorize/call_checks/${checkId}/guest_confirmations`, {
method: "POST",
headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
body: JSON.stringify({
"contact": {
"phone": "+14155550199",
"email": "rowan@tarrowby.example"
},
"description": "Confirm your table for 2 at 7pm Friday"
}),
})).json();import os
import httpx
api = os.environ["PROVENANCE_API"]
step1 = httpx.post(f"{api}/v1/authorize/call_checks", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
"from": "+14155550177",
"to": "+14155550123",
"code": "123456"
}).json()
check_id = step1["id"]
data = httpx.post(f"{api}/v1/authorize/call_checks/{check_id}/guest_confirmations", headers={"Authorization": "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5"}, json={
"contact": {
"phone": "+14155550199",
"email": "rowan@tarrowby.example"
},
"description": "Confirm your table for 2 at 7pm Friday"
}).json()