***

title: Build the merchant’s receipt page
icon: calendar-exclamation
intro: Build the merchant’s receipt page
published: true
---------------------

For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://docs.payroc.com/essentials-guides/hosted-payment-page/extend-your-solution/run-a-pre-authorization/llms.txt. For full documentation content, see https://docs.payroc.com/essentials-guides/hosted-payment-page/extend-your-solution/run-a-pre-authorization/llms-full.txt.

Create a receipt page on the merchant's website to display the transaction response to customers.

After the customer submits their payment details, the Hosted Payment Page redirects them to the merchant's receipt page and appends the transaction response as query parameters. The receipt page must parse these parameters and display a success or decline message.

<Note>
  **Note:** If a pre-authorization is declined, the Hosted Payment Page still redirects the customer to the receipt page and returns the response in the query parameters.
</Note>

## Before you begin

If you've already integrated with run a sale, you've completed the following steps:

* You've provided us with the URL of the merchant's receipt page.
* You've handled the response parameters to run a sale, which are the same for running pre-authorizations. We’ve included them below.

However, you must store the UNIQUEREF from the response so you can capture the pre-authorization later.

## Handle the transaction response

The Hosted Payment Page returns the transaction response as query parameters appended to the receipt page URL.

### Card details

| Parameter                | Type    | Size              | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| ------------------------ | ------- | ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| TERMINALID               | String  | 1-50 characters   | Unique identifier that we assigned to the terminal.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ORDERID                  | String  | 1-24 characters   | Unique identifier that the merchant assigned to the transaction.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| APPROVALCODE             | String  | 0-48 characters   | Authorization code that the processor assigned to the transaction.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| AMOUNT                   | Double  |                   | Subtotal of the transaction including taxes. This value doesn't include surcharges or convenience fees.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| RESPONSECODE             | Enum    |                   | Response code for the transaction from the processor. The value is one of the following:<br />- `A` - Processor approved the transaction.<br />- `E` - Processor authorized the transaction. This enum applies to only China UnionPay cards.<br />- `D` - Processor declined the transaction.<br />- `R` - Processor declined the transaction, and the customer should contact their bank.<br />- `C` - Processor declined the transaction because the payment card was reported lost or stolen.                                                                                                                                                                                                                                                                                                                                                                           |
| RESPONSETEXT             | String  | 0-48 characters   | Response description from the processor.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| DATETIME                 | String  |                   | Date and time that the processor received the request and returned a response to our gateway. We return this value in **YYYY-MM-DDTHH:MM:SS** format, for example, `2026-02-10T14:51:40`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| AVSRESPONSE              | String  | 1 character       | Indicates if the address that the customer entered on the Hosted Payment Page matches the address linked to the card. The value is one of the following:<br />- `A` - First five numerical characters in the address match, but the ZIP code or postal code doesn't match.<br />- `E` - Transaction isn't eligible for an AVS check.<br />- `N` - Address doesn't match.<br />- `R` - AVS check temporarily unavailable.<br />- `S` - Card type not supported by AVS.<br />- `U` - Address information unavailable from the card issuer.<br />- `G` - Address information unavailable from the card issuer. This value applies to only Visa cards.<br />- `W` - ZIP code or postal code matches, but the street address doesn't.<br />- `X` - Address matches.<br />- `Y` - Address matches.<br />- `Z` - ZIP code or postal code matches, but the street address doesn't. |
| CVVRESPONSE              | String  | 1 character       | Indicates if the card verification value (CVV) that the customer entered on the Hosted Payment Page matches the CVV on the card. The value is one of the following:<br />- `M` - CVV matches.<br />- `N` - CVV doesn't match.<br />- `P` - CVV not processed.<br />- `U` - CVV isn't registered.<br /><br />**Note:** Our gateway doesn't automatically decline transactions when the CVV doesn't match, unless the merchant has asked us to decline transactions where the CVV doesn't match.                                                                                                                                                                                                                                                                                                                                                                             |
| UNIQUEREF                | String  | 10 characters     | Unique identifier that our gateway assigned to the transaction.<br /><br />**Note:** Store the UNIQUEREF if you use our API for follow-on transactions, for example, to refund the transaction.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| CARDREFERENCE            | String  | 12-19 characters  | Secure token that represents the customer's payment details.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| EMAIL                    | String  | 1-128 characters  | Customer's email address.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| PHONE                    | String  | 5-20 characters   | Customer's phone number.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| REGION                   | String  | 0-128 characters  | Region of the customer's billing address.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| CITY                     | String  | 0-40 characters   | City of the customer's billing address.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| POSTCODE                 | String  | 0-128 characters  | Zip code or postal code of the customer's address.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| STATE                    | String  | 0-128 characters  | Name of the state or state abbreviation of the customer's billing address.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| COUNTRY                  | String  | 2 characters      | Two-letter code for the country of the customer's card. The format follows the [ISO 3166-1](https://www.iso.org/iso-3166-country-codes.html) standard.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| CARDNUMBER               | String  | 12-19 characters  | Masked card number. Our gateway returns only the first six digits and the last four digits of the card number, for example, `548010******5929`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| CARDHOLDERNAME           | String  | 0-50 characters   | Customer's name.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| CARDTYPE                 | String  |                   | Card brand of the card.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| HASH                     | String  | 1-128 characters  | SHA-512 hash value that we generate with values from the response parameters and the terminal secret. You can use this hash to verify that the response is legitimate. <br /><br />We return the hash in the following order: <br />- `[TERMINALID]:[ORDERID]:[AMOUNT]:[DATETIME]:[RESPONSECODE]:[RESPONSETEXT]:[SECRET]`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| CUSTOMFIELD              | String  |                   | Custom field that you sent in the request.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| OTHERFIELD               | String  | 0-2000 characters | Other field that you sent in the request.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| BRANDTXIDENTIFIER        | String  | 1-50 characters   | Unique identifier that the card brand assigns to the transaction. If you use a third-party vault for tokenization, include this value when you use a secure token in follow-on transactions with our API, for example, to refund the transaction.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| SECURECARDMERCHANTREF    | String  | 1-200 characters  | Unique identifier that the merchant assigned to the secure token.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| STOREDCREDENTIALUSE      | Enum    |                   | Indicates how the merchant can use the card details, as agreed by the customer:<br />- `UNSCHEDULED` - Transactions for a fixed or variable amount that are run at a certain predefined event.<br />- `RECURRING` - Transactions for a fixed amount that are run at regular intervals, for example, monthly. Recurring transactions don't have a fixed duration and run until the customer cancels the agreement.<br />- `INSTALLMENT` - Transactions for a fixed amount that are run at regular intervals, for example, monthly. Installment transactions have a fixed duration.<br /><br />**Note:** We return this field only if the merchant has tokenized the card details as part of the transaction.                                                                                                                                                                |
| STOREDCREDENTIALTXTYPE   | Enum    |                   | Indicates if a payment with stored card details is the first in a series of payments, or if it is a follow-on payment. The value is one of the following:<br />- `FIRST_TXN` - First payment in a series of payments.<br />- `SUBSEQUENT_CARDHOLDER_INITIATED_TXN` - Payment that the customer initiates after the first payment in the series.<br />- `SUBSEQUENT_MERCHANT_INITIATED_TXN` - Payment that the merchant initiates after the first payment in the series.<br /><br />**Note:** We return this field only if the customer used saved payment details for the transaction.                                                                                                                                                                                                                                                                                     |
| BYPASS\_SURCHARGE        | Boolean |                   | Indicates if the merchant has bypassed surcharges for the transaction. The value is one of the following:<br />- `true` - Surcharges don't apply to the transaction.<br />- `false` - Surcharges apply to the transaction.<br /><br />**Note:** You can't apply surcharges to pre-authorizations.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| ACCEPTTERMSANDCONDITIONS | Enum    |                   | Indicates if the customer accepted the terms and conditions for convenience fees. We return a value of `ON` because the customer can't complete the transaction without accepting the terms and conditions.<br /><br />**Note:** You can't apply convenience fees to pre-authorizations.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| CONVENIENCE\_FEE         | Double  |                   | Convenience fee that the merchant applied to the transaction.<br /><br />**Note:** You can't apply convenience fees to pre-authorizations.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| SURCHARGE\_FEE           | Double  |                   | Surcharge fee that the merchant applied to the transaction.<br /><br />**Note:** You can't apply surcharges to pre-authorizations.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| SURCHARGE\_PERCENT       | Double  |                   | Surcharge percentage that the merchant applied to the transaction.<br /><br />**Note:** You can't apply surcharges to pre-authorizations.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| DL\_NUMBER               | String  | 0-30 characters   | License number of the customer's driver's license.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| DL\_STATE                | String  | 2 characters      | Two-character abbreviation of the state that issued the customer's driver's license, for example, IL.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| POSDEVICE                | String  | 0-30 characters   | Name of the POS device that captured the customer's payment details.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |

#### Example response

```
    https://[receipt_page_url].com/receipt?DL_NUMBER=&DL_STATE=&CARDREFERENCE=&POSDEVICE=&STATE=&OTHERFIELD_1=Other+Field1&ORDERID=HPP967631811&AMOUNT=10.17&BYPASS_SURCHARGE=&ACCEPTTERMSANDCONDITIONS=ON&SECURECARDMERCHANTREF=&REGION=&TERMINALID=3204004&CITY=&CONVENIENCE_FEE=2.00&RESPONSETEXT=OK8835&RESPONSECODE=A&APPROVALCODE=OK8835&CVVRESPONSE=M&DATETIME=2026-02-10T09:16:23&UNIQUEREF=JH1TY9LL4S&EMAIL=vvd%40worldnettps.it&PHONE=8000005555&CARDTYPE=VISA%20DEBIT&CARDNUMBER=411111******1111&HASH=70a28ef2f11f3b415ba0aac52631cb2755a56641bfebaa33dd581f59b9cf3a48e264e5710886987bf5cd54967a67716b2b256ed92ce33ca529547c024b5e9398
```