SDK reference · Python SDK

prov.mandate.approvers.invite

prov.mandate.approvers.invite in Python SDK. Invite a contact you already hold: {"phone":..., "email":...} (one or both) or one string.

Signature

prov.mandate.approvers.invite(contact: Any, grant: Optional[dict] = …, ask_app: Optional[bool] = …, delivery: Optional[str] = …, channels: Optional[list] = …, follow_up_text: Optional[dict] = …) -> Any

Parameters

contactAnyRequired
grantOptional[dict]
ask_appOptional[bool]
deliveryOptional[str]
channelsOptional[list]
follow_up_textOptional[dict]

Request fields

Idempotency-Keystringheader
Retry a create safely: the same key + request returns the stored response (24 h, per caller).
contactobject | stringRequired
Who the invite goes to: { phone, email } (one or both, the same rule as every request), or one string holding an email or an E.164 phone. Required, with delivery: self too.
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 as POST /v1/account/text_consents). Needs the consent mode company (409 text_consent_mode_mismatch otherwise) 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 https link to how they agreed. Stored, never fetched.
deliveryenum
send: Provenance sends the request on the channels channels allows. 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 (send out of the box). With a default of link only, a request that gives a contact must say send. One of send, 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), email and text. 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 with text, the email beside either only with email). Each message is reported on its own in deliveries. A list that can reach none of the contacts is refused, as are sms and app_push.
follow_up_textobject
The follow-up text after the invite's app notification. An invite has no expiry, so any wait from 1 to 1440 minutes is accepted. On a live deployment it is Pro and above (402 plan_required on Free); in the sandbox it works on every plan. Refused beside delivery: "self".
Show child attributes
enabledboolean
false sends no follow-up text.
whenenum
not_opened (the default) or not_finished. One of not_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_invalid on follow_up_text.after_minutes); a longer wait from your default is kept, and the text is skipped as expired if the request ends first.
grantobject
What the integrator will ask the approver to approve.
Show child attributes
action_typesarray of strings
The action types allowed.
max_amountnumber
The largest amount allowed per action.
productsarray of strings
The products enabled for the account.
ask_appboolean
The invite page says "{Company} asks you to approve with the Provenance app", with the store links once they're live.

Returns

Any The invite, with the delivery in force (channels, follow_up_text) and each message in deliveries.

HTTP operation

POST /v1/mandate/approver_links: Invite an approver

Errors

Example

const step1 = await (await fetch(`${process.env.PROVENANCE_API}/v1/account/text_consent`, {
  method: "PUT",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({ "mode": "company", "everyone": null }),
})).json();
const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/approver_links`, {
  method: "POST",
  headers: { Authorization: "Bearer prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5", "Content-Type": "application/json" },
  body: JSON.stringify({
    "contact": {
      "phone": "+14155550148",
      "email": "dana@example.com"
    },
    "grant": {
      "max_amount": 1000,
      "action_types": [
        "payment"
      ]
    }
  }),
})).json();

Was this page helpful? Send us feedback

LLM? Read llms.txt.