Package: secursus-api
Secursus Integration APISecursus is the most powerful digital insurance for parcels, covering the most sensitive items and up to €100,000 per parcel.
To integrate the insurance service in your website, we provide this php library that will allow you to automate your insurance orders.For more information about the product, please visit our website :https://www.secursus.com/integration/PrerequisiteTo use the Secursus API, you need to create an account on our platform and activate it.https://www.secursus.com/integration/registration.phpInstallationpip install -i secursus-apiUsagefromsecursus_apiimportapiassecursus_api# Set your API credentials heresecursus=secursus_api.Api('YOUR_API_ID','YOUR_API_KEY')# And call methods afterresponse=secursus.retrieve_parcel_order("YOUR_PARCEL_ID")DocumentationGet the insurance amount feesThis method is used to calculate the amount of insurance fees.More details :https://developer.secursus.com/parcels/feesUsageinsurance_amount=secursus.get_insurance_amount(10000)ArgumentThe create parcel order method can receive only one argument, the parcel value. This argument need to be anintegerand represents the total value of the parcel in euro cents.Create parcel orderA parcel object is created and the insurance credentials are returned. Once the object has been created, you have 12 hours if you want to cancel the insurance order.More details :https://developer.secursus.com/parcels/createUsageparcel_order=secursus.create_parcel_order(params)Data argumentThe create parcel order method can receive andictionarywho can contains these eight arguments (six are required):EntryRequiredData typeDescriptionparcel_valueYesIntegerTotal value of the order in euro cents.first_nameYesStringCustomer first name.last_nameYesStringCustomer last name.emailYesStringCustomer email address.full_addressYesStringCustomer full address.cart_dataYesJsonDetails of cart on your website. No specific format is required, this information will be analyzed for any claim.companyNoStringCustomer company name.langNoStringLanguage used for the insurance confirmation email sent to the customer. Two possible values: "fr" or "en". Default value: "en".Retrieve a parcel orderThis method is used to get the insurance credentials and parcel informations.Usageparcel_order=secursus.retrieve_parcel_order(id_parcel)ArgumentThe retrieve parcel order method can receive only one argument, the parcel id. This argument need to be astringand is the insurance id generated by the createParcelOrder method.Retrieve a history parcel reportThis method is used to get the list of all parcels of the account.Usageparcel_order=secursus.retrieve_history_report(id_parcel)Retrieve a current parcel reportThis method is used to get the list of all parcels to due during the current month.Usageparcel_order=secursus.retrieve_current_report(id_parcel)Cancel a parcel orderThis method is used to cancel an insurance order that you previously sent.Note: Once the insurance request has been created, you have 12 hours if you want to cancel the insurance order. After this period, the insurance order is considered as confirmed and can't be canceled. The insurance fees are then payable.More details :https://developer.secursus.com/parcels/cancelUsageparcel_order=secursus.cancel_parcel_order(id_parcel)ArgumentThe retrieve parcel order method can receive only one argument, the parcel id. This argument need to be astringand is the insurance id generated by the createParcelOrder method.