Package: procuret
Procuret PythonA Python library for interfacing with Procuret API.Procuretis a
business - to - business payment platform that allows customers to pay
for purchases over time, while the supplier is paid upfront.ContentsInstallationDocumentationSupportInstallationProcuret Python may beinstalled via PIP:$pipinstallprocuretTo update Procuret Python to the latest version, usepip --upgrade:$pipinstall--upgradeprocuretDocumentationProcuret Python offers a library of classes that map to services provided
by the Procuret API.SessionSessions are the means of authenticating requests to the Procuret API. All
requests to Procuret API, save for those creating Sessions themselves, require
a Session.In Procuret Python, theSessionclass will handle all authentication for you.
For example, it will compute the SHA256 signature that must be included
in your HTTP headers.Properties.session_id: int- A 63-bit positive integer uniquely identifying thisSession.Sessionwill include this number in requests to Procuret API, so
that Procuret API can identify you..api_key- A 192-bit random number encoded in urlsafe base64 and generated
in a cryptographically secure manner.Sessionwill use this key to sign your
requests to Procuret API using the SHA256 algorithm.Methods.create_with_email(...) -> SessionUse.create_with_email()to create a newSession. This is analogous to
"logging in" to the Procuret API.Parametersemail: str- Your account emailplaintext_secret: str- Your plaintext passphraseperspective: Perspective- an instance ofPerspectiveExample Usagesession=Session.create_with_email(email='me@somedomain.com',plaintext_secret='excellent passphrase',perspective=Perspective.SUPPLIER)InstalmentLinkInstalmentLinkfacilitates the creation of customised links to the Procuret
Instalment Product (PIP). PIP allows a customer Business to pay for a purchase
over time, while you the Supplier are paid upfront.When you create anInstalmentLink, you can ask Procuret to send an email
to the customer Business on your behalf.Properties.invitee_email: str- The email address you associated with the link.invoice_amount: Decimal- The invoice amount presented by the link.invoice_identifier: str- The invoice ID presented by the link.url: str- The URL of the linkMethods.create(...) -> InstalmentLinkParameterssupplier: Union[int, EntityHeadline]- Either the unique integer
identifier of your Supplier entity in Procuret, or an instead ofEntityHeadlinedescribing your Supplier entity.invoice_amount: Decimal- The amount that you wish to charge the customer,
in Australian dollars.invoice_email: str- The email address you wish to associate with this
link.invoice_identifier: str- Your own identifier for the invoice. For
example, you might use an invoice number from your accounting system.communication: CommunicationOption- An instance ofCommunicationOption,
which will tell Procuret API what you want it to do with the supplied email
address.session: Session- An instance ofSession, which will be used to
authenticate your request.Example usage# First we get a Session. In this case we authenticate with email and# passphrase. In a real integration, you might store the Session elsehwhere.session=Session.create_with_email(email=email,plaintext_secret=secret,perspective=Perspective.SUPPLIER)# Now we use the Session in an InstalmentLink.create() call, along with# the parameters describing the link. By supplying# CommunicationOption.EMAIL_CUSTOMER, we tell Procuret that we would like# Procuret to send an email to the customer on our behalf inviting them# to pay using the link.link=InstalmentLink.create(supplier=supplier_id,invoice_amount=Decimal('422.42'),invitee_email='someone@great-domain.org',invoice_identifier='T 055',communication=CommunicationOption.EMAIL_CUSTOMER,session=session)PerspectivePerspective is an enumeration of possible angles from which a client
can engage with Procuret. If you wish to use Procuret services from
the perspective of a Supplier, you will create aSessionwith thePerspective.SUPPLIERcase.Cases.SUPPLIER.BUSINESSCommunicationOptionAn enumeration of instructions you can send Procuret in some contexts, to
tell it how you wish for it to contact (or not contact) the a customer.Cases.EMAIL_CUSTOMER- Procuret will contact the customer by email.DO_NOT_CONTACT_CUSTOMER- Procuret will not try to contact the customerSupportPlease contact us anytime atsupport@procuret.comwith any questions. To chat with us less formally, please feel free to tweet@hugh_jeremy.For more general information about Procuret, please visitprocuret.com.