Receipt Generation

Modified on Tue, 30 May 2023 at 12:49 PM

Often solutions will require a simple human-readable ID to allow users to easily reference their form submission. To cater for this requirement we have created the Receipt Generation feature allowing you to create custom Receipt Ids as part of your form submission process. 


There are two ways to create a Receipt ID, one is generating it using the built-in Receipt ID feature, and the second is using an API. 


 


Receipt ID


To create your own Receipt Id without needing to create your own API use the Receipt ID option on the Summary tab of your form. The Receipt Id will be an 8-character random string created from numbers and uppercase letters by default. You are able to customise this Receipt Id by adding additional components. 


Components come in 3 types Text, Date, and Random. You can choose to add any number of these to your Receipt Id. In the example below I have added a Text prefix (Pre-), the month (MM), the date (DD), another text (-) and a random 8-character string consisting of uppercase letters, lowercase letters and numbers. An example of the Receipt Id will be displayed to show how your components will affect the Receipt Id.


IMPORTANT NOTE - We do not guarantee that the Receipt Ids generated in this manner are unique. However, depending on the configuration, the Receipt Ids can be made so that it is very unlikely that there will be submissions with the same Receipt Id. For example, the Receipt ID below has 84 trillion possible options generated each day. 



Custom URL and Hosted API


If you need to generate a Receipt Id that cannot be catered for using the out-of-the-box Receipt Id functionality, then you will need to add a custom URL or a hosted API endpoint. This endpoint will be called on form submission and allow you to generate an external Id.


Example


Below is a type definition of the request payload


{ 
formsAppId: number
formId: number
externalIdUrlSearchParam: string | null
draftId: string | null
preFillFormDataId: string | null
jobId: string | null
previousFormSubmissionApprovalId: string | null
}

Below is a type definition of the response payload

    externalId?: string 
}


The External Id is required in the response payload if the externalIdUrlSearchParam is provided in the request payload.


Presenting the Receipt Id to Users


Submission Message


In order to display the Receipt Id to your users you can add it in the successful submission message. 

To do so go to the Buttons configuration on the Forms Summary page. Turn on the switch to "Customise the display after submission". This will allow you to customise the Submission message. Clicking "Use Default" will help you get started, and then adding the {EXTERNAL_ID} into the Submission Message will allow users to see their Receipt ID once they complete the form. See the example below.




Creating a Receipt Page


If you instead want to redirect the user to another form and display the Receipt Id there, you do so using the OneBlink pre-fill, and redirect URL functionality. Create your receipt page and add the URL of your Receipt page as a redirect URL to your form. 

Add the below text to the end of the redirect URL, be sure to add the name of the element you want to pre-fill with the external Id. This will ensure that an element on your Receipt page is populated with the Receipt Id.


?preFillData={"name of your element":"{EXTERNAL_ID}"}



Get Help


If you have any question or would like assistance with setting up your Receipt Generation please contact us via this support portal or email support@oneblink.io. We are happy to assist in any way we can.





Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons

Feedback sent

We appreciate your effort and will try to fix the article